WordPress/wp-includes/js/dist/rich-text.min.js
youknowriad a225c5cdc6 Block Editor: Updated the WordPress packages from Gutenberg 10.7.0 RC.
This also includes:

 - The removal of the Post Author block.
 - Renaming build_query_vars_from_query_block function.
 - Update the block supports.

Props gziolo.
See #52991. 
-This line, and those below, will be ignored--

M    package-lock.json
M    package.json
M    src/wp-includes/assets/script-loader-packages.php
M    src/wp-includes/block-supports/colors.php
AM   src/wp-includes/block-supports/elements.php
D    src/wp-includes/block-supports/padding.php
AM   src/wp-includes/block-supports/spacing.php
M    src/wp-includes/block-supports/typography.php
M    src/wp-includes/blocks/column/block.json
M    src/wp-includes/blocks/index.php
D    src/wp-includes/blocks/post-author
D    src/wp-includes/blocks/post-author.php
M    src/wp-includes/blocks/post-content.php
M    src/wp-includes/blocks/post-featured-image.php
M    src/wp-includes/blocks/query/block.json
M    src/wp-includes/blocks/query-loop/block.json
M    src/wp-includes/blocks/query-loop.php
M    src/wp-includes/blocks/query-pagination/block.json
M    src/wp-includes/blocks/query-pagination-next.php
M    src/wp-includes/blocks/query-pagination-numbers.php
M    src/wp-includes/blocks/site-tagline/block.json
M    src/wp-includes/blocks/site-title/block.json
M    src/wp-includes/blocks.php
M    src/wp-settings.php
M    tests/phpunit/tests/blocks/block.php
M    tools/webpack/packages.js

Built from https://develop.svn.wordpress.org/trunk@50945


git-svn-id: http://core.svn.wordpress.org/trunk@50554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-21 10:14:23 +00:00

