Priority File Manager

📁 public_html
Base Directory:
/home/ecedu/public_html/wp-includes/js/dist
NameTypeSizeActions
📁 .. Folder -
📄 a11y.js File 8570
Edit Download
📄 a11y.min.js File 2358
Edit Download
📄 annotations.js File 23335
Edit Download
📄 annotations.min.js File 5521
Edit Download
📄 api-fetch.js File 23874
Edit Download
📄 api-fetch.min.js File 5838
Edit Download
📄 autop.js File 15982
Edit Download
📄 autop.min.js File 5614
Edit Download
📄 blob.js File 4622
Edit Download
📄 blob.min.js File 1108
Edit Download
📄 block-directory.js File 80526
Edit Download
📄 block-directory.min.js File 20734
Edit Download
📄 block-editor.js File 2724345
Edit Download
📄 block-editor.min.js File 865941
Edit Download
📄 block-library.js File 2232874
Edit Download
📄 block-library.min.js File 876704
Edit Download
📄 block-serialization-default-parser.js File 15228
Edit Download
📄 block-serialization-default-parser.min.js File 2400
Edit Download
📄 blocks.js File 567313
Edit Download
📄 blocks.min.js File 173562
Edit Download
📄 commands.js File 182724
Edit Download
📄 commands.min.js File 49429
Edit Download
📄 components.js File 2357667
Edit Download
📄 components.min.js File 719028
Edit Download
📄 compose.js File 200300
Edit Download
📄 compose.min.js File 36853
Edit Download
📄 core-commands.js File 24398
Edit Download
📄 core-commands.min.js File 9416
Edit Download
📄 core-data.js File 267493
Edit Download
📄 core-data.min.js File 65783
Edit Download
📄 customize-widgets.js File 97615
Edit Download
📄 customize-widgets.min.js File 34999
Edit Download
📄 data-controls.js File 7243
Edit Download
📄 data-controls.min.js File 1472
Edit Download
📄 data.js File 144947
Edit Download
📄 data.min.js File 25596
Edit Download
📄 date.js File 817573
Edit Download
📄 date.min.js File 783424
Edit Download
📄 deprecated.js File 4694
Edit Download
📄 deprecated.min.js File 684
Edit Download
📁 development Folder -
📄 dom-ready.js File 2464
Edit Download
📄 dom-ready.min.js File 457
Edit Download
📄 dom.js File 62127
Edit Download
📄 dom.min.js File 12547
Edit Download
📄 edit-post.js File 123321
Edit Download
📄 edit-post.min.js File 42263
Edit Download
📄 edit-site.js File 1640694
Edit Download
📄 edit-site.min.js File 641138
Edit Download
📄 edit-widgets.js File 175604
Edit Download
📄 edit-widgets.min.js File 58605
Edit Download
📄 editor.js File 1212327
Edit Download
📄 editor.min.js File 396996
Edit Download
📄 element.js File 68130
Edit Download
📄 element.min.js File 11968
Edit Download
📄 escape-html.js File 6003
Edit Download
📄 escape-html.min.js File 1000
Edit Download
📄 format-library.js File 68467
Edit Download
📄 format-library.min.js File 22769
Edit Download
📄 hooks.js File 20687
Edit Download
📄 hooks.min.js File 4776
Edit Download
📄 html-entities.js File 3706
Edit Download
📄 html-entities.min.js File 788
Edit Download
📄 i18n.js File 49627
Edit Download
📄 i18n.min.js File 9141
Edit Download
📄 is-shallow-equal.js File 4287
Edit Download
📄 is-shallow-equal.min.js File 1018
Edit Download
📄 keyboard-shortcuts.js File 24479
Edit Download
📄 keyboard-shortcuts.min.js File 3017
Edit Download
📄 keycodes.js File 14113
Edit Download
📄 keycodes.min.js File 2642
Edit Download
📄 list-reusable-blocks.js File 31355
Edit Download
📄 list-reusable-blocks.min.js File 4737
Edit Download
📄 media-utils.js File 31462
Edit Download
📄 media-utils.min.js File 9968
Edit Download
📄 notices.js File 21989
Edit Download
📄 notices.min.js File 2070
Edit Download
📄 nux.js File 13295
Edit Download
📄 nux.min.js File 3509
Edit Download
📄 patterns.js File 64049
Edit Download
📄 patterns.min.js File 21454
Edit Download
📄 plugins.js File 18277
Edit Download
📄 plugins.min.js File 4284
Edit Download
📄 preferences-persistence.js File 30015
Edit Download
📄 preferences-persistence.min.js File 5625
Edit Download
📄 preferences.js File 25641
Edit Download
📄 preferences.min.js File 7012
Edit Download
📄 primitives.js File 6720
Edit Download
📄 primitives.min.js File 1655
Edit Download
📄 priority-queue.js File 14208
Edit Download
📄 priority-queue.min.js File 3378
Edit Download
📄 private-apis.js File 8503
Edit Download
📄 private-apis.min.js File 2815
Edit Download
📄 redux-routine.js File 23734
Edit Download
📄 redux-routine.min.js File 8889
Edit Download
📄 reusable-blocks.js File 20432
Edit Download
📄 reusable-blocks.min.js File 6112
Edit Download
📄 rich-text.js File 120684
Edit Download
📄 rich-text.min.js File 31005
Edit Download
📄 router.js File 53261
Edit Download
📄 router.min.js File 13532
Edit Download
📁 script-modules Folder -
📄 server-side-render.js File 14599
Edit Download
📄 server-side-render.min.js File 4368
Edit Download
📄 shortcode.js File 14578
Edit Download
📄 shortcode.min.js File 2900
Edit Download
📄 style-engine.js File 40004
Edit Download
📄 style-engine.min.js File 6050
Edit Download
📄 token-list.js File 6049
Edit Download
📄 token-list.min.js File 1271
Edit Download
📄 url.js File 34824
Edit Download
📄 url.min.js File 8523
Edit Download
📁 vendor Folder -
📄 viewport.js File 10465
Edit Download
📄 viewport.min.js File 1868
Edit Download
📄 warning.js File 2444
Edit Download
📄 warning.min.js File 311
Edit Download
📄 widgets.js File 53737
Edit Download
📄 widgets.min.js File 20034
Edit Download
📄 wordcount.js File 14748
Edit Download
📄 wordcount.min.js File 2480
Edit Download

