1 line
128 KiB
Plaintext
1 line
128 KiB
Plaintext
{"version":3,"sources":["webpack://wp.[name]/webpack/bootstrap","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/iterableToArray.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/objectSpread.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/apply-format.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/char-at.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/concat.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/create-element.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/create.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/get-active-format.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/get-format-type.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/get-format-types.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/get-selection-end.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/get-selection-start.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/get-text-content.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/index.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/insert-line-separator.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/insert-object.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/insert.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/is-collapsed.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/is-empty.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/is-format-equal.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/join.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/normalise-formats.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/register-format-type.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/remove-format.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/remove.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/replace.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/slice.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/special-characters.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/split.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/store/actions.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/store/index.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/store/reducer.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/store/selectors.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/to-dom.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/to-html-string.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/to-tree.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/toggle-format.js","webpack://wp.[name]//Users/pento/Projects/gutenberg/packages/rich-text/src/unregister-format-type.js","webpack://wp.[name]/./node_modules/rememo/es/rememo.js","webpack://wp.[name]/external {\"this\":[\"wp\",\"data\"]}","webpack://wp.[name]/external {\"this\":[\"wp\",\"deprecated\"]}","webpack://wp.[name]/external {\"this\":[\"wp\",\"escapeHtml\"]}","webpack://wp.[name]/external \"lodash\""],"names":["applyFormat","format","formats","text","start","end","startIndex","endIndex","newFormats","slice","startFormat","find","type","applyFormats","previousFormat","hasType","formatPlaceholder","index","undefined","normaliseFormats","newFormatsAtIndex","filter","push","charAt","concat","values","reduce","accumlator","createElement","html","implementation","createHTMLDocument","body","innerHTML","window","Node","TEXT_NODE","ELEMENT_NODE","createEmptyValue","simpleFindKey","object","value","key","toFormat","attributes","formatType","getFormatTypes","match","tagName","name","registeredAttributes","unregisteredAttributes","create","element","range","multilineTag","multilineWrapperTags","removeNode","unwrapNode","filterString","removeAttribute","length","Array","document","createFromElement","createFromMultilineElement","accumulateSelection","accumulator","node","parentNode","startContainer","startOffset","endContainer","endOffset","currentLength","nodeType","childNodes","filterRange","nodeValue","currentWrapperTags","hasChildNodes","filterStringComplete","string","replace","nodeName","toLowerCase","lastFormats","lastFormat","newFormat","getAttributes","isFormatEqual","indexOf","isEmpty","OBJECT_REPLACEMENT_CHARACTER","unshift","i","formatIndex","children","LINE_SEPARATOR","hasAttributes","getActiveFormat","getFormatType","select","getSelectionEnd","getSelectionStart","getTextContent","insertLineSeparator","beforeText","previousLineSeparatorIndex","lastIndexOf","valueToInsert","insert","insertObject","formatToInsert","isCollapsed","isEmptyLine","format1","format2","attributes1","attributes2","keys1","Object","keys","keys2","join","separator","forEach","formatsAtIndex","lastFormatsAtIndex","registerFormatType","settings","console","error","test","isFunction","edit","title","keywords","dispatch","addFormatTypes","removeFormat","filterFormats","remove","pattern","replacement","rest","offset","newText","fill","ZERO_WIDTH_NO_BREAK_SPACE","split","splitAtSelection","arguments","nextStart","map","substring","before","after","formatTypes","castArray","removeFormatTypes","names","registerStore","reducer","selectors","actions","state","action","keyBy","omit","combineReducers","createSelector","createPathToNode","rootNode","path","previousSibling","getNodeByPath","shift","createEmpty","append","child","ownerDocument","createTextNode","setAttribute","appendChild","appendText","appendData","getLastChild","lastChild","getParent","isText","getText","removeChild","padEmptyLines","createLinePadding","doc","insertBefore","toDom","startPath","endPath","tree","toTree","onStartIndex","pointer","onEndIndex","isEditableTree","selection","apply","current","applyValue","applySelection","future","firstChild","currentChild","futureNodeType","replaceChild","windowSelection","getSelection","createRange","collapsed","insertData","setStart","setEnd","removeAllRanges","addRange","toHTMLString","deprecated","version","alternative","plugin","createChildrenHTML","parent","splice","createElementHTML","attributeString","isValidAttributeName","escapeAttribute","escapeHTML","fromFormat","elementAttributes","formatsLength","multilineFormat","lastSeparatorFormats","lastCharacterFormats","lastCharacter","setFormatPlaceholder","character","characterFormats","newNode","toggleFormat","unregisterFormatType","oldFormat"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFA;AAAA;AAAe;AACf;AACA,iDAAiD,gBAAgB;AACjE;AACA;;AAEA;AACA;AACA,C;;;;;;;;;;;;ACRA;AAAA;AAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACbA;AAAA;AAAe;AACf;AACA,C;;;;;;;;;;;;ACFA;AAAA;AAAe;AACf;AACA,C;;;;;;;;;;;;ACFA;AAAA;AAAA;AAA8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A;AACA,WAAW,EAAE;AACb;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qBAAqB,cAAc;AACnC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACe;AACf;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,MAAM;AAClB;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA,cAAc,uBAAuB;AACrC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,KAAK;AACjB;AACA,aAAa,EAAE;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,SAAS;AACvB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;;;;;;ACjRD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,2CAA2C,EAAE,I;;;;;;;;;;;ACA1D,aAAa,2CAA2C,EAAE,I;;;;;;;;;;;ACA1D,aAAa,iCAAiC,EAAE,I","file":"rich-text.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./node_modules/@wordpress/rich-text/build-module/index.js\");\n","export default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","export default function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}","import defineProperty from \"./defineProperty\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","import arrayWithoutHoles from \"./arrayWithoutHoles\";\nimport iterableToArray from \"./iterableToArray\";\nimport nonIterableSpread from \"./nonIterableSpread\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}","function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nexport default function _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}","/**\n * External dependencies\n */\n\nimport { find } from 'lodash';\n\n/**\n * Internal dependencies\n */\n\nimport { normaliseFormats } from './normalise-formats';\n\n/**\n * Apply a format object to a Rich Text value from the given `startIndex` to the\n * given `endIndex`. Indices are retrieved from the selection if none are\n * provided.\n *\n * @param {Object} value Value to modify.\n * @param {Object} format Format to apply.\n * @param {number} startIndex Start index.\n * @param {number} endIndex End index.\n *\n * @return {Object} A new value with the format applied.\n */\nexport function applyFormat(\n\t{ formats, text, start, end },\n\tformat,\n\tstartIndex = start,\n\tendIndex = end\n) {\n\tconst newFormats = formats.slice( 0 );\n\n\t// The selection is collpased.\n\tif ( startIndex === endIndex ) {\n\t\tconst startFormat = find( newFormats[ startIndex ], { type: format.type } );\n\n\t\t// If the caret is at a format of the same type, expand start and end to\n\t\t// the edges of the format. This is useful to apply new attributes.\n\t\tif ( startFormat ) {\n\t\t\twhile ( find( newFormats[ startIndex ], startFormat ) ) {\n\t\t\t\tapplyFormats( newFormats, startIndex, format );\n\t\t\t\tstartIndex--;\n\t\t\t}\n\n\t\t\tendIndex++;\n\n\t\t\twhile ( find( newFormats[ endIndex ], startFormat ) ) {\n\t\t\t\tapplyFormats( newFormats, endIndex, format );\n\t\t\t\tendIndex++;\n\t\t\t}\n\t\t// Otherwise, insert a placeholder with the format so new input appears\n\t\t// with the format applied.\n\t\t} else {\n\t\t\tconst previousFormat = newFormats[ startIndex - 1 ] || [];\n\t\t\tconst hasType = find( previousFormat, { type: format.type } );\n\n\t\t\treturn {\n\t\t\t\tformats,\n\t\t\t\ttext,\n\t\t\t\tstart,\n\t\t\t\tend,\n\t\t\t\tformatPlaceholder: {\n\t\t\t\t\tindex: startIndex,\n\t\t\t\t\tformat: hasType ? undefined : format,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t} else {\n\t\tfor ( let index = startIndex; index < endIndex; index++ ) {\n\t\t\tapplyFormats( newFormats, index, format );\n\t\t}\n\t}\n\n\treturn normaliseFormats( { formats: newFormats, text, start, end } );\n}\n\nfunction applyFormats( formats, index, format ) {\n\tif ( formats[ index ] ) {\n\t\tconst newFormatsAtIndex = formats[ index ].filter( ( { type } ) => type !== format.type );\n\t\tnewFormatsAtIndex.push( format );\n\t\tformats[ index ] = newFormatsAtIndex;\n\t} else {\n\t\tformats[ index ] = [ format ];\n\t}\n}\n","/**\n * Gets the character at the specified index, or returns `undefined` if no\n * character was found.\n *\n * @param {Object} value Value to get the character from.\n * @param {string} index Index to use.\n *\n * @return {?string} A one character long string, or undefined.\n */\nexport function charAt( { text }, index ) {\n\treturn text[ index ];\n}\n","/**\n * Internal dependencies\n */\n\nimport { normaliseFormats } from './normalise-formats';\n\n/**\n * Combine all Rich Text values into one. This is similar to\n * `String.prototype.concat`.\n *\n * @param {...[object]} values An array of all values to combine.\n *\n * @return {Object} A new value combining all given records.\n */\nexport function concat( ...values ) {\n\treturn normaliseFormats( values.reduce( ( accumlator, { formats, text } ) => ( {\n\t\ttext: accumlator.text + text,\n\t\tformats: accumlator.formats.concat( formats ),\n\t} ) ) );\n}\n","/**\n * Parse the given HTML into a body element.\n *\n * @param {HTMLDocument} document The HTML document to use to parse.\n * @param {string} html The HTML to parse.\n *\n * @return {HTMLBodyElement} Body element with parsed HTML.\n */\nexport function createElement( { implementation }, html ) {\n\tconst { body } = implementation.createHTMLDocument( '' );\n\tbody.innerHTML = html;\n\treturn body;\n}\n","/**\n * External dependencies\n */\n\nimport { find } from 'lodash';\n\n/**\n * Internal dependencies\n */\n\nimport { isEmpty } from './is-empty';\nimport { isFormatEqual } from './is-format-equal';\nimport { createElement } from './create-element';\nimport { getFormatTypes } from './get-format-types';\nimport {\n\tLINE_SEPARATOR,\n\tOBJECT_REPLACEMENT_CHARACTER,\n} from './special-characters';\n\n/**\n * Browser dependencies\n */\n\nconst { TEXT_NODE, ELEMENT_NODE } = window.Node;\n\nfunction createEmptyValue() {\n\treturn { formats: [], text: '' };\n}\n\nfunction simpleFindKey( object, value ) {\n\tfor ( const key in object ) {\n\t\tif ( object[ key ] === value ) {\n\t\t\treturn key;\n\t\t}\n\t}\n}\n\nfunction toFormat( { type, attributes } ) {\n\tconst formatType = find( getFormatTypes(), ( { match } ) =>\n\t\ttype === match.tagName\n\t);\n\n\tif ( ! formatType ) {\n\t\treturn attributes ? { type, attributes } : { type };\n\t}\n\n\tif ( ! attributes ) {\n\t\treturn { type: formatType.name };\n\t}\n\n\tconst registeredAttributes = {};\n\tconst unregisteredAttributes = {};\n\n\tfor ( const name in attributes ) {\n\t\tconst key = simpleFindKey( formatType.attributes, name );\n\n\t\tif ( key ) {\n\t\t\tregisteredAttributes[ key ] = attributes[ name ];\n\t\t} else {\n\t\t\tunregisteredAttributes[ name ] = attributes[ name ];\n\t\t}\n\t}\n\n\treturn {\n\t\ttype: formatType.name,\n\t\tattributes: registeredAttributes,\n\t\tunregisteredAttributes,\n\t};\n}\n\n/**\n * Create a RichText value from an `Element` tree (DOM), an HTML string or a\n * plain text string, with optionally a `Range` object to set the selection. If\n * called without any input, an empty value will be created. If\n * `multilineTag` is provided, any content of direct children whose type matches\n * `multilineTag` will be separated by two newlines. The optional functions can\n * be used to filter out content.\n *\n * @param {?Object} $1 Optional named argements.\n * @param {?Element} $1.element Element to create value from.\n * @param {?string} $1.text Text to create value from.\n * @param {?string} $1.html HTML to create value from.\n * @param {?Range} $1.range Range to create value from.\n * @param {?string} $1.multilineTag Multiline tag if the structure is\n * multiline.\n * @param {?Array} $1.multilineWrapperTags Tags where lines can be found if\n * nesting is possible.\n * @param {?Function} $1.removeNode Function to declare whether the\n * given node should be removed.\n * @param {?Function} $1.unwrapNode Function to declare whether the\n * given node should be unwrapped.\n * @param {?Function} $1.filterString Function to filter the given\n * string.\n * @param {?Function} $1.removeAttribute Wether to remove an attribute\n * based on the name.\n *\n * @return {Object} A rich text value.\n */\nexport function create( {\n\telement,\n\ttext,\n\thtml,\n\trange,\n\tmultilineTag,\n\tmultilineWrapperTags,\n\tremoveNode,\n\tunwrapNode,\n\tfilterString,\n\tremoveAttribute,\n} = {} ) {\n\tif ( typeof text === 'string' && text.length > 0 ) {\n\t\treturn {\n\t\t\tformats: Array( text.length ),\n\t\t\ttext: text,\n\t\t};\n\t}\n\n\tif ( typeof html === 'string' && html.length > 0 ) {\n\t\telement = createElement( document, html );\n\t}\n\n\tif ( typeof element !== 'object' ) {\n\t\treturn createEmptyValue();\n\t}\n\n\tif ( ! multilineTag ) {\n\t\treturn createFromElement( {\n\t\t\telement,\n\t\t\trange,\n\t\t\tremoveNode,\n\t\t\tunwrapNode,\n\t\t\tfilterString,\n\t\t\tremoveAttribute,\n\t\t} );\n\t}\n\n\treturn createFromMultilineElement( {\n\t\telement,\n\t\trange,\n\t\tmultilineTag,\n\t\tmultilineWrapperTags,\n\t\tremoveNode,\n\t\tunwrapNode,\n\t\tfilterString,\n\t\tremoveAttribute,\n\t} );\n}\n\n/**\n * Helper to accumulate the value's selection start and end from the current\n * node and range.\n *\n * @param {Object} accumulator Object to accumulate into.\n * @param {Node} node Node to create value with.\n * @param {Range} range Range to create value with.\n * @param {Object} value Value that is being accumulated.\n */\nfunction accumulateSelection( accumulator, node, range, value ) {\n\tif ( ! range ) {\n\t\treturn;\n\t}\n\n\tconst { parentNode } = node;\n\tconst { startContainer, startOffset, endContainer, endOffset } = range;\n\tconst currentLength = accumulator.text.length;\n\n\t// Selection can be extracted from value.\n\tif ( value.start !== undefined ) {\n\t\taccumulator.start = currentLength + value.start;\n\t// Range indicates that the current node has selection.\n\t} else if ( node === startContainer && node.nodeType === TEXT_NODE ) {\n\t\taccumulator.start = currentLength + startOffset;\n\t// Range indicates that the current node is selected.\n\t} else if (\n\t\tparentNode === startContainer &&\n\t\tnode === startContainer.childNodes[ startOffset ]\n\t) {\n\t\taccumulator.start = currentLength;\n\t// Range indicates that the selection is after the current node.\n\t} else if (\n\t\tparentNode === startContainer &&\n\t\tnode === startContainer.childNodes[ startOffset - 1 ]\n\t) {\n\t\taccumulator.start = currentLength + value.text.length;\n\t// Fallback if no child inside handled the selection.\n\t} else if ( node === startContainer ) {\n\t\taccumulator.start = currentLength;\n\t}\n\n\t// Selection can be extracted from value.\n\tif ( value.end !== undefined ) {\n\t\taccumulator.end = currentLength + value.end;\n\t// Range indicates that the current node has selection.\n\t} else if ( node === endContainer && node.nodeType === TEXT_NODE ) {\n\t\taccumulator.end = currentLength + endOffset;\n\t// Range indicates that the current node is selected.\n\t} else if (\n\t\tparentNode === endContainer &&\n\t\tnode === endContainer.childNodes[ endOffset - 1 ]\n\t) {\n\t\taccumulator.end = currentLength + value.text.length;\n\t// Range indicates that the selection is before the current node.\n\t} else if (\n\t\tparentNode === endContainer &&\n\t\tnode === endContainer.childNodes[ endOffset ]\n\t) {\n\t\taccumulator.end = currentLength;\n\t// Fallback if no child inside handled the selection.\n\t} else if ( node === endContainer ) {\n\t\taccumulator.end = currentLength + endOffset;\n\t}\n}\n\n/**\n * Adjusts the start and end offsets from a range based on a text filter.\n *\n * @param {Node} node Node of which the text should be filtered.\n * @param {Range} range The range to filter.\n * @param {Function} filter Function to use to filter the text.\n *\n * @return {?Object} Object containing range properties.\n */\nfunction filterRange( node, range, filter ) {\n\tif ( ! range ) {\n\t\treturn;\n\t}\n\n\tconst { startContainer, endContainer } = range;\n\tlet { startOffset, endOffset } = range;\n\n\tif ( node === startContainer ) {\n\t\tstartOffset = filter( node.nodeValue.slice( 0, startOffset ) ).length;\n\t}\n\n\tif ( node === endContainer ) {\n\t\tendOffset = filter( node.nodeValue.slice( 0, endOffset ) ).length;\n\t}\n\n\treturn { startContainer, startOffset, endContainer, endOffset };\n}\n\n/**\n * Creates a Rich Text value from a DOM element and range.\n *\n * @param {Object} $1 Named argements.\n * @param {?Element} $1.element Element to create value from.\n * @param {?Range} $1.range Range to create value from.\n * @param {?string} $1.multilineTag Multiline tag if the structure is\n * multiline.\n * @param {?Array} $1.multilineWrapperTags Tags where lines can be found if\n * nesting is possible.\n * @param {?Function} $1.removeNode Function to declare whether the\n * given node should be removed.\n * @param {?Function} $1.unwrapNode Function to declare whether the\n * given node should be unwrapped.\n * @param {?Function} $1.filterString Function to filter the given\n * string.\n * @param {?Function} $1.removeAttribute Wether to remove an attribute\n * based on the name.\n *\n * @return {Object} A rich text value.\n */\nfunction createFromElement( {\n\telement,\n\trange,\n\tmultilineTag,\n\tmultilineWrapperTags,\n\tcurrentWrapperTags = [],\n\tremoveNode,\n\tunwrapNode,\n\tfilterString,\n\tremoveAttribute,\n} ) {\n\tconst accumulator = createEmptyValue();\n\n\tif ( ! element ) {\n\t\treturn accumulator;\n\t}\n\n\tif ( ! element.hasChildNodes() ) {\n\t\taccumulateSelection( accumulator, element, range, createEmptyValue() );\n\t\treturn accumulator;\n\t}\n\n\tconst length = element.childNodes.length;\n\n\t// Remove any line breaks in text nodes. They are not content, but used to\n\t// format the HTML. Line breaks in HTML are stored as BR elements.\n\t// See https://www.w3.org/TR/html5/syntax.html#newlines.\n\tconst filterStringComplete = ( string ) => {\n\t\tstring = string.replace( /[\\r\\n]/g, '' );\n\n\t\tif ( filterString ) {\n\t\t\tstring = filterString( string );\n\t\t}\n\n\t\treturn string;\n\t};\n\n\t// Optimise for speed.\n\tfor ( let index = 0; index < length; index++ ) {\n\t\tconst node = element.childNodes[ index ];\n\t\tconst type = node.nodeName.toLowerCase();\n\n\t\tif ( node.nodeType === TEXT_NODE ) {\n\t\t\tconst text = filterStringComplete( node.nodeValue );\n\t\t\trange = filterRange( node, range, filterStringComplete );\n\t\t\taccumulateSelection( accumulator, node, range, { text } );\n\t\t\taccumulator.text += text;\n\t\t\t// Create a sparse array of the same length as `text`, in which\n\t\t\t// formats can be added.\n\t\t\taccumulator.formats.length += text.length;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( node.nodeType !== ELEMENT_NODE ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (\n\t\t\t( removeNode && removeNode( node ) ) ||\n\t\t\t( unwrapNode && unwrapNode( node ) && ! node.hasChildNodes() )\n\t\t) {\n\t\t\taccumulateSelection( accumulator, node, range, createEmptyValue() );\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( type === 'br' ) {\n\t\t\taccumulateSelection( accumulator, node, range, createEmptyValue() );\n\t\t\taccumulator.text += '\\n';\n\t\t\taccumulator.formats.length += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst lastFormats = accumulator.formats[ accumulator.formats.length - 1 ];\n\t\tconst lastFormat = lastFormats && lastFormats[ lastFormats.length - 1 ];\n\t\tlet format;\n\t\tlet value;\n\n\t\tif ( ! unwrapNode || ! unwrapNode( node ) ) {\n\t\t\tconst newFormat = toFormat( {\n\t\t\t\ttype,\n\t\t\t\tattributes: getAttributes( {\n\t\t\t\t\telement: node,\n\t\t\t\t\tremoveAttribute,\n\t\t\t\t} ),\n\t\t\t} );\n\n\t\t\t// Reuse the last format if it's equal.\n\t\t\tif ( isFormatEqual( newFormat, lastFormat ) ) {\n\t\t\t\tformat = lastFormat;\n\t\t\t} else {\n\t\t\t\tformat = newFormat;\n\t\t\t}\n\t\t}\n\n\t\tif ( multilineWrapperTags && multilineWrapperTags.indexOf( type ) !== -1 ) {\n\t\t\tvalue = createFromMultilineElement( {\n\t\t\t\telement: node,\n\t\t\t\trange,\n\t\t\t\tmultilineTag,\n\t\t\t\tmultilineWrapperTags,\n\t\t\t\tremoveNode,\n\t\t\t\tunwrapNode,\n\t\t\t\tfilterString,\n\t\t\t\tremoveAttribute,\n\t\t\t\tcurrentWrapperTags: [ ...currentWrapperTags, format ],\n\t\t\t} );\n\t\t\tformat = undefined;\n\t\t} else {\n\t\t\tvalue = createFromElement( {\n\t\t\t\telement: node,\n\t\t\t\trange,\n\t\t\t\tmultilineTag,\n\t\t\t\tmultilineWrapperTags,\n\t\t\t\tremoveNode,\n\t\t\t\tunwrapNode,\n\t\t\t\tfilterString,\n\t\t\t\tremoveAttribute,\n\t\t\t} );\n\t\t}\n\n\t\tconst text = value.text;\n\t\tconst start = accumulator.text.length;\n\n\t\taccumulateSelection( accumulator, node, range, value );\n\n\t\t// Don't apply the element as formatting if it has no content.\n\t\tif ( isEmpty( value ) && format && ! format.attributes ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst { formats } = accumulator;\n\n\t\tif ( format && format.attributes && text.length === 0 ) {\n\t\t\tformat.object = true;\n\t\t\taccumulator.text += OBJECT_REPLACEMENT_CHARACTER;\n\n\t\t\tif ( formats[ start ] ) {\n\t\t\t\tformats[ start ].unshift( format );\n\t\t\t} else {\n\t\t\t\tformats[ start ] = [ format ];\n\t\t\t}\n\t\t} else {\n\t\t\taccumulator.text += text;\n\t\t\taccumulator.formats.length += text.length;\n\n\t\t\tlet i = value.formats.length;\n\n\t\t\t// Optimise for speed.\n\t\t\twhile ( i-- ) {\n\t\t\t\tconst formatIndex = start + i;\n\n\t\t\t\tif ( format ) {\n\t\t\t\t\tif ( formats[ formatIndex ] ) {\n\t\t\t\t\t\tformats[ formatIndex ].push( format );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tformats[ formatIndex ] = [ format ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( value.formats[ i ] ) {\n\t\t\t\t\tif ( formats[ formatIndex ] ) {\n\t\t\t\t\t\tformats[ formatIndex ].push( ...value.formats[ i ] );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tformats[ formatIndex ] = value.formats[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn accumulator;\n}\n\n/**\n * Creates a rich text value from a DOM element and range that should be\n * multiline.\n *\n * @param {Object} $1 Named argements.\n * @param {?Element} $1.element Element to create value from.\n * @param {?Range} $1.range Range to create value from.\n * @param {?string} $1.multilineTag Multiline tag if the structure is\n * multiline.\n * @param {?Array} $1.multilineWrapperTags Tags where lines can be found if\n * nesting is possible.\n * @param {?Function} $1.removeNode Function to declare whether the\n * given node should be removed.\n * @param {?Function} $1.unwrapNode Function to declare whether the\n * given node should be unwrapped.\n * @param {?Function} $1.filterString Function to filter the given\n * string.\n * @param {?Function} $1.removeAttribute Wether to remove an attribute\n * based on the name.\n * @param {boolean} $1.currentWrapperTags Whether to prepend a line\n * separator.\n *\n * @return {Object} A rich text value.\n */\nfunction createFromMultilineElement( {\n\telement,\n\trange,\n\tmultilineTag,\n\tmultilineWrapperTags,\n\tremoveNode,\n\tunwrapNode,\n\tfilterString,\n\tremoveAttribute,\n\tcurrentWrapperTags = [],\n} ) {\n\tconst accumulator = createEmptyValue();\n\n\tif ( ! element || ! element.hasChildNodes() ) {\n\t\treturn accumulator;\n\t}\n\n\tconst length = element.children.length;\n\n\t// Optimise for speed.\n\tfor ( let index = 0; index < length; index++ ) {\n\t\tconst node = element.children[ index ];\n\n\t\tif ( node.nodeName.toLowerCase() !== multilineTag ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet value = createFromElement( {\n\t\t\telement: node,\n\t\t\trange,\n\t\t\tmultilineTag,\n\t\t\tmultilineWrapperTags,\n\t\t\tcurrentWrapperTags,\n\t\t\tremoveNode,\n\t\t\tunwrapNode,\n\t\t\tfilterString,\n\t\t\tremoveAttribute,\n\t\t} );\n\n\t\t// If a line consists of one single line break (invisible), consider the\n\t\t// line empty, wether this is the browser's doing or not.\n\t\tif ( value.text === '\\n' ) {\n\t\t\tconst start = value.start;\n\t\t\tconst end = value.end;\n\n\t\t\tvalue = createEmptyValue();\n\n\t\t\tif ( start !== undefined ) {\n\t\t\t\tvalue.start = 0;\n\t\t\t}\n\n\t\t\tif ( end !== undefined ) {\n\t\t\t\tvalue.end = 0;\n\t\t\t}\n\t\t}\n\n\t\t// Multiline value text should be separated by a double line break.\n\t\tif ( index !== 0 || currentWrapperTags.length > 0 ) {\n\t\t\tconst formats = currentWrapperTags.length > 0 ? [ currentWrapperTags ] : [ , ];\n\t\t\taccumulator.formats = accumulator.formats.concat( formats );\n\t\t\taccumulator.text += LINE_SEPARATOR;\n\t\t}\n\n\t\taccumulateSelection( accumulator, node, range, value );\n\n\t\taccumulator.formats = accumulator.formats.concat( value.formats );\n\t\taccumulator.text += value.text;\n\t}\n\n\treturn accumulator;\n}\n\n/**\n * Gets the attributes of an element in object shape.\n *\n * @param {Object} $1 Named argements.\n * @param {Element} $1.element Element to get attributes from.\n * @param {?Function} $1.removeAttribute Wether to remove an attribute based on\n * the name.\n *\n * @return {?Object} Attribute object or `undefined` if the element has no\n * attributes.\n */\nfunction getAttributes( {\n\telement,\n\tremoveAttribute,\n} ) {\n\tif ( ! element.hasAttributes() ) {\n\t\treturn;\n\t}\n\n\tconst length = element.attributes.length;\n\tlet accumulator;\n\n\t// Optimise for speed.\n\tfor ( let i = 0; i < length; i++ ) {\n\t\tconst { name, value } = element.attributes[ i ];\n\n\t\tif ( removeAttribute && removeAttribute( name ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\taccumulator = accumulator || {};\n\t\taccumulator[ name ] = value;\n\t}\n\n\treturn accumulator;\n}\n","/**\n * External dependencies\n */\n\nimport { find } from 'lodash';\n\n/**\n * Gets the format object by type at the start of the selection. This can be\n * used to get e.g. the URL of a link format at the current selection, but also\n * to check if a format is active at the selection. Returns undefined if there\n * is no format at the selection.\n *\n * @param {Object} value Value to inspect.\n * @param {string} formatType Format type to look for.\n *\n * @return {?Object} Active format object of the specified type, or undefined.\n */\nexport function getActiveFormat( { formats, start }, formatType ) {\n\tif ( start === undefined ) {\n\t\treturn;\n\t}\n\n\treturn find( formats[ start ], { type: formatType } );\n}\n","/**\n * WordPress dependencies\n */\nimport { select } from '@wordpress/data';\n\n/**\n * Returns a registered format type.\n *\n * @param {string} name Format name.\n *\n * @return {?Object} Format type.\n */\nexport function getFormatType( name ) {\n\treturn select( 'core/rich-text' ).getFormatType( name );\n}\n","/**\n * WordPress dependencies\n */\nimport { select } from '@wordpress/data';\n\n/**\n * Returns all registered formats.\n *\n * @return {Array} Format settings.\n */\nexport function getFormatTypes() {\n\treturn select( 'core/rich-text' ).getFormatTypes();\n}\n","/**\n * Gets the end index of the current selection, or returns `undefined` if no\n * selection exists. The selection ends right before the character at this\n * index.\n *\n * @param {Object} value Value to get the selection from.\n *\n * @return {?number} Index where the selection ends.\n */\nexport function getSelectionEnd( { end } ) {\n\treturn end;\n}\n","/**\n * Gets the start index of the current selection, or returns `undefined` if no\n * selection exists. The selection starts right before the character at this\n * index.\n *\n * @param {Object} value Value to get the selection from.\n *\n * @return {?number} Index where the selection starts.\n */\nexport function getSelectionStart( { start } ) {\n\treturn start;\n}\n","/**\n * Get the textual content of a Rich Text value. This is similar to\n * `Element.textContent`.\n *\n * @param {Object} value Value to use.\n *\n * @return {string} The text content.\n */\nexport function getTextContent( { text } ) {\n\treturn text;\n}\n","import './store';\n\nexport { applyFormat } from './apply-format';\nexport { charAt } from './char-at';\nexport { concat } from './concat';\nexport { create } from './create';\nexport { getActiveFormat } from './get-active-format';\nexport { getFormatType } from './get-format-type';\nexport { getFormatTypes } from './get-format-types';\nexport { getSelectionEnd } from './get-selection-end';\nexport { getSelectionStart } from './get-selection-start';\nexport { getTextContent } from './get-text-content';\nexport { isCollapsed } from './is-collapsed';\nexport { isEmpty, isEmptyLine } from './is-empty';\nexport { join } from './join';\nexport { registerFormatType } from './register-format-type';\nexport { removeFormat } from './remove-format';\nexport { remove } from './remove';\nexport { replace } from './replace';\nexport { insert } from './insert';\nexport { insertLineSeparator } from './insert-line-separator';\nexport { insertObject } from './insert-object';\nexport { slice } from './slice';\nexport { split } from './split';\nexport { apply, toDom as unstableToDom } from './to-dom';\nexport { toHTMLString } from './to-html-string';\nexport { toggleFormat } from './toggle-format';\nexport { LINE_SEPARATOR } from './special-characters';\nexport { unregisterFormatType } from './unregister-format-type';\n","/**\n * Internal dependencies\n */\n\nimport { getTextContent } from './get-text-content';\nimport { insert } from './insert';\nimport { LINE_SEPARATOR } from './special-characters';\n\n/**\n * Insert a line break character into a Rich Text value at the given\n * `startIndex`. Any content between `startIndex` and `endIndex` will be\n * removed. Indices are retrieved from the selection if none are provided.\n *\n * @param {Object} value Value to modify.\n * @param {number} startIndex Start index.\n * @param {number} endIndex End index.\n *\n * @return {Object} A new value with the value inserted.\n */\nexport function insertLineSeparator(\n\tvalue,\n\tstartIndex = value.start,\n\tendIndex = value.end,\n) {\n\tconst beforeText = getTextContent( value ).slice( 0, startIndex );\n\tconst previousLineSeparatorIndex = beforeText.lastIndexOf( LINE_SEPARATOR );\n\tlet formats = [ , ];\n\n\tif ( previousLineSeparatorIndex !== -1 ) {\n\t\tformats = [ value.formats[ previousLineSeparatorIndex ] ];\n\t}\n\n\tconst valueToInsert = {\n\t\tformats,\n\t\ttext: LINE_SEPARATOR,\n\t};\n\n\treturn insert( value, valueToInsert, startIndex, endIndex );\n}\n","/**\n * Internal dependencies\n */\n\nimport { insert } from './insert';\n\nconst OBJECT_REPLACEMENT_CHARACTER = '\\ufffc';\n\n/**\n * Insert a format as an object into a Rich Text value at the given\n * `startIndex`. Any content between `startIndex` and `endIndex` will be\n * removed. Indices are retrieved from the selection if none are provided.\n *\n * @param {Object} value Value to modify.\n * @param {string} formatToInsert Format to insert as object.\n * @param {number} startIndex Start index.\n * @param {number} endIndex End index.\n *\n * @return {Object} A new value with the object inserted.\n */\nexport function insertObject(\n\tvalue,\n\tformatToInsert,\n\tstartIndex,\n\tendIndex\n) {\n\tconst valueToInsert = {\n\t\ttext: OBJECT_REPLACEMENT_CHARACTER,\n\t\tformats: [ [ {\n\t\t\t...formatToInsert,\n\t\t\tobject: true,\n\t\t} ] ],\n\t};\n\n\treturn insert( value, valueToInsert, startIndex, endIndex );\n}\n","/**\n * Internal dependencies\n */\n\nimport { create } from './create';\nimport { normaliseFormats } from './normalise-formats';\n\n/**\n * Insert a Rich Text value, an HTML string, or a plain text string, into a\n * Rich Text value at the given `startIndex`. Any content between `startIndex`\n * and `endIndex` will be removed. Indices are retrieved from the selection if\n * none are provided.\n *\n * @param {Object} value Value to modify.\n * @param {string} valueToInsert Value to insert.\n * @param {number} startIndex Start index.\n * @param {number} endIndex End index.\n *\n * @return {Object} A new value with the value inserted.\n */\nexport function insert(\n\t{ formats, text, start, end },\n\tvalueToInsert,\n\tstartIndex = start,\n\tendIndex = end\n) {\n\tif ( typeof valueToInsert === 'string' ) {\n\t\tvalueToInsert = create( { text: valueToInsert } );\n\t}\n\n\tconst index = startIndex + valueToInsert.text.length;\n\n\treturn normaliseFormats( {\n\t\tformats: formats.slice( 0, startIndex ).concat( valueToInsert.formats, formats.slice( endIndex ) ),\n\t\ttext: text.slice( 0, startIndex ) + valueToInsert.text + text.slice( endIndex ),\n\t\tstart: index,\n\t\tend: index,\n\t} );\n}\n","/**\n * Check if the selection of a Rich Text value is collapsed or not. Collapsed\n * means that no characters are selected, but there is a caret present. If there\n * is no selection, `undefined` will be returned. This is similar to\n * `window.getSelection().isCollapsed()`.\n *\n * @param {Object} value The rich text value to check.\n *\n * @return {?boolean} True if the selection is collapsed, false if not,\n * undefined if there is no selection.\n */\nexport function isCollapsed( { start, end } ) {\n\tif ( start === undefined || end === undefined ) {\n\t\treturn;\n\t}\n\n\treturn start === end;\n}\n","import { LINE_SEPARATOR } from './special-characters';\n\n/**\n * Check if a Rich Text value is Empty, meaning it contains no text or any\n * objects (such as images).\n *\n * @param {Object} value Value to use.\n *\n * @return {boolean} True if the value is empty, false if not.\n */\nexport function isEmpty( { text } ) {\n\treturn text.length === 0;\n}\n\n/**\n * Check if the current collapsed selection is on an empty line in case of a\n * multiline value.\n *\n * @param {Object} value Value te check.\n *\n * @return {boolean} True if the line is empty, false if not.\n */\nexport function isEmptyLine( { text, start, end } ) {\n\tif ( start !== end ) {\n\t\treturn false;\n\t}\n\n\tif ( text.length === 0 ) {\n\t\treturn true;\n\t}\n\n\tif ( start === 0 && text.slice( 0, 1 ) === LINE_SEPARATOR ) {\n\t\treturn true;\n\t}\n\n\tif ( start === text.length && text.slice( -1 ) === LINE_SEPARATOR ) {\n\t\treturn true;\n\t}\n\n\treturn text.slice( start - 1, end + 1 ) === `${ LINE_SEPARATOR }${ LINE_SEPARATOR }`;\n}\n","/**\n * Optimised equality check for format objects.\n *\n * @param {?Object} format1 Format to compare.\n * @param {?Object} format2 Format to compare.\n *\n * @return {boolean} True if formats are equal, false if not.\n */\nexport function isFormatEqual( format1, format2 ) {\n\t// Both not defined.\n\tif ( format1 === format2 ) {\n\t\treturn true;\n\t}\n\n\t// Either not defined.\n\tif ( ! format1 || ! format2 ) {\n\t\treturn false;\n\t}\n\n\tif ( format1.type !== format2.type ) {\n\t\treturn false;\n\t}\n\n\tconst attributes1 = format1.attributes;\n\tconst attributes2 = format2.attributes;\n\n\t// Both not defined.\n\tif ( attributes1 === attributes2 ) {\n\t\treturn true;\n\t}\n\n\t// Either not defined.\n\tif ( ! attributes1 || ! attributes2 ) {\n\t\treturn false;\n\t}\n\n\tconst keys1 = Object.keys( attributes1 );\n\tconst keys2 = Object.keys( attributes2 );\n\n\tif ( keys1.length !== keys2.length ) {\n\t\treturn false;\n\t}\n\n\tconst length = keys1.length;\n\n\t// Optimise for speed.\n\tfor ( let i = 0; i < length; i++ ) {\n\t\tconst name = keys1[ i ];\n\n\t\tif ( attributes1[ name ] !== attributes2[ name ] ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n","/**\n * Internal dependencies\n */\n\nimport { create } from './create';\nimport { normaliseFormats } from './normalise-formats';\n\n/**\n * Combine an array of Rich Text values into one, optionally separated by\n * `separator`, which can be a Rich Text value, HTML string, or plain text\n * string. This is similar to `Array.prototype.join`.\n *\n * @param {Array} values An array of values to join.\n * @param {string|Object} separator Separator string or value.\n *\n * @return {Object} A new combined value.\n */\nexport function join( values, separator = '' ) {\n\tif ( typeof separator === 'string' ) {\n\t\tseparator = create( { text: separator } );\n\t}\n\n\treturn normaliseFormats( values.reduce( ( accumlator, { formats, text } ) => ( {\n\t\ttext: accumlator.text + separator.text + text,\n\t\tformats: accumlator.formats.concat( separator.formats, formats ),\n\t} ) ) );\n}\n","/**\n * Internal dependencies\n */\n\nimport { isFormatEqual } from './is-format-equal';\n\n/**\n * Normalises formats: ensures subsequent equal formats have the same reference.\n *\n * @param {Object} value Value to normalise formats of.\n *\n * @return {Object} New value with normalised formats.\n */\nexport function normaliseFormats( { formats, text, start, end } ) {\n\tconst newFormats = formats.slice( 0 );\n\n\tnewFormats.forEach( ( formatsAtIndex, index ) => {\n\t\tconst lastFormatsAtIndex = newFormats[ index - 1 ];\n\n\t\tif ( lastFormatsAtIndex ) {\n\t\t\tconst newFormatsAtIndex = formatsAtIndex.slice( 0 );\n\n\t\t\tnewFormatsAtIndex.forEach( ( format, formatIndex ) => {\n\t\t\t\tconst lastFormat = lastFormatsAtIndex[ formatIndex ];\n\n\t\t\t\tif ( isFormatEqual( format, lastFormat ) ) {\n\t\t\t\t\tnewFormatsAtIndex[ formatIndex ] = lastFormat;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tnewFormats[ index ] = newFormatsAtIndex;\n\t\t}\n\t} );\n\n\treturn { formats: newFormats, text, start, end };\n}\n","/**\n * External dependencies\n */\nimport { isFunction } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { select, dispatch } from '@wordpress/data';\n\n/**\n * Registers a new format provided a unique name and an object defining its\n * behavior.\n *\n * @param {string} name Format name.\n * @param {Object} settings Format settings.\n *\n * @return {?WPFormat} The format, if it has been successfully registered;\n * otherwise `undefined`.\n */\nexport function registerFormatType( name, settings ) {\n\tsettings = {\n\t\tname,\n\t\t...settings,\n\t};\n\n\tif ( typeof settings.name !== 'string' ) {\n\t\twindow.console.error(\n\t\t\t'Format names must be strings.'\n\t\t);\n\t\treturn;\n\t}\n\n\tif ( ! /^[a-z][a-z0-9-]*\\/[a-z][a-z0-9-]*$/.test( settings.name ) ) {\n\t\twindow.console.error(\n\t\t\t'Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format'\n\t\t);\n\t\treturn;\n\t}\n\n\tif ( select( 'core/rich-text' ).getFormatType( settings.name ) ) {\n\t\twindow.console.error(\n\t\t\t'Format \"' + settings.name + '\" is already registered.'\n\t\t);\n\t\treturn;\n\t}\n\n\tif ( ! settings || ! isFunction( settings.edit ) ) {\n\t\twindow.console.error(\n\t\t\t'The \"edit\" property must be specified and must be a valid function.'\n\t\t);\n\t\treturn;\n\t}\n\n\tif ( ! ( 'title' in settings ) || settings.title === '' ) {\n\t\twindow.console.error(\n\t\t\t'The format \"' + settings.name + '\" must have a title.'\n\t\t);\n\t\treturn;\n\t}\n\n\tif ( 'keywords' in settings && settings.keywords.length > 3 ) {\n\t\twindow.console.error(\n\t\t\t'The format \"' + settings.name + '\" can have a maximum of 3 keywords.'\n\t\t);\n\t\treturn;\n\t}\n\n\tif ( typeof settings.title !== 'string' ) {\n\t\twindow.console.error(\n\t\t\t'Format titles must be strings.'\n\t\t);\n\t\treturn;\n\t}\n\n\tdispatch( 'core/rich-text' ).addFormatTypes( settings );\n\n\treturn settings;\n}\n","/**\n * External dependencies\n */\n\nimport { find } from 'lodash';\n\n/**\n * Internal dependencies\n */\n\nimport { normaliseFormats } from './normalise-formats';\n\n/**\n * Remove any format object from a Rich Text value by type from the given\n * `startIndex` to the given `endIndex`. Indices are retrieved from the\n * selection if none are provided.\n *\n * @param {Object} value Value to modify.\n * @param {string} formatType Format type to remove.\n * @param {number} startIndex Start index.\n * @param {number} endIndex End index.\n *\n * @return {Object} A new value with the format applied.\n */\nexport function removeFormat(\n\t{ formats, text, start, end },\n\tformatType,\n\tstartIndex = start,\n\tendIndex = end\n) {\n\tconst newFormats = formats.slice( 0 );\n\n\t// If the selection is collapsed, expand start and end to the edges of the\n\t// format.\n\tif ( startIndex === endIndex ) {\n\t\tconst format = find( newFormats[ startIndex ], { type: formatType } );\n\n\t\twhile ( find( newFormats[ startIndex ], format ) ) {\n\t\t\tfilterFormats( newFormats, startIndex, formatType );\n\t\t\tstartIndex--;\n\t\t}\n\n\t\tendIndex++;\n\n\t\twhile ( find( newFormats[ endIndex ], format ) ) {\n\t\t\tfilterFormats( newFormats, endIndex, formatType );\n\t\t\tendIndex++;\n\t\t}\n\t} else {\n\t\tfor ( let i = startIndex; i < endIndex; i++ ) {\n\t\t\tif ( newFormats[ i ] ) {\n\t\t\t\tfilterFormats( newFormats, i, formatType );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn normaliseFormats( { formats: newFormats, text, start, end } );\n}\n\nfunction filterFormats( formats, index, formatType ) {\n\tconst newFormats = formats[ index ].filter( ( { type } ) => type !== formatType );\n\n\tif ( newFormats.length ) {\n\t\tformats[ index ] = newFormats;\n\t} else {\n\t\tdelete formats[ index ];\n\t}\n}\n","/**\n * Internal dependencies\n */\n\nimport { insert } from './insert';\nimport { create } from './create';\n\n/**\n * Remove content from a Rich Text value between the given `startIndex` and\n * `endIndex`. Indices are retrieved from the selection if none are provided.\n *\n * @param {Object} value Value to modify.\n * @param {number} startIndex Start index.\n * @param {number} endIndex End index.\n *\n * @return {Object} A new value with the content removed.\n */\nexport function remove( value, startIndex, endIndex ) {\n\treturn insert( value, create(), startIndex, endIndex );\n}\n","/**\n * Internal dependencies\n */\n\nimport { normaliseFormats } from './normalise-formats';\n\n/**\n * Search a Rich Text value and replace the match(es) with `replacement`. This\n * is similar to `String.prototype.replace`.\n *\n * @param {Object} value The value to modify.\n * @param {RegExp|string} pattern A RegExp object or literal. Can also be\n * a string. It is treated as a verbatim\n * string and is not interpreted as a\n * regular expression. Only the first\n * occurrence will be replaced.\n * @param {Function|string} replacement The match or matches are replaced with\n * the specified or the value returned by\n * the specified function.\n *\n * @return {Object} A new value with replacements applied.\n */\nexport function replace( { formats, text, start, end }, pattern, replacement ) {\n\ttext = text.replace( pattern, ( match, ...rest ) => {\n\t\tconst offset = rest[ rest.length - 2 ];\n\t\tlet newText = replacement;\n\t\tlet newFormats;\n\n\t\tif ( typeof newText === 'function' ) {\n\t\t\tnewText = replacement( match, ...rest );\n\t\t}\n\n\t\tif ( typeof newText === 'object' ) {\n\t\t\tnewFormats = newText.formats;\n\t\t\tnewText = newText.text;\n\t\t} else {\n\t\t\tnewFormats = Array( newText.length );\n\n\t\t\tif ( formats[ offset ] ) {\n\t\t\t\tnewFormats = newFormats.fill( formats[ offset ] );\n\t\t\t}\n\t\t}\n\n\t\tformats = formats.slice( 0, offset ).concat( newFormats, formats.slice( offset + match.length ) );\n\n\t\tif ( start ) {\n\t\t\tstart = end = offset + newText.length;\n\t\t}\n\n\t\treturn newText;\n\t} );\n\n\treturn normaliseFormats( { formats, text, start, end } );\n}\n","/**\n * Slice a Rich Text value from `startIndex` to `endIndex`. Indices are\n * retrieved from the selection if none are provided. This is similar to\n * `String.prototype.slice`.\n *\n * @param {Object} value Value to modify.\n * @param {number} startIndex Start index.\n * @param {number} endIndex End index.\n *\n * @return {Object} A new extracted value.\n */\nexport function slice(\n\t{ formats, text, start, end },\n\tstartIndex = start,\n\tendIndex = end\n) {\n\tif ( startIndex === undefined || endIndex === undefined ) {\n\t\treturn { formats, text };\n\t}\n\n\treturn {\n\t\tformats: formats.slice( startIndex, endIndex ),\n\t\ttext: text.slice( startIndex, endIndex ),\n\t};\n}\n","export const LINE_SEPARATOR = '\\u2028';\nexport const OBJECT_REPLACEMENT_CHARACTER = '\\ufffc';\nexport const ZERO_WIDTH_NO_BREAK_SPACE = '\\uFEFF';\n","/**\n * Internal dependencies\n */\n\nimport { replace } from './replace';\n\n/**\n * Split a Rich Text value in two at the given `startIndex` and `endIndex`, or\n * split at the given separator. This is similar to `String.prototype.split`.\n * Indices are retrieved from the selection if none are provided.\n *\n * @param {Object} value Value to modify.\n * @param {number|string} string Start index, or string at which to split.\n * @param {number} end End index.\n *\n * @return {Array} An array of new values.\n */\nexport function split( { formats, text, start, end }, string ) {\n\tif ( typeof string !== 'string' ) {\n\t\treturn splitAtSelection( ...arguments );\n\t}\n\n\tlet nextStart = 0;\n\n\treturn text.split( string ).map( ( substring ) => {\n\t\tconst startIndex = nextStart;\n\t\tconst value = {\n\t\t\tformats: formats.slice( startIndex, startIndex + substring.length ),\n\t\t\ttext: substring,\n\t\t};\n\n\t\tnextStart += string.length + substring.length;\n\n\t\tif ( start !== undefined && end !== undefined ) {\n\t\t\tif ( start >= startIndex && start < nextStart ) {\n\t\t\t\tvalue.start = start - startIndex;\n\t\t\t} else if ( start < startIndex && end > startIndex ) {\n\t\t\t\tvalue.start = 0;\n\t\t\t}\n\n\t\t\tif ( end >= startIndex && end < nextStart ) {\n\t\t\t\tvalue.end = end - startIndex;\n\t\t\t} else if ( start < nextStart && end > nextStart ) {\n\t\t\t\tvalue.end = substring.length;\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t} );\n}\n\nfunction splitAtSelection(\n\t{ formats, text, start, end },\n\tstartIndex = start,\n\tendIndex = end\n) {\n\tconst before = {\n\t\tformats: formats.slice( 0, startIndex ),\n\t\ttext: text.slice( 0, startIndex ),\n\t};\n\tconst after = {\n\t\tformats: formats.slice( endIndex ),\n\t\ttext: text.slice( endIndex ),\n\t\tstart: 0,\n\t\tend: 0,\n\t};\n\n\treturn [\n\t\t// Ensure newlines are trimmed.\n\t\treplace( before, /\\u2028+$/, '' ),\n\t\treplace( after, /^\\u2028+/, '' ),\n\t];\n}\n","/**\n * External dependencies\n */\nimport { castArray } from 'lodash';\n\n/**\n * Returns an action object used in signalling that format types have been\n * added.\n *\n * @param {Array|Object} formatTypes Format types received.\n *\n * @return {Object} Action object.\n */\nexport function addFormatTypes( formatTypes ) {\n\treturn {\n\t\ttype: 'ADD_FORMAT_TYPES',\n\t\tformatTypes: castArray( formatTypes ),\n\t};\n}\n\n/**\n * Returns an action object used to remove a registered format type.\n *\n * @param {string|Array} names Format name.\n *\n * @return {Object} Action object.\n */\nexport function removeFormatTypes( names ) {\n\treturn {\n\t\ttype: 'REMOVE_FORMAT_TYPES',\n\t\tnames: castArray( names ),\n\t};\n}\n","/**\n * WordPress dependencies\n */\nimport { registerStore } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\n\nregisterStore( 'core/rich-text', { reducer, selectors, actions } );\n","/**\n * External dependencies\n */\nimport { keyBy, omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer managing the format types\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function formatTypes( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'ADD_FORMAT_TYPES':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...keyBy( action.formatTypes, 'name' ),\n\t\t\t};\n\t\tcase 'REMOVE_FORMAT_TYPES':\n\t\t\treturn omit( state, action.names );\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( { formatTypes } );\n","/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * Returns all the available format types.\n *\n * @param {Object} state Data state.\n *\n * @return {Array} Format types.\n */\nexport const getFormatTypes = createSelector(\n\t( state ) => Object.values( state.formatTypes ),\n\t( state ) => [\n\t\tstate.formatTypes,\n\t]\n);\n\n/**\n * Returns a format type by name.\n *\n * @param {Object} state Data state.\n * @param {string} name Format type name.\n *\n * @return {Object?} Format type.\n */\nexport function getFormatType( state, name ) {\n\treturn state.formatTypes[ name ];\n}\n","/**\n * Internal dependencies\n */\n\nimport { toTree } from './to-tree';\n\n/**\n * Browser dependencies\n */\n\nconst { TEXT_NODE, ELEMENT_NODE } = window.Node;\n\n/**\n * Creates a path as an array of indices from the given root node to the given\n * node.\n *\n * @param {Node} node Node to find the path of.\n * @param {HTMLElement} rootNode Root node to find the path from.\n * @param {Array} path Initial path to build on.\n *\n * @return {Array} The path from the root node to the node.\n */\nfunction createPathToNode( node, rootNode, path ) {\n\tconst parentNode = node.parentNode;\n\tlet i = 0;\n\n\twhile ( ( node = node.previousSibling ) ) {\n\t\ti++;\n\t}\n\n\tpath = [ i, ...path ];\n\n\tif ( parentNode !== rootNode ) {\n\t\tpath = createPathToNode( parentNode, rootNode, path );\n\t}\n\n\treturn path;\n}\n\n/**\n * Gets a node given a path (array of indices) from the given node.\n *\n * @param {HTMLElement} node Root node to find the wanted node in.\n * @param {Array} path Path (indices) to the wanted node.\n *\n * @return {Object} Object with the found node and the remaining offset (if any).\n */\nfunction getNodeByPath( node, path ) {\n\tpath = [ ...path ];\n\n\twhile ( node && path.length > 1 ) {\n\t\tnode = node.childNodes[ path.shift() ];\n\t}\n\n\treturn {\n\t\tnode,\n\t\toffset: path[ 0 ],\n\t};\n}\n\nfunction createEmpty() {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\treturn body;\n}\n\nfunction append( element, child ) {\n\tif ( typeof child === 'string' ) {\n\t\tchild = element.ownerDocument.createTextNode( child );\n\t}\n\n\tconst { type, attributes } = child;\n\n\tif ( type ) {\n\t\tchild = element.ownerDocument.createElement( type );\n\n\t\tfor ( const key in attributes ) {\n\t\t\tchild.setAttribute( key, attributes[ key ] );\n\t\t}\n\t}\n\n\treturn element.appendChild( child );\n}\n\nfunction appendText( node, text ) {\n\tnode.appendData( text );\n}\n\nfunction getLastChild( { lastChild } ) {\n\treturn lastChild;\n}\n\nfunction getParent( { parentNode } ) {\n\treturn parentNode;\n}\n\nfunction isText( { nodeType } ) {\n\treturn nodeType === TEXT_NODE;\n}\n\nfunction getText( { nodeValue } ) {\n\treturn nodeValue;\n}\n\nfunction remove( node ) {\n\treturn node.parentNode.removeChild( node );\n}\n\nfunction padEmptyLines( { element, createLinePadding, multilineWrapperTags } ) {\n\tconst length = element.childNodes.length;\n\tconst doc = element.ownerDocument;\n\n\tfor ( let index = 0; index < length; index++ ) {\n\t\tconst child = element.childNodes[ index ];\n\n\t\tif ( child.nodeType === TEXT_NODE ) {\n\t\t\tif ( length === 1 && ! child.nodeValue ) {\n\t\t\t\t// Pad if the only child is an empty text node.\n\t\t\t\telement.appendChild( createLinePadding( doc ) );\n\t\t\t}\n\t\t} else {\n\t\t\tif (\n\t\t\t\tmultilineWrapperTags &&\n\t\t\t\t! child.previousSibling &&\n\t\t\t\tmultilineWrapperTags.indexOf( child.nodeName.toLowerCase() ) !== -1\n\t\t\t) {\n\t\t\t\t// Pad the line if there is no content before a nested wrapper.\n\t\t\t\telement.insertBefore( createLinePadding( doc ), child );\n\t\t\t}\n\n\t\t\tpadEmptyLines( { element: child, createLinePadding, multilineWrapperTags } );\n\t\t}\n\t}\n}\n\nexport function toDom( {\n\tvalue,\n\tmultilineTag,\n\tmultilineWrapperTags,\n\tcreateLinePadding,\n} ) {\n\tlet startPath = [];\n\tlet endPath = [];\n\n\tconst tree = toTree( {\n\t\tvalue,\n\t\tmultilineTag,\n\t\tmultilineWrapperTags,\n\t\tcreateEmpty,\n\t\tappend,\n\t\tgetLastChild,\n\t\tgetParent,\n\t\tisText,\n\t\tgetText,\n\t\tremove,\n\t\tappendText,\n\t\tonStartIndex( body, pointer ) {\n\t\t\tstartPath = createPathToNode( pointer, body, [ pointer.nodeValue.length ] );\n\t\t},\n\t\tonEndIndex( body, pointer ) {\n\t\t\tendPath = createPathToNode( pointer, body, [ pointer.nodeValue.length ] );\n\t\t},\n\t\tisEditableTree: true,\n\t} );\n\n\tif ( createLinePadding ) {\n\t\tpadEmptyLines( { element: tree, createLinePadding, multilineWrapperTags } );\n\t}\n\n\treturn {\n\t\tbody: tree,\n\t\tselection: { startPath, endPath },\n\t};\n}\n\n/**\n * Create an `Element` tree from a Rich Text value and applies the difference to\n * the `Element` tree contained by `current`. If a `multilineTag` is provided,\n * text separated by two new lines will be wrapped in an `Element` of that type.\n *\n * @param {Object} value Value to apply.\n * @param {HTMLElement} current The live root node to apply the element\n * tree to.\n * @param {string} multilineTag Multiline tag.\n */\nexport function apply( {\n\tvalue,\n\tcurrent,\n\tmultilineTag,\n\tmultilineWrapperTags,\n\tcreateLinePadding,\n} ) {\n\t// Construct a new element tree in memory.\n\tconst { body, selection } = toDom( {\n\t\tvalue,\n\t\tmultilineTag,\n\t\tmultilineWrapperTags,\n\t\tcreateLinePadding,\n\t} );\n\n\tapplyValue( body, current );\n\n\tif ( value.start !== undefined ) {\n\t\tapplySelection( selection, current );\n\t}\n}\n\nexport function applyValue( future, current ) {\n\tlet i = 0;\n\n\twhile ( future.firstChild ) {\n\t\tconst currentChild = current.childNodes[ i ];\n\t\tconst futureNodeType = future.firstChild.nodeType;\n\n\t\tif ( ! currentChild ) {\n\t\t\tcurrent.appendChild( future.firstChild );\n\t\t} else if (\n\t\t\tfutureNodeType !== currentChild.nodeType ||\n\t\t\tfutureNodeType !== TEXT_NODE ||\n\t\t\tfuture.firstChild.nodeValue !== currentChild.nodeValue\n\t\t) {\n\t\t\tcurrent.replaceChild( future.firstChild, currentChild );\n\t\t} else {\n\t\t\tfuture.removeChild( future.firstChild );\n\t\t}\n\n\t\ti++;\n\t}\n\n\twhile ( current.childNodes[ i ] ) {\n\t\tcurrent.removeChild( current.childNodes[ i ] );\n\t}\n}\n\nexport function applySelection( selection, current ) {\n\tconst { node: startContainer, offset: startOffset } = getNodeByPath( current, selection.startPath );\n\tconst { node: endContainer, offset: endOffset } = getNodeByPath( current, selection.endPath );\n\n\tconst windowSelection = window.getSelection();\n\tconst range = current.ownerDocument.createRange();\n\tconst collapsed = startContainer === endContainer && startOffset === endOffset;\n\n\tif (\n\t\tcollapsed &&\n\t\tstartOffset === 0 &&\n\t\tstartContainer.previousSibling &&\n\t\tstartContainer.previousSibling.nodeType === ELEMENT_NODE &&\n\t\tstartContainer.previousSibling.nodeName !== 'BR'\n\t) {\n\t\tstartContainer.insertData( 0, '\\uFEFF' );\n\t\trange.setStart( startContainer, 1 );\n\t\trange.setEnd( endContainer, 1 );\n\t} else if (\n\t\tcollapsed &&\n\t\tstartOffset === 0 &&\n\t\tstartContainer === TEXT_NODE &&\n\t\tstartContainer.nodeValue.length === 0\n\t) {\n\t\tstartContainer.insertData( 0, '\\uFEFF' );\n\t\trange.setStart( startContainer, 1 );\n\t\trange.setEnd( endContainer, 1 );\n\t} else {\n\t\trange.setStart( startContainer, startOffset );\n\t\trange.setEnd( endContainer, endOffset );\n\t}\n\n\twindowSelection.removeAllRanges();\n\twindowSelection.addRange( range );\n}\n","/**\n * Internal dependencies\n */\n\nimport {\n\tescapeHTML,\n\tescapeAttribute,\n\tisValidAttributeName,\n} from '@wordpress/escape-html';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\n\nimport { toTree } from './to-tree';\n\n/**\n * Create an HTML string from a Rich Text value. If a `multilineTag` is\n * provided, text separated by a line separator will be wrapped in it.\n *\n * @param {Object} $1 Named argements.\n * @param {Object} $1.value Rich text value.\n * @param {string} $1.multilineTag Multiline tag.\n * @param {Array} $1.multilineWrapperTags Tags where lines can be found if\n * nesting is possible.\n *\n * @return {string} HTML string.\n */\nexport function toHTMLString( { value, multilineTag, multilineWrapperTags } ) {\n\t// Check other arguments for backward compatibility.\n\tif ( value === undefined ) {\n\t\tdeprecated( 'wp.richText.toHTMLString positional parameters', {\n\t\t\tversion: '4.4',\n\t\t\talternative: 'named parameters',\n\t\t\tplugin: 'Gutenberg',\n\t\t} );\n\n\t\tvalue = arguments[ 0 ];\n\t\tmultilineTag = arguments[ 1 ];\n\t\tmultilineWrapperTags = arguments[ 2 ];\n\t}\n\n\tconst tree = toTree( {\n\t\tvalue,\n\t\tmultilineTag,\n\t\tmultilineWrapperTags,\n\t\tcreateEmpty,\n\t\tappend,\n\t\tgetLastChild,\n\t\tgetParent,\n\t\tisText,\n\t\tgetText,\n\t\tremove,\n\t\tappendText,\n\t} );\n\n\treturn createChildrenHTML( tree.children );\n}\n\nfunction createEmpty() {\n\treturn {};\n}\n\nfunction getLastChild( { children } ) {\n\treturn children && children[ children.length - 1 ];\n}\n\nfunction append( parent, object ) {\n\tif ( typeof object === 'string' ) {\n\t\tobject = { text: object };\n\t}\n\n\tobject.parent = parent;\n\tparent.children = parent.children || [];\n\tparent.children.push( object );\n\treturn object;\n}\n\nfunction appendText( object, text ) {\n\tobject.text += text;\n}\n\nfunction getParent( { parent } ) {\n\treturn parent;\n}\n\nfunction isText( { text } ) {\n\treturn typeof text === 'string';\n}\n\nfunction getText( { text } ) {\n\treturn text;\n}\n\nfunction remove( object ) {\n\tconst index = object.parent.children.indexOf( object );\n\n\tif ( index !== -1 ) {\n\t\tobject.parent.children.splice( index, 1 );\n\t}\n\n\treturn object;\n}\n\nfunction createElementHTML( { type, attributes, object, children } ) {\n\tlet attributeString = '';\n\n\tfor ( const key in attributes ) {\n\t\tif ( ! isValidAttributeName( key ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tattributeString += ` ${ key }=\"${ escapeAttribute( attributes[ key ] ) }\"`;\n\t}\n\n\tif ( object ) {\n\t\treturn `<${ type }${ attributeString }>`;\n\t}\n\n\treturn `<${ type }${ attributeString }>${ createChildrenHTML( children ) }</${ type }>`;\n}\n\nfunction createChildrenHTML( children = [] ) {\n\treturn children.map( ( child ) => {\n\t\treturn child.text === undefined ? createElementHTML( child ) : escapeHTML( child.text );\n\t} ).join( '' );\n}\n","/**\n * Internal dependencies\n */\n\nimport { getFormatType } from './get-format-type';\nimport {\n\tLINE_SEPARATOR,\n\tOBJECT_REPLACEMENT_CHARACTER,\n\tZERO_WIDTH_NO_BREAK_SPACE,\n} from './special-characters';\n\nfunction fromFormat( { type, attributes, object } ) {\n\tconst formatType = getFormatType( type );\n\n\tif ( ! formatType ) {\n\t\treturn { type, attributes, object };\n\t}\n\n\tif ( ! attributes ) {\n\t\treturn {\n\t\t\ttype: formatType.match.tagName,\n\t\t\tobject: formatType.object,\n\t\t};\n\t}\n\n\tconst elementAttributes = {};\n\n\tfor ( const name in attributes ) {\n\t\tconst key = formatType.attributes[ name ];\n\n\t\tif ( key ) {\n\t\t\telementAttributes[ key ] = attributes[ name ];\n\t\t} else {\n\t\t\telementAttributes[ name ] = attributes[ name ];\n\t\t}\n\t}\n\n\treturn {\n\t\ttype: formatType.match.tagName,\n\t\tobject: formatType.object,\n\t\tattributes: elementAttributes,\n\t};\n}\n\nexport function toTree( {\n\tvalue,\n\tmultilineTag,\n\tmultilineWrapperTags,\n\tcreateEmpty,\n\tappend,\n\tgetLastChild,\n\tgetParent,\n\tisText,\n\tgetText,\n\tremove,\n\tappendText,\n\tonStartIndex,\n\tonEndIndex,\n\tisEditableTree,\n} ) {\n\tconst { formats, text, start, end, formatPlaceholder } = value;\n\tconst formatsLength = formats.length + 1;\n\tconst tree = createEmpty();\n\tconst multilineFormat = { type: multilineTag };\n\n\tlet lastSeparatorFormats;\n\tlet lastCharacterFormats;\n\tlet lastCharacter;\n\n\t// If we're building a multiline tree, start off with a multiline element.\n\tif ( multilineTag ) {\n\t\tappend( append( tree, { type: multilineTag } ), '' );\n\t\tlastCharacterFormats = lastSeparatorFormats = [ multilineFormat ];\n\t} else {\n\t\tappend( tree, '' );\n\t}\n\n\tfunction setFormatPlaceholder( pointer, index ) {\n\t\tif ( isEditableTree && formatPlaceholder && formatPlaceholder.index === index ) {\n\t\t\tconst parent = getParent( pointer );\n\n\t\t\tif ( formatPlaceholder.format === undefined ) {\n\t\t\t\tpointer = getParent( parent );\n\t\t\t} else {\n\t\t\t\tpointer = append( parent, fromFormat( formatPlaceholder.format ) );\n\t\t\t}\n\n\t\t\tpointer = append( pointer, ZERO_WIDTH_NO_BREAK_SPACE );\n\t\t}\n\n\t\treturn pointer;\n\t}\n\n\tfor ( let i = 0; i < formatsLength; i++ ) {\n\t\tconst character = text.charAt( i );\n\t\tlet characterFormats = formats[ i ];\n\n\t\t// Set multiline tags in queue for building the tree.\n\t\tif ( multilineTag ) {\n\t\t\tif ( character === LINE_SEPARATOR ) {\n\t\t\t\tcharacterFormats = lastSeparatorFormats = ( characterFormats || [] ).reduce( ( accumulator, format ) => {\n\t\t\t\t\tif ( character === LINE_SEPARATOR && multilineWrapperTags.indexOf( format.type ) !== -1 ) {\n\t\t\t\t\t\taccumulator.push( format );\n\t\t\t\t\t\taccumulator.push( multilineFormat );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}, [ multilineFormat ] );\n\t\t\t} else {\n\t\t\t\tcharacterFormats = [ ...lastSeparatorFormats, ...( characterFormats || [] ) ];\n\t\t\t}\n\t\t}\n\n\t\tlet pointer = getLastChild( tree );\n\n\t\t// Set selection for the start of line.\n\t\tif ( lastCharacter === LINE_SEPARATOR ) {\n\t\t\tlet node = pointer;\n\n\t\t\twhile ( ! isText( node ) ) {\n\t\t\t\tnode = getLastChild( node );\n\t\t\t}\n\n\t\t\tif ( onStartIndex && start === i ) {\n\t\t\t\tonStartIndex( tree, node );\n\t\t\t}\n\n\t\t\tif ( onEndIndex && end === i ) {\n\t\t\t\tonEndIndex( tree, node );\n\t\t\t}\n\t\t}\n\n\t\tif ( characterFormats ) {\n\t\t\tcharacterFormats.forEach( ( format, formatIndex ) => {\n\t\t\t\tif (\n\t\t\t\t\tpointer &&\n\t\t\t\t\tlastCharacterFormats &&\n\t\t\t\t\tformat === lastCharacterFormats[ formatIndex ] &&\n\t\t\t\t\t// Do not reuse the last element if the character is a\n\t\t\t\t\t// line separator.\n\t\t\t\t\t( character !== LINE_SEPARATOR ||\n\t\t\t\t\t\tcharacterFormats.length - 1 !== formatIndex )\n\t\t\t\t) {\n\t\t\t\t\tpointer = getLastChild( pointer );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { type, attributes, object } = format;\n\t\t\t\tconst parent = getParent( pointer );\n\t\t\t\tconst newNode = append( parent, fromFormat( { type, attributes, object } ) );\n\n\t\t\t\tif ( isText( pointer ) && getText( pointer ).length === 0 ) {\n\t\t\t\t\tremove( pointer );\n\t\t\t\t}\n\n\t\t\t\tpointer = append( object ? parent : newNode, '' );\n\t\t\t} );\n\t\t}\n\n\t\t// No need for further processing if the character is a line separator.\n\t\tif ( character === LINE_SEPARATOR ) {\n\t\t\tlastCharacterFormats = characterFormats;\n\t\t\tlastCharacter = character;\n\t\t\tcontinue;\n\t\t}\n\n\t\tpointer = setFormatPlaceholder( pointer, 0 );\n\n\t\t// If there is selection at 0, handle it before characters are inserted.\n\t\tif ( i === 0 ) {\n\t\t\tif ( onStartIndex && start === 0 ) {\n\t\t\t\tonStartIndex( tree, pointer );\n\t\t\t}\n\n\t\t\tif ( onEndIndex && end === 0 ) {\n\t\t\t\tonEndIndex( tree, pointer );\n\t\t\t}\n\t\t}\n\n\t\tif ( character !== OBJECT_REPLACEMENT_CHARACTER ) {\n\t\t\tif ( character === '\\n' ) {\n\t\t\t\tpointer = append( getParent( pointer ), { type: 'br', object: true } );\n\t\t\t\t// Ensure pointer is text node.\n\t\t\t\tpointer = append( getParent( pointer ), '' );\n\t\t\t} else if ( ! isText( pointer ) ) {\n\t\t\t\tpointer = append( getParent( pointer ), character );\n\t\t\t} else {\n\t\t\t\tappendText( pointer, character );\n\t\t\t}\n\t\t}\n\n\t\tpointer = setFormatPlaceholder( pointer, i + 1 );\n\n\t\tif ( onStartIndex && start === i + 1 ) {\n\t\t\tonStartIndex( tree, pointer );\n\t\t}\n\n\t\tif ( onEndIndex && end === i + 1 ) {\n\t\t\tonEndIndex( tree, pointer );\n\t\t}\n\n\t\tlastCharacterFormats = characterFormats;\n\t\tlastCharacter = character;\n\t}\n\n\treturn tree;\n}\n","/**\n * Internal dependencies\n */\n\nimport { getActiveFormat } from './get-active-format';\nimport { removeFormat } from './remove-format';\nimport { applyFormat } from './apply-format';\n\n/**\n * Toggles a format object to a Rich Text value at the current selection.\n *\n * @param {Object} value Value to modify.\n * @param {Object} format Format to apply or remove.\n *\n * @return {Object} A new value with the format applied or removed.\n */\nexport function toggleFormat(\n\tvalue,\n\tformat\n) {\n\tif ( getActiveFormat( value, format.type ) ) {\n\t\treturn removeFormat( value, format.type );\n\t}\n\n\treturn applyFormat( value, format );\n}\n","/**\n * WordPress dependencies\n */\nimport { select, dispatch } from '@wordpress/data';\n\n/**\n * Unregisters a format.\n *\n * @param {string} name Format name.\n *\n * @return {?WPFormat} The previous format value, if it has been successfully\n * unregistered; otherwise `undefined`.\n */\nexport function unregisterFormatType( name ) {\n\tconst oldFormat = select( 'core/rich-text' ).getFormatType( name );\n\n\tif ( ! oldFormat ) {\n\t\twindow.console.error(\n\t\t\t`Format ${ name } is not registered.`\n\t\t);\n\t\treturn;\n\t}\n\n\tdispatch( 'core/rich-text' ).removeFormatTypes( name );\n\n\treturn oldFormat;\n}\n","'use strict';\n\nvar LEAF_KEY, hasWeakMap;\n\n/**\n * Arbitrary value used as key for referencing cache object in WeakMap tree.\n *\n * @type {Object}\n */\nLEAF_KEY = {};\n\n/**\n * Whether environment supports WeakMap.\n *\n * @type {boolean}\n */\nhasWeakMap = typeof WeakMap !== 'undefined';\n\n/**\n * Returns the first argument as the sole entry in an array.\n *\n * @param {*} value Value to return.\n *\n * @return {Array} Value returned as entry in array.\n */\nfunction arrayOf( value ) {\n\treturn [ value ];\n}\n\n/**\n * Returns true if the value passed is object-like, or false otherwise. A value\n * is object-like if it can support property assignment, e.g. object or array.\n *\n * @param {*} value Value to test.\n *\n * @return {boolean} Whether value is object-like.\n */\nfunction isObjectLike( value ) {\n\treturn !! value && 'object' === typeof value;\n}\n\n/**\n * Creates and returns a new cache object.\n *\n * @return {Object} Cache object.\n */\nfunction createCache() {\n\tvar cache = {\n\t\tclear: function() {\n\t\t\tcache.head = null;\n\t\t},\n\t};\n\n\treturn cache;\n}\n\n/**\n * Returns true if entries within the two arrays are strictly equal by\n * reference from a starting index.\n *\n * @param {Array} a First array.\n * @param {Array} b Second array.\n * @param {number} fromIndex Index from which to start comparison.\n *\n * @return {boolean} Whether arrays are shallowly equal.\n */\nfunction isShallowEqual( a, b, fromIndex ) {\n\tvar i;\n\n\tif ( a.length !== b.length ) {\n\t\treturn false;\n\t}\n\n\tfor ( i = fromIndex; i < a.length; i++ ) {\n\t\tif ( a[ i ] !== b[ i ] ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns a memoized selector function. The getDependants function argument is\n * called before the memoized selector and is expected to return an immutable\n * reference or array of references on which the selector depends for computing\n * its own return value. The memoize cache is preserved only as long as those\n * dependant references remain the same. If getDependants returns a different\n * reference(s), the cache is cleared and the selector value regenerated.\n *\n * @param {Function} selector Selector function.\n * @param {Function} getDependants Dependant getter returning an immutable\n * reference or array of reference used in\n * cache bust consideration.\n *\n * @return {Function} Memoized selector.\n */\nexport default function( selector, getDependants ) {\n\tvar rootCache, getCache;\n\n\t// Use object source as dependant if getter not provided\n\tif ( ! getDependants ) {\n\t\tgetDependants = arrayOf;\n\t}\n\n\t/**\n\t * Returns the root cache. If WeakMap is supported, this is assigned to the\n\t * root WeakMap cache set, otherwise it is a shared instance of the default\n\t * cache object.\n\t *\n\t * @return {(WeakMap|Object)} Root cache object.\n\t */\n\tfunction getRootCache() {\n\t\treturn rootCache;\n\t}\n\n\t/**\n\t * Returns the cache for a given dependants array. When possible, a WeakMap\n\t * will be used to create a unique cache for each set of dependants. This\n\t * is feasible due to the nature of WeakMap in allowing garbage collection\n\t * to occur on entries where the key object is no longer referenced. Since\n\t * WeakMap requires the key to be an object, this is only possible when the\n\t * dependant is object-like. The root cache is created as a hierarchy where\n\t * each top-level key is the first entry in a dependants set, the value a\n\t * WeakMap where each key is the next dependant, and so on. This continues\n\t * so long as the dependants are object-like. If no dependants are object-\n\t * like, then the cache is shared across all invocations.\n\t *\n\t * @see isObjectLike\n\t *\n\t * @param {Array} dependants Selector dependants.\n\t *\n\t * @return {Object} Cache object.\n\t */\n\tfunction getWeakMapCache( dependants ) {\n\t\tvar caches = rootCache,\n\t\t\tisUniqueByDependants = true,\n\t\t\ti, dependant, map, cache;\n\n\t\tfor ( i = 0; i < dependants.length; i++ ) {\n\t\t\tdependant = dependants[ i ];\n\n\t\t\t// Can only compose WeakMap from object-like key.\n\t\t\tif ( ! isObjectLike( dependant ) ) {\n\t\t\t\tisUniqueByDependants = false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Does current segment of cache already have a WeakMap?\n\t\t\tif ( caches.has( dependant ) ) {\n\t\t\t\t// Traverse into nested WeakMap.\n\t\t\t\tcaches = caches.get( dependant );\n\t\t\t} else {\n\t\t\t\t// Create, set, and traverse into a new one.\n\t\t\t\tmap = new WeakMap();\n\t\t\t\tcaches.set( dependant, map );\n\t\t\t\tcaches = map;\n\t\t\t}\n\t\t}\n\n\t\t// We use an arbitrary (but consistent) object as key for the last item\n\t\t// in the WeakMap to serve as our running cache.\n\t\tif ( ! caches.has( LEAF_KEY ) ) {\n\t\t\tcache = createCache();\n\t\t\tcache.isUniqueByDependants = isUniqueByDependants;\n\t\t\tcaches.set( LEAF_KEY, cache );\n\t\t}\n\n\t\treturn caches.get( LEAF_KEY );\n\t}\n\n\t// Assign cache handler by availability of WeakMap\n\tgetCache = hasWeakMap ? getWeakMapCache : getRootCache;\n\n\t/**\n\t * Resets root memoization cache.\n\t */\n\tfunction clear() {\n\t\trootCache = hasWeakMap ? new WeakMap() : createCache();\n\t}\n\n\t// eslint-disable-next-line jsdoc/check-param-names\n\t/**\n\t * The augmented selector call, considering first whether dependants have\n\t * changed before passing it to underlying memoize function.\n\t *\n\t * @param {Object} source Source object for derivation.\n\t * @param {...*} extraArgs Additional arguments to pass to selector.\n\t *\n\t * @return {*} Selector result.\n\t */\n\tfunction callSelector( /* source, ...extraArgs */ ) {\n\t\tvar len = arguments.length,\n\t\t\tcache, node, i, args, dependants;\n\n\t\t// Create copy of arguments (avoid leaking deoptimization).\n\t\targs = new Array( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tdependants = getDependants.apply( null, args );\n\t\tcache = getCache( dependants );\n\n\t\t// If not guaranteed uniqueness by dependants (primitive type or lack\n\t\t// of WeakMap support), shallow compare against last dependants and, if\n\t\t// references have changed, destroy cache to recalculate result.\n\t\tif ( ! cache.isUniqueByDependants ) {\n\t\t\tif ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {\n\t\t\t\tcache.clear();\n\t\t\t}\n\n\t\t\tcache.lastDependants = dependants;\n\t\t}\n\n\t\tnode = cache.head;\n\t\twhile ( node ) {\n\t\t\t// Check whether node arguments match arguments\n\t\t\tif ( ! isShallowEqual( node.args, args, 1 ) ) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif ( node !== cache.head ) {\n\t\t\t\t// Adjust siblings to point to each other.\n\t\t\t\tnode.prev.next = node.next;\n\t\t\t\tif ( node.next ) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = cache.head;\n\t\t\t\tnode.prev = null;\n\t\t\t\tcache.head.prev = node;\n\t\t\t\tcache.head = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\tnode = {\n\t\t\t// Generate the result from original function\n\t\t\tval: selector.apply( null, args ),\n\t\t};\n\n\t\t// Avoid including the source object in the cache.\n\t\targs[ 0 ] = null;\n\t\tnode.args = args;\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif ( cache.head ) {\n\t\t\tcache.head.prev = node;\n\t\t\tnode.next = cache.head;\n\t\t}\n\n\t\tcache.head = node;\n\n\t\treturn node.val;\n\t}\n\n\tcallSelector.getDependants = getDependants;\n\tcallSelector.clear = clear;\n\tclear();\n\n\treturn callSelector;\n}\n","(function() { module.exports = this[\"wp\"][\"data\"]; }());","(function() { module.exports = this[\"wp\"][\"deprecated\"]; }());","(function() { module.exports = this[\"wp\"][\"escapeHtml\"]; }());","(function() { module.exports = this[\"lodash\"]; }());"],"sourceRoot":""} |