2 lines
33 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.richText=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./node_modules/@wordpress/rich-text/build-module/index.js")}({"./node_modules/@wordpress/rich-text/build-module/index.js":function(e,t,n){"use strict";n.r(t),n.d(t,"store",(function(){return g})),n.d(t,"applyFormat",(function(){return y})),n.d(t,"concat",(function(){return D})),n.d(t,"create",(function(){return w})),n.d(t,"getActiveFormat",(function(){return k})),n.d(t,"getActiveObject",(function(){return M})),n.d(t,"getTextContent",(function(){return $})),n.d(t,"__unstableIsListRootSelected",(function(){return I})),n.d(t,"__unstableIsActiveListType",(function(){return V})),n.d(t,"isCollapsed",(function(){return B})),n.d(t,"isEmpty",(function(){return H})),n.d(t,"__unstableIsEmptyLine",(function(){return K})),n.d(t,"join",(function(){return z})),n.d(t,"registerFormatType",(function(){return q})),n.d(t,"removeFormat",(function(){return U})),n.d(t,"remove",(function(){return G})),n.d(t,"replace",(function(){return Z})),n.d(t,"insert",(function(){return Y})),n.d(t,"__unstableInsertLineSeparator",(function(){return J})),n.d(t,"__unstableRemoveLineSeparator",(function(){return Q})),n.d(t,"insertObject",(function(){return ee})),n.d(t,"slice",(function(){return te})),n.d(t,"split",(function(){return ne})),n.d(t,"__unstableToDom",(function(){return he})),n.d(t,"toHTMLString",(function(){return ye})),n.d(t,"toggleFormat",(function(){return Le})),n.d(t,"__UNSTABLE_LINE_SEPARATOR",(function(){return x})),n.d(t,"unregisterFormatType",(function(){return Ne})),n.d(t,"__unstableCanIndentListItems",(function(){return Re})),n.d(t,"__unstableCanOutdentListItems",(function(){return Ae})),n.d(t,"__unstableIndentListItems",(function(){return Se})),n.d(t,"__unstableOutdentListItems",(function(){return We})),n.d(t,"__unstableChangeListType",(function(){return ke})),n.d(t,"__unstableCreateElement",(function(){return T})),n.d(t,"useAnchorRef",(function(){return $e})),n.d(t,"__experimentalRichText",(function(){return Je})),n.d(t,"__unstableUseRichText",(function(){return Ze})),n.d(t,"__unstableFormatEdit",(function(){return Qe}));var r={};n.r(r),n.d(r,"getFormatTypes",(function(){return u})),n.d(r,"getFormatType",(function(){return l})),n.d(r,"getFormatTypeForBareElement",(function(){return f})),n.d(r,"getFormatTypeForClassName",(function(){return d}));var o={};n.r(o),n.d(o,"addFormatTypes",(function(){return m})),n.d(o,"removeFormatTypes",(function(){return p}));var a=n("@wordpress/data"),s=n("lodash");var c=Object(a.combineReducers)({formatTypes:function(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...Object(s.keyBy)(t.formatTypes,"name")};case"REMOVE_FORMAT_TYPES":return Object(s.omit)(e,t.names)}return e}}),i=n("./node_modules/rememo/es/rememo.js");const u=Object(i.a)(e=>Object.values(e.formatTypes),e=>[e.formatTypes]);function l(e,t){return e.formatTypes[t]}function f(e,t){return Object(s.find)(u(e),({className:e,tagName:n})=>null===e&&t===n)}function d(e,t){return Object(s.find)(u(e),({className:e})=>null!==e&&` ${t} `.indexOf(` ${e} `)>=0)}function m(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Object(s.castArray)(e)}}function p(e){return{type:"REMOVE_FORMAT_TYPES",names:Object(s.castArray)(e)}}const g=Object(a.createReduxStore)("core/rich-text",{reducer:c,selectors:r,actions:o});function h(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r=t.attributes;if(n===r)return!0;if(!n||!r)return!1;const o=Object.keys(n),a=Object.keys(r);if(o.length!==a.length)return!1;const s=o.length;for(let e=0;e<s;e++){const t=o[e];if(n[t]!==r[t])return!1}return!0}function b(e){const t=e.formats.slice();return t.forEach((e,n)=>{const r=t[n-1];if(r){const o=e.slice();o.forEach((e,t)=>{const n=r[t];h(e,n)&&(o[t]=n)}),t[n]=o}}),{...e,formats:t}}function v(e,t,n){return(e=e.slice())[t]=n,e}function y(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:a}=e,c=o.slice();if(n===r){const e=Object(s.find)(c[n],{type:t.type});if(e){const o=c[n].indexOf(e);for(;c[n]&&c[n][o]===e;)c[n]=v(c[n],o,t),n--;for(r++;c[r]&&c[r][o]===e;)c[r]=v(c[r],o,t),r++}}else{let e=1/0;for(let o=n;o<r;o++)if(c[o]){c[o]=c[o].filter(({type:e})=>e!==t.type);const n=c[o].length;n<e&&(e=n)}else c[o]=[],e=0;for(let o=n;o<r;o++)c[o].splice(e,0,t)}return b({...e,formats:c,activeFormats:[...Object(s.reject)(a,{type:t.type}),t]})}function T({implementation:e},t){return T.body||(T.body=e.createHTMLDocument("").body),T.body.innerHTML=t,T.body}Object(a.register)(g);const x="\u2028";function E(e,t){for(const n in e)if(e[n]===t)return n}function O({type:e,attributes:t}){let n;if(t&&t.class&&(n=Object(a.select)("core/rich-text").getFormatTypeForClassName(t.class),n&&(t.class=` ${t.class} `.replace(` ${n.className} `," ").trim(),t.class||delete t.class)),n||(n=Object(a.select)("core/rich-text").getFormatTypeForBareElement(e)),!n)return t?{type:e,attributes:t}:{type:e};if(n.__experimentalCreatePrepareEditableTree&&!n.__experimentalCreateOnChangeEditableValue)return null;if(!t)return{type:n.name};const r={},o={};for(const e in t){const a=E(n.attributes,e);a?r[a]=t[e]:o[e]=t[e]}return{type:n.name,attributes:r,unregisteredAttributes:o}}function w({element:e,text:t,html:n,range:r,multilineTag:o,multilineWrapperTags:a,__unstableIsEditableTree:s,preserveWhiteSpace:c}={}){return"string"==typeof t&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:("string"==typeof n&&n.length>0&&(e=T(document,n)),"object"!=typeof e?{formats:[],replacements:[],text:""}:o?R({element:e,range:r,multilineTag:o,multilineWrapperTags:a,isEditableTree:s,preserveWhiteSpace:c}):N({element:e,range:r,isEditableTree:s,preserveWhiteSpace:c}))}function _(e,t,n,r){if(!n)return;const{parentNode:o}=t,{startContainer:a,startOffset:s,endContainer:c,endOffset:i}=n,u=e.text.length;void 0!==r.start?e.start=u+r.start:t===a&&t.nodeType===t.TEXT_NODE?e.start=u+s:o===a&&t===a.childNodes[s]?e.start=u:o===a&&t===a.childNodes[s-1]?e.start=u+r.text.length:t===a&&(e.start=u),void 0!==r.end?e.end=u+r.end:t===c&&t.nodeType===t.TEXT_NODE?e.end=u+i:o===c&&t===c.childNodes[i-1]?e.end=u+r.text.length:o===c&&t===c.childNodes[i]?e.end=u:t===c&&(e.end=u+i)}function j(e,t,n){if(!t)return;const{startContainer:r,endContainer:o}=t;let{startOffset:a,endOffset:s}=t;return e===r&&(a=n(e.nodeValue.slice(0,a)).length),e===o&&(s=n(e.nodeValue.slice(0,s)).length),{startContainer:r,startOffset:a,endContainer:o,endOffset:s}}function C(e){return e.replace(/[\n\r\t]+/g," ")}const F=new RegExp("\ufeff","g");function L(e){return e.replace(F,"")}function N({element:e,range:t,multilineTag:n,multilineWrapperTags:r,currentWrapperTags:o=[],isEditableTree:a,preserveWhiteSpace:s}){const c={formats:[],replacements:[],text:""};if(!e)return c;if(!e.hasChildNodes())return _(c,e,t,{formats:[],replacements:[],text:""}),c;const i=e.childNodes.length;for(let l=0;l<i;l++){const i=e.childNodes[l],f=i.nodeName.toLowerCase();if(i.nodeType===i.TEXT_NODE){let e=L;s||(e=e=>L(C(e)));const n=e(i.nodeValue);_(c,i,t=j(i,t,e),{text:n}),c.formats.length+=n.length,c.replacements.length+=n.length,c.text+=n;continue}if(i.nodeType!==i.ELEMENT_NODE)continue;if(a&&(i.getAttribute("data-rich-text-placeholder")||"br"===f&&!i.getAttribute("data-rich-text-line-break"))){_(c,i,t,{formats:[],replacements:[],text:""});continue}if("br"===f){_(c,i,t,{formats:[],replacements:[],text:""}),S(c,w({text:"\n"}));continue}const d=c.formats[c.formats.length-1],m=d&&d[d.length-1],p=O({type:f,attributes:A({element:i})}),g=h(p,m)?m:p;if(r&&-1!==r.indexOf(f)){const e=R({element:i,range:t,multilineTag:n,multilineWrapperTags:r,currentWrapperTags:[...o,g],isEditableTree:a,preserveWhiteSpace:s});_(c,i,t,e),S(c,e);continue}const b=N({element:i,range:t,multilineTag:n,multilineWrapperTags:r,isEditableTree:a,preserveWhiteSpace:s});if(_(c,i,t,b),g)if(0===b.text.length)g.attributes&&S(c,{formats:[,],replacements:[g],text:""});else{function u(e){if(u.formats===e)return u.newFormats;const t=e?[g,...e]:[g];return u.formats=e,u.newFormats=t,t}u.newFormats=[g],S(c,{...b,formats:Array.from(b.formats,u)})}else S(c,b)}return c}function R({element:e,range:t,multilineTag:n,multilineWrapperTags:r,currentWrapperTags:o=[],isEditableTree:a,preserveWhiteSpace:s}){const c={formats:[],replacements:[],text:""};if(!e||!e.hasChildNodes())return c;const i=e.children.length;for(let u=0;u<i;u++){const i=e.children[u];if(i.nodeName.toLowerCase()!==n)continue;const l=N({element:i,range:t,multilineTag:n,multilineWrapperTags:r,currentWrapperTags:o,isEditableTree:a,preserveWhiteSpace:s});(0!==u||o.length>0)&&S(c,{formats:[,],replacements:o.length>0?[o]:[,],text:x}),_(c,i,t,l),S(c,l)}return c}function A({element:e}){if(!e.hasAttributes())return;const t=e.attributes.length;let n;for(let r=0;r<t;r++){const{name:t,value:o}=e.attributes[r];0!==t.indexOf("data-rich-text-")&&(n=n||{},n[t]=o)}return n}function S(e,t){return e.formats=e.formats.concat(t.formats),e.replacements=e.replacements.concat(t.replacements),e.text+=t.text,e}function D(...e){return b(e.reduce(S,w()))}function W({formats:e,start:t,end:n,activeFormats:r},o=[]){if(void 0===t)return o;if(t===n){if(r)return r;const n=e[t-1]||o,a=e[t]||o;return n.length<a.length?n:a}return e[t]||o}function k(e,t){return Object(s.find)(W(e),{type:t})}function M({start:e,end:t,replacements:n,text:r}){if(e+1===t&&""===r[e])return n[e]}function $({text:e}){return e.replace(new RegExp("","g"),"").replace(new RegExp(x,"g"),"\n")}function P({start:e,text:t},n=e){let r=n;for(;r--;)if(t[r]===x)return r}function I(e){const{replacements:t,start:n}=e,r=t[P(e,n)];return!r||r.length<1}function V(e,t,n){const{replacements:r,start:o}=e,a=r[P(e,o)];if(!a||0===a.length)return t===n;return a[a.length-1].type===t}function B({start:e,end:t}){if(void 0!==e&&void 0!==t)return e===t}function H({text:e}){return 0===e.length}function K({text:e,start:t,end:n}){return t===n&&(0===e.length||(0===t&&e.slice(0,1)===x||(t===e.length&&e.slice(-1)===x||e.slice(t-1,n+1)===`${x}${x}`)))}function z(e,t=""){return"string"==typeof t&&(t=w({text:t})),b(e.reduce((e,{formats:n,replacements:r,text:o})=>({formats:e.formats.concat(t.formats,n),replacements:e.replacements.concat(t.replacements,r),text:e.text+t.text+o})))}function q(e,t){if("string"==typeof(t={name:e,...t}).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if(Object(a.select)(g).getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9-]*$/.test(t.className)){if(null===t.className){const e=Object(a.select)(g).getFormatTypeForBareElement(t.tagName);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle bare tag name "${t.tagName}".`)}else{const e=Object(a.select)(g).getFormatTypeForClassName(t.className);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle class name "${t.className}".`)}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return Object(a.dispatch)(g).addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("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");else window.console.error("Format names must be strings.")}function U(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:a}=e,c=o.slice();if(n===r){const e=Object(s.find)(c[n],{type:t});if(e){for(;Object(s.find)(c[n],e);)X(c,n,t),n--;for(r++;Object(s.find)(c[r],e);)X(c,r,t),r++}}else for(let e=n;e<r;e++)c[e]&&X(c,e,t);return b({...e,formats:c,activeFormats:Object(s.reject)(a,{type:t})})}function X(e,t,n){const r=e[t].filter(({type:e})=>e!==n);r.length?e[t]=r:delete e[t]}function Y(e,t,n=e.start,r=e.end){const{formats:o,replacements:a,text:s}=e;"string"==typeof t&&(t=w({text:t}));const c=n+t.text.length;return b({formats:o.slice(0,n).concat(t.formats,o.slice(r)),replacements:a.slice(0,n).concat(t.replacements,a.slice(r)),text:s.slice(0,n)+t.text+s.slice(r),start:c,end:c})}function G(e,t,n){return Y(e,w(),t,n)}function Z({formats:e,replacements:t,text:n,start:r,end:o},a,s){return n=n.replace(a,(n,...a)=>{const c=a[a.length-2];let i,u,l=s;return"function"==typeof l&&(l=s(n,...a)),"object"==typeof l?(i=l.formats,u=l.replacements,l=l.text):(i=Array(l.length),u=Array(l.length),e[c]&&(i=i.fill(e[c]))),e=e.slice(0,c).concat(i,e.slice(c+n.length)),t=t.slice(0,c).concat(u,t.slice(c+n.length)),r&&(r=o=c+l.length),l}),b({formats:e,replacements:t,text:n,start:r,end:o})}function J(e,t=e.start,n=e.end){const r=e.text.slice(0,t).lastIndexOf(x),o=e.replacements[r];let a=[,];o&&(a=[o]);return Y(e,{formats:[,],replacements:a,text:x},t,n)}function Q(e,t=!0){const{replacements:n,text:r,start:o,end:a}=e,s=B(e);let c,i=o-1,u=s?o-1:o,l=a;if(t||(i=a,u=o,l=s?a+1:a),r[i]===x){if(s&&n[i]&&n[i].length){const t=n.slice();t[i]=n[i].slice(0,-1),c={...e,replacements:t}}else c=G(e,u,l);return c}}function ee(e,t,n,r){return Y(e,{formats:[,],replacements:[t],text:""},n,r)}function te(e,t=e.start,n=e.end){const{formats:r,replacements:o,text:a}=e;return void 0===t||void 0===n?{...e}:{formats:r.slice(t,n),replacements:o.slice(t,n),text:a.slice(t,n)}}function ne({formats:e,replacements:t,text:n,start:r,end:o},a){if("string"!=typeof a)return re(...arguments);let s=0;return n.split(a).map(n=>{const c=s,i={formats:e.slice(c,c+n.length),replacements:t.slice(c,c+n.length),text:n};return s+=a.length+n.length,void 0!==r&&void 0!==o&&(r>=c&&r<s?i.start=r-c:r<c&&o>c&&(i.start=0),o>=c&&o<s?i.end=o-c:r<s&&o>s&&(i.end=n.length)),i})}function re({formats:e,replacements:t,text:n,start:r,end:o},a=r,s=o){if(void 0===r||void 0===o)return;const c={formats:e.slice(0,a),replacements:t.slice(0,a),text:n.slice(0,a)},i={formats:e.slice(s),replacements:t.slice(s),text:n.slice(s),start:0,end:0};return[Z(c,/\u2028+$/,""),Z(i,/^\u2028+/,"")]}function oe({type:e,attributes:t,unregisteredAttributes:n,object:r,boundaryClass:o}){const s=(c=e,Object(a.select)(g).getFormatType(c));var c;let i={};if(o&&(i["data-rich-text-format-boundary"]="true"),!s)return t&&(i={...t,...i}),{type:e,attributes:i,object:r};i={...n,...i};for(const e in t){const n=!!s.attributes&&s.attributes[e];n?i[n]=t[e]:i[e]=t[e]}return s.className&&(i.class?i.class=`${s.className} ${i.class}`:i.class=s.className),{type:s.tagName,object:s.object,attributes:i}}function ae(e,t,n){do{if(e[n]!==t[n])return!1}while(n--);return!0}function se({value:e,multilineTag:t,preserveWhiteSpace:n,createEmpty:r,append:o,getLastChild:a,getParent:s,isText:c,getText:i,remove:u,appendText:l,onStartIndex:f,onEndIndex:d,isEditableTree:m,placeholder:p}){const{formats:g,replacements:h,text:b,start:v,end:y}=e,T=g.length+1,E=r(),O={type:t},w=W(e),_=w[w.length-1];let j,C,F;t?(o(o(E,{type:t}),""),C=j=[O]):o(E,"");for(let e=0;e<T;e++){const r=b.charAt(e),T=m&&(!F||F===x||"\n"===F);let w=g[e];t&&(w=r===x?j=(h[e]||[]).reduce((e,t)=>(e.push(t,O),e),[O]):[...j,...w||[]]);let L=a(E);if(T&&r===x){let e=L;for(;!c(e);)e=a(e);o(s(e),"\ufeff")}if(F===x){let t=L;for(;!c(t);)t=a(t);f&&v===e&&f(E,t),d&&y===e&&d(E,t)}w&&w.forEach((e,t)=>{if(L&&C&&ae(w,C,t)&&(r!==x||w.length-1!==t))return void(L=a(L));const{type:n,attributes:l,unregisteredAttributes:f}=e,d=m&&r!==x&&e===_,p=s(L),g=o(p,oe({type:n,attributes:l,unregisteredAttributes:f,boundaryClass:d}));c(L)&&0===i(L).length&&u(L),L=o(g,"")}),r!==x?(0===e&&(f&&0===v&&f(E,L),d&&0===y&&d(E,L)),""===r?(L=o(s(L),oe({...h[e],object:!0})),L=o(s(L),"")):n||"\n"!==r?c(L)?l(L,r):L=o(s(L),r):(L=o(s(L),{type:"br",attributes:m?{"data-rich-text-line-break":"true"}:void 0,object:!0}),L=o(s(L),"")),f&&v===e+1&&f(E,L),d&&y===e+1&&d(E,L),T&&e===b.length&&(o(s(L),"\ufeff"),p&&0===b.length&&o(s(L),{type:"span",attributes:{"data-rich-text-placeholder":p,contenteditable:"false",style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),C=w,F=r):(C=w,F=r)}return E}function ce(e,t,n){const r=e.parentNode;let o=0;for(;e=e.previousSibling;)o++;return n=[o,...n],r!==t&&(n=ce(r,t,n)),n}function ie(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function ue(e,t){"string"==typeof t&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:r}=t;if(n){t=e.ownerDocument.createElement(n);for(const e in r)t.setAttribute(e,r[e])}return e.appendChild(t)}function le(e,t){e.appendData(t)}function fe({lastChild:e}){return e}function de({parentNode:e}){return e}function me(e){return e.nodeType===e.TEXT_NODE}function pe({nodeValue:e}){return e}function ge(e){return e.parentNode.removeChild(e)}function he({value:e,multilineTag:t,prepareEditableTree:n,isEditableTree:r=!0,placeholder:o,doc:a=document}){let s=[],c=[];n&&(e={...e,formats:n(e)});return{body:se({value:e,multilineTag:t,createEmpty:()=>T(a,""),append:ue,getLastChild:fe,getParent:de,isText:me,getText:pe,remove:ge,appendText:le,onStartIndex(e,t){s=ce(t,e,[t.nodeValue.length])},onEndIndex(e,t){c=ce(t,e,[t.nodeValue.length])},isEditableTree:r,placeholder:o}),selection:{startPath:s,endPath:c}}}function be({value:e,current:t,multilineTag:n,prepareEditableTree:r,__unstableDomOnly:o,placeholder:a}){const{body:s,selection:c}=he({value:e,multilineTag:n,prepareEditableTree:r,placeholder:a,doc:t.ownerDocument});!function e(t,n){let r,o=0;for(;r=t.firstChild;){const a=n.childNodes[o];if(a)if(a.isEqualNode(r))t.removeChild(r);else if(a.nodeName!==r.nodeName||a.nodeType===a.TEXT_NODE&&a.data!==r.data)n.replaceChild(r,a);else{const n=a.attributes,o=r.attributes;if(n){let e=n.length;for(;e--;){const{name:t}=n[e];r.getAttribute(t)||a.removeAttribute(t)}}if(o)for(let e=0;e<o.length;e++){const{name:t,value:n}=o[e];a.getAttribute(t)!==n&&a.setAttribute(t,n)}e(r,a),t.removeChild(r)}else n.appendChild(r);o++}for(;n.childNodes[o];)n.removeChild(n.childNodes[o])}(s,t),void 0===e.start||o||function({startPath:e,endPath:t},n){const{node:r,offset:o}=ie(n,e),{node:a,offset:s}=ie(n,t),{ownerDocument:c}=n,{defaultView:i}=c,u=i.getSelection(),l=c.createRange();l.setStart(r,o),l.setEnd(a,s);const{activeElement:f}=c;if(u.rangeCount>0){if(d=l,m=u.getRangeAt(0),d.startContainer===m.startContainer&&d.startOffset===m.startOffset&&d.endContainer===m.endContainer&&d.endOffset===m.endOffset)return;u.removeAllRanges()}var d,m;u.addRange(l),f!==c.activeElement&&f instanceof i.HTMLElement&&f.focus()}(c,t)}var ve=n("@wordpress/escape-html");function ye({value:e,multilineTag:t,preserveWhiteSpace:n}){return Fe(se({value:e,multilineTag:t,preserveWhiteSpace:n,createEmpty:Te,append:Ee,getLastChild:xe,getParent:we,isText:_e,getText:je,remove:Ce,appendText:Oe}).children)}function Te(){return{}}function xe({children:e}){return e&&e[e.length-1]}function Ee(e,t){return"string"==typeof t&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function Oe(e,t){e.text+=t}function we({parent:e}){return e}function _e({text:e}){return"string"==typeof e}function je({text:e}){return e}function Ce(e){const t=e.parent.children.indexOf(e);return-1!==t&&e.parent.children.splice(t,1),e}function Fe(e=[]){return e.map(e=>void 0===e.text?function({type:e,attributes:t,object:n,children:r}){let o="";for(const e in t)Object(ve.isValidAttributeName)(e)&&(o+=` ${e}="${Object(ve.escapeAttribute)(t[e])}"`);return n?`<${e}${o}>`:`<${e}${o}>${Fe(r)}</${e}>`}(e):Object(ve.escapeEditableHTML)(e.text)).join("")}function Le(e,t){return k(e,t.type)?U(e,t.type):y(e,t)}function Ne(e){const t=Object(a.select)(g).getFormatType(e);if(t)return Object(a.dispatch)(g).removeFormatTypes(e),t;window.console.error(`Format ${e} is not registered.`)}function Re(e){const t=P(e);if(void 0===t)return!1;const{replacements:n}=e,r=P(e,t),o=n[t]||[],a=n[r]||[];return o.length<=a.length}function Ae(e){const{replacements:t,start:n}=e;return void 0!==t[P(e,n)]}function Se(e,t){if(!Re(e))return e;const n=P(e),r=P(e,n),{text:o,replacements:a,end:s}=e,c=a.slice(),i=function({text:e,replacements:t},n){const r=t[n]||[];let o=n;for(;o-- >=0;){if(e[o]!==x)continue;const n=t[o]||[];if(n.length===r.length+1)return o;if(n.length<=r.length)return}}(e,n);for(let e=n;e<s;e++)if(o[e]===x)if(i){const t=a[i]||[];c[e]=t.concat((c[e]||[]).slice(t.length-1))}else{const n=a[r]||[],o=n[n.length-1]||t;c[e]=n.concat([o],(c[e]||[]).slice(n.length))}return{...e,replacements:c}}function De({text:e,replacements:t},n){const r=t[n]||[];let o=n;for(;o-- >=0;){if(e[o]!==x)continue;if((t[o]||[]).length===r.length-1)return o}}function We(e){if(!Ae(e))return e;const{text:t,replacements:n,start:r,end:o}=e,a=P(e,r),s=n.slice(0),c=n[De(e,a)]||[],i=function({text:e,replacements:t},n){const r=t[n]||[];let o=n;for(let a=n||0;a<e.length;a++){if(e[a]!==x)continue;if(!((t[a]||[]).length>=r.length))return o;o=a}return o}(e,P(e,o));for(let e=a;e<=i;e++){if(t[e]!==x)continue;const n=s[e]||[];s[e]=c.concat(n.slice(c.length+1)),0===s[e].length&&delete s[e]}return{...e,replacements:s}}function ke(e,t){const{text:n,replacements:r,start:o,end:a}=e,s=P(e,o),c=r[s]||[],i=r[P(e,a)]||[],u=De(e,s),l=r.slice(),f=c.length-1,d=i.length-1;let m;for(let e=u+1||0;e<n.length;e++)if(n[e]===x){if((l[e]||[]).length<=f)break;l[e]&&(m=!0,l[e]=l[e].map((e,n)=>n<f||n>d?e:t))}return m?{...e,replacements:l}:e}var Me=n("@wordpress/element");function $e({ref:e,value:t,settings:n={}}){const{tagName:r,className:o,name:a}=n,s=a?k(t,a):void 0;return Object(Me.useMemo)(()=>{if(!e.current)return;const{ownerDocument:{defaultView:t}}=e.current,n=t.getSelection();if(!n.rangeCount)return;const a=n.getRangeAt(0);if(!s)return a;let c=a.startContainer;for(c=c.nextElementSibling||c;c.nodeType!==c.ELEMENT_NODE;)c=c.parentNode;return c.closest(r+(o?"."+o:""))},[s,t.start,t.end,r,o])}var Pe=n("@wordpress/compose");function Ie({record:e}){const t=Object(Me.useRef)(),{activeFormats:n=[]}=e.current;return Object(Me.useEffect)(()=>{if(!n||!n.length)return;const e=t.current.querySelector("*[data-rich-text-format-boundary]");if(!e)return;const{ownerDocument:r}=e,{defaultView:o}=r,a=`.rich-text:focus *[data-rich-text-format-boundary] {${"background-color: "+o.getComputedStyle(e).color.replace(")",", 0.2)").replace("rgb","rgba")}}`;let s=r.getElementById("rich-text-boundary-style");s||(s=r.createElement("style"),s.id="rich-text-boundary-style",r.head.appendChild(s)),s.innerHTML!==a&&(s.innerHTML=a)},[n]),t}function Ve(){const e=Object(Me.useRef)();return Object(Me.useEffect)(()=>{0},[]),e}function Be(e){const t=Object(Me.useRef)(e);return t.current=e,Object(Pe.useRefEffect)(e=>{function n(n){const{record:r,multilineTag:o,preserveWhiteSpace:a}=t.current;if(B(r.current)||!e.contains(e.ownerDocument.activeElement))return;const s=te(r.current),c=$(s),i=ye({value:s,multilineTag:o,preserveWhiteSpace:a});n.clipboardData.setData("text/plain",c),n.clipboardData.setData("text/html",i),n.clipboardData.setData("rich-text","true"),n.preventDefault()}return e.addEventListener("copy",n),()=>{e.removeEventListener("copy",n)}},[])}var He=n("@wordpress/keycodes");const Ke=[];function ze(e){const[,t]=Object(Me.useReducer)(()=>({})),n=Object(Me.useRef)(e);return n.current=e,Object(Pe.useRefEffect)(e=>{function r(r){const{keyCode:o,shiftKey:a,altKey:s,metaKey:c,ctrlKey:i}=r;if(a||s||c||i||o!==He.LEFT&&o!==He.RIGHT)return;const{record:u,applyRecord:l}=n.current,{text:f,formats:d,start:m,end:p,activeFormats:g=[]}=u.current,h=B(u.current),{ownerDocument:b}=e,{defaultView:v}=b,{direction:y}=v.getComputedStyle(e),T="rtl"===y?He.RIGHT:He.LEFT,x=r.keyCode===T;if(h&&0===g.length){if(0===m&&x)return;if(p===f.length&&!x)return}if(!h)return;const E=d[m-1]||Ke,O=d[m]||Ke;let w=g.length,_=O;if(E.length>O.length&&(_=E),E.length<O.length?(!x&&g.length<O.length&&w++,x&&g.length>E.length&&w--):E.length>O.length&&(!x&&g.length>O.length&&w--,x&&g.length<E.length&&w++),w===g.length)return void(u.current._newActiveFormats=x?E:O);r.preventDefault();const j=_.slice(0,w),C={...u.current,activeFormats:j};u.current=C,l(C),t()}return e.addEventListener("keydown",r),()=>{e.removeEventListener("keydown",r)}},[])}function qe(e){const t=Object(Me.useRef)(e);return t.current=e,Object(Pe.useRefEffect)(e=>{function n(n){const{keyCode:r,shiftKey:o,altKey:a,metaKey:s,ctrlKey:c}=n,{multilineTag:i,createRecord:u,handleChange:l}=t.current;if(o||a||s||c||r!==He.SPACE||"li"!==i)return;const f=u();if(!B(f))return;const{text:d,start:m}=f,p=d[m-1];p&&p!==x||(l(Se(f,{type:e.tagName.toLowerCase()})),n.preventDefault())}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}},[])}const Ue=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),Xe=[];function Ye(e){const t=Object(Me.useRef)(e);return t.current=e,Object(Pe.useRefEffect)(e=>{const{ownerDocument:n}=e,{defaultView:r}=n;let o,a=!1;function s(e){if(a)return;let n;e&&(n=e.inputType);const{record:r,applyRecord:o,createRecord:s,handleChange:c}=t.current;if(n&&(0===n.indexOf("format")||Ue.has(n)))return void o(r.current);const i=s(),{start:u,activeFormats:l=[]}=r.current;c(function({value:e,start:t,end:n,formats:r}){const o=e.formats[t-1]||[],a=e.formats[n]||[];for(e.activeFormats=r.map((e,t)=>{if(o[t]){if(h(e,o[t]))return o[t]}else if(a[t]&&h(e,a[t]))return a[t];return e});--n>=t;)e.activeFormats.length>0?e.formats[n]=e.activeFormats:delete e.formats[n];return e}({value:i,start:u,end:i.start,formats:l}))}function c(o){if(n.activeElement!==e)return;const{record:c,applyRecord:i,createRecord:u,isSelected:l,onSelectionChange:f}=t.current;if("selectionchange"!==o.type&&!l)return;if("true"!==e.contentEditable)return;if(a)return;const{start:d,end:m,text:p}=u(),g=c.current;if(p!==g.text)return void s();if(d===g.start&&m===g.end)return void(0===g.text.length&&0===d&&function(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:r}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const o=n.childNodes[r];o&&o.nodeType===o.ELEMENT_NODE&&o.getAttribute("data-rich-text-placeholder")&&t.collapseToStart()}(r));const h={...g,start:d,end:m,activeFormats:g._newActiveFormats,_newActiveFormats:void 0},b=W(h,Xe);h.activeFormats=b,c.current=h,i(h,{domOnly:!0}),f(d,m)}function i(){a=!0,n.removeEventListener("selectionchange",c)}function u(){a=!1,s({inputType:"insertText"}),n.addEventListener("selectionchange",c)}function l(){const{record:e,isSelected:a,onSelectionChange:s}=t.current;if(a)s(e.current.start,e.current.end);else{const t=void 0;e.current={...e.current,start:t,end:t,activeFormats:Xe},s(t,t)}o=r.requestAnimationFrame(c),n.addEventListener("selectionchange",c)}function f(){n.removeEventListener("selectionchange",c)}return e.addEventListener("input",s),e.addEventListener("compositionstart",i),e.addEventListener("compositionend",u),e.addEventListener("focus",l),e.addEventListener("blur",f),e.addEventListener("keyup",c),e.addEventListener("mouseup",c),e.addEventListener("touchend",c),()=>{e.removeEventListener("input",s),e.removeEventListener("compositionstart",i),e.removeEventListener("compositionend",u),e.removeEventListener("focus",l),e.removeEventListener("blur",f),e.removeEventListener("keyup",c),e.removeEventListener("mouseup",c),e.removeEventListener("touchend",c),n.removeEventListener("selectionchange",c),r.cancelAnimationFrame(o)}},[])}function Ge(e){const t=Object(Me.useRef)(e);return t.current=e,Object(Pe.useRefEffect)(e=>{function n(e){const{keyCode:n}=e,{createRecord:r,handleChange:o,multilineTag:a}=t.current;if(e.defaultPrevented)return;if(n!==He.DELETE&&n!==He.BACKSPACE)return;const s=r(),{start:c,end:i,text:u}=s,l=n===He.BACKSPACE;if(0===c&&0!==i&&i===u.length)return o(G(s)),void e.preventDefault();if(a){let t;t=l&&0===s.start&&0===s.end&&K(s)?Q(s,!l):Q(s,l),t&&(o(t),e.preventDefault())}}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}},[])}function Ze({value:e="",selectionStart:t,selectionEnd:n,placeholder:r,preserveWhiteSpace:o,onSelectionChange:a,onChange:s,__unstableMultilineTag:c,__unstableDisableFormats:i,__unstableIsSelected:u,__unstableDependencies:l,__unstableAfterParse:f,__unstableBeforeSerialize:d,__unstableAddInvisibleFormats:m}){const[,p]=Object(Me.useReducer)(()=>({})),g=Object(Me.useRef)();function h(){const{ownerDocument:{defaultView:e}}=g.current,t=e.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null;return w({element:g.current,range:n,multilineTag:c,multilineWrapperTags:"li"===c?["ul","ol"]:void 0,__unstableIsEditableTree:!0,preserveWhiteSpace:o})}function b(e,{domOnly:t}={}){be({value:e,current:g.current,multilineTag:c,multilineWrapperTags:"li"===c?["ul","ol"]:void 0,prepareEditableTree:m,__unstableDomOnly:t,placeholder:r})}const v=Object(Me.useRef)(e),y=Object(Me.useRef)();function T(){v.current=e,y.current=w({html:e,multilineTag:c,multilineWrapperTags:"li"===c?["ul","ol"]:void 0,preserveWhiteSpace:o}),i&&(y.current.formats=Array(e.length),y.current.replacements=Array(e.length)),y.current.formats=f(y.current),y.current.start=t,y.current.end=n}const x=Object(Me.useRef)(!1);function E(e){b(e),v.current=i?e.text:ye({value:{...e,formats:d(e)},multilineTag:c,preserveWhiteSpace:o}),y.current=e;const{start:t,end:n,formats:r,text:u}=e;a(t,n),s(v.current,{__unstableFormats:r,__unstableText:u}),p()}function O(){T(),b(y.current)}y.current?t===y.current.start&&n===y.current.end||(x.current=u,y.current={...y.current,start:t,end:n}):T();const _=Object(Me.useRef)(!1);Object(Me.useLayoutEffect)(()=>{_.current&&e!==v.current&&O()},[e]),Object(Me.useLayoutEffect)(()=>{x.current&&(O(),x.current=!1)},[x.current]);const j=Object(Pe.useMergeRefs)([g,Object(Me.useCallback)(e=>{e&&(e.style.whiteSpace="pre-wrap",e.style.minWidth="1px")},[]),Ie({record:y}),Ve(),Be({record:y,multilineTag:c,preserveWhiteSpace:o}),Object(Pe.useRefEffect)(e=>{function t(t){const{target:n}=t;if(n===e||n.textContent)return;const{ownerDocument:r}=n,{defaultView:o}=r,a=r.createRange(),s=o.getSelection();a.selectNode(n),s.removeAllRanges(),s.addRange(a)}return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}},[]),ze({record:y,applyRecord:b}),Ge({createRecord:h,handleChange:E,multilineTag:c}),qe({multilineTag:c,createRecord:h,handleChange:E}),Ye({record:y,applyRecord:b,createRecord:h,handleChange:E,isSelected:u,onSelectionChange:a}),Object(Pe.useRefEffect)(()=>{O(),_.current=!0},[r,...l])]);return{value:y.current,onChange:E,onFocus:function(){g.current.focus(),b(y.current)},ref:j}}function Je(){}function Qe({formatTypes:e,onChange:t,onFocus:n,value:r,forwardedRef:o}){return e.map(e=>{const{name:a,edit:s}=e;if(!s)return null;const c=k(r,a),i=void 0!==c,u=M(r),l=void 0!==u&&u.type===a;return Object(Me.createElement)(s,{key:a,isActive:i,activeAttributes:i&&c.attributes||{},isObjectActive:l,activeObjectAttributes:l&&u.attributes||{},value:r,onChange:t,onFocus:n,contentRef:o})})}},"./node_modules/rememo/es/rememo.js":function(e,t,n){"use strict";var r,o;function a(e){return[e]}function s(){var e={clear:function(){e.head=null}};return e}function c(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}r={},o="undefined"!=typeof WeakMap,t.a=function(e,t){var n,i;function u(){n=o?new WeakMap:s()}function l(){var n,r,o,a,s,u=arguments.length;for(a=new Array(u),o=0;o<u;o++)a[o]=arguments[o];for(s=t.apply(null,a),(n=i(s)).isUniqueByDependants||(n.lastDependants&&!c(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),r=n.head;r;){if(c(r.args,a,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,a)},a[0]=null,r.args=a,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=a),i=o?function(e){var t,o,a,c,i,u=n,l=!0;for(t=0;t<e.length;t++){if(o=e[t],!(i=o)||"object"!=typeof i){l=!1;break}u.has(o)?u=u.get(o):(a=new WeakMap,u.set(o,a),u=a)}return u.has(r)||((c=s()).isUniqueByDependants=l,u.set(r,c)),u.get(r)}:function(){return n},l.getDependants=t,l.clear=u,u(),l}},"@wordpress/compose":function(e,t){e.exports=window.wp.compose},"@wordpress/data":function(e,t){e.exports=window.wp.data},"@wordpress/element":function(e,t){e.exports=window.wp.element},"@wordpress/escape-html":function(e,t){e.exports=window.wp.escapeHtml},"@wordpress/keycodes":function(e,t){e.exports=window.wp.keycodes},lodash:function(e,t){e.exports=window.lodash}});