View File: wordcount.js

/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	// The require scope
/******/ 	var __webpack_require__ = {};
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  count: () => (/* binding */ count)
});

;// ./node_modules/@wordpress/wordcount/build-module/defaultSettings.js
/** @typedef {import('./index').WPWordCountStrategy} WPWordCountStrategy */

/** @typedef {Partial<{type: WPWordCountStrategy, shortcodes: string[]}>} WPWordCountL10n */

/**
 * @typedef WPWordCountSettingsFields
 * @property {RegExp}              HTMLRegExp                        Regular expression that matches HTML tags
 * @property {RegExp}              HTMLcommentRegExp                 Regular expression that matches HTML comments
 * @property {RegExp}              spaceRegExp                       Regular expression that matches spaces in HTML
 * @property {RegExp}              HTMLEntityRegExp                  Regular expression that matches HTML entities
 * @property {RegExp}              connectorRegExp                   Regular expression that matches word connectors, like em-dash
 * @property {RegExp}              removeRegExp                      Regular expression that matches various characters to be removed when counting
 * @property {RegExp}              astralRegExp                      Regular expression that matches astral UTF-16 code points
 * @property {RegExp}              wordsRegExp                       Regular expression that matches words
 * @property {RegExp}              characters_excluding_spacesRegExp Regular expression that matches characters excluding spaces
 * @property {RegExp}              characters_including_spacesRegExp Regular expression that matches characters including spaces
 * @property {RegExp}              shortcodesRegExp                  Regular expression that matches WordPress shortcodes
 * @property {string[]}            shortcodes                        List of all shortcodes
 * @property {WPWordCountStrategy} type                              Describes what and how are we counting
 * @property {WPWordCountL10n}     l10n                              Object with human translations
 */

/**
 * Lower-level settings for word counting that can be overridden.
 *
 * @typedef {Partial<WPWordCountSettingsFields>} WPWordCountUserSettings
 */

// Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly: https://github.com/jsdoc/jsdoc/issues/1285
/* eslint-disable jsdoc/valid-types */
/**
 * Word counting settings that include non-optional values we set if missing
 *
 * @typedef {WPWordCountUserSettings & typeof defaultSettings} WPWordCountDefaultSettings
 */
/* eslint-enable jsdoc/valid-types */

const defaultSettings = {
  HTMLRegExp: /<\/?[a-z][^>]*?>/gi,
  HTMLcommentRegExp: /<!--[\s\S]*?-->/g,
  spaceRegExp: /&nbsp;|&#160;/gi,
  HTMLEntityRegExp: /&\S+?;/g,
  // \u2014 = em-dash.
  connectorRegExp: /--|\u2014/g,
  // Characters to be removed from input text.
  removeRegExp: new RegExp(['[',
  // Basic Latin (extract)
  '\u0021-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E',
  // Latin-1 Supplement (extract)
  '\u0080-\u00BF\u00D7\u00F7',
  /*
   * The following range consists of:
   * General Punctuation
   * Superscripts and Subscripts
   * Currency Symbols
   * Combining Diacritical Marks for Symbols
   * Letterlike Symbols
   * Number Forms
   * Arrows
   * Mathematical Operators
   * Miscellaneous Technical
   * Control Pictures
   * Optical Character Recognition
   * Enclosed Alphanumerics
   * Box Drawing
   * Block Elements
   * Geometric Shapes
   * Miscellaneous Symbols
   * Dingbats
   * Miscellaneous Mathematical Symbols-A
   * Supplemental Arrows-A
   * Braille Patterns
   * Supplemental Arrows-B
   * Miscellaneous Mathematical Symbols-B
   * Supplemental Mathematical Operators
   * Miscellaneous Symbols and Arrows
   */
  '\u2000-\u2BFF',
  // Supplemental Punctuation.
  '\u2E00-\u2E7F', ']'].join(''), 'g'),
  // Remove UTF-16 surrogate points, see https://en.wikipedia.org/wiki/UTF-16#U.2BD800_to_U.2BDFFF
  astralRegExp: /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
  wordsRegExp: /\S\s+/g,
  characters_excluding_spacesRegExp: /\S/g,
  /*
   * Match anything that is not a formatting character, excluding:
   * \f = form feed
   * \n = new line
   * \r = carriage return
   * \t = tab
   * \v = vertical tab
   * \u00AD = soft hyphen
   * \u2028 = line separator
   * \u2029 = paragraph separator
   */
  characters_including_spacesRegExp: /[^\f\n\r\t\v\u00AD\u2028\u2029]/g,
  l10n: {
    type: 'words'
  }
};

;// ./node_modules/@wordpress/wordcount/build-module/stripTags.js
/**
 * Replaces items matched in the regex with new line
 *
 * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions
 * @param {string}                                text     The string being counted.
 *
 * @return {string} The manipulated text.
 */
function stripTags(settings, text) {
  return text.replace(settings.HTMLRegExp, '\n');
}

;// ./node_modules/@wordpress/wordcount/build-module/transposeAstralsToCountableChar.js
/**
 * Replaces items matched in the regex with character.
 *
 * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions
 * @param {string}                                text     The string being counted.
 *
 * @return {string} The manipulated text.
 */
function transposeAstralsToCountableChar(settings, text) {
  return text.replace(settings.astralRegExp, 'a');
}

;// ./node_modules/@wordpress/wordcount/build-module/stripHTMLEntities.js
/**
 * Removes items matched in the regex.
 *
 * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions
 * @param {string}                                text     The string being counted.
 *
 * @return {string} The manipulated text.
 */
function stripHTMLEntities(settings, text) {
  return text.replace(settings.HTMLEntityRegExp, '');
}

;// ./node_modules/@wordpress/wordcount/build-module/stripConnectors.js
/**
 * Replaces items matched in the regex with spaces.
 *
 * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions
 * @param {string}                                text     The string being counted.
 *
 * @return {string} The manipulated text.
 */
function stripConnectors(settings, text) {
  return text.replace(settings.connectorRegExp, ' ');
}

;// ./node_modules/@wordpress/wordcount/build-module/stripRemovables.js
/**
 * Removes items matched in the regex.
 *
 * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions
 * @param {string}                                text     The string being counted.
 *
 * @return {string} The manipulated text.
 */
function stripRemovables(settings, text) {
  return text.replace(settings.removeRegExp, '');
}

;// ./node_modules/@wordpress/wordcount/build-module/stripHTMLComments.js
/**
 * Removes items matched in the regex.
 *
 * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions
 * @param {string}                                text     The string being counted.
 *
 * @return {string} The manipulated text.
 */
function stripHTMLComments(settings, text) {
  return text.replace(settings.HTMLcommentRegExp, '');
}

;// ./node_modules/@wordpress/wordcount/build-module/stripShortcodes.js
/**
 * Replaces items matched in the regex with a new line.
 *
 * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions
 * @param {string}                                text     The string being counted.
 *
 * @return {string} The manipulated text.
 */
function stripShortcodes(settings, text) {
  if (settings.shortcodesRegExp) {
    return text.replace(settings.shortcodesRegExp, '\n');
  }
  return text;
}

;// ./node_modules/@wordpress/wordcount/build-module/stripSpaces.js
/**
 * Replaces items matched in the regex with spaces.
 *
 * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions
 * @param {string}                                text     The string being counted.
 *
 * @return {string} The manipulated text.
 */
function stripSpaces(settings, text) {
  return text.replace(settings.spaceRegExp, ' ');
}

;// ./node_modules/@wordpress/wordcount/build-module/transposeHTMLEntitiesToCountableChars.js
/**
 * Replaces items matched in the regex with a single character.
 *
 * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions
 * @param {string}                                text     The string being counted.
 *
 * @return {string} The manipulated text.
 */
function transposeHTMLEntitiesToCountableChars(settings, text) {
  return text.replace(settings.HTMLEntityRegExp, 'a');
}

;// ./node_modules/@wordpress/wordcount/build-module/index.js
/**
 * Internal dependencies
 */











/**
 * @typedef {import('./defaultSettings').WPWordCountDefaultSettings}  WPWordCountSettings
 * @typedef {import('./defaultSettings').WPWordCountUserSettings}     WPWordCountUserSettings
 */

/**
 * Possible ways of counting.
 *
 * @typedef {'words'|'characters_excluding_spaces'|'characters_including_spaces'} WPWordCountStrategy
 */

/**
 * Private function to manage the settings.
 *
 * @param {WPWordCountStrategy}     type         The type of count to be done.
 * @param {WPWordCountUserSettings} userSettings Custom settings for the count.
 *
 * @return {WPWordCountSettings} The combined settings object to be used.
 */
function loadSettings(type, userSettings) {
  var _settings$l10n$shortc;
  const settings = Object.assign({}, defaultSettings, userSettings);
  settings.shortcodes = (_settings$l10n$shortc = settings.l10n?.shortcodes) !== null && _settings$l10n$shortc !== void 0 ? _settings$l10n$shortc : [];
  if (settings.shortcodes && settings.shortcodes.length) {
    settings.shortcodesRegExp = new RegExp('\\[\\/?(?:' + settings.shortcodes.join('|') + ')[^\\]]*?\\]', 'g');
  }
  settings.type = type;
  if (settings.type !== 'characters_excluding_spaces' && settings.type !== 'characters_including_spaces') {
    settings.type = 'words';
  }
  return settings;
}

/**
 * Count the words in text
 *
 * @param {string}              text     The text being processed
 * @param {RegExp}              regex    The regular expression pattern being matched
 * @param {WPWordCountSettings} settings Settings object containing regular expressions for each strip function
 *
 * @return {number} Count of words.
 */
function countWords(text, regex, settings) {
  var _text$match$length;
  text = [stripTags.bind(null, settings), stripHTMLComments.bind(null, settings), stripShortcodes.bind(null, settings), stripSpaces.bind(null, settings), stripHTMLEntities.bind(null, settings), stripConnectors.bind(null, settings), stripRemovables.bind(null, settings)].reduce((result, fn) => fn(result), text);
  text = text + '\n';
  return (_text$match$length = text.match(regex)?.length) !== null && _text$match$length !== void 0 ? _text$match$length : 0;
}

/**
 * Count the characters in text
 *
 * @param {string}              text     The text being processed
 * @param {RegExp}              regex    The regular expression pattern being matched
 * @param {WPWordCountSettings} settings Settings object containing regular expressions for each strip function
 *
 * @return {number} Count of characters.
 */
function countCharacters(text, regex, settings) {
  var _text$match$length2;
  text = [stripTags.bind(null, settings), stripHTMLComments.bind(null, settings), stripShortcodes.bind(null, settings), transposeAstralsToCountableChar.bind(null, settings), stripSpaces.bind(null, settings), transposeHTMLEntitiesToCountableChars.bind(null, settings)].reduce((result, fn) => fn(result), text);
  text = text + '\n';
  return (_text$match$length2 = text.match(regex)?.length) !== null && _text$match$length2 !== void 0 ? _text$match$length2 : 0;
}

/**
 * Count some words.
 *
 * @param {string}                  text         The text being processed
 * @param {WPWordCountStrategy}     type         The type of count. Accepts 'words', 'characters_excluding_spaces', or 'characters_including_spaces'.
 * @param {WPWordCountUserSettings} userSettings Custom settings object.
 *
 * @example
 * ```js
 * import { count } from '@wordpress/wordcount';
 * const numberOfWords = count( 'Words to count', 'words', {} )
 * ```
 *
 * @return {number} The word or character count.
 */
function count(text, type, userSettings) {
  const settings = loadSettings(type, userSettings);
  let matchRegExp;
  switch (settings.type) {
    case 'words':
      matchRegExp = settings.wordsRegExp;
      return countWords(text, matchRegExp, settings);
    case 'characters_including_spaces':
      matchRegExp = settings.characters_including_spacesRegExp;
      return countCharacters(text, matchRegExp, settings);
    case 'characters_excluding_spaces':
      matchRegExp = settings.characters_excluding_spacesRegExp;
      return countCharacters(text, matchRegExp, settings);
    default:
      return 0;
  }
}

(window.wp = window.wp || {}).wordcount = __webpack_exports__;
/******/ })()
;