Version Description
Download this release
Release Info
Developer | gutenbergplugin |
Plugin | Gutenberg |
Version | 12.8.0 |
Comparing to | |
See all releases |
Code changes from version 12.7.2 to 12.8.0
- build/api-fetch/index.js +12 -11
- build/api-fetch/index.min.asset.php +1 -1
- build/api-fetch/index.min.js +1 -1
- build/api-fetch/index.min.js.map +1 -1
- build/block-directory/index.js +2 -2
- build/block-directory/index.min.asset.php +1 -1
- build/block-directory/index.min.js.map +1 -1
- build/block-editor/index.js +345 -206
- build/block-editor/index.min.asset.php +1 -1
- build/block-editor/index.min.js +23 -24
build/api-fetch/index.js
CHANGED
@@ -147,12 +147,10 @@ var external_wp_url_namespaceObject = window["wp"]["url"];
|
|
147 |
*/
|
148 |
|
149 |
function createPreloadingMiddleware(preloadedData) {
|
150 |
-
const cache = Object.
|
151 |
-
|
152 |
-
return
|
153 |
-
}
|
154 |
-
/** @type {Record<string, any>} */
|
155 |
-
{});
|
156 |
return (options, next) => {
|
157 |
const {
|
158 |
parse = true
|
@@ -162,10 +160,13 @@ function createPreloadingMiddleware(preloadedData) {
|
|
162 |
let rawPath = options.path;
|
163 |
|
164 |
if (!rawPath && options.url) {
|
165 |
-
const
|
|
|
|
|
|
|
166 |
|
167 |
if (typeof pathFromQuery === 'string') {
|
168 |
-
rawPath = pathFromQuery;
|
169 |
}
|
170 |
}
|
171 |
|
@@ -177,12 +178,12 @@ function createPreloadingMiddleware(preloadedData) {
|
|
177 |
const path = (0,external_wp_url_namespaceObject.normalizePath)(rawPath);
|
178 |
|
179 |
if ('GET' === method && cache[path]) {
|
180 |
-
const cacheData = cache[path]; // Unsetting the cache key ensures that the data is only used a single time
|
181 |
|
182 |
delete cache[path];
|
183 |
return prepareResponse(cacheData, !!parse);
|
184 |
} else if ('OPTIONS' === method && cache[method] && cache[method][path]) {
|
185 |
-
const cacheData = cache[method][path]; // Unsetting the cache key ensures that the data is only used a single time
|
186 |
|
187 |
delete cache[method][path];
|
188 |
return prepareResponse(cacheData, !!parse);
|
@@ -702,7 +703,7 @@ const defaultFetchHandler = nextOptions => {
|
|
702 |
headers['Content-Type'] = 'application/json';
|
703 |
}
|
704 |
|
705 |
-
const responsePromise = window.fetch( //
|
706 |
url || path || window.location.href, { ...DEFAULT_OPTIONS,
|
707 |
...remainingOptions,
|
708 |
body,
|
147 |
*/
|
148 |
|
149 |
function createPreloadingMiddleware(preloadedData) {
|
150 |
+
const cache = Object.fromEntries(Object.entries(preloadedData).map(_ref => {
|
151 |
+
let [path, data] = _ref;
|
152 |
+
return [(0,external_wp_url_namespaceObject.normalizePath)(path), data];
|
153 |
+
}));
|
|
|
|
|
154 |
return (options, next) => {
|
155 |
const {
|
156 |
parse = true
|
160 |
let rawPath = options.path;
|
161 |
|
162 |
if (!rawPath && options.url) {
|
163 |
+
const {
|
164 |
+
rest_route: pathFromQuery,
|
165 |
+
...queryArgs
|
166 |
+
} = (0,external_wp_url_namespaceObject.getQueryArgs)(options.url);
|
167 |
|
168 |
if (typeof pathFromQuery === 'string') {
|
169 |
+
rawPath = (0,external_wp_url_namespaceObject.addQueryArgs)(pathFromQuery, queryArgs);
|
170 |
}
|
171 |
}
|
172 |
|
178 |
const path = (0,external_wp_url_namespaceObject.normalizePath)(rawPath);
|
179 |
|
180 |
if ('GET' === method && cache[path]) {
|
181 |
+
const cacheData = cache[path]; // Unsetting the cache key ensures that the data is only used a single time.
|
182 |
|
183 |
delete cache[path];
|
184 |
return prepareResponse(cacheData, !!parse);
|
185 |
} else if ('OPTIONS' === method && cache[method] && cache[method][path]) {
|
186 |
+
const cacheData = cache[method][path]; // Unsetting the cache key ensures that the data is only used a single time.
|
187 |
|
188 |
delete cache[method][path];
|
189 |
return prepareResponse(cacheData, !!parse);
|
703 |
headers['Content-Type'] = 'application/json';
|
704 |
}
|
705 |
|
706 |
+
const responsePromise = window.fetch( // Fall back to explicitly passing `window.location` which is the behavior if `undefined` is passed.
|
707 |
url || path || window.location.href, { ...DEFAULT_OPTIONS,
|
708 |
...remainingOptions,
|
709 |
body,
|
build/api-fetch/index.min.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'b3dff7bbc29b5636d58cdd73d2973625');
|
build/api-fetch/index.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
!function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};e.d(t,{default:function(){return
|
2 |
//# sourceMappingURL=index.min.js.map
|
1 |
+
!function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};e.d(t,{default:function(){return j}});var r=window.wp.i18n,n=(e,t)=>{let r,n,o=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(r=e.namespace.replace(/^\/|\/$/g,""),n=e.endpoint.replace(/^\//,""),o=n?r+"/"+n:r),delete e.namespace,delete e.endpoint,t({...e,path:o})},o=window.wp.url;function a(e,t){return Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}const s=(e,t)=>{let{path:r,url:n,...a}=e;return{...a,url:n&&(0,o.addQueryArgs)(n,t),path:r&&(0,o.addQueryArgs)(r,t)}},i=e=>e.json?e.json():Promise.reject(e),c=e=>{const{next:t}=(e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}})(e.headers.get("link"));return t};var d=async(e,t)=>{if(!1===e.parse)return t(e);if(!(e=>{const t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),r=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||r})(e))return t(e);const r=await j({...s(e,{per_page:100}),parse:!1}),n=await i(r);if(!Array.isArray(n))return n;let o=c(r);if(!o)return n;let a=[].concat(n);for(;o;){const t=await j({...e,path:void 0,url:o,parse:!1}),r=await i(t);a=a.concat(r),o=c(t)}return a};const u=new Set(["PATCH","PUT","DELETE"]),p="GET",l=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},h=e=>{const t={code:"invalid_json",message:(0,r.__)("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((()=>{throw t}))},f=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(l(e,t)).catch((e=>w(e,t)))};function w(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return h(e).then((e=>{const t={code:"unknown_error",message:(0,r.__)("An unknown error occurred.")};throw e||t}))}const g={Accept:"application/json, */*;q=0.1"},m={credentials:"include"},y=[(e,t)=>("string"!=typeof e.url||(0,o.hasQueryArg)(e.url,"_locale")||(e.url=(0,o.addQueryArgs)(e.url,{_locale:"user"})),"string"!=typeof e.path||(0,o.hasQueryArg)(e.path,"_locale")||(e.path=(0,o.addQueryArgs)(e.path,{_locale:"user"})),t(e)),n,(e,t)=>{const{method:r=p}=e;return u.has(r.toUpperCase())&&(e={...e,headers:{...e.headers,"X-HTTP-Method-Override":r,"Content-Type":"application/json"},method:"POST"}),t(e)},d],_=e=>{if(e.status>=200&&e.status<300)return e;throw e};let P=e=>{const{url:t,path:n,data:o,parse:a=!0,...s}=e;let{body:i,headers:c}=e;return c={...g,...c},o&&(i=JSON.stringify(o),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,{...m,...s,body:i,headers:c}).then((e=>Promise.resolve(e).then(_).catch((e=>w(e,a))).then((e=>f(e,a)))),(e=>{if(e&&"AbortError"===e.name)throw e;throw{code:"fetch_error",message:(0,r.__)("You are probably offline.")}}))};function O(e){return y.reduceRight(((e,t)=>r=>t(r,e)),P)(e).catch((t=>"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(O.nonceEndpoint).then(_).then((e=>e.text())).then((t=>(O.nonceMiddleware.nonce=t,O(e))))))}O.use=function(e){y.unshift(e)},O.setFetchHandler=function(e){P=e},O.createNonceMiddleware=function(e){const t=(e,r)=>{const{headers:n={}}=e;for(const o in n)if("x-wp-nonce"===o.toLowerCase()&&n[o]===t.nonce)return r(e);return r({...e,headers:{...n,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t},O.createPreloadingMiddleware=function(e){const t=Object.fromEntries(Object.entries(e).map((e=>{let[t,r]=e;return[(0,o.normalizePath)(t),r]})));return(e,r)=>{const{parse:n=!0}=e;let s=e.path;if(!s&&e.url){const{rest_route:t,...r}=(0,o.getQueryArgs)(e.url);"string"==typeof t&&(s=(0,o.addQueryArgs)(t,r))}if("string"!=typeof s)return r(e);const i=e.method||"GET",c=(0,o.normalizePath)(s);if("GET"===i&&t[c]){const e=t[c];return delete t[c],a(e,!!n)}if("OPTIONS"===i&&t[i]&&t[i][c]){const e=t[i][c];return delete t[i][c],a(e,!!n)}return r(e)}},O.createRootURLMiddleware=e=>(t,r)=>n(t,(t=>{let n,o=t.url,a=t.path;return"string"==typeof a&&(n=e,-1!==e.indexOf("?")&&(a=a.replace("?","&")),a=a.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(a=a.replace("?","&")),o=n+a),r({...t,url:o})})),O.fetchAllMiddleware=d,O.mediaUploadMiddleware=(e,t)=>{if(!function(e){const t=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&t}(e))return t(e);let n=0;const o=e=>(n++,t({path:`/wp/v2/media/${e}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((()=>n<5?o(e):(t({path:`/wp/v2/media/${e}?force=true`,method:"DELETE"}),Promise.reject()))));return t({...e,parse:!1}).catch((t=>{const n=t.headers.get("x-wp-upload-attachment-id");return t.status>=500&&t.status<600&&n?o(n).catch((()=>!1!==e.parse?Promise.reject({code:"post_process",message:(0,r.__)("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t))):w(t,e.parse)})).then((t=>f(t,e.parse)))};var j=O;(window.wp=window.wp||{}).apiFetch=t.default}();
|
2 |
//# sourceMappingURL=index.min.js.map
|
build/api-fetch/index.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"./build/api-fetch/index.min.js","mappings":"yBACA,IAAIA,EAAsB,CCA1B,EAAwB,SAASC,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,SAASM,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,K,2CCA/F,IAAI,EAA+BI,OAAW,GAAQ,KC6BtD,EA1BuC,CAAEC,EAASC,KACjD,IACIC,EAAkBC,EADlBC,EAAOJ,EAAQI,KAmBnB,MAf8B,iBAAtBJ,EAAQK,WACa,iBAArBL,EAAQM,WAEfJ,EAAmBF,EAAQK,UAAUE,QAAS,WAAY,IAC1DJ,EAAkBH,EAAQM,SAASC,QAAS,MAAO,IAElDH,EADID,EACGD,EAAmB,IAAMC,EAEzBD,UAIFF,EAAQK,iBACRL,EAAQM,SAERL,EAAM,IACTD,EACHI,KAAAA,KCzBE,EAA+BL,OAAW,GAAO,IC+DrD,SAASS,EAAiBC,EAAcC,GACvC,OAAOC,QAAQC,QACdF,EACGD,EAAaI,KACb,IAAId,OAAOe,SAAUC,KAAKC,UAAWP,EAAaI,MAAQ,CAC1DI,OAAQ,IACRC,WAAY,KACZC,QAASV,EAAaU,WCrD3B,MAAMC,EAAc,CAAC,EAA4BC,KAA7B,IAAE,KAAEjB,EAAF,IAAQkB,KAAQtB,GAAlB,QAA8C,IAC9DA,EACHsB,IAAKA,IAAOC,EAAAA,EAAAA,cAAcD,EAAKD,GAC/BjB,KAAMA,IAAQmB,EAAAA,EAAAA,cAAcnB,EAAMiB,KAS7BG,EAAkBC,GACvBA,EAASC,KAAOD,EAASC,OAASf,QAAQgB,OAAQF,GAsB7CG,EAAmBH,IACxB,MAAM,KAAExB,GAjBiB4B,CAAAA,IACzB,IAAOA,EACN,MAAO,GAER,MAAMC,EAAQD,EAAWC,MAAO,yBAChC,OAAOA,EACJ,CACA7B,KAAM6B,EAAO,IAEb,IAQcC,CAAiBN,EAASN,QAAQ1B,IAAK,SACxD,OAAOQ,GAyER,MAnD2B+B,MAAQhC,EAASC,KAC3C,IAAuB,IAAlBD,EAAQU,MAEZ,OAAOT,EAAMD,GAEd,IApBuCA,CAAAA,IACvC,MAAMiC,IACFjC,EAAQI,OAAmD,IAA3CJ,EAAQI,KAAK8B,QAAS,eACpCC,IACFnC,EAAQsB,MAAiD,IAA1CtB,EAAQsB,IAAIY,QAAS,eACxC,OAAOD,GAAmBE,GAenBC,CAA+BpC,GAErC,OAAOC,EAAMD,GAId,MAAMyB,QAAiBY,EAAU,IAC7BjB,EAAapB,EAAS,CACxBsC,SAAU,MAGX5B,OAAO,IAGF6B,QAAgBf,EAAeC,GAErC,IAAOe,MAAMC,QAASF,GAErB,OAAOA,EAGR,IAAIG,EAAWd,EAAgBH,GAE/B,IAAOiB,EAEN,OAAOH,EAIR,IAAII,EAAuC,GAAKC,OAAQL,GACxD,KAAQG,GAAW,CAClB,MAAMG,QAAqBR,EAAU,IACjCrC,EAEHI,UAAM0C,EACNxB,IAAKoB,EAELhC,OAAO,IAEFqC,QAAoBvB,EAAeqB,GACzCF,EAAgBA,EAAcC,OAAQG,GACtCL,EAAWd,EAAgBiB,GAE5B,OAAOF,GCvHR,MAAMK,EAAmB,IAAIC,IAAK,CAAE,QAAS,MAAO,WAY9CC,EAAiB,MCJjB1B,EAAgB,SAAEC,GAA0C,IAAhC0B,IAAgC,yDACjE,OAAKA,EACqB,MAApB1B,EAASR,OACN,KAGDQ,EAASC,KAAOD,EAASC,OAASf,QAAQgB,OAAQF,GAGnDA,GAUF2B,EAA+B3B,IACpC,MAAM4B,EAAmB,CACxBC,KAAM,eACNC,SAASC,EAAAA,EAAAA,IAAI,+CAGd,IAAO/B,IAAcA,EAASC,KAC7B,MAAM2B,EAGP,OAAO5B,EAASC,OAAO+B,OAAO,KAC7B,MAAMJ,MAYKK,EAAiC,SAC7CjC,GAEI,IADJ0B,IACI,yDACJ,OAAOxC,QAAQC,QACdY,EAAeC,EAAU0B,IACxBM,OAASE,GAASC,EAAoBD,EAAKR,MAUvC,SAASS,EAAoBnC,GAAuC,IAA7B0B,IAA6B,yDAC1E,IAAOA,EACN,MAAM1B,EAGP,OAAO2B,EAA4B3B,GAAWoC,MAAQC,IACrD,MAAMC,EAAe,CACpBT,KAAM,gBACNC,SAASC,EAAAA,EAAAA,IAAI,+BAGd,MAAMM,GAASC,KCvDjB,MAAMC,EAAkB,CAKvBC,OAAQ,+BASHC,EAAkB,CACvBC,YAAa,WASRC,EAAc,CC3CS,CAAEpE,EAASC,KAEf,iBAAhBD,EAAQsB,MACb+C,EAAAA,EAAAA,aAAarE,EAAQsB,IAAK,aAE5BtB,EAAQsB,KAAMC,EAAAA,EAAAA,cAAcvB,EAAQsB,IAAK,CAAEgD,QAAS,UAI5B,iBAAjBtE,EAAQI,OACbiE,EAAAA,EAAAA,aAAarE,EAAQI,KAAM,aAE7BJ,EAAQI,MAAOmB,EAAAA,EAAAA,cAAcvB,EAAQI,KAAM,CAAEkE,QAAS,UAGhDrE,EAAMD,ID8BbuE,EF5BwB,CAAEvE,EAASC,KACnC,MAAM,OAAEuE,EAAStB,GAAmBlD,EAapC,OAZKgD,EAAiByB,IAAKD,EAAOE,iBACjC1E,EAAU,IACNA,EACHmB,QAAS,IACLnB,EAAQmB,QACX,yBAA0BqD,EAC1B,eAAgB,oBAEjBA,OAAQ,SAIHvE,EAAMD,IEgBb2E,GAmBKC,EAAgBnD,IACrB,GAAKA,EAASR,QAAU,KAAOQ,EAASR,OAAS,IAChD,OAAOQ,EAGR,MAAMA,GAyDP,IAAIoD,EAjD0BC,IAC7B,MAAM,IAAExD,EAAF,KAAOlB,EAAP,KAAa2E,EAAb,MAAmBrE,GAAQ,KAASsE,GAAqBF,EAC/D,IAAI,KAAEjE,EAAF,QAAQM,GAAY2D,EAsBxB,OAnBA3D,EAAU,IAAK6C,KAAoB7C,GAG9B4D,IACJlE,EAAOE,KAAKC,UAAW+D,GACvB5D,EAAS,gBAAmB,oBAGLpB,OAAOkF,MAE9B3D,GAAOlB,GAAQL,OAAOmF,SAASC,KAC/B,IACIjB,KACAc,EACHnE,KAAAA,EACAM,QAAAA,IAIqB0C,MACpBuB,GACDzE,QAAQC,QAASwE,GACfvB,KAAMe,GACNnB,OAAShC,GAAcmC,EAAoBnC,EAAUf,KACrDmD,MAAQpC,GACRiC,EAAgCjC,EAAUf,OAE3C2E,IAED,GAAKA,GAAoB,eAAbA,EAAIC,KACf,MAAMD,EAKP,KAAM,CACL/B,KAAM,cACNC,SAASC,EAAAA,EAAAA,IAAI,kCAwBjB,SAASnB,EAAUrC,GAalB,OAPwBoE,EAAYmB,aAAa,CACpBtF,EAC5BuF,IAESC,GAAoBD,EAAYC,EAAgBxF,IACvD4E,EAEIa,CAAiB1F,GAAUyD,OAASK,GACtB,8BAAfA,EAAMR,KACH3C,QAAQgB,OAAQmC,GAKvB/D,OAEEkF,MAAO5C,EAASsD,eAChB9B,KAAMe,GACNf,MAAQkB,GAAUA,EAAKa,SACvB/B,MAAQ+B,IAERvD,EAASwD,gBAAgBC,MAAQF,EAC1BvD,EAAUrC,QAMtBqC,EAAS0D,IA5HT,SAA6BP,GAC5BpB,EAAY4B,QAASR,IA4HtBnD,EAAS4D,gBA5CT,SAA0BC,GACzBrB,EAAeqB,GA6ChB7D,EAAS8D,sBE1LT,SAAgCL,GAI/B,MAAMN,EAAa,CAAExF,EAASC,KAC7B,MAAM,QAAEkB,EAAU,IAAOnB,EAIzB,IAAM,MAAMoG,KAAcjF,EACzB,GAC8B,eAA7BiF,EAAWC,eACXlF,EAASiF,KAAiBZ,EAAWM,MAErC,OAAO7F,EAAMD,GAIf,OAAOC,EAAM,IACTD,EACHmB,QAAS,IACLA,EACH,aAAcqE,EAAWM,UAO5B,OAFAN,EAAWM,MAAQA,EAEZN,GF8JRnD,EAASiE,2BJtLT,SAAqCC,GACpC,MAAMC,EAAQlH,OAAOmH,KAAMF,GAAgBG,QAAQ,CAAEC,EAAQvG,KAC5DuG,GAAQC,EAAAA,EAAAA,eAAexG,IAAWmG,EAAenG,GAC1CuG,IACgC,IAExC,MAAO,CAAE3G,EAASC,KACjB,MAAM,MAAES,GAAQ,GAASV,EAEzB,IAAI6G,EAAU7G,EAAQI,KACtB,IAAOyG,GAAW7G,EAAQsB,IAAM,CAC/B,MAAMwF,GAAgBC,EAAAA,EAAAA,aAAa/G,EAAQsB,IAAK,cAClB,iBAAlBwF,IACXD,EAAUC,GAGZ,GAAwB,iBAAZD,EACX,OAAO5G,EAAMD,GAGd,MAAMwE,EAASxE,EAAQwE,QAAU,MAC3BpE,GAAOwG,EAAAA,EAAAA,eAAeC,GAE5B,GAAK,QAAUrC,GAAUgC,EAAOpG,GAAS,CACxC,MAAM4G,EAAYR,EAAOpG,GAKzB,cAFOoG,EAAOpG,GAEPI,EAAiBwG,IAActG,GAChC,GACN,YAAc8D,GACdgC,EAAOhC,IACPgC,EAAOhC,GAAUpE,GAChB,CACD,MAAM4G,EAAYR,EAAOhC,GAAUpE,GAKnC,cAFOoG,EAAOhC,GAAUpE,GAEjBI,EAAiBwG,IAActG,GAGvC,OAAOT,EAAMD,KI4IfqC,EAAS4E,wBGvLyBC,GAAa,CAAElH,EAASC,IAClDkH,EAAgCnH,GAAWoH,IACjD,IAEIC,EAFA/F,EAAM8F,EAAgB9F,IACtBlB,EAAOgH,EAAgBhH,KAwB3B,MArBqB,iBAATA,IACXiH,EAAUH,GAEJ,IAAMA,EAAQhF,QAAS,OAC5B9B,EAAOA,EAAKG,QAAS,IAAK,MAG3BH,EAAOA,EAAKG,QAAS,MAAO,IAK3B,iBAAoB8G,IACnB,IAAMA,EAAQnF,QAAS,OAExB9B,EAAOA,EAAKG,QAAS,IAAK,MAG3Be,EAAM+F,EAAUjH,GAGVH,EAAM,IACTmH,EACH9F,IAAAA,OH2JHe,EAASsC,mBAAqBA,EAC9BtC,EAASiF,sBInKqB,CAAEtH,EAASC,KACxC,IAfD,SAA+BD,GAC9B,MAAMuH,IAAoBvH,EAAQwE,QAA6B,SAAnBxE,EAAQwE,OAKpD,SAHMxE,EAAQI,OAAoD,IAA5CJ,EAAQI,KAAK8B,QAAS,mBACtClC,EAAQsB,MAAkD,IAA3CtB,EAAQsB,IAAIY,QAAS,kBAEhBqF,EASnBC,CAAsBxH,GAC5B,OAAOC,EAAMD,GAGd,IAAIyH,EAAU,EACd,MAMMC,EAAgBC,IACrBF,IACOxH,EAAM,CACZG,KAAO,gBAAgBuH,iBACvBnD,OAAQ,OACRO,KAAM,CAAE6C,OAAQ,yBAChBlH,OAAO,IACJ+C,OAAO,IACLgE,EAdY,EAeTC,EAAaC,IAErB1H,EAAM,CACLG,KAAO,gBAAgBuH,eACvBnD,OAAQ,WAGF7D,QAAQgB,aAIjB,OAAO1B,EAAM,IAAKD,EAASU,OAAO,IAChC+C,OAAShC,IACT,MAAMkG,EAAelG,EAASN,QAAQ1B,IACrC,6BAED,OACCgC,EAASR,QAAU,KACnBQ,EAASR,OAAS,KAClB0G,EAEOD,EAAaC,GAAelE,OAAO,KAClB,IAAlBzD,EAAQU,MACLC,QAAQgB,OAAQ,CACtB2B,KAAM,eACNC,SAASC,EAAAA,EAAAA,IACR,mGAKI7C,QAAQgB,OAAQF,KAGlBmC,EAAoBnC,EAAUzB,EAAQU,UAE7CmD,MAAQpC,GACRiC,EAAgCjC,EAAUzB,EAAQU,UJ2GrD,S","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/external window [\"wp\",\"i18n\"]","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/namespace-endpoint.js","webpack://wp/external window [\"wp\",\"url\"]","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/preloading.js","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/fetch-all-middleware.js","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/http-v1.js","webpack://wp/./packages/api-fetch/build-module/utils/@wordpress/api-fetch/src/utils/response.js","webpack://wp/./packages/api-fetch/build-module/@wordpress/api-fetch/src/index.js","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/user-locale.js","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/nonce.js","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/root-url.js","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/media-upload.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","/**\n * @type {import('../types').APIFetchMiddleware}\n */\nconst namespaceAndEndpointMiddleware = ( options, next ) => {\n\tlet path = options.path;\n\tlet namespaceTrimmed, endpointTrimmed;\n\n\tif (\n\t\ttypeof options.namespace === 'string' &&\n\t\ttypeof options.endpoint === 'string'\n\t) {\n\t\tnamespaceTrimmed = options.namespace.replace( /^\\/|\\/$/g, '' );\n\t\tendpointTrimmed = options.endpoint.replace( /^\\//, '' );\n\t\tif ( endpointTrimmed ) {\n\t\t\tpath = namespaceTrimmed + '/' + endpointTrimmed;\n\t\t} else {\n\t\t\tpath = namespaceTrimmed;\n\t\t}\n\t}\n\n\tdelete options.namespace;\n\tdelete options.endpoint;\n\n\treturn next( {\n\t\t...options,\n\t\tpath,\n\t} );\n};\n\nexport default namespaceAndEndpointMiddleware;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress dependencies\n */\nimport { getQueryArg, normalizePath } from '@wordpress/url';\n\n/**\n * @param {Record<string, any>} preloadedData\n * @return {import('../types').APIFetchMiddleware} Preloading middleware.\n */\nfunction createPreloadingMiddleware( preloadedData ) {\n\tconst cache = Object.keys( preloadedData ).reduce( ( result, path ) => {\n\t\tresult[ normalizePath( path ) ] = preloadedData[ path ];\n\t\treturn result;\n\t}, /** @type {Record<string, any>} */ ( {} ) );\n\n\treturn ( options, next ) => {\n\t\tconst { parse = true } = options;\n\t\t/** @type {string | void} */\n\t\tlet rawPath = options.path;\n\t\tif ( ! rawPath && options.url ) {\n\t\t\tconst pathFromQuery = getQueryArg( options.url, 'rest_route' );\n\t\t\tif ( typeof pathFromQuery === 'string' ) {\n\t\t\t\trawPath = pathFromQuery;\n\t\t\t}\n\t\t}\n\t\tif ( typeof rawPath !== 'string' ) {\n\t\t\treturn next( options );\n\t\t}\n\n\t\tconst method = options.method || 'GET';\n\t\tconst path = normalizePath( rawPath );\n\n\t\tif ( 'GET' === method && cache[ path ] ) {\n\t\t\tconst cacheData = cache[ path ];\n\n\t\t\t// Unsetting the cache key ensures that the data is only used a single time\n\t\t\tdelete cache[ path ];\n\n\t\t\treturn prepareResponse( cacheData, !! parse );\n\t\t} else if (\n\t\t\t'OPTIONS' === method &&\n\t\t\tcache[ method ] &&\n\t\t\tcache[ method ][ path ]\n\t\t) {\n\t\t\tconst cacheData = cache[ method ][ path ];\n\n\t\t\t// Unsetting the cache key ensures that the data is only used a single time\n\t\t\tdelete cache[ method ][ path ];\n\n\t\t\treturn prepareResponse( cacheData, !! parse );\n\t\t}\n\n\t\treturn next( options );\n\t};\n}\n\n/**\n * This is a helper function that sends a success response.\n *\n * @param {Record<string, any>} responseData\n * @param {boolean} parse\n * @return {Promise<any>} Promise with the response.\n */\nfunction prepareResponse( responseData, parse ) {\n\treturn Promise.resolve(\n\t\tparse\n\t\t\t? responseData.body\n\t\t\t: new window.Response( JSON.stringify( responseData.body ), {\n\t\t\t\t\tstatus: 200,\n\t\t\t\t\tstatusText: 'OK',\n\t\t\t\t\theaders: responseData.headers,\n\t\t\t } )\n\t);\n}\n\nexport default createPreloadingMiddleware;\n","/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport apiFetch from '..';\n\n/**\n * Apply query arguments to both URL and Path, whichever is present.\n *\n * @param {import('../types').APIFetchOptions} props\n * @param {Record<string, string | number>} queryArgs\n * @return {import('../types').APIFetchOptions} The request with the modified query args\n */\nconst modifyQuery = ( { path, url, ...options }, queryArgs ) => ( {\n\t...options,\n\turl: url && addQueryArgs( url, queryArgs ),\n\tpath: path && addQueryArgs( path, queryArgs ),\n} );\n\n/**\n * Duplicates parsing functionality from apiFetch.\n *\n * @param {Response} response\n * @return {Promise<any>} Parsed response json.\n */\nconst parseResponse = ( response ) =>\n\tresponse.json ? response.json() : Promise.reject( response );\n\n/**\n * @param {string | null} linkHeader\n * @return {{ next?: string }} The parsed link header.\n */\nconst parseLinkHeader = ( linkHeader ) => {\n\tif ( ! linkHeader ) {\n\t\treturn {};\n\t}\n\tconst match = linkHeader.match( /<([^>]+)>; rel=\"next\"/ );\n\treturn match\n\t\t? {\n\t\t\t\tnext: match[ 1 ],\n\t\t }\n\t\t: {};\n};\n\n/**\n * @param {Response} response\n * @return {string | undefined} The next page URL.\n */\nconst getNextPageUrl = ( response ) => {\n\tconst { next } = parseLinkHeader( response.headers.get( 'link' ) );\n\treturn next;\n};\n\n/**\n * @param {import('../types').APIFetchOptions} options\n * @return {boolean} True if the request contains an unbounded query.\n */\nconst requestContainsUnboundedQuery = ( options ) => {\n\tconst pathIsUnbounded =\n\t\t!! options.path && options.path.indexOf( 'per_page=-1' ) !== -1;\n\tconst urlIsUnbounded =\n\t\t!! options.url && options.url.indexOf( 'per_page=-1' ) !== -1;\n\treturn pathIsUnbounded || urlIsUnbounded;\n};\n\n/**\n * The REST API enforces an upper limit on the per_page option. To handle large\n * collections, apiFetch consumers can pass `per_page=-1`; this middleware will\n * then recursively assemble a full response array from all available pages.\n *\n * @type {import('../types').APIFetchMiddleware}\n */\nconst fetchAllMiddleware = async ( options, next ) => {\n\tif ( options.parse === false ) {\n\t\t// If a consumer has opted out of parsing, do not apply middleware.\n\t\treturn next( options );\n\t}\n\tif ( ! requestContainsUnboundedQuery( options ) ) {\n\t\t// If neither url nor path is requesting all items, do not apply middleware.\n\t\treturn next( options );\n\t}\n\n\t// Retrieve requested page of results.\n\tconst response = await apiFetch( {\n\t\t...modifyQuery( options, {\n\t\t\tper_page: 100,\n\t\t} ),\n\t\t// Ensure headers are returned for page 1.\n\t\tparse: false,\n\t} );\n\n\tconst results = await parseResponse( response );\n\n\tif ( ! Array.isArray( results ) ) {\n\t\t// We have no reliable way of merging non-array results.\n\t\treturn results;\n\t}\n\n\tlet nextPage = getNextPageUrl( response );\n\n\tif ( ! nextPage ) {\n\t\t// There are no further pages to request.\n\t\treturn results;\n\t}\n\n\t// Iteratively fetch all remaining pages until no \"next\" header is found.\n\tlet mergedResults = /** @type {any[]} */ ( [] ).concat( results );\n\twhile ( nextPage ) {\n\t\tconst nextResponse = await apiFetch( {\n\t\t\t...options,\n\t\t\t// Ensure the URL for the next page is used instead of any provided path.\n\t\t\tpath: undefined,\n\t\t\turl: nextPage,\n\t\t\t// Ensure we still get headers so we can identify the next page.\n\t\t\tparse: false,\n\t\t} );\n\t\tconst nextResults = await parseResponse( nextResponse );\n\t\tmergedResults = mergedResults.concat( nextResults );\n\t\tnextPage = getNextPageUrl( nextResponse );\n\t}\n\treturn mergedResults;\n};\n\nexport default fetchAllMiddleware;\n","/**\n * Set of HTTP methods which are eligible to be overridden.\n *\n * @type {Set<string>}\n */\nconst OVERRIDE_METHODS = new Set( [ 'PATCH', 'PUT', 'DELETE' ] );\n\n/**\n * Default request method.\n *\n * \"A request has an associated method (a method). Unless stated otherwise it\n * is `GET`.\"\n *\n * @see https://fetch.spec.whatwg.org/#requests\n *\n * @type {string}\n */\nconst DEFAULT_METHOD = 'GET';\n\n/**\n * API Fetch middleware which overrides the request method for HTTP v1\n * compatibility leveraging the REST API X-HTTP-Method-Override header.\n *\n * @type {import('../types').APIFetchMiddleware}\n */\nconst httpV1Middleware = ( options, next ) => {\n\tconst { method = DEFAULT_METHOD } = options;\n\tif ( OVERRIDE_METHODS.has( method.toUpperCase() ) ) {\n\t\toptions = {\n\t\t\t...options,\n\t\t\theaders: {\n\t\t\t\t...options.headers,\n\t\t\t\t'X-HTTP-Method-Override': method,\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t};\n\t}\n\n\treturn next( options );\n};\n\nexport default httpV1Middleware;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Parses the apiFetch response.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n *\n * @return {Promise<any> | null | Response} Parsed response.\n */\nconst parseResponse = ( response, shouldParseResponse = true ) => {\n\tif ( shouldParseResponse ) {\n\t\tif ( response.status === 204 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn response.json ? response.json() : Promise.reject( response );\n\t}\n\n\treturn response;\n};\n\n/**\n * Calls the `json` function on the Response, throwing an error if the response\n * doesn't have a json function or if parsing the json itself fails.\n *\n * @param {Response} response\n * @return {Promise<any>} Parsed response.\n */\nconst parseJsonAndNormalizeError = ( response ) => {\n\tconst invalidJsonError = {\n\t\tcode: 'invalid_json',\n\t\tmessage: __( 'The response is not a valid JSON response.' ),\n\t};\n\n\tif ( ! response || ! response.json ) {\n\t\tthrow invalidJsonError;\n\t}\n\n\treturn response.json().catch( () => {\n\t\tthrow invalidJsonError;\n\t} );\n};\n\n/**\n * Parses the apiFetch response properly and normalize response errors.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n *\n * @return {Promise<any>} Parsed response.\n */\nexport const parseResponseAndNormalizeError = (\n\tresponse,\n\tshouldParseResponse = true\n) => {\n\treturn Promise.resolve(\n\t\tparseResponse( response, shouldParseResponse )\n\t).catch( ( res ) => parseAndThrowError( res, shouldParseResponse ) );\n};\n\n/**\n * Parses a response, throwing an error if parsing the response fails.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n * @return {Promise<any>} Parsed response.\n */\nexport function parseAndThrowError( response, shouldParseResponse = true ) {\n\tif ( ! shouldParseResponse ) {\n\t\tthrow response;\n\t}\n\n\treturn parseJsonAndNormalizeError( response ).then( ( error ) => {\n\t\tconst unknownError = {\n\t\t\tcode: 'unknown_error',\n\t\t\tmessage: __( 'An unknown error occurred.' ),\n\t\t};\n\n\t\tthrow error || unknownError;\n\t} );\n}\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport createNonceMiddleware from './middlewares/nonce';\nimport createRootURLMiddleware from './middlewares/root-url';\nimport createPreloadingMiddleware from './middlewares/preloading';\nimport fetchAllMiddleware from './middlewares/fetch-all-middleware';\nimport namespaceEndpointMiddleware from './middlewares/namespace-endpoint';\nimport httpV1Middleware from './middlewares/http-v1';\nimport userLocaleMiddleware from './middlewares/user-locale';\nimport mediaUploadMiddleware from './middlewares/media-upload';\nimport {\n\tparseResponseAndNormalizeError,\n\tparseAndThrowError,\n} from './utils/response';\n\n/**\n * Default set of header values which should be sent with every request unless\n * explicitly provided through apiFetch options.\n *\n * @type {Record<string, string>}\n */\nconst DEFAULT_HEADERS = {\n\t// The backend uses the Accept header as a condition for considering an\n\t// incoming request as a REST request.\n\t//\n\t// See: https://core.trac.wordpress.org/ticket/44534\n\tAccept: 'application/json, */*;q=0.1',\n};\n\n/**\n * Default set of fetch option values which should be sent with every request\n * unless explicitly provided through apiFetch options.\n *\n * @type {Object}\n */\nconst DEFAULT_OPTIONS = {\n\tcredentials: 'include',\n};\n\n/** @typedef {import('./types').APIFetchMiddleware} APIFetchMiddleware */\n/** @typedef {import('./types').APIFetchOptions} APIFetchOptions */\n\n/**\n * @type {import('./types').APIFetchMiddleware[]}\n */\nconst middlewares = [\n\tuserLocaleMiddleware,\n\tnamespaceEndpointMiddleware,\n\thttpV1Middleware,\n\tfetchAllMiddleware,\n];\n\n/**\n * Register a middleware\n *\n * @param {import('./types').APIFetchMiddleware} middleware\n */\nfunction registerMiddleware( middleware ) {\n\tmiddlewares.unshift( middleware );\n}\n\n/**\n * Checks the status of a response, throwing the Response as an error if\n * it is outside the 200 range.\n *\n * @param {Response} response\n * @return {Response} The response if the status is in the 200 range.\n */\nconst checkStatus = ( response ) => {\n\tif ( response.status >= 200 && response.status < 300 ) {\n\t\treturn response;\n\t}\n\n\tthrow response;\n};\n\n/** @typedef {(options: import('./types').APIFetchOptions) => Promise<any>} FetchHandler*/\n\n/**\n * @type {FetchHandler}\n */\nconst defaultFetchHandler = ( nextOptions ) => {\n\tconst { url, path, data, parse = true, ...remainingOptions } = nextOptions;\n\tlet { body, headers } = nextOptions;\n\n\t// Merge explicitly-provided headers with default values.\n\theaders = { ...DEFAULT_HEADERS, ...headers };\n\n\t// The `data` property is a shorthand for sending a JSON body.\n\tif ( data ) {\n\t\tbody = JSON.stringify( data );\n\t\theaders[ 'Content-Type' ] = 'application/json';\n\t}\n\n\tconst responsePromise = window.fetch(\n\t\t// fall back to explicitly passing `window.location` which is the behavior if `undefined` is passed\n\t\turl || path || window.location.href,\n\t\t{\n\t\t\t...DEFAULT_OPTIONS,\n\t\t\t...remainingOptions,\n\t\t\tbody,\n\t\t\theaders,\n\t\t}\n\t);\n\n\treturn responsePromise.then(\n\t\t( value ) =>\n\t\t\tPromise.resolve( value )\n\t\t\t\t.then( checkStatus )\n\t\t\t\t.catch( ( response ) => parseAndThrowError( response, parse ) )\n\t\t\t\t.then( ( response ) =>\n\t\t\t\t\tparseResponseAndNormalizeError( response, parse )\n\t\t\t\t),\n\t\t( err ) => {\n\t\t\t// Re-throw AbortError for the users to handle it themselves.\n\t\t\tif ( err && err.name === 'AbortError' ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\t// Otherwise, there is most likely no network connection.\n\t\t\t// Unfortunately the message might depend on the browser.\n\t\t\tthrow {\n\t\t\t\tcode: 'fetch_error',\n\t\t\t\tmessage: __( 'You are probably offline.' ),\n\t\t\t};\n\t\t}\n\t);\n};\n\n/** @type {FetchHandler} */\nlet fetchHandler = defaultFetchHandler;\n\n/**\n * Defines a custom fetch handler for making the requests that will override\n * the default one using window.fetch\n *\n * @param {FetchHandler} newFetchHandler The new fetch handler\n */\nfunction setFetchHandler( newFetchHandler ) {\n\tfetchHandler = newFetchHandler;\n}\n\n/**\n * @template T\n * @param {import('./types').APIFetchOptions} options\n * @return {Promise<T>} A promise representing the request processed via the registered middlewares.\n */\nfunction apiFetch( options ) {\n\t// creates a nested function chain that calls all middlewares and finally the `fetchHandler`,\n\t// converting `middlewares = [ m1, m2, m3 ]` into:\n\t// ```\n\t// opts1 => m1( opts1, opts2 => m2( opts2, opts3 => m3( opts3, fetchHandler ) ) );\n\t// ```\n\tconst enhancedHandler = middlewares.reduceRight( (\n\t\t/** @type {FetchHandler} */ next,\n\t\tmiddleware\n\t) => {\n\t\treturn ( workingOptions ) => middleware( workingOptions, next );\n\t}, fetchHandler );\n\n\treturn enhancedHandler( options ).catch( ( error ) => {\n\t\tif ( error.code !== 'rest_cookie_invalid_nonce' ) {\n\t\t\treturn Promise.reject( error );\n\t\t}\n\n\t\t// If the nonce is invalid, refresh it and try again.\n\t\treturn (\n\t\t\twindow\n\t\t\t\t// @ts-ignore\n\t\t\t\t.fetch( apiFetch.nonceEndpoint )\n\t\t\t\t.then( checkStatus )\n\t\t\t\t.then( ( data ) => data.text() )\n\t\t\t\t.then( ( text ) => {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tapiFetch.nonceMiddleware.nonce = text;\n\t\t\t\t\treturn apiFetch( options );\n\t\t\t\t} )\n\t\t);\n\t} );\n}\n\napiFetch.use = registerMiddleware;\napiFetch.setFetchHandler = setFetchHandler;\n\napiFetch.createNonceMiddleware = createNonceMiddleware;\napiFetch.createPreloadingMiddleware = createPreloadingMiddleware;\napiFetch.createRootURLMiddleware = createRootURLMiddleware;\napiFetch.fetchAllMiddleware = fetchAllMiddleware;\napiFetch.mediaUploadMiddleware = mediaUploadMiddleware;\n\nexport default apiFetch;\n","/**\n * WordPress dependencies\n */\nimport { addQueryArgs, hasQueryArg } from '@wordpress/url';\n\n/**\n * @type {import('../types').APIFetchMiddleware}\n */\nconst userLocaleMiddleware = ( options, next ) => {\n\tif (\n\t\ttypeof options.url === 'string' &&\n\t\t! hasQueryArg( options.url, '_locale' )\n\t) {\n\t\toptions.url = addQueryArgs( options.url, { _locale: 'user' } );\n\t}\n\n\tif (\n\t\ttypeof options.path === 'string' &&\n\t\t! hasQueryArg( options.path, '_locale' )\n\t) {\n\t\toptions.path = addQueryArgs( options.path, { _locale: 'user' } );\n\t}\n\n\treturn next( options );\n};\n\nexport default userLocaleMiddleware;\n","/**\n * @param {string} nonce\n * @return {import('../types').APIFetchMiddleware & { nonce: string }} A middleware to enhance a request with a nonce.\n */\nfunction createNonceMiddleware( nonce ) {\n\t/**\n\t * @type {import('../types').APIFetchMiddleware & { nonce: string }}\n\t */\n\tconst middleware = ( options, next ) => {\n\t\tconst { headers = {} } = options;\n\n\t\t// If an 'X-WP-Nonce' header (or any case-insensitive variation\n\t\t// thereof) was specified, no need to add a nonce header.\n\t\tfor ( const headerName in headers ) {\n\t\t\tif (\n\t\t\t\theaderName.toLowerCase() === 'x-wp-nonce' &&\n\t\t\t\theaders[ headerName ] === middleware.nonce\n\t\t\t) {\n\t\t\t\treturn next( options );\n\t\t\t}\n\t\t}\n\n\t\treturn next( {\n\t\t\t...options,\n\t\t\theaders: {\n\t\t\t\t...headers,\n\t\t\t\t'X-WP-Nonce': middleware.nonce,\n\t\t\t},\n\t\t} );\n\t};\n\n\tmiddleware.nonce = nonce;\n\n\treturn middleware;\n}\n\nexport default createNonceMiddleware;\n","/**\n * Internal dependencies\n */\nimport namespaceAndEndpointMiddleware from './namespace-endpoint';\n\n/**\n * @param {string} rootURL\n * @return {import('../types').APIFetchMiddleware} Root URL middleware.\n */\nconst createRootURLMiddleware = ( rootURL ) => ( options, next ) => {\n\treturn namespaceAndEndpointMiddleware( options, ( optionsWithPath ) => {\n\t\tlet url = optionsWithPath.url;\n\t\tlet path = optionsWithPath.path;\n\t\tlet apiRoot;\n\n\t\tif ( typeof path === 'string' ) {\n\t\t\tapiRoot = rootURL;\n\n\t\t\tif ( -1 !== rootURL.indexOf( '?' ) ) {\n\t\t\t\tpath = path.replace( '?', '&' );\n\t\t\t}\n\n\t\t\tpath = path.replace( /^\\//, '' );\n\n\t\t\t// API root may already include query parameter prefix if site is\n\t\t\t// configured to use plain permalinks.\n\t\t\tif (\n\t\t\t\t'string' === typeof apiRoot &&\n\t\t\t\t-1 !== apiRoot.indexOf( '?' )\n\t\t\t) {\n\t\t\t\tpath = path.replace( '?', '&' );\n\t\t\t}\n\n\t\t\turl = apiRoot + path;\n\t\t}\n\n\t\treturn next( {\n\t\t\t...optionsWithPath,\n\t\t\turl,\n\t\t} );\n\t} );\n};\n\nexport default createRootURLMiddleware;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tparseAndThrowError,\n\tparseResponseAndNormalizeError,\n} from '../utils/response';\n\n/**\n * @param {import('../types').APIFetchOptions} options\n * @return {boolean} True if the request is for media upload.\n */\nfunction isMediaUploadRequest( options ) {\n\tconst isCreateMethod = !! options.method && options.method === 'POST';\n\tconst isMediaEndpoint =\n\t\t( !! options.path && options.path.indexOf( '/wp/v2/media' ) !== -1 ) ||\n\t\t( !! options.url && options.url.indexOf( '/wp/v2/media' ) !== -1 );\n\n\treturn isMediaEndpoint && isCreateMethod;\n}\n\n/**\n * Middleware handling media upload failures and retries.\n *\n * @type {import('../types').APIFetchMiddleware}\n */\nconst mediaUploadMiddleware = ( options, next ) => {\n\tif ( ! isMediaUploadRequest( options ) ) {\n\t\treturn next( options );\n\t}\n\n\tlet retries = 0;\n\tconst maxRetries = 5;\n\n\t/**\n\t * @param {string} attachmentId\n\t * @return {Promise<any>} Processed post response.\n\t */\n\tconst postProcess = ( attachmentId ) => {\n\t\tretries++;\n\t\treturn next( {\n\t\t\tpath: `/wp/v2/media/${ attachmentId }/post-process`,\n\t\t\tmethod: 'POST',\n\t\t\tdata: { action: 'create-image-subsizes' },\n\t\t\tparse: false,\n\t\t} ).catch( () => {\n\t\t\tif ( retries < maxRetries ) {\n\t\t\t\treturn postProcess( attachmentId );\n\t\t\t}\n\t\t\tnext( {\n\t\t\t\tpath: `/wp/v2/media/${ attachmentId }?force=true`,\n\t\t\t\tmethod: 'DELETE',\n\t\t\t} );\n\n\t\t\treturn Promise.reject();\n\t\t} );\n\t};\n\n\treturn next( { ...options, parse: false } )\n\t\t.catch( ( response ) => {\n\t\t\tconst attachmentId = response.headers.get(\n\t\t\t\t'x-wp-upload-attachment-id'\n\t\t\t);\n\t\t\tif (\n\t\t\t\tresponse.status >= 500 &&\n\t\t\t\tresponse.status < 600 &&\n\t\t\t\tattachmentId\n\t\t\t) {\n\t\t\t\treturn postProcess( attachmentId ).catch( () => {\n\t\t\t\t\tif ( options.parse !== false ) {\n\t\t\t\t\t\treturn Promise.reject( {\n\t\t\t\t\t\t\tcode: 'post_process',\n\t\t\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t\t\t'Media upload failed. If this is a photo or a large image, please scale it down and try again.'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Promise.reject( response );\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn parseAndThrowError( response, options.parse );\n\t\t} )\n\t\t.then( ( response ) =>\n\t\t\tparseResponseAndNormalizeError( response, options.parse )\n\t\t);\n};\n\nexport default mediaUploadMiddleware;\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","window","options","next","namespaceTrimmed","endpointTrimmed","path","namespace","endpoint","replace","prepareResponse","responseData","parse","Promise","resolve","body","Response","JSON","stringify","status","statusText","headers","modifyQuery","queryArgs","url","addQueryArgs","parseResponse","response","json","reject","getNextPageUrl","linkHeader","match","parseLinkHeader","async","pathIsUnbounded","indexOf","urlIsUnbounded","requestContainsUnboundedQuery","apiFetch","per_page","results","Array","isArray","nextPage","mergedResults","concat","nextResponse","undefined","nextResults","OVERRIDE_METHODS","Set","DEFAULT_METHOD","shouldParseResponse","parseJsonAndNormalizeError","invalidJsonError","code","message","__","catch","parseResponseAndNormalizeError","res","parseAndThrowError","then","error","unknownError","DEFAULT_HEADERS","Accept","DEFAULT_OPTIONS","credentials","middlewares","hasQueryArg","_locale","namespaceEndpointMiddleware","method","has","toUpperCase","fetchAllMiddleware","checkStatus","fetchHandler","nextOptions","data","remainingOptions","fetch","location","href","value","err","name","reduceRight","middleware","workingOptions","enhancedHandler","nonceEndpoint","text","nonceMiddleware","nonce","use","unshift","setFetchHandler","newFetchHandler","createNonceMiddleware","headerName","toLowerCase","createPreloadingMiddleware","preloadedData","cache","keys","reduce","result","normalizePath","rawPath","pathFromQuery","getQueryArg","cacheData","createRootURLMiddleware","rootURL","namespaceAndEndpointMiddleware","optionsWithPath","apiRoot","mediaUploadMiddleware","isCreateMethod","isMediaUploadRequest","retries","postProcess","attachmentId","action"],"sourceRoot":""}
|
1 |
+
{"version":3,"file":"./build/api-fetch/index.min.js","mappings":"yBACA,IAAIA,EAAsB,CCA1B,EAAwB,SAASC,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,SAASM,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,K,2CCA/F,IAAI,EAA+BI,OAAW,GAAQ,KC6BtD,EA1BuC,CAAEC,EAASC,KACjD,IACIC,EAAkBC,EADlBC,EAAOJ,EAAQI,KAmBnB,MAf8B,iBAAtBJ,EAAQK,WACa,iBAArBL,EAAQM,WAEfJ,EAAmBF,EAAQK,UAAUE,QAAS,WAAY,IAC1DJ,EAAkBH,EAAQM,SAASC,QAAS,MAAO,IAElDH,EADID,EACGD,EAAmB,IAAMC,EAEzBD,UAIFF,EAAQK,iBACRL,EAAQM,SAERL,EAAM,IACTD,EACHI,KAAAA,KCzBE,EAA+BL,OAAW,GAAO,ICqErD,SAASS,EAAiBC,EAAcC,GACvC,OAAOC,QAAQC,QACdF,EACGD,EAAaI,KACb,IAAId,OAAOe,SAAUC,KAAKC,UAAWP,EAAaI,MAAQ,CAC1DI,OAAQ,IACRC,WAAY,KACZC,QAASV,EAAaU,WC3D3B,MAAMC,EAAc,CAAC,EAA4BC,KAA7B,IAAE,KAAEjB,EAAF,IAAQkB,KAAQtB,GAAlB,QAA8C,IAC9DA,EACHsB,IAAKA,IAAOC,EAAAA,EAAAA,cAAcD,EAAKD,GAC/BjB,KAAMA,IAAQmB,EAAAA,EAAAA,cAAcnB,EAAMiB,KAS7BG,EAAkBC,GACvBA,EAASC,KAAOD,EAASC,OAASf,QAAQgB,OAAQF,GAsB7CG,EAAmBH,IACxB,MAAM,KAAExB,GAjBiB4B,CAAAA,IACzB,IAAOA,EACN,MAAO,GAER,MAAMC,EAAQD,EAAWC,MAAO,yBAChC,OAAOA,EACJ,CACA7B,KAAM6B,EAAO,IAEb,IAQcC,CAAiBN,EAASN,QAAQ1B,IAAK,SACxD,OAAOQ,GAyER,MAnD2B+B,MAAQhC,EAASC,KAC3C,IAAuB,IAAlBD,EAAQU,MAEZ,OAAOT,EAAMD,GAEd,IApBuCA,CAAAA,IACvC,MAAMiC,IACFjC,EAAQI,OAAmD,IAA3CJ,EAAQI,KAAK8B,QAAS,eACpCC,IACFnC,EAAQsB,MAAiD,IAA1CtB,EAAQsB,IAAIY,QAAS,eACxC,OAAOD,GAAmBE,GAenBC,CAA+BpC,GAErC,OAAOC,EAAMD,GAId,MAAMyB,QAAiBY,EAAU,IAC7BjB,EAAapB,EAAS,CACxBsC,SAAU,MAGX5B,OAAO,IAGF6B,QAAgBf,EAAeC,GAErC,IAAOe,MAAMC,QAASF,GAErB,OAAOA,EAGR,IAAIG,EAAWd,EAAgBH,GAE/B,IAAOiB,EAEN,OAAOH,EAIR,IAAII,EAAuC,GAAKC,OAAQL,GACxD,KAAQG,GAAW,CAClB,MAAMG,QAAqBR,EAAU,IACjCrC,EAEHI,UAAM0C,EACNxB,IAAKoB,EAELhC,OAAO,IAEFqC,QAAoBvB,EAAeqB,GACzCF,EAAgBA,EAAcC,OAAQG,GACtCL,EAAWd,EAAgBiB,GAE5B,OAAOF,GCvHR,MAAMK,EAAmB,IAAIC,IAAK,CAAE,QAAS,MAAO,WAY9CC,EAAiB,MCJjB1B,EAAgB,SAAEC,GAA0C,IAAhC0B,IAAgC,yDACjE,OAAKA,EACqB,MAApB1B,EAASR,OACN,KAGDQ,EAASC,KAAOD,EAASC,OAASf,QAAQgB,OAAQF,GAGnDA,GAUF2B,EAA+B3B,IACpC,MAAM4B,EAAmB,CACxBC,KAAM,eACNC,SAASC,EAAAA,EAAAA,IAAI,+CAGd,IAAO/B,IAAcA,EAASC,KAC7B,MAAM2B,EAGP,OAAO5B,EAASC,OAAO+B,OAAO,KAC7B,MAAMJ,MAYKK,EAAiC,SAC7CjC,GAEI,IADJ0B,IACI,yDACJ,OAAOxC,QAAQC,QACdY,EAAeC,EAAU0B,IACxBM,OAASE,GAASC,EAAoBD,EAAKR,MAUvC,SAASS,EAAoBnC,GAAuC,IAA7B0B,IAA6B,yDAC1E,IAAOA,EACN,MAAM1B,EAGP,OAAO2B,EAA4B3B,GAAWoC,MAAQC,IACrD,MAAMC,EAAe,CACpBT,KAAM,gBACNC,SAASC,EAAAA,EAAAA,IAAI,+BAGd,MAAMM,GAASC,KCvDjB,MAAMC,EAAkB,CAKvBC,OAAQ,+BASHC,EAAkB,CACvBC,YAAa,WASRC,EAAc,CC3CS,CAAEpE,EAASC,KAEf,iBAAhBD,EAAQsB,MACb+C,EAAAA,EAAAA,aAAarE,EAAQsB,IAAK,aAE5BtB,EAAQsB,KAAMC,EAAAA,EAAAA,cAAcvB,EAAQsB,IAAK,CAAEgD,QAAS,UAI5B,iBAAjBtE,EAAQI,OACbiE,EAAAA,EAAAA,aAAarE,EAAQI,KAAM,aAE7BJ,EAAQI,MAAOmB,EAAAA,EAAAA,cAAcvB,EAAQI,KAAM,CAAEkE,QAAS,UAGhDrE,EAAMD,ID8BbuE,EF5BwB,CAAEvE,EAASC,KACnC,MAAM,OAAEuE,EAAStB,GAAmBlD,EAapC,OAZKgD,EAAiByB,IAAKD,EAAOE,iBACjC1E,EAAU,IACNA,EACHmB,QAAS,IACLnB,EAAQmB,QACX,yBAA0BqD,EAC1B,eAAgB,oBAEjBA,OAAQ,SAIHvE,EAAMD,IEgBb2E,GAmBKC,EAAgBnD,IACrB,GAAKA,EAASR,QAAU,KAAOQ,EAASR,OAAS,IAChD,OAAOQ,EAGR,MAAMA,GAyDP,IAAIoD,EAjD0BC,IAC7B,MAAM,IAAExD,EAAF,KAAOlB,EAAP,KAAa2E,EAAb,MAAmBrE,GAAQ,KAASsE,GAAqBF,EAC/D,IAAI,KAAEjE,EAAF,QAAQM,GAAY2D,EAsBxB,OAnBA3D,EAAU,IAAK6C,KAAoB7C,GAG9B4D,IACJlE,EAAOE,KAAKC,UAAW+D,GACvB5D,EAAS,gBAAmB,oBAGLpB,OAAOkF,MAE9B3D,GAAOlB,GAAQL,OAAOmF,SAASC,KAC/B,IACIjB,KACAc,EACHnE,KAAAA,EACAM,QAAAA,IAIqB0C,MACpBuB,GACDzE,QAAQC,QAASwE,GACfvB,KAAMe,GACNnB,OAAShC,GAAcmC,EAAoBnC,EAAUf,KACrDmD,MAAQpC,GACRiC,EAAgCjC,EAAUf,OAE3C2E,IAED,GAAKA,GAAoB,eAAbA,EAAIC,KACf,MAAMD,EAKP,KAAM,CACL/B,KAAM,cACNC,SAASC,EAAAA,EAAAA,IAAI,kCAwBjB,SAASnB,EAAUrC,GAalB,OAPwBoE,EAAYmB,aAAa,CACpBtF,EAC5BuF,IAESC,GAAoBD,EAAYC,EAAgBxF,IACvD4E,EAEIa,CAAiB1F,GAAUyD,OAASK,GACtB,8BAAfA,EAAMR,KACH3C,QAAQgB,OAAQmC,GAKvB/D,OAEEkF,MAAO5C,EAASsD,eAChB9B,KAAMe,GACNf,MAAQkB,GAAUA,EAAKa,SACvB/B,MAAQ+B,IAERvD,EAASwD,gBAAgBC,MAAQF,EAC1BvD,EAAUrC,QAMtBqC,EAAS0D,IA5HT,SAA6BP,GAC5BpB,EAAY4B,QAASR,IA4HtBnD,EAAS4D,gBA5CT,SAA0BC,GACzBrB,EAAeqB,GA6ChB7D,EAAS8D,sBE1LT,SAAgCL,GAI/B,MAAMN,EAAa,CAAExF,EAASC,KAC7B,MAAM,QAAEkB,EAAU,IAAOnB,EAIzB,IAAM,MAAMoG,KAAcjF,EACzB,GAC8B,eAA7BiF,EAAWC,eACXlF,EAASiF,KAAiBZ,EAAWM,MAErC,OAAO7F,EAAMD,GAIf,OAAOC,EAAM,IACTD,EACHmB,QAAS,IACLA,EACH,aAAcqE,EAAWM,UAO5B,OAFAN,EAAWM,MAAQA,EAEZN,GF8JRnD,EAASiE,2BJtLT,SAAqCC,GACpC,MAAMC,EAAQlH,OAAOmH,YACpBnH,OAAOoH,QAASH,GAAgBI,KAAK,QAAIvG,EAAM2E,GAAV,QAAsB,EAC1D6B,EAAAA,EAAAA,eAAexG,GACf2E,OAIF,MAAO,CAAE/E,EAASC,KACjB,MAAM,MAAES,GAAQ,GAASV,EAEzB,IAAI6G,EAAU7G,EAAQI,KACtB,IAAOyG,GAAW7G,EAAQsB,IAAM,CAC/B,MAAQwF,WAAYC,KAAkB1F,IAAc2F,EAAAA,EAAAA,cACnDhH,EAAQsB,KAGqB,iBAAlByF,IACXF,GAAUtF,EAAAA,EAAAA,cAAcwF,EAAe1F,IAIzC,GAAwB,iBAAZwF,EACX,OAAO5G,EAAMD,GAGd,MAAMwE,EAASxE,EAAQwE,QAAU,MAC3BpE,GAAOwG,EAAAA,EAAAA,eAAeC,GAE5B,GAAK,QAAUrC,GAAUgC,EAAOpG,GAAS,CACxC,MAAM6G,EAAYT,EAAOpG,GAKzB,cAFOoG,EAAOpG,GAEPI,EAAiByG,IAAcvG,GAChC,GACN,YAAc8D,GACdgC,EAAOhC,IACPgC,EAAOhC,GAAUpE,GAChB,CACD,MAAM6G,EAAYT,EAAOhC,GAAUpE,GAKnC,cAFOoG,EAAOhC,GAAUpE,GAEjBI,EAAiByG,IAAcvG,GAGvC,OAAOT,EAAMD,KIsIfqC,EAAS6E,wBGvLyBC,GAAa,CAAEnH,EAASC,IAClDmH,EAAgCpH,GAAWqH,IACjD,IAEIC,EAFAhG,EAAM+F,EAAgB/F,IACtBlB,EAAOiH,EAAgBjH,KAwB3B,MArBqB,iBAATA,IACXkH,EAAUH,GAEJ,IAAMA,EAAQjF,QAAS,OAC5B9B,EAAOA,EAAKG,QAAS,IAAK,MAG3BH,EAAOA,EAAKG,QAAS,MAAO,IAK3B,iBAAoB+G,IACnB,IAAMA,EAAQpF,QAAS,OAExB9B,EAAOA,EAAKG,QAAS,IAAK,MAG3Be,EAAMgG,EAAUlH,GAGVH,EAAM,IACToH,EACH/F,IAAAA,OH2JHe,EAASsC,mBAAqBA,EAC9BtC,EAASkF,sBInKqB,CAAEvH,EAASC,KACxC,IAfD,SAA+BD,GAC9B,MAAMwH,IAAoBxH,EAAQwE,QAA6B,SAAnBxE,EAAQwE,OAKpD,SAHMxE,EAAQI,OAAoD,IAA5CJ,EAAQI,KAAK8B,QAAS,mBACtClC,EAAQsB,MAAkD,IAA3CtB,EAAQsB,IAAIY,QAAS,kBAEhBsF,EASnBC,CAAsBzH,GAC5B,OAAOC,EAAMD,GAGd,IAAI0H,EAAU,EACd,MAMMC,EAAgBC,IACrBF,IACOzH,EAAM,CACZG,KAAO,gBAAgBwH,iBACvBpD,OAAQ,OACRO,KAAM,CAAE8C,OAAQ,yBAChBnH,OAAO,IACJ+C,OAAO,IACLiE,EAdY,EAeTC,EAAaC,IAErB3H,EAAM,CACLG,KAAO,gBAAgBwH,eACvBpD,OAAQ,WAGF7D,QAAQgB,aAIjB,OAAO1B,EAAM,IAAKD,EAASU,OAAO,IAChC+C,OAAShC,IACT,MAAMmG,EAAenG,EAASN,QAAQ1B,IACrC,6BAED,OACCgC,EAASR,QAAU,KACnBQ,EAASR,OAAS,KAClB2G,EAEOD,EAAaC,GAAenE,OAAO,KAClB,IAAlBzD,EAAQU,MACLC,QAAQgB,OAAQ,CACtB2B,KAAM,eACNC,SAASC,EAAAA,EAAAA,IACR,mGAKI7C,QAAQgB,OAAQF,KAGlBmC,EAAoBnC,EAAUzB,EAAQU,UAE7CmD,MAAQpC,GACRiC,EAAgCjC,EAAUzB,EAAQU,UJ2GrD,S","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/external window [\"wp\",\"i18n\"]","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/namespace-endpoint.js","webpack://wp/external window [\"wp\",\"url\"]","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/preloading.js","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/fetch-all-middleware.js","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/http-v1.js","webpack://wp/./packages/api-fetch/build-module/utils/@wordpress/api-fetch/src/utils/response.js","webpack://wp/./packages/api-fetch/build-module/@wordpress/api-fetch/src/index.js","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/user-locale.js","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/nonce.js","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/root-url.js","webpack://wp/./packages/api-fetch/build-module/middlewares/@wordpress/api-fetch/src/middlewares/media-upload.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","/**\n * @type {import('../types').APIFetchMiddleware}\n */\nconst namespaceAndEndpointMiddleware = ( options, next ) => {\n\tlet path = options.path;\n\tlet namespaceTrimmed, endpointTrimmed;\n\n\tif (\n\t\ttypeof options.namespace === 'string' &&\n\t\ttypeof options.endpoint === 'string'\n\t) {\n\t\tnamespaceTrimmed = options.namespace.replace( /^\\/|\\/$/g, '' );\n\t\tendpointTrimmed = options.endpoint.replace( /^\\//, '' );\n\t\tif ( endpointTrimmed ) {\n\t\t\tpath = namespaceTrimmed + '/' + endpointTrimmed;\n\t\t} else {\n\t\t\tpath = namespaceTrimmed;\n\t\t}\n\t}\n\n\tdelete options.namespace;\n\tdelete options.endpoint;\n\n\treturn next( {\n\t\t...options,\n\t\tpath,\n\t} );\n};\n\nexport default namespaceAndEndpointMiddleware;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, normalizePath } from '@wordpress/url';\n\n/**\n * @param {Record<string, any>} preloadedData\n * @return {import('../types').APIFetchMiddleware} Preloading middleware.\n */\nfunction createPreloadingMiddleware( preloadedData ) {\n\tconst cache = Object.fromEntries(\n\t\tObject.entries( preloadedData ).map( ( [ path, data ] ) => [\n\t\t\tnormalizePath( path ),\n\t\t\tdata,\n\t\t] )\n\t);\n\n\treturn ( options, next ) => {\n\t\tconst { parse = true } = options;\n\t\t/** @type {string | void} */\n\t\tlet rawPath = options.path;\n\t\tif ( ! rawPath && options.url ) {\n\t\t\tconst { rest_route: pathFromQuery, ...queryArgs } = getQueryArgs(\n\t\t\t\toptions.url\n\t\t\t);\n\n\t\t\tif ( typeof pathFromQuery === 'string' ) {\n\t\t\t\trawPath = addQueryArgs( pathFromQuery, queryArgs );\n\t\t\t}\n\t\t}\n\n\t\tif ( typeof rawPath !== 'string' ) {\n\t\t\treturn next( options );\n\t\t}\n\n\t\tconst method = options.method || 'GET';\n\t\tconst path = normalizePath( rawPath );\n\n\t\tif ( 'GET' === method && cache[ path ] ) {\n\t\t\tconst cacheData = cache[ path ];\n\n\t\t\t// Unsetting the cache key ensures that the data is only used a single time.\n\t\t\tdelete cache[ path ];\n\n\t\t\treturn prepareResponse( cacheData, !! parse );\n\t\t} else if (\n\t\t\t'OPTIONS' === method &&\n\t\t\tcache[ method ] &&\n\t\t\tcache[ method ][ path ]\n\t\t) {\n\t\t\tconst cacheData = cache[ method ][ path ];\n\n\t\t\t// Unsetting the cache key ensures that the data is only used a single time.\n\t\t\tdelete cache[ method ][ path ];\n\n\t\t\treturn prepareResponse( cacheData, !! parse );\n\t\t}\n\n\t\treturn next( options );\n\t};\n}\n\n/**\n * This is a helper function that sends a success response.\n *\n * @param {Record<string, any>} responseData\n * @param {boolean} parse\n * @return {Promise<any>} Promise with the response.\n */\nfunction prepareResponse( responseData, parse ) {\n\treturn Promise.resolve(\n\t\tparse\n\t\t\t? responseData.body\n\t\t\t: new window.Response( JSON.stringify( responseData.body ), {\n\t\t\t\t\tstatus: 200,\n\t\t\t\t\tstatusText: 'OK',\n\t\t\t\t\theaders: responseData.headers,\n\t\t\t } )\n\t);\n}\n\nexport default createPreloadingMiddleware;\n","/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport apiFetch from '..';\n\n/**\n * Apply query arguments to both URL and Path, whichever is present.\n *\n * @param {import('../types').APIFetchOptions} props\n * @param {Record<string, string | number>} queryArgs\n * @return {import('../types').APIFetchOptions} The request with the modified query args\n */\nconst modifyQuery = ( { path, url, ...options }, queryArgs ) => ( {\n\t...options,\n\turl: url && addQueryArgs( url, queryArgs ),\n\tpath: path && addQueryArgs( path, queryArgs ),\n} );\n\n/**\n * Duplicates parsing functionality from apiFetch.\n *\n * @param {Response} response\n * @return {Promise<any>} Parsed response json.\n */\nconst parseResponse = ( response ) =>\n\tresponse.json ? response.json() : Promise.reject( response );\n\n/**\n * @param {string | null} linkHeader\n * @return {{ next?: string }} The parsed link header.\n */\nconst parseLinkHeader = ( linkHeader ) => {\n\tif ( ! linkHeader ) {\n\t\treturn {};\n\t}\n\tconst match = linkHeader.match( /<([^>]+)>; rel=\"next\"/ );\n\treturn match\n\t\t? {\n\t\t\t\tnext: match[ 1 ],\n\t\t }\n\t\t: {};\n};\n\n/**\n * @param {Response} response\n * @return {string | undefined} The next page URL.\n */\nconst getNextPageUrl = ( response ) => {\n\tconst { next } = parseLinkHeader( response.headers.get( 'link' ) );\n\treturn next;\n};\n\n/**\n * @param {import('../types').APIFetchOptions} options\n * @return {boolean} True if the request contains an unbounded query.\n */\nconst requestContainsUnboundedQuery = ( options ) => {\n\tconst pathIsUnbounded =\n\t\t!! options.path && options.path.indexOf( 'per_page=-1' ) !== -1;\n\tconst urlIsUnbounded =\n\t\t!! options.url && options.url.indexOf( 'per_page=-1' ) !== -1;\n\treturn pathIsUnbounded || urlIsUnbounded;\n};\n\n/**\n * The REST API enforces an upper limit on the per_page option. To handle large\n * collections, apiFetch consumers can pass `per_page=-1`; this middleware will\n * then recursively assemble a full response array from all available pages.\n *\n * @type {import('../types').APIFetchMiddleware}\n */\nconst fetchAllMiddleware = async ( options, next ) => {\n\tif ( options.parse === false ) {\n\t\t// If a consumer has opted out of parsing, do not apply middleware.\n\t\treturn next( options );\n\t}\n\tif ( ! requestContainsUnboundedQuery( options ) ) {\n\t\t// If neither url nor path is requesting all items, do not apply middleware.\n\t\treturn next( options );\n\t}\n\n\t// Retrieve requested page of results.\n\tconst response = await apiFetch( {\n\t\t...modifyQuery( options, {\n\t\t\tper_page: 100,\n\t\t} ),\n\t\t// Ensure headers are returned for page 1.\n\t\tparse: false,\n\t} );\n\n\tconst results = await parseResponse( response );\n\n\tif ( ! Array.isArray( results ) ) {\n\t\t// We have no reliable way of merging non-array results.\n\t\treturn results;\n\t}\n\n\tlet nextPage = getNextPageUrl( response );\n\n\tif ( ! nextPage ) {\n\t\t// There are no further pages to request.\n\t\treturn results;\n\t}\n\n\t// Iteratively fetch all remaining pages until no \"next\" header is found.\n\tlet mergedResults = /** @type {any[]} */ ( [] ).concat( results );\n\twhile ( nextPage ) {\n\t\tconst nextResponse = await apiFetch( {\n\t\t\t...options,\n\t\t\t// Ensure the URL for the next page is used instead of any provided path.\n\t\t\tpath: undefined,\n\t\t\turl: nextPage,\n\t\t\t// Ensure we still get headers so we can identify the next page.\n\t\t\tparse: false,\n\t\t} );\n\t\tconst nextResults = await parseResponse( nextResponse );\n\t\tmergedResults = mergedResults.concat( nextResults );\n\t\tnextPage = getNextPageUrl( nextResponse );\n\t}\n\treturn mergedResults;\n};\n\nexport default fetchAllMiddleware;\n","/**\n * Set of HTTP methods which are eligible to be overridden.\n *\n * @type {Set<string>}\n */\nconst OVERRIDE_METHODS = new Set( [ 'PATCH', 'PUT', 'DELETE' ] );\n\n/**\n * Default request method.\n *\n * \"A request has an associated method (a method). Unless stated otherwise it\n * is `GET`.\"\n *\n * @see https://fetch.spec.whatwg.org/#requests\n *\n * @type {string}\n */\nconst DEFAULT_METHOD = 'GET';\n\n/**\n * API Fetch middleware which overrides the request method for HTTP v1\n * compatibility leveraging the REST API X-HTTP-Method-Override header.\n *\n * @type {import('../types').APIFetchMiddleware}\n */\nconst httpV1Middleware = ( options, next ) => {\n\tconst { method = DEFAULT_METHOD } = options;\n\tif ( OVERRIDE_METHODS.has( method.toUpperCase() ) ) {\n\t\toptions = {\n\t\t\t...options,\n\t\t\theaders: {\n\t\t\t\t...options.headers,\n\t\t\t\t'X-HTTP-Method-Override': method,\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t};\n\t}\n\n\treturn next( options );\n};\n\nexport default httpV1Middleware;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Parses the apiFetch response.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n *\n * @return {Promise<any> | null | Response} Parsed response.\n */\nconst parseResponse = ( response, shouldParseResponse = true ) => {\n\tif ( shouldParseResponse ) {\n\t\tif ( response.status === 204 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn response.json ? response.json() : Promise.reject( response );\n\t}\n\n\treturn response;\n};\n\n/**\n * Calls the `json` function on the Response, throwing an error if the response\n * doesn't have a json function or if parsing the json itself fails.\n *\n * @param {Response} response\n * @return {Promise<any>} Parsed response.\n */\nconst parseJsonAndNormalizeError = ( response ) => {\n\tconst invalidJsonError = {\n\t\tcode: 'invalid_json',\n\t\tmessage: __( 'The response is not a valid JSON response.' ),\n\t};\n\n\tif ( ! response || ! response.json ) {\n\t\tthrow invalidJsonError;\n\t}\n\n\treturn response.json().catch( () => {\n\t\tthrow invalidJsonError;\n\t} );\n};\n\n/**\n * Parses the apiFetch response properly and normalize response errors.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n *\n * @return {Promise<any>} Parsed response.\n */\nexport const parseResponseAndNormalizeError = (\n\tresponse,\n\tshouldParseResponse = true\n) => {\n\treturn Promise.resolve(\n\t\tparseResponse( response, shouldParseResponse )\n\t).catch( ( res ) => parseAndThrowError( res, shouldParseResponse ) );\n};\n\n/**\n * Parses a response, throwing an error if parsing the response fails.\n *\n * @param {Response} response\n * @param {boolean} shouldParseResponse\n * @return {Promise<any>} Parsed response.\n */\nexport function parseAndThrowError( response, shouldParseResponse = true ) {\n\tif ( ! shouldParseResponse ) {\n\t\tthrow response;\n\t}\n\n\treturn parseJsonAndNormalizeError( response ).then( ( error ) => {\n\t\tconst unknownError = {\n\t\t\tcode: 'unknown_error',\n\t\t\tmessage: __( 'An unknown error occurred.' ),\n\t\t};\n\n\t\tthrow error || unknownError;\n\t} );\n}\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport createNonceMiddleware from './middlewares/nonce';\nimport createRootURLMiddleware from './middlewares/root-url';\nimport createPreloadingMiddleware from './middlewares/preloading';\nimport fetchAllMiddleware from './middlewares/fetch-all-middleware';\nimport namespaceEndpointMiddleware from './middlewares/namespace-endpoint';\nimport httpV1Middleware from './middlewares/http-v1';\nimport userLocaleMiddleware from './middlewares/user-locale';\nimport mediaUploadMiddleware from './middlewares/media-upload';\nimport {\n\tparseResponseAndNormalizeError,\n\tparseAndThrowError,\n} from './utils/response';\n\n/**\n * Default set of header values which should be sent with every request unless\n * explicitly provided through apiFetch options.\n *\n * @type {Record<string, string>}\n */\nconst DEFAULT_HEADERS = {\n\t// The backend uses the Accept header as a condition for considering an\n\t// incoming request as a REST request.\n\t//\n\t// See: https://core.trac.wordpress.org/ticket/44534\n\tAccept: 'application/json, */*;q=0.1',\n};\n\n/**\n * Default set of fetch option values which should be sent with every request\n * unless explicitly provided through apiFetch options.\n *\n * @type {Object}\n */\nconst DEFAULT_OPTIONS = {\n\tcredentials: 'include',\n};\n\n/** @typedef {import('./types').APIFetchMiddleware} APIFetchMiddleware */\n/** @typedef {import('./types').APIFetchOptions} APIFetchOptions */\n\n/**\n * @type {import('./types').APIFetchMiddleware[]}\n */\nconst middlewares = [\n\tuserLocaleMiddleware,\n\tnamespaceEndpointMiddleware,\n\thttpV1Middleware,\n\tfetchAllMiddleware,\n];\n\n/**\n * Register a middleware\n *\n * @param {import('./types').APIFetchMiddleware} middleware\n */\nfunction registerMiddleware( middleware ) {\n\tmiddlewares.unshift( middleware );\n}\n\n/**\n * Checks the status of a response, throwing the Response as an error if\n * it is outside the 200 range.\n *\n * @param {Response} response\n * @return {Response} The response if the status is in the 200 range.\n */\nconst checkStatus = ( response ) => {\n\tif ( response.status >= 200 && response.status < 300 ) {\n\t\treturn response;\n\t}\n\n\tthrow response;\n};\n\n/** @typedef {(options: import('./types').APIFetchOptions) => Promise<any>} FetchHandler*/\n\n/**\n * @type {FetchHandler}\n */\nconst defaultFetchHandler = ( nextOptions ) => {\n\tconst { url, path, data, parse = true, ...remainingOptions } = nextOptions;\n\tlet { body, headers } = nextOptions;\n\n\t// Merge explicitly-provided headers with default values.\n\theaders = { ...DEFAULT_HEADERS, ...headers };\n\n\t// The `data` property is a shorthand for sending a JSON body.\n\tif ( data ) {\n\t\tbody = JSON.stringify( data );\n\t\theaders[ 'Content-Type' ] = 'application/json';\n\t}\n\n\tconst responsePromise = window.fetch(\n\t\t// Fall back to explicitly passing `window.location` which is the behavior if `undefined` is passed.\n\t\turl || path || window.location.href,\n\t\t{\n\t\t\t...DEFAULT_OPTIONS,\n\t\t\t...remainingOptions,\n\t\t\tbody,\n\t\t\theaders,\n\t\t}\n\t);\n\n\treturn responsePromise.then(\n\t\t( value ) =>\n\t\t\tPromise.resolve( value )\n\t\t\t\t.then( checkStatus )\n\t\t\t\t.catch( ( response ) => parseAndThrowError( response, parse ) )\n\t\t\t\t.then( ( response ) =>\n\t\t\t\t\tparseResponseAndNormalizeError( response, parse )\n\t\t\t\t),\n\t\t( err ) => {\n\t\t\t// Re-throw AbortError for the users to handle it themselves.\n\t\t\tif ( err && err.name === 'AbortError' ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\t// Otherwise, there is most likely no network connection.\n\t\t\t// Unfortunately the message might depend on the browser.\n\t\t\tthrow {\n\t\t\t\tcode: 'fetch_error',\n\t\t\t\tmessage: __( 'You are probably offline.' ),\n\t\t\t};\n\t\t}\n\t);\n};\n\n/** @type {FetchHandler} */\nlet fetchHandler = defaultFetchHandler;\n\n/**\n * Defines a custom fetch handler for making the requests that will override\n * the default one using window.fetch\n *\n * @param {FetchHandler} newFetchHandler The new fetch handler\n */\nfunction setFetchHandler( newFetchHandler ) {\n\tfetchHandler = newFetchHandler;\n}\n\n/**\n * @template T\n * @param {import('./types').APIFetchOptions} options\n * @return {Promise<T>} A promise representing the request processed via the registered middlewares.\n */\nfunction apiFetch( options ) {\n\t// creates a nested function chain that calls all middlewares and finally the `fetchHandler`,\n\t// converting `middlewares = [ m1, m2, m3 ]` into:\n\t// ```\n\t// opts1 => m1( opts1, opts2 => m2( opts2, opts3 => m3( opts3, fetchHandler ) ) );\n\t// ```\n\tconst enhancedHandler = middlewares.reduceRight( (\n\t\t/** @type {FetchHandler} */ next,\n\t\tmiddleware\n\t) => {\n\t\treturn ( workingOptions ) => middleware( workingOptions, next );\n\t}, fetchHandler );\n\n\treturn enhancedHandler( options ).catch( ( error ) => {\n\t\tif ( error.code !== 'rest_cookie_invalid_nonce' ) {\n\t\t\treturn Promise.reject( error );\n\t\t}\n\n\t\t// If the nonce is invalid, refresh it and try again.\n\t\treturn (\n\t\t\twindow\n\t\t\t\t// @ts-ignore\n\t\t\t\t.fetch( apiFetch.nonceEndpoint )\n\t\t\t\t.then( checkStatus )\n\t\t\t\t.then( ( data ) => data.text() )\n\t\t\t\t.then( ( text ) => {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tapiFetch.nonceMiddleware.nonce = text;\n\t\t\t\t\treturn apiFetch( options );\n\t\t\t\t} )\n\t\t);\n\t} );\n}\n\napiFetch.use = registerMiddleware;\napiFetch.setFetchHandler = setFetchHandler;\n\napiFetch.createNonceMiddleware = createNonceMiddleware;\napiFetch.createPreloadingMiddleware = createPreloadingMiddleware;\napiFetch.createRootURLMiddleware = createRootURLMiddleware;\napiFetch.fetchAllMiddleware = fetchAllMiddleware;\napiFetch.mediaUploadMiddleware = mediaUploadMiddleware;\n\nexport default apiFetch;\n","/**\n * WordPress dependencies\n */\nimport { addQueryArgs, hasQueryArg } from '@wordpress/url';\n\n/**\n * @type {import('../types').APIFetchMiddleware}\n */\nconst userLocaleMiddleware = ( options, next ) => {\n\tif (\n\t\ttypeof options.url === 'string' &&\n\t\t! hasQueryArg( options.url, '_locale' )\n\t) {\n\t\toptions.url = addQueryArgs( options.url, { _locale: 'user' } );\n\t}\n\n\tif (\n\t\ttypeof options.path === 'string' &&\n\t\t! hasQueryArg( options.path, '_locale' )\n\t) {\n\t\toptions.path = addQueryArgs( options.path, { _locale: 'user' } );\n\t}\n\n\treturn next( options );\n};\n\nexport default userLocaleMiddleware;\n","/**\n * @param {string} nonce\n * @return {import('../types').APIFetchMiddleware & { nonce: string }} A middleware to enhance a request with a nonce.\n */\nfunction createNonceMiddleware( nonce ) {\n\t/**\n\t * @type {import('../types').APIFetchMiddleware & { nonce: string }}\n\t */\n\tconst middleware = ( options, next ) => {\n\t\tconst { headers = {} } = options;\n\n\t\t// If an 'X-WP-Nonce' header (or any case-insensitive variation\n\t\t// thereof) was specified, no need to add a nonce header.\n\t\tfor ( const headerName in headers ) {\n\t\t\tif (\n\t\t\t\theaderName.toLowerCase() === 'x-wp-nonce' &&\n\t\t\t\theaders[ headerName ] === middleware.nonce\n\t\t\t) {\n\t\t\t\treturn next( options );\n\t\t\t}\n\t\t}\n\n\t\treturn next( {\n\t\t\t...options,\n\t\t\theaders: {\n\t\t\t\t...headers,\n\t\t\t\t'X-WP-Nonce': middleware.nonce,\n\t\t\t},\n\t\t} );\n\t};\n\n\tmiddleware.nonce = nonce;\n\n\treturn middleware;\n}\n\nexport default createNonceMiddleware;\n","/**\n * Internal dependencies\n */\nimport namespaceAndEndpointMiddleware from './namespace-endpoint';\n\n/**\n * @param {string} rootURL\n * @return {import('../types').APIFetchMiddleware} Root URL middleware.\n */\nconst createRootURLMiddleware = ( rootURL ) => ( options, next ) => {\n\treturn namespaceAndEndpointMiddleware( options, ( optionsWithPath ) => {\n\t\tlet url = optionsWithPath.url;\n\t\tlet path = optionsWithPath.path;\n\t\tlet apiRoot;\n\n\t\tif ( typeof path === 'string' ) {\n\t\t\tapiRoot = rootURL;\n\n\t\t\tif ( -1 !== rootURL.indexOf( '?' ) ) {\n\t\t\t\tpath = path.replace( '?', '&' );\n\t\t\t}\n\n\t\t\tpath = path.replace( /^\\//, '' );\n\n\t\t\t// API root may already include query parameter prefix if site is\n\t\t\t// configured to use plain permalinks.\n\t\t\tif (\n\t\t\t\t'string' === typeof apiRoot &&\n\t\t\t\t-1 !== apiRoot.indexOf( '?' )\n\t\t\t) {\n\t\t\t\tpath = path.replace( '?', '&' );\n\t\t\t}\n\n\t\t\turl = apiRoot + path;\n\t\t}\n\n\t\treturn next( {\n\t\t\t...optionsWithPath,\n\t\t\turl,\n\t\t} );\n\t} );\n};\n\nexport default createRootURLMiddleware;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tparseAndThrowError,\n\tparseResponseAndNormalizeError,\n} from '../utils/response';\n\n/**\n * @param {import('../types').APIFetchOptions} options\n * @return {boolean} True if the request is for media upload.\n */\nfunction isMediaUploadRequest( options ) {\n\tconst isCreateMethod = !! options.method && options.method === 'POST';\n\tconst isMediaEndpoint =\n\t\t( !! options.path && options.path.indexOf( '/wp/v2/media' ) !== -1 ) ||\n\t\t( !! options.url && options.url.indexOf( '/wp/v2/media' ) !== -1 );\n\n\treturn isMediaEndpoint && isCreateMethod;\n}\n\n/**\n * Middleware handling media upload failures and retries.\n *\n * @type {import('../types').APIFetchMiddleware}\n */\nconst mediaUploadMiddleware = ( options, next ) => {\n\tif ( ! isMediaUploadRequest( options ) ) {\n\t\treturn next( options );\n\t}\n\n\tlet retries = 0;\n\tconst maxRetries = 5;\n\n\t/**\n\t * @param {string} attachmentId\n\t * @return {Promise<any>} Processed post response.\n\t */\n\tconst postProcess = ( attachmentId ) => {\n\t\tretries++;\n\t\treturn next( {\n\t\t\tpath: `/wp/v2/media/${ attachmentId }/post-process`,\n\t\t\tmethod: 'POST',\n\t\t\tdata: { action: 'create-image-subsizes' },\n\t\t\tparse: false,\n\t\t} ).catch( () => {\n\t\t\tif ( retries < maxRetries ) {\n\t\t\t\treturn postProcess( attachmentId );\n\t\t\t}\n\t\t\tnext( {\n\t\t\t\tpath: `/wp/v2/media/${ attachmentId }?force=true`,\n\t\t\t\tmethod: 'DELETE',\n\t\t\t} );\n\n\t\t\treturn Promise.reject();\n\t\t} );\n\t};\n\n\treturn next( { ...options, parse: false } )\n\t\t.catch( ( response ) => {\n\t\t\tconst attachmentId = response.headers.get(\n\t\t\t\t'x-wp-upload-attachment-id'\n\t\t\t);\n\t\t\tif (\n\t\t\t\tresponse.status >= 500 &&\n\t\t\t\tresponse.status < 600 &&\n\t\t\t\tattachmentId\n\t\t\t) {\n\t\t\t\treturn postProcess( attachmentId ).catch( () => {\n\t\t\t\t\tif ( options.parse !== false ) {\n\t\t\t\t\t\treturn Promise.reject( {\n\t\t\t\t\t\t\tcode: 'post_process',\n\t\t\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t\t\t'Media upload failed. If this is a photo or a large image, please scale it down and try again.'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Promise.reject( response );\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn parseAndThrowError( response, options.parse );\n\t\t} )\n\t\t.then( ( response ) =>\n\t\t\tparseResponseAndNormalizeError( response, options.parse )\n\t\t);\n};\n\nexport default mediaUploadMiddleware;\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","window","options","next","namespaceTrimmed","endpointTrimmed","path","namespace","endpoint","replace","prepareResponse","responseData","parse","Promise","resolve","body","Response","JSON","stringify","status","statusText","headers","modifyQuery","queryArgs","url","addQueryArgs","parseResponse","response","json","reject","getNextPageUrl","linkHeader","match","parseLinkHeader","async","pathIsUnbounded","indexOf","urlIsUnbounded","requestContainsUnboundedQuery","apiFetch","per_page","results","Array","isArray","nextPage","mergedResults","concat","nextResponse","undefined","nextResults","OVERRIDE_METHODS","Set","DEFAULT_METHOD","shouldParseResponse","parseJsonAndNormalizeError","invalidJsonError","code","message","__","catch","parseResponseAndNormalizeError","res","parseAndThrowError","then","error","unknownError","DEFAULT_HEADERS","Accept","DEFAULT_OPTIONS","credentials","middlewares","hasQueryArg","_locale","namespaceEndpointMiddleware","method","has","toUpperCase","fetchAllMiddleware","checkStatus","fetchHandler","nextOptions","data","remainingOptions","fetch","location","href","value","err","name","reduceRight","middleware","workingOptions","enhancedHandler","nonceEndpoint","text","nonceMiddleware","nonce","use","unshift","setFetchHandler","newFetchHandler","createNonceMiddleware","headerName","toLowerCase","createPreloadingMiddleware","preloadedData","cache","fromEntries","entries","map","normalizePath","rawPath","rest_route","pathFromQuery","getQueryArgs","cacheData","createRootURLMiddleware","rootURL","namespaceAndEndpointMiddleware","optionsWithPath","apiRoot","mediaUploadMiddleware","isCreateMethod","isMediaUploadRequest","retries","postProcess","attachmentId","action"],"sourceRoot":""}
|
build/block-directory/index.js
CHANGED
@@ -607,10 +607,10 @@ const installBlockType = block => async _ref => {
|
|
607 |
});
|
608 |
success = true;
|
609 |
} catch (error) {
|
610 |
-
let message = error.message || (0,external_wp_i18n_namespaceObject.__)('An error occurred.'); // Errors we throw are fatal
|
611 |
|
612 |
|
613 |
-
let isFatal = error instanceof Error; // Specific API errors that are fatal
|
614 |
|
615 |
const fatalAPIErrors = {
|
616 |
folder_exists: (0,external_wp_i18n_namespaceObject.__)('This block is already installed. Try reloading the page.'),
|
607 |
});
|
608 |
success = true;
|
609 |
} catch (error) {
|
610 |
+
let message = error.message || (0,external_wp_i18n_namespaceObject.__)('An error occurred.'); // Errors we throw are fatal.
|
611 |
|
612 |
|
613 |
+
let isFatal = error instanceof Error; // Specific API errors that are fatal.
|
614 |
|
615 |
const fatalAPIErrors = {
|
616 |
folder_exists: (0,external_wp_i18n_namespaceObject.__)('This block is already installed. Try reloading the page.'),
|
build/block-directory/index.min.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '122e16b41c2c43bdc8639b68e40b3b7a');
|
build/block-directory/index.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"./build/block-directory/index.min.js","mappings":"yBACA,IAAIA,EAAsB,CCA1B,EAAwB,SAASC,GAChC,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,WAAa,OAAOF,EAAgB,SACpC,WAAa,OAAOA,GAErB,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLR,EAAwB,SAASI,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,SAASM,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICC/F,EAAwB,SAAST,GACX,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,q2BCLvD,IAAI,EAA+BC,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAS,MCAnD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAe,OC2GlD,GAAeC,EAAAA,EAAAA,iBAAiB,CAC/BC,mBAzFiC,WAA0B,IAAxBC,EAAwB,uDAAhB,GAAIC,EAAY,uCAC3D,OAASA,EAAOC,MACf,IAAK,4BACJ,MAAO,IACHF,EACH,CAAEC,EAAOE,aAAe,CACvBC,cAAc,IAGjB,IAAK,8BACJ,MAAO,IACHJ,EACH,CAAEC,EAAOE,aAAe,CACvBE,QAASJ,EAAOF,mBAChBK,cAAc,IAIlB,OAAOJ,GAwEPM,gBA7D8B,WAM1B,IALJN,EAKI,uDALI,CACPO,oBAAqB,GACrBC,aAAc,IAEfP,EACI,uCACJ,OAASA,EAAOC,MACf,IAAK,2BACJ,MAAO,IACHF,EACHO,oBAAqB,IACjBP,EAAMO,oBACTN,EAAOQ,OAGV,IAAK,8BACJ,MAAO,IACHT,EACHO,oBAAqBP,EAAMO,oBAAoBG,QAC5CC,GAAeA,EAAUC,OAASX,EAAOQ,KAAKG,QAGnD,IAAK,uBACJ,MAAO,IACHZ,EACHQ,aAAc,IACVR,EAAMQ,aACT,CAAEP,EAAOY,SAAWZ,EAAOO,eAI/B,OAAOR,GA8BPc,aAnB2B,WAA0B,IAAxBd,EAAwB,uDAAhB,GAAIC,EAAY,uCACrD,OAASA,EAAOC,MACf,IAAK,mBACJ,MAAO,IACHF,EACH,CAAEC,EAAOY,SAAW,CACnBE,QAASd,EAAOc,QAChBC,QAASf,EAAOe,UAGnB,IAAK,qBACJ,OAAOC,EAAAA,EAAAA,MAAMjB,EAAOC,EAAOY,SAE7B,OAAOb,KCxGJ,EAA+BH,OAAW,GAAe,YCS9C,SAASqB,EAAcP,GAAyB,IAAdQ,EAAc,uDAAL,GACzD,IAAOA,EAAOC,OACb,OAAO,EAER,GAAKD,EAAOE,MAAM,QAAE,KAAET,GAAJ,SAAgBA,IAASD,EAAUC,QACpD,OAAO,EAER,IAAM,IAAIU,EAAI,EAAGA,EAAIH,EAAOC,OAAQE,IACnC,GAAKJ,EAAcP,EAAWQ,EAAQG,GAAIC,aACzC,OAAO,EAIT,OAAO,ECHD,SAASC,EAAgCxB,EAAOG,GAAc,QACpE,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCC,oBAAhD,SAWM,SAASqB,EAAuBzB,EAAOG,GAAc,QAC3D,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCE,eAAhD,QAA2D,GAWrD,SAASqB,EAAwB1B,GACvC,OAAOA,EAAMM,gBAAgBC,oBAWvB,MAAMoB,GAAmBC,EAAAA,EAAAA,yBAC7BC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QAAUC,GACpCO,EAAcP,EAAWmB,QAafG,GAAsBL,EAAAA,EAAAA,yBAChCC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QACxBC,IAAiBO,EAAcP,EAAWmB,QAaxC,SAAStB,EAAcR,EAAOa,GACpC,OAAOb,EAAMM,gBAAgBE,aAAcK,KAAa,EAUlD,SAASqB,EAAiBlC,GAChC,OAAOA,EAAMc,aAWP,SAASqB,EAAwBnC,EAAOa,GAC9C,OAAOb,EAAMc,aAAcD,GCrH5B,IAAI,EAA+BhB,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAY,S,SCAtD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAO,ICe9C,MAAMuC,EAAcC,GACnB,IAAIC,SAAS,CAAEC,EAASC,KAK9B,MAAMC,EAAUC,SAASC,cAAeN,EAAGO,UAE3C,CAAE,KAAM,MAAO,MAAO,OAAQ,QAASC,SAAWC,IAC5CT,EAAIS,KACRL,EAASK,GAAST,EAAIS,OAKnBT,EAAGU,WACPN,EAAQO,YAAaN,SAASO,eAAgBZ,EAAGU,YAGlDN,EAAQS,OAAS,IAAMX,GAAS,GAChCE,EAAQU,QAAU,IAAMX,EAAQ,IAAIY,MAAO,yBAE3CV,SAASW,KAAKL,YAAaP,IAI1B,SAAWA,EAAQG,SAASU,eAC1B,WAAab,EAAQG,SAASU,gBAAmBb,EAAQc,MAE3DhB,OCrCY,SAASiB,EAAcC,GACrC,IAAOA,EACN,OAAO,EAER,MAAMC,EAAOD,EAAME,MAAO,cAAiBF,EAAME,MAAMC,KACvD,SAAKF,IAAQA,EAAKtC,SACVsC,EAAM,GAAIG,KCkBZ,SAASC,EAAyB3D,GACxC,MAAO,CAAED,KAAM,4BAA6BC,YAAAA,GAYtC,SAAS4D,EAA2BhE,EAAoBI,GAC9D,MAAO,CACND,KAAM,8BACNH,mBAAAA,EACAI,YAAAA,GAWK,MAAM6D,EAAqBP,GAAWQ,MAAAA,IAGtC,IAH8C,SACpDC,EADoD,SAEpDC,GACM,EACN,MAAM,GAAEC,EAAF,KAAMxD,GAAS6C,EACrB,IAAIY,GAAU,EACdF,EAASG,iBAAkBF,GAC3B,IACCD,EAASI,gBAAiBH,GAAI,GAG9B,MAAMI,EAAMhB,EAAcC,GAC1B,IAAIE,EAAQ,GACPa,QACEC,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,YASjBjB,SANuBc,GAAAA,CAAU,CAChCC,OAAQ,OACRG,KAAM,gBACNF,KAAM,CAAEG,KAAMV,EAAIQ,OAAQ,aAGVG,OAGlBZ,EAASa,sBAAuB,IAC5BvB,EACHE,MAAO,IAAKF,EAAME,SAAUA,KAI7B,MAAMsB,EAAiB,CACtB,cACA,QACA,WACA,SACA,OACA,cACA,WACA,aACA,mBACA,eACA,WACA,SACA,UACA,cAoBD,SAlBMR,GAAAA,CAAU,CACfI,MAAMK,EAAAA,EAAAA,cAAe,sBAAsBtE,IAAS,CACnDuE,QAASF,MAITG,OAAO,SACPC,MAAQC,IACDA,IAGPC,EAAAA,EAAAA,+CAA+C,CAC9C,CAAE3E,IAAQ4E,EAAAA,EAAAA,MAAMF,EAAUL,cFtExBhB,iBAQN,MAAMqB,QAAiBb,GAAAA,CAAU,CAChCD,IAAK9B,SAAS+C,SAAS5B,KACvB6B,OAAO,IAGFf,QAAaW,EAASK,OAEtBC,GAAM,IAAI/F,OAAOgG,WAAYC,gBAAiBnB,EAAM,aAEpDoB,EAAYC,MAAMC,KACvBL,EAAIM,iBAAkB,kCACrBxF,QAAUyF,GAAWA,EAAM/B,KAAQ1B,SAAS0D,eAAgBD,EAAM/B,MAMpE,IAAM,MAAMiC,KAAYN,QACjB3D,EAAWiE,GEgDXC,IACmBpC,EAASrC,OAAQ0E,EAAAA,OAAcC,gBAChCnF,MAAQC,GAAOA,EAAEV,OAASA,IACjD,MAAM,IAAIwC,OACTqD,EAAAA,EAAAA,IAAI,qDAINvC,EAASC,SAAUuC,EAAAA,OAAeC,kBACjCC,EAAAA,EAAAA;CAECH,EAAAA,EAAAA,IAAI,iCACJhD,EAAMoD,OAEP,CACCC,OAAO,EACP5G,KAAM,aAGRmE,GAAU,EACT,MAAQ0C,GACT,IAAIhG,EAAUgG,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,sBAG/BzF,EAAU+F,aAAiB3D,MAG/B,MAAM4D,EAAiB,CACtBC,eAAeR,EAAAA,EAAAA,IACd,4DAEDS,iCAAiCT,EAAAA,EAAAA,IAChC,mEAIGO,EAAgBD,EAAMI,QAC1BnG,GAAU,EACVD,EAAUiG,EAAgBD,EAAMI,OAGjChD,EAASiD,eAAgBhD,EAAIrD,EAASC,GACtCkD,EAASC,SAAUuC,EAAAA,OAAeW,kBAAmBtG,EAAS,CAC7D+F,OAAO,EACPQ,eAAe,IAIjB,OADAnD,EAASI,gBAAiBH,GAAI,GACvBC,GAQKkD,EAAuB9D,GAAWQ,MAAAA,IAGxC,IAHgD,SACtDC,EADsD,SAEtDC,GACM,EACN,IACC,MAAMK,EAAMhB,EAAcC,SACpBgB,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,oBAEXH,GAAAA,CAAU,CACfC,OAAQ,SACRF,IAAAA,IAEDL,EAASqD,yBAA0B/D,GAClC,MAAQsD,GACT7C,EACEC,SAAUuC,EAAAA,OACVW,kBAAmBN,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,yBAYrC,SAASzB,EAAuBvE,GACtC,MAAO,CACNP,KAAM,2BACNO,KAAAA,GAYK,SAAS+G,EAA0B/G,GACzC,MAAO,CACNP,KAAM,8BACNO,KAAAA,GAYK,SAAS8D,EAAiB1D,EAASL,GACzC,MAAO,CACNN,KAAM,uBACNW,QAAAA,EACAL,aAAAA,GAaK,SAAS4G,EAAgBvG,EAASE,GAA2B,IAAlBC,EAAkB,wDACnE,MAAO,CACNd,KAAM,mBACNW,QAAAA,EACAE,QAAAA,EACAC,QAAAA,GAWK,SAASsD,EAAkBzD,GACjC,MAAO,CACNX,KAAM,qBACNW,QAAAA,GCxQK,MAAMY,EAA0BtB,GAAiB8D,MAAAA,IAEjD,IAFyD,SAC/DE,GACM,EACN,GAAOhE,EAIP,IACCgE,EAAUL,EAAyB3D,IAQnCgE,EAAUJ,SAPYU,GAAAA,CAAU,CAC/BI,KAAO,qCAAqC1E,OAEtBsH,KAAOC,IAC7BC,EAAAA,EAAAA,SAASD,GAAQ,CAAE9H,EAAOb,KAAS6I,EAAAA,EAAAA,WAAW7I,OAGFoB,IAC5C,SCPU0H,EAAc,CAC1BC,QAD0B,EAE1BC,UAF0B,EAG1BC,QAH0B,EAI1BC,UAASA,GAUGC,GAAQC,EAAAA,EAAAA,kBAvBF,uBAuBgCN,GC1BpC,SAASO,IACvB,MAAM,mBAAEb,IAAuBc,EAAAA,EAAAA,aAAaC,GAEtCC,GAAyBC,EAAAA,EAAAA,YAAa3G,IAC3C,MAAM,iBAAE4G,EAAF,aAAoBC,GAAiB7G,EAAQ8G,EAAAA,OACnD,OAAOD,MAAoBD,MACzB,IAEGG,GAAmBJ,EAAAA,EAAAA,YACtB3G,GAAYA,EAAQyG,GAAsBrG,uBAC5C,IAYD,OATA4G,EAAAA,EAAAA,YAAW,KACLN,GAA0BK,EAAiBxH,QAC/CwH,EAAiB/F,SAAWlC,IAC3B4G,EAAoB5G,IACpBmI,EAAAA,EAAAA,qBAAqBnI,EAAUC,WAG/B,CAAE2H,IAEE,MDMRQ,EAAAA,EAAAA,UAAUb,GEzCV,IAAI,EAA+BrI,OAAW,GAAc,WCAxD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAY,SCA3C,SAASmJ,IAetB,OAdAA,EAAW/J,OAAOgK,QAAU,SAAUC,GACpC,IAAK,IAAI5H,EAAI,EAAGA,EAAI6H,UAAU/H,OAAQE,IAAK,CACzC,IAAI8H,EAASD,UAAU7H,GAEvB,IAAK,IAAIvC,KAAOqK,EACVnK,OAAOM,UAAUC,eAAeC,KAAK2J,EAAQrK,KAC/CmK,EAAOnK,GAAOqK,EAAOrK,IAK3B,OAAOmK,IAGOG,MAAMC,KAAMH,WCf9B,IAAI,EAA+BtJ,OAAW,GAAgB,aCwB9D,EARA,YAA+C,IAAhC,KAAE0J,EAAF,KAAQC,EAAO,MAAOC,GAAU,EAC9C,OAAOC,EAAAA,EAAAA,cAAcH,EAAM,CAC1BI,MAAOH,EACPI,OAAQJ,KACLC,KCpBD,EAA+B5J,OAAW,GAAc,WCW5D,GALC,mBAAC,EAAAgK,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,qVCIV,GALC,mBAAC,EAAAkL,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,4dCQV,GATC,mBAAC,EAAAkL,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CACCC,SAAS,UACTtL,EAAE,+jBACFuL,SAAS,aC4CZ,EA3CA,YAA6B,IAAb,OAAEC,GAAW,EAC5B,MAAMC,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAE7BI,EAAgBF,KAAKG,MAAOL,GAC5BM,EAAgBJ,KAAKK,KAAMP,EAASI,GACpCI,EAAiB,GAAMJ,EAAgBE,GAE7C,OACC,2BACC,cAAa7D,EAAAA,EAAAA;;CAEZH,EAAAA,EAAAA,IAAI,qBACJ2D,KAGCQ,EAAAA,EAAAA,OAAOL,GAAiBjJ,IACzB,mBAAC,EAAD,CACCvC,IAAO,cAAcuC,IACrBuJ,UAAU,2CACVtB,KAAOuB,EACPtB,KAAO,QAGPoB,EAAAA,EAAAA,OAAOH,GAAiBnJ,IACzB,mBAAC,EAAD,CACCvC,IAAO,cAAcuC,IACrBuJ,UAAU,gDACVtB,KAAOwB,EACPvB,KAAO,QAGPoB,EAAAA,EAAAA,OAAOD,GAAkBrJ,IAC1B,mBAAC,EAAD,CACCvC,IAAO,eAAeuC,IACtBuJ,UAAU,4CACVtB,KAAOyB,EACPxB,KAAO,SCpCZ,GAN4B,QAAE,OAAEW,GAAJ,SAC3B,2BAAMU,UAAU,kCACf,mBAAC,EAAD,CAAOV,OAASA,MCOlB,GATA,YAA2C,IAAX,KAAEZ,GAAS,EAC1C,MAAMsB,EAAY,0CAClB,OAA8D,OAAvDtB,EAAK0B,MAAO,uCAClB,0BAAKJ,UAAYA,EAAYtH,IAAMgG,EAAO2B,IAAI,MAE9C,mBAAC,EAAAC,UAAD,CAAWN,UAAYA,EAAYtB,KAAOA,EAAO6B,YAAU,KCwB7D,GAvBuC,IAAiB,IAAf,MAAE3H,GAAa,EACvD,MAAM4H,GAAc7C,EAAAA,EAAAA,YACjB3G,GACDA,EAAQyG,GAAsBnG,uBAAwBsB,EAAMW,KAC7D,CAAEX,IAGH,OAAO4H,GAKN,0BAAKR,UAAU,8CACd,0BAAKA,UAAU,sDACZQ,EAAYtK,QACZsK,EAAYrK,QACX,KAAMyF,EAAAA,EAAAA,IAAI,2BACV,OATE,MCKT,SAAS6E,GAAT,KAGE,IAFD,MAAEzE,EAAF,OAASsD,EAAT,YAAiBoB,GAEhB,GADD,UAAEC,EAAF,YAAaC,EAAb,aAA0BjL,GACzB,EACD,MAAM4J,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAEnC,OAAOsB,GAAeD,GAEd5E,EAAAA,EAAAA,SAAS,wBAAwB8E,EAAAA,EAAAA,gBAAgB7E,IAGpD4E,GAEG7E,EAAAA,EAAAA,SAAS,WAAW8E,EAAAA,EAAAA,gBAAgB7E,IAGvCrG,GAEGoG,EAAAA,EAAAA,SAAS,kBAAkB8E,EAAAA,EAAAA,gBAAgB7E,IAI9C0E,EAAc,GAEX3E,EAAAA,EAAAA,SAAS,eAAe8E,EAAAA,EAAAA,gBAAgB7E,KAGzCD,EAAAA,EAAAA;;CAEN+E,EAAAA,EAAAA,IACC,6CACA,8CACAJ,IAEDG,EAAAA,EAAAA,gBAAgB7E,GAChBuD,EACAmB,GAqGF,OAjGA,YAAmE,IAA/B,UAAEK,EAAF,KAAanL,EAAb,QAAmBoL,GAAY,EAClE,MAAM,OAAEC,EAAF,YAAUC,EAAV,KAAuBxC,EAAvB,OAA6BY,EAA7B,MAAqCtD,GAAUpG,EAE/CgL,KAAiBO,EAAAA,EAAAA,cAAcvL,EAAKG,OAEpC,UAAE4K,EAAF,aAAahL,EAAb,cAA2ByL,IAAkBzD,EAAAA,EAAAA,YAChD3G,IACD,MAAM,uBACLM,EACA3B,aAAc0L,GACXrK,EAAQyG,GACN6D,EAAShK,EAAwB1B,EAAK2D,IACtCgI,EAAWD,GAAUA,EAAOnL,QAClC,MAAO,CACNwK,YAAcW,EACd3L,aAAc0L,EAAmBzL,EAAK2D,IACtC6H,eAAiBG,KAGnB,CAAE3L,IAGH,IAAI4L,EAAa,GAOjB,OANKZ,EACJY,GAAa5F,EAAAA,EAAAA,IAAI,cACNjG,IACX6L,GAAa5F,EAAAA,EAAAA,IAAI,iBAIjB,mBAAC,0BAAD,GACC6F,KAAK,SACLC,GAAKC,EAAAA,QACAZ,EAHN,CAICf,UAAU,+CACVgB,QAAYY,IACXA,EAAMC,iBACNb,KAEDc,OAASnM,EACToM,SAAWpM,IAAkByL,EAC7BY,MAAQvB,GAA2B7K,EAAM,CACxC+K,UAAAA,EACAC,YAAAA,EACAjL,aAAAA,IAEDsM,aAAc,EACdC,gBAAgB,gBAEhB,0BAAKlC,UAAU,uDACd,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO1C,MAAQA,IAC3CrG,GACD,2BAAMqK,UAAU,0DACf,mBAAC,EAAAmC,QAAD,QAGD,mBAAC,GAAD,CAAc7C,OAASA,MAGzB,2BAAMU,UAAU,0DACf,2BAAMA,UAAU,wDACboC,EAAAA,EAAAA,2BACDrG,EAAAA,EAAAA;;CAECH,EAAAA,EAAAA,IAAI,8BACJiF,EAAAA,EAAAA,gBAAgB7E,GAChBiF,GAED,CACCoB,MACC,2BAAMrC,UAAU,4DAKlBW,GACD,mBAAC,GAAD,CAAyB/H,MAAQhD,KAEjC,oCACC,2BAAMoK,UAAU,sDACVwB,IAEFX,EAAAA,EAAAA,gBAAgBK,IAElBE,KACGR,GAAejL,KAClB,mBAAC,EAAA2M,eAAD,MACG1G,EAAAA,EAAAA,IAAI,sBCrFf,GA5CA,YAAuE,IAAtC,MAAE2G,EAAF,QAASC,EAAUC,EAAAA,KAAnB,SAAyBC,GAAa,EACtE,MAAM3B,GAAY4B,EAAAA,EAAAA,gCACZ,iBAAExJ,IAAqBqE,EAAAA,EAAAA,aAAaC,GAE1C,OAAO8E,EAAMhM,QAKZ,mBAAC,sBAAD,KACMwK,EADN,CAECU,KAAK,UACLzB,UAAU,2CACV,cAAapE,EAAAA,EAAAA,IAAI,kCAEf2G,EAAM3F,KAAOhH,IAEb,mBAAC,GAAD,CACC1B,IAAM0B,EAAK2D,GACXwH,UAAYA,EACZC,QAAU,MAIJG,EAAAA,EAAAA,cAAcvL,EAAKG,MACvB2M,EAAU9M,GAEVuD,EAAkBvD,GAAO4E,MAAQhB,IAC3BA,GACJkJ,EAAU9M,MAIb4M,EAAS,OAEVA,QAAUA,EACV5M,KAAOA,OA/BJ,MC3BL,GAA+BZ,OAAW,GAAQ,KCsDtD,GA/CA,YAII,IAJsC,SACzC4N,EADyC,kBAEzCC,EAFyC,eAGzCC,GACG,EACH,MAAMC,EAAQF,EAAkBtM,OAehC,OAdAyH,EAAAA,EAAAA,YAAW,MACV/B,EAAAA,GAAAA,QACCF,EAAAA,EAAAA;;CAEC+E,EAAAA,EAAAA,IACC,+CACA,iDACAiC,GAEDA,MAGA,CAAEA,KAGJ,oCACKD,IACH,wBAAG9C,UAAU,wDACVpE,EAAAA,EAAAA,IAAI,sDAIR,0BAAKoE,UAAU,qDAEf,0BAAKA,UAAU,8CACd,0BAAKA,UAAU,sDACd,yBAAIA,UAAU,qDACXpE,EAAAA,EAAAA,IAAI,0BAEP,wBAAGoE,UAAU,2DACVpE,EAAAA,EAAAA,IACD,wDAIDgH,KCrCN,IALC,mBAAC,EAAA5D,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,oLCWV,GAZA,WACC,OACC,0BAAKkM,UAAU,sCACd,mBAAC,EAAD,CACCA,UAAU,yCACVtB,KAAOsE,MAER,6BAAKpH,EAAAA,EAAAA,IAAI,wBC0DZ,IAAeqH,EAAAA,EAAAA,SAAS,EACvBC,EAAAA,EAAAA,aAAY,CAAElM,EAAF,KAAoD,IAA1C,YAAE1B,EAAF,aAAe6N,EAAe,MAAY,EAC/D,MAAM,sBACLvM,EADK,+BAELD,GACGK,EAAQyG,IACN,mBAAE2F,GAAuBpM,EAAQE,EAAAA,OAEjCmM,EAAgBrM,EAAQsM,EAAAA,OAAYC,QACzC,OACA,0BAcD,MAAO,CACNV,kBANyBQ,EALlBzM,EAMiBtB,GANaO,QAAU+C,GAC9CwK,EAAoBxK,EAAOuK,GAAc,KAMxC,GAKFE,cAAAA,EACAG,UALiB7M,EAAgCrB,QAtBpD,EArDA,YAQI,IAR8B,kBACjCuN,EADiC,SAEjCH,EAFiC,QAGjCF,EAHiC,eAIjCM,EAJiC,cAKjCO,EALiC,UAMjCG,EANiC,SAOjCC,GACG,EACH,YAA8B,IAAlBJ,GAAiCG,GAAaC,GAExD,mCACGJ,IAAmBP,IACpB,oCACC,wBAAG9C,UAAU,wDACVpE,EAAAA,EAAAA,IACD,sDAGF,0BAAKoE,UAAU,sDAGjB,0BAAKA,UAAU,iEACd,mBAAC,EAAAmC,QAAD,SAMC,IAAUkB,EACPP,EAIA,MAHC,mBAAC,GAAD,MAMCD,EAAkBtM,QAC3B,mBAAC,GAAD,CACCsM,kBAAoBA,EACpBC,eAAiBA,IAEjB,mBAAC,GAAD,CACCP,MAAQM,EACRH,SAAWA,EACXF,QAAUA,MAIVM,IAAkB,mBAAC,GAAD,SCftB,GApCA,WACC,MAAQY,EAAsBC,IAAmBC,EAAAA,EAAAA,UAAU,IACrDC,GAA0BC,EAAAA,EAAAA,UAAUH,EAAgB,KAE1D,OACC,mBAAC,EAAAI,gCAAD,MACG,IAMK,IANH,SACHrB,EADG,QAEHF,EAFG,YAGHlN,EAHG,SAIH0O,EAJG,aAKHb,GACM,EAKN,OAJKO,IAAyBpO,GAC7BuO,EAAyBvO,GAGnBoO,GAKN,mBAAC,GAAD,CACChB,SAAWA,EACXF,QAAUA,EACVW,aAAeA,EACf7N,YAAcoO,EACdZ,eAAiBkB,EACjBP,SAAWnO,IAAgBoO,IAVrB,SClCR,GAA+B1O,OAAW,GAAY,SCU3C,SAASiP,GAAT,GAAkC,IAAZ,MAAE1B,GAAU,EAChD,OAAOA,EAAMhM,QAKZ,yBAAIyJ,UAAU,gCACXuC,EAAM3F,KAAK,QAAE,KAAE8B,EAAF,GAAQnF,EAAR,MAAYyC,EAAZ,OAAmBiF,GAArB,SACZ,yBAAI/M,IAAMqF,EAAKyG,UAAU,uCACxB,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO1C,MAAQA,KAE7C,0BAAKgE,UAAU,+CACd,0BAAKA,UAAU,4CACZhE,IAEH,0BAAKgE,UAAU,8CACZjE,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,SACJqF,UAjBC,KCEM,SAASiD,KACvB,MAAMC,GAAgBxG,EAAAA,EAAAA,YACnB3G,GAAYA,EAAQyG,GAAsB3G,oBAC5C,IAGD,OAAOqN,EAAc5N,QAKpB,mBAAC,GAAA6N,sBAAD,CACC1F,KAAOsE,GACPhH,OAAQD,EAAAA,EAAAA;CAEP+E,EAAAA,EAAAA,IACC,kBACA,mBACAqD,EAAc5N,QAEf4N,EAAc5N,QAEf8N,aAAc,IAEd,wBAAGrE,UAAU,6CACVc,EAAAA,EAAAA,IACD,mDACA,qDACAqD,EAAc5N,UAGhB,mBAAC0N,GAAD,CAAa1B,MAAQ4B,KAxBf,KCPM,SAASG,GAAT,GAA0D,IAAlC,WAAEC,EAAF,MAAc3L,EAAd,SAAqB4L,GAAa,EACxE,MAAMC,GAAoB9G,EAAAA,EAAAA,YACvB3G,GAAYA,EAAQyG,GAAsB9H,aAAciD,EAAMW,KAChE,CAAEX,EAAMW,MAEH,iBAAEJ,IAAqBqE,EAAAA,EAAAA,aAAaC,IACpC,aAAEiH,IAAiBlH,EAAAA,EAAAA,aAAatG,EAAAA,OAEtC,OACC,mBAAC,EAAAyK,OAAD,CACCX,QAAU,IACT7H,EAAkBP,GAAQ4B,MAAQhB,IACjC,GAAKA,EAAU,CACd,MAAM1D,GAAYqL,EAAAA,EAAAA,cAAcvI,EAAM7C,OAC9B4O,IAAkB9J,EAAAA,EAAAA,OACzB0J,EAAWK,iBAEPD,GAAiB7O,GACrB4O,EACCF,GACAK,EAAAA,EAAAA,aACC/O,EAAUC,KACV4O,EAAcJ,WACdI,EAAcjO,kBAOpBqL,SAAW0C,EACX3C,OAAS2C,EACTK,QAAQ,YAEN/I,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,cACJhD,EAAMoD,QC9BV,MA6BM+I,GAAkB,IAAmC,IAAjC,cAAEJ,KAAkB/F,GAAa,EAC1D,MAAM,aAAEoG,EAAF,2BAAgBC,GAA+BrG,EAAM2F,YACrD,aAAEG,IAAiBlH,EAAAA,EAAAA,aAAatG,EAAAA,OAUhCgO,IAAgBD,EAChBE,GAAehE,EAAAA,EAAAA,cAAc,aAEnC,IAAIiE,GAAcrJ,EAAAA,EAAAA;;CAEjBH,EAAAA,EAAAA,IACC,+GAED+I,EAAc3I,OAASgJ,GAExB,MAAM7H,EAAU,EACf,mBAACmH,GAAD,CACCpQ,IAAI,UACJ0E,MAAQ+L,EACRJ,WAAa3F,EAAM2F,WACnBC,SAAW5F,EAAM4F,YAmBnB,OAfKU,GAAcC,IAClBC,GAAcrJ,EAAAA,EAAAA;;CAEbH,EAAAA,EAAAA,IACC,mJAED+I,EAAc3I,OAASgJ,GAExB7H,EAAQkI,MACP,mBAAC,EAAA1D,OAAD,CAAQzN,IAAI,UAAU8M,QArCF,KACrB0D,EACC9F,EAAM4F,UACNK,EAAAA,EAAAA,aAAa,YAAa,CACzBS,QAASL,MAiCsCH,QAAQ,SACrDlJ,EAAAA,EAAAA,IAAI,oBAMR,0BAAU2J,EAAAA,EAAAA,kBACT,mBAAC,EAAAC,QAAD,CAASrI,QAAUA,GAAYiI,IAC/B,mBAAC,EAAAK,QAAD,KAAWR,MCrFdS,EAAAA,EAAAA,gBAAgB,kBAAmB,CAClCC,OAAM,KAEJ,oCACC,mBAACpI,EAAD,OACA,mBAAC,GAAD,OACA,mBAAC2G,GAAD,UAMJ0B,EAAAA,EAAAA,WACC,2BACA,4BACA,CAAEC,EAAU9P,KACX,MAAc,iBAATA,IAGL8P,EAASC,MDZiBC,ECYSF,EAASC,KDZOlH,IACpD,MAAM,aAAEoG,GAAiBpG,EAAM2F,YAGzB,MAAE3L,EAAF,cAASyK,IAAkB1F,EAAAA,EAAAA,YAC9B3G,IACD,MAAM,sBAAEJ,GAA0BI,EAAQyG,GACpCnH,EAASM,EACd,SAAWoO,GACVnP,QAAQ,QAAE,KAAEE,GAAJ,SAAgBiP,IAAiBjP,KAC3C,MAAO,CACNsN,cAAerM,EAAQsM,EAAAA,OAAYC,QAClC,OACA,0BAED3K,MAAOtC,EAAOC,QAAUD,EAAQ,MAGlC,CAAE0O,IAIH,OAAO3B,GAAmBzK,GAInB,mBAACmM,GAAD,KAAsBnG,EAAtB,CAA8B+F,cAAgB/L,MAH7C,mBAACmN,EAAuBnH,MCbvBiH,EDVkBE,IAAAA,M","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/compat get default export","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/runtime/make namespace object","webpack://wp/external window [\"wp\",\"element\"]","webpack://wp/external window [\"wp\",\"plugins\"]","webpack://wp/external window [\"wp\",\"hooks\"]","webpack://wp/external window [\"wp\",\"blocks\"]","webpack://wp/external window [\"wp\",\"data\"]","webpack://wp/external window [\"wp\",\"editor\"]","webpack://wp/external window \"lodash\"","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/reducer.js","webpack://wp/external window [\"wp\",\"blockEditor\"]","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/has-block-type.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/selectors.js","webpack://wp/external window [\"wp\",\"i18n\"]","webpack://wp/external window [\"wp\",\"apiFetch\"]","webpack://wp/external window [\"wp\",\"notices\"]","webpack://wp/external window [\"wp\",\"url\"]","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/load-assets.js","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/get-plugin-url.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/actions.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/resolvers.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/index.js","webpack://wp/./packages/block-directory/build-module/components/auto-block-uninstaller/@wordpress/block-directory/src/components/auto-block-uninstaller/index.js","webpack://wp/external window [\"wp\",\"components\"]","webpack://wp/external window [\"wp\",\"compose\"]","webpack://wp/external window [\"wp\",\"coreData\"]","webpack://wp/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://wp/external window [\"wp\",\"htmlEntities\"]","webpack://wp/./packages/icons/build-module/icon/@wordpress/icons/src/icon/index.js","webpack://wp/external window [\"wp\",\"primitives\"]","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-filled.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-half.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-empty.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/stars.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-icon/@wordpress/block-directory/src/components/downloadable-block-icon/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-notice/@wordpress/block-directory/src/components/downloadable-block-notice/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-list-item/@wordpress/block-directory/src/components/downloadable-block-list-item/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-list/@wordpress/block-directory/src/components/downloadable-blocks-list/index.js","webpack://wp/external window [\"wp\",\"a11y\"]","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/inserter-panel.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/block-default.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/no-results.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/@wordpress/block-directory/src/plugins/inserter-menu-downloadable-blocks-panel/index.js","webpack://wp/external window [\"wp\",\"editPost\"]","webpack://wp/./packages/block-directory/build-module/components/compact-list/@wordpress/block-directory/src/components/compact-list/index.js","webpack://wp/./packages/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/@wordpress/block-directory/src/plugins/installed-blocks-pre-publish-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/install-button.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/index.js","webpack://wp/./packages/block-directory/build-module/plugins/@wordpress/block-directory/src/plugins/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"plugins\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editor\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"lodash\"];","/**\n * External dependencies\n */\n\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning an array of downloadable blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const downloadableBlocks = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'FETCH_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tisRequesting: true,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'RECEIVE_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tresults: action.downloadableBlocks,\n\t\t\t\t\tisRequesting: false,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer managing the installation and deletion of blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const blockManagement = (\n\tstate = {\n\t\tinstalledBlockTypes: [],\n\t\tisInstalling: {},\n\t},\n\taction\n) => {\n\tswitch ( action.type ) {\n\t\tcase 'ADD_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: [\n\t\t\t\t\t...state.installedBlockTypes,\n\t\t\t\t\taction.item,\n\t\t\t\t],\n\t\t\t};\n\t\tcase 'REMOVE_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: state.installedBlockTypes.filter(\n\t\t\t\t\t( blockType ) => blockType.name !== action.item.name\n\t\t\t\t),\n\t\t\t};\n\t\tcase 'SET_INSTALLING_BLOCK':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisInstalling: {\n\t\t\t\t\t...state.isInstalling,\n\t\t\t\t\t[ action.blockId ]: action.isInstalling,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer returning an object of error notices.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const errorNotices = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'SET_ERROR_NOTICE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.blockId ]: {\n\t\t\t\t\tmessage: action.message,\n\t\t\t\t\tisFatal: action.isFatal,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'CLEAR_ERROR_NOTICE':\n\t\t\treturn omit( state, action.blockId );\n\t}\n\treturn state;\n};\n\nexport default combineReducers( {\n\tdownloadableBlocks,\n\tblockManagement,\n\terrorNotices,\n} );\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * Check if a block list contains a specific block type. Recursively searches\n * through `innerBlocks` if they exist.\n *\n * @param {Object} blockType A block object to search for.\n * @param {Object[]} blocks The list of blocks to look through.\n *\n * @return {boolean} Whether the blockType is found.\n */\nexport default function hasBlockType( blockType, blocks = [] ) {\n\tif ( ! blocks.length ) {\n\t\treturn false;\n\t}\n\tif ( blocks.some( ( { name } ) => name === blockType.name ) ) {\n\t\treturn true;\n\t}\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( hasBlockType( blockType, blocks[ i ].innerBlocks ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport hasBlockType from './utils/has-block-type';\n\n/**\n * Returns true if application is requesting for downloadable blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {boolean} Whether a request is in progress for the blocks list.\n */\nexport function isRequestingDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.isRequesting ?? false;\n}\n\n/**\n * Returns the available uninstalled blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {Array} Downloadable blocks.\n */\nexport function getDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.results ?? [];\n}\n\n/**\n * Returns the block types that have been installed on the server in this\n * session.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items\n */\nexport function getInstalledBlockTypes( state ) {\n\treturn state.blockManagement.installedBlockTypes;\n}\n\n/**\n * Returns block types that have been installed on the server and used in the\n * current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getNewBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter( ( blockType ) =>\n\t\t\thasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns the block types that have been installed on the server but are not\n * used in the current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getUnusedBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter(\n\t\t\t( blockType ) => ! hasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if a block plugin install is in progress.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId Id of the block.\n *\n * @return {boolean} Whether this block is currently being installed.\n */\nexport function isInstalling( state, blockId ) {\n\treturn state.blockManagement.isInstalling[ blockId ] || false;\n}\n\n/**\n * Returns all block error notices.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Object with error notices.\n */\nexport function getErrorNotices( state ) {\n\treturn state.errorNotices;\n}\n\n/**\n * Returns the error notice for a given block.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {string|boolean} The error text, or false if no error.\n */\nexport function getErrorNoticeForBlock( state, blockId ) {\n\treturn state.errorNotices[ blockId ];\n}\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"apiFetch\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"notices\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Load an asset for a block.\n *\n * This function returns a Promise that will resolve once the asset is loaded,\n * or in the case of Stylesheets and Inline JavaScript, will resolve immediately.\n *\n * @param {HTMLElement} el A HTML Element asset to inject.\n *\n * @return {Promise} Promise which will resolve when the asset is loaded.\n */\nexport const loadAsset = ( el ) => {\n\treturn new Promise( ( resolve, reject ) => {\n\t\t/*\n\t\t * Reconstruct the passed element, this is required as inserting the Node directly\n\t\t * won't always fire the required onload events, even if the asset wasn't already loaded.\n\t\t */\n\t\tconst newNode = document.createElement( el.nodeName );\n\n\t\t[ 'id', 'rel', 'src', 'href', 'type' ].forEach( ( attr ) => {\n\t\t\tif ( el[ attr ] ) {\n\t\t\t\tnewNode[ attr ] = el[ attr ];\n\t\t\t}\n\t\t} );\n\n\t\t// Append inline <script> contents.\n\t\tif ( el.innerHTML ) {\n\t\t\tnewNode.appendChild( document.createTextNode( el.innerHTML ) );\n\t\t}\n\n\t\tnewNode.onload = () => resolve( true );\n\t\tnewNode.onerror = () => reject( new Error( 'Error loading asset.' ) );\n\n\t\tdocument.body.appendChild( newNode );\n\n\t\t// Resolve Stylesheets and Inline JavaScript immediately.\n\t\tif (\n\t\t\t'link' === newNode.nodeName.toLowerCase() ||\n\t\t\t( 'script' === newNode.nodeName.toLowerCase() && ! newNode.src )\n\t\t) {\n\t\t\tresolve();\n\t\t}\n\t} );\n};\n\n/**\n * Load the asset files for a block\n */\nexport async function loadAssets() {\n\t/*\n\t * Fetch the current URL (post-new.php, or post.php?post=1&action=edit) and compare the\n\t * JavaScript and CSS assets loaded between the pages. This imports the required assets\n\t * for the block into the current page while not requiring that we know them up-front.\n\t * In the future this can be improved by reliance upon block.json and/or a script-loader\n\t * dependency API.\n\t */\n\tconst response = await apiFetch( {\n\t\turl: document.location.href,\n\t\tparse: false,\n\t} );\n\n\tconst data = await response.text();\n\n\tconst doc = new window.DOMParser().parseFromString( data, 'text/html' );\n\n\tconst newAssets = Array.from(\n\t\tdoc.querySelectorAll( 'link[rel=\"stylesheet\"],script' )\n\t).filter( ( asset ) => asset.id && ! document.getElementById( asset.id ) );\n\n\t/*\n\t * Load each asset in order, as they may depend upon an earlier loaded script.\n\t * Stylesheets and Inline Scripts will resolve immediately upon insertion.\n\t */\n\tfor ( const newAsset of newAssets ) {\n\t\tawait loadAsset( newAsset );\n\t}\n}\n","/**\n * Get the plugin's direct API link out of a block-directory response.\n *\n * @param {Object} block The block object\n *\n * @return {string} The plugin URL, if exists.\n */\nexport default function getPluginUrl( block ) {\n\tif ( ! block ) {\n\t\treturn false;\n\t}\n\tconst link = block.links[ 'wp:plugin' ] || block.links.self;\n\tif ( link && link.length ) {\n\t\treturn link[ 0 ].href;\n\t}\n\treturn false;\n}\n","/**\n * External dependencies\n */\nimport { pick } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tstore as blocksStore,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n} from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { loadAssets } from './load-assets';\nimport getPluginUrl from './utils/get-plugin-url';\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been requested and are loading.\n *\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function fetchDownloadableBlocks( filterValue ) {\n\treturn { type: 'FETCH_DOWNLOADABLE_BLOCKS', filterValue };\n}\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been updated.\n *\n * @param {Array} downloadableBlocks Downloadable blocks.\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function receiveDownloadableBlocks( downloadableBlocks, filterValue ) {\n\treturn {\n\t\ttype: 'RECEIVE_DOWNLOADABLE_BLOCKS',\n\t\tdownloadableBlocks,\n\t\tfilterValue,\n\t};\n}\n\n/**\n * Action triggered to install a block plugin.\n *\n * @param {Object} block The block item returned by search.\n *\n * @return {boolean} Whether the block was successfully installed & loaded.\n */\nexport const installBlockType = ( block ) => async ( {\n\tregistry,\n\tdispatch,\n} ) => {\n\tconst { id, name } = block;\n\tlet success = false;\n\tdispatch.clearErrorNotice( id );\n\ttry {\n\t\tdispatch.setIsInstalling( id, true );\n\n\t\t// If we have a wp:plugin link, the plugin is installed but inactive.\n\t\tconst url = getPluginUrl( block );\n\t\tlet links = {};\n\t\tif ( url ) {\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'PUT',\n\t\t\t\turl,\n\t\t\t\tdata: { status: 'active' },\n\t\t\t} );\n\t\t} else {\n\t\t\tconst response = await apiFetch( {\n\t\t\t\tmethod: 'POST',\n\t\t\t\tpath: 'wp/v2/plugins',\n\t\t\t\tdata: { slug: id, status: 'active' },\n\t\t\t} );\n\t\t\t// Add the `self` link for newly-installed blocks.\n\t\t\tlinks = response._links;\n\t\t}\n\n\t\tdispatch.addInstalledBlockType( {\n\t\t\t...block,\n\t\t\tlinks: { ...block.links, ...links },\n\t\t} );\n\n\t\t// Ensures that the block metadata is propagated to the editor when registered on the server.\n\t\tconst metadataFields = [\n\t\t\t'api_version',\n\t\t\t'title',\n\t\t\t'category',\n\t\t\t'parent',\n\t\t\t'icon',\n\t\t\t'description',\n\t\t\t'keywords',\n\t\t\t'attributes',\n\t\t\t'provides_context',\n\t\t\t'uses_context',\n\t\t\t'supports',\n\t\t\t'styles',\n\t\t\t'example',\n\t\t\t'variations',\n\t\t];\n\t\tawait apiFetch( {\n\t\t\tpath: addQueryArgs( `/wp/v2/block-types/${ name }`, {\n\t\t\t\t_fields: metadataFields,\n\t\t\t} ),\n\t\t} )\n\t\t\t// Ignore when the block is not registered on the server.\n\t\t\t.catch( () => {} )\n\t\t\t.then( ( response ) => {\n\t\t\t\tif ( ! response ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tunstable__bootstrapServerSideBlockDefinitions( {\n\t\t\t\t\t[ name ]: pick( response, metadataFields ),\n\t\t\t\t} );\n\t\t\t} );\n\n\t\tawait loadAssets();\n\t\tconst registeredBlocks = registry.select( blocksStore ).getBlockTypes();\n\t\tif ( ! registeredBlocks.some( ( i ) => i.name === name ) ) {\n\t\t\tthrow new Error(\n\t\t\t\t__( 'Error registering block. Try reloading the page.' )\n\t\t\t);\n\t\t}\n\n\t\tregistry.dispatch( noticesStore ).createInfoNotice(\n\t\t\tsprintf(\n\t\t\t\t// translators: %s is the block title.\n\t\t\t\t__( 'Block %s installed and added.' ),\n\t\t\t\tblock.title\n\t\t\t),\n\t\t\t{\n\t\t\t\tspeak: true,\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t\tsuccess = true;\n\t} catch ( error ) {\n\t\tlet message = error.message || __( 'An error occurred.' );\n\n\t\t// Errors we throw are fatal\n\t\tlet isFatal = error instanceof Error;\n\n\t\t// Specific API errors that are fatal\n\t\tconst fatalAPIErrors = {\n\t\t\tfolder_exists: __(\n\t\t\t\t'This block is already installed. Try reloading the page.'\n\t\t\t),\n\t\t\tunable_to_connect_to_filesystem: __(\n\t\t\t\t'Error installing block. You can reload the page and try again.'\n\t\t\t),\n\t\t};\n\n\t\tif ( fatalAPIErrors[ error.code ] ) {\n\t\t\tisFatal = true;\n\t\t\tmessage = fatalAPIErrors[ error.code ];\n\t\t}\n\n\t\tdispatch.setErrorNotice( id, message, isFatal );\n\t\tregistry.dispatch( noticesStore ).createErrorNotice( message, {\n\t\t\tspeak: true,\n\t\t\tisDismissible: true,\n\t\t} );\n\t}\n\tdispatch.setIsInstalling( id, false );\n\treturn success;\n};\n\n/**\n * Action triggered to uninstall a block plugin.\n *\n * @param {Object} block The blockType object.\n */\nexport const uninstallBlockType = ( block ) => async ( {\n\tregistry,\n\tdispatch,\n} ) => {\n\ttry {\n\t\tconst url = getPluginUrl( block );\n\t\tawait apiFetch( {\n\t\t\tmethod: 'PUT',\n\t\t\turl,\n\t\t\tdata: { status: 'inactive' },\n\t\t} );\n\t\tawait apiFetch( {\n\t\t\tmethod: 'DELETE',\n\t\t\turl,\n\t\t} );\n\t\tdispatch.removeInstalledBlockType( block );\n\t} catch ( error ) {\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createErrorNotice( error.message || __( 'An error occurred.' ) );\n\t}\n};\n\n/**\n * Returns an action object used to add a block type to the \"newly installed\"\n * tracking list.\n *\n * @param {Object} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function addInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'ADD_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to remove a block type from the \"newly installed\"\n * tracking list.\n *\n * @param {string} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function removeInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'REMOVE_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to indicate install in progress.\n *\n * @param {string} blockId\n * @param {boolean} isInstalling\n *\n * @return {Object} Action object.\n */\nexport function setIsInstalling( blockId, isInstalling ) {\n\treturn {\n\t\ttype: 'SET_INSTALLING_BLOCK',\n\t\tblockId,\n\t\tisInstalling,\n\t};\n}\n\n/**\n * Sets an error notice to be displayed to the user for a given block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n * @param {string} message The message shown in the notice.\n * @param {boolean} isFatal Whether the user can recover from the error.\n *\n * @return {Object} Action object.\n */\nexport function setErrorNotice( blockId, message, isFatal = false ) {\n\treturn {\n\t\ttype: 'SET_ERROR_NOTICE',\n\t\tblockId,\n\t\tmessage,\n\t\tisFatal,\n\t};\n}\n\n/**\n * Sets the error notice to empty for specific block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {Object} Action object.\n */\nexport function clearErrorNotice( blockId ) {\n\treturn {\n\t\ttype: 'CLEAR_ERROR_NOTICE',\n\t\tblockId,\n\t};\n}\n","/**\n * External dependencies\n */\nimport { camelCase, mapKeys } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport { fetchDownloadableBlocks, receiveDownloadableBlocks } from './actions';\n\nexport const getDownloadableBlocks = ( filterValue ) => async ( {\n\tdispatch,\n} ) => {\n\tif ( ! filterValue ) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tdispatch( fetchDownloadableBlocks( filterValue ) );\n\t\tconst results = await apiFetch( {\n\t\t\tpath: `wp/v2/block-directory/search?term=${ filterValue }`,\n\t\t} );\n\t\tconst blocks = results.map( ( result ) =>\n\t\t\tmapKeys( result, ( value, key ) => camelCase( key ) )\n\t\t);\n\n\t\tdispatch( receiveDownloadableBlocks( blocks, filterValue ) );\n\t} catch {}\n};\n","/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as resolvers from './resolvers';\n\n/**\n * Module Constants\n */\nconst STORE_NAME = 'core/block-directory';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n\tresolvers,\n};\n\n/**\n * Store definition for the block directory namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\n\nregister( store );\n","/**\n * WordPress dependencies\n */\nimport { unregisterBlockType } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function AutoBlockUninstaller() {\n\tconst { uninstallBlockType } = useDispatch( blockDirectoryStore );\n\n\tconst shouldRemoveBlockTypes = useSelect( ( select ) => {\n\t\tconst { isAutosavingPost, isSavingPost } = select( editorStore );\n\t\treturn isSavingPost() && ! isAutosavingPost();\n\t}, [] );\n\n\tconst unusedBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getUnusedBlockTypes(),\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldRemoveBlockTypes && unusedBlockTypes.length ) {\n\t\t\tunusedBlockTypes.forEach( ( blockType ) => {\n\t\t\t\tuninstallBlockType( blockType );\n\t\t\t\tunregisterBlockType( blockType.name );\n\t\t\t} );\n\t\t}\n\t}, [ shouldRemoveBlockTypes ] );\n\n\treturn null;\n}\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"compose\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"htmlEntities\"];","/**\n * WordPress dependencies\n */\nimport { cloneElement } from '@wordpress/element';\n\n/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */\n\n/**\n * Return an SVG icon.\n *\n * @param {IconProps} props icon is the SVG component to render\n * size is a number specifiying the icon size in pixels\n * Other props will be passed to wrapped SVG component\n *\n * @return {JSX.Element} Icon component\n */\nfunction Icon( { icon, size = 24, ...props } ) {\n\treturn cloneElement( icon, {\n\t\twidth: size,\n\t\theight: size,\n\t\t...props,\n\t} );\n}\n\nexport default Icon;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starFilled = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z\" />\n\t</SVG>\n);\n\nexport default starFilled;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starHalf = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z\" />\n\t</SVG>\n);\n\nexport default starHalf;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starEmpty = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path\n\t\t\tfillRule=\"evenodd\"\n\t\t\td=\"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z\"\n\t\t\tclipRule=\"evenodd\"\n\t\t/>\n\t</SVG>\n);\n\nexport default starEmpty;\n","/**\n * External dependencies\n */\nimport { times } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Icon, starEmpty, starFilled, starHalf } from '@wordpress/icons';\n\nfunction Stars( { rating } ) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tconst fullStarCount = Math.floor( rating );\n\tconst halfStarCount = Math.ceil( rating - fullStarCount );\n\tconst emptyStarCount = 5 - ( fullStarCount + halfStarCount );\n\n\treturn (\n\t\t<span\n\t\t\taria-label={ sprintf(\n\t\t\t\t/* translators: %s: number of stars. */\n\t\t\t\t__( '%s out of 5 stars' ),\n\t\t\t\tstars\n\t\t\t) }\n\t\t>\n\t\t\t{ times( fullStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `full_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-full\"\n\t\t\t\t\ticon={ starFilled }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ times( halfStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `half_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-half-full\"\n\t\t\t\t\ticon={ starHalf }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ times( emptyStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `empty_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-empty\"\n\t\t\t\t\ticon={ starEmpty }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</span>\n\t);\n}\n\nexport default Stars;\n","/**\n * Internal dependencies\n */\nimport Stars from './stars';\n\nexport const BlockRatings = ( { rating } ) => (\n\t<span className=\"block-directory-block-ratings\">\n\t\t<Stars rating={ rating } />\n\t</span>\n);\n\nexport default BlockRatings;\n","/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\n\nfunction DownloadableBlockIcon( { icon } ) {\n\tconst className = 'block-directory-downloadable-block-icon';\n\treturn icon.match( /\\.(jpeg|jpg|gif|png|svg)(?:\\?.*)?$/ ) !== null ? (\n\t\t<img className={ className } src={ icon } alt=\"\" />\n\t) : (\n\t\t<BlockIcon className={ className } icon={ icon } showColors />\n\t);\n}\n\nexport default DownloadableBlockIcon;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport const DownloadableBlockNotice = ( { block } ) => {\n\tconst errorNotice = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockDirectoryStore ).getErrorNoticeForBlock( block.id ),\n\t\t[ block ]\n\t);\n\n\tif ( ! errorNotice ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"block-directory-downloadable-block-notice\">\n\t\t\t<div className=\"block-directory-downloadable-block-notice__content\">\n\t\t\t\t{ errorNotice.message }\n\t\t\t\t{ errorNotice.isFatal\n\t\t\t\t\t? ' ' + __( 'Try reloading the page.' )\n\t\t\t\t\t: null }\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default DownloadableBlockNotice;\n","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tSpinner,\n\tVisuallyHidden,\n\t__unstableCompositeItem as CompositeItem,\n} from '@wordpress/components';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockRatings from '../block-ratings';\nimport DownloadableBlockIcon from '../downloadable-block-icon';\nimport DownloadableBlockNotice from '../downloadable-block-notice';\nimport { store as blockDirectoryStore } from '../../store';\n\n// Return the appropriate block item label, given the block data and status.\nfunction getDownloadableBlockLabel(\n\t{ title, rating, ratingCount },\n\t{ hasNotice, isInstalled, isInstalling }\n) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tif ( ! isInstalled && hasNotice ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Retry installing %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalled ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Add %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalling ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Installing %s.', decodeEntities( title ) );\n\t}\n\n\t// No ratings yet, just use the title.\n\tif ( ratingCount < 1 ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Install %s.', decodeEntities( title ) );\n\t}\n\n\treturn sprintf(\n\t\t/* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */\n\t\t_n(\n\t\t\t'Install %1$s. %2$s stars with %3$s review.',\n\t\t\t'Install %1$s. %2$s stars with %3$s reviews.',\n\t\t\tratingCount\n\t\t),\n\t\tdecodeEntities( title ),\n\t\tstars,\n\t\tratingCount\n\t);\n}\n\nfunction DownloadableBlockListItem( { composite, item, onClick } ) {\n\tconst { author, description, icon, rating, title } = item;\n\t// getBlockType returns a block object if this block exists, or null if not.\n\tconst isInstalled = !! getBlockType( item.name );\n\n\tconst { hasNotice, isInstalling, isInstallable } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetErrorNoticeForBlock,\n\t\t\t\tisInstalling: isBlockInstalling,\n\t\t\t} = select( blockDirectoryStore );\n\t\t\tconst notice = getErrorNoticeForBlock( item.id );\n\t\t\tconst hasFatal = notice && notice.isFatal;\n\t\t\treturn {\n\t\t\t\thasNotice: !! notice,\n\t\t\t\tisInstalling: isBlockInstalling( item.id ),\n\t\t\t\tisInstallable: ! hasFatal,\n\t\t\t};\n\t\t},\n\t\t[ item ]\n\t);\n\n\tlet statusText = '';\n\tif ( isInstalled ) {\n\t\tstatusText = __( 'Installed!' );\n\t} else if ( isInstalling ) {\n\t\tstatusText = __( 'Installing…' );\n\t}\n\n\treturn (\n\t\t<CompositeItem\n\t\t\trole=\"option\"\n\t\t\tas={ Button }\n\t\t\t{ ...composite }\n\t\t\tclassName=\"block-directory-downloadable-block-list-item\"\n\t\t\tonClick={ ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick();\n\t\t\t} }\n\t\t\tisBusy={ isInstalling }\n\t\t\tdisabled={ isInstalling || ! isInstallable }\n\t\t\tlabel={ getDownloadableBlockLabel( item, {\n\t\t\t\thasNotice,\n\t\t\t\tisInstalled,\n\t\t\t\tisInstalling,\n\t\t\t} ) }\n\t\t\tshowTooltip={ true }\n\t\t\ttooltipPosition=\"top center\"\n\t\t>\n\t\t\t<div className=\"block-directory-downloadable-block-list-item__icon\">\n\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\t\t\t\t{ isInstalling ? (\n\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__spinner\">\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockRatings rating={ rating } />\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<span className=\"block-directory-downloadable-block-list-item__details\">\n\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__title\">\n\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %1$s: block title, %2$s: author name. */\n\t\t\t\t\t\t\t__( '%1$s <span>by %2$s</span>' ),\n\t\t\t\t\t\t\tdecodeEntities( title ),\n\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__author\" />\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t\t{ hasNotice ? (\n\t\t\t\t\t<DownloadableBlockNotice block={ item } />\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__desc\">\n\t\t\t\t\t\t\t{ !! statusText\n\t\t\t\t\t\t\t\t? statusText\n\t\t\t\t\t\t\t\t: decodeEntities( description ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{ isInstallable &&\n\t\t\t\t\t\t\t! ( isInstalled || isInstalling ) && (\n\t\t\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t\t\t{ __( 'Install block' ) }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</CompositeItem>\n\t);\n}\n\nexport default DownloadableBlockListItem;\n","/**\n * External dependencies\n */\nimport { noop } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n} from '@wordpress/components';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockListItem from '../downloadable-block-list-item';\nimport { store as blockDirectoryStore } from '../../store';\n\nfunction DownloadableBlocksList( { items, onHover = noop, onSelect } ) {\n\tconst composite = useCompositeState();\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-directory-downloadable-blocks-list\"\n\t\t\taria-label={ __( 'Blocks available for install' ) }\n\t\t>\n\t\t\t{ items.map( ( item ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlockListItem\n\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t// Check if the block is registered (`getBlockType`\n\t\t\t\t\t\t\t// will return an object). If so, insert the block.\n\t\t\t\t\t\t\t// This prevents installing existing plugins.\n\t\t\t\t\t\t\tif ( getBlockType( item.name ) ) {\n\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tinstallBlockType( item ).then( ( success ) => {\n\t\t\t\t\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\titem={ item }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Composite>\n\t);\n}\n\nexport default DownloadableBlocksList;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"a11y\"];","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\nfunction DownloadableBlocksInserterPanel( {\n\tchildren,\n\tdownloadableItems,\n\thasLocalBlocks,\n} ) {\n\tconst count = downloadableItems.length;\n\tuseEffect( () => {\n\t\tspeak(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %d: number of available blocks. */\n\t\t\t\t_n(\n\t\t\t\t\t'%d additional block is available to install.',\n\t\t\t\t\t'%d additional blocks are available to install.',\n\t\t\t\t\tcount\n\t\t\t\t),\n\t\t\t\tcount\n\t\t\t)\n\t\t);\n\t}, [ count ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! hasLocalBlocks && (\n\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t{ __( 'No results available from your installed blocks.' ) }\n\t\t\t\t</p>\n\t\t\t) }\n\n\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\n\t\t\t<div className=\"block-directory-downloadable-blocks-panel\">\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel__header\">\n\t\t\t\t\t<h2 className=\"block-directory-downloadable-blocks-panel__title\">\n\t\t\t\t\t\t{ __( 'Available to install' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__description\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Select a block to install and add it to your post.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksInserterPanel;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst blockDefault = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z\" />\n\t</SVG>\n);\n\nexport default blockDefault;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, blockDefault } from '@wordpress/icons';\n\nfunction DownloadableBlocksNoResults() {\n\treturn (\n\t\t<div className=\"block-editor-inserter__no-results\">\n\t\t\t<Icon\n\t\t\t\tclassName=\"block-editor-inserter__no-results-icon\"\n\t\t\t\ticon={ blockDefault }\n\t\t\t/>\n\t\t\t<p>{ __( 'No results found.' ) }</p>\n\t\t</div>\n\t);\n}\n\nexport default DownloadableBlocksNoResults;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Spinner } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksList from '../downloadable-blocks-list';\nimport DownloadableBlocksInserterPanel from './inserter-panel';\nimport DownloadableBlocksNoResults from './no-results';\nimport { store as blockDirectoryStore } from '../../store';\n\nfunction DownloadableBlocksPanel( {\n\tdownloadableItems,\n\tonSelect,\n\tonHover,\n\thasLocalBlocks,\n\thasPermission,\n\tisLoading,\n\tisTyping,\n} ) {\n\tif ( typeof hasPermission === 'undefined' || isLoading || isTyping ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ hasPermission && ! hasLocalBlocks && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'No results available from your installed blocks.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel has-blocks-loading\">\n\t\t\t\t\t<Spinner />\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( false === hasPermission ) {\n\t\tif ( ! hasLocalBlocks ) {\n\t\t\treturn <DownloadableBlocksNoResults />;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\treturn !! downloadableItems.length ? (\n\t\t<DownloadableBlocksInserterPanel\n\t\t\tdownloadableItems={ downloadableItems }\n\t\t\thasLocalBlocks={ hasLocalBlocks }\n\t\t>\n\t\t\t<DownloadableBlocksList\n\t\t\t\titems={ downloadableItems }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tonHover={ onHover }\n\t\t\t/>\n\t\t</DownloadableBlocksInserterPanel>\n\t) : (\n\t\t! hasLocalBlocks && <DownloadableBlocksNoResults />\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select, { filterValue, rootClientId = null } ) => {\n\t\tconst {\n\t\t\tgetDownloadableBlocks,\n\t\t\tisRequestingDownloadableBlocks,\n\t\t} = select( blockDirectoryStore );\n\t\tconst { canInsertBlockType } = select( blockEditorStore );\n\n\t\tconst hasPermission = select( coreStore ).canUser(\n\t\t\t'read',\n\t\t\t'block-directory/search'\n\t\t);\n\n\t\tfunction getInstallableBlocks( term ) {\n\t\t\treturn getDownloadableBlocks( term ).filter( ( block ) =>\n\t\t\t\tcanInsertBlockType( block, rootClientId, true )\n\t\t\t);\n\t\t}\n\n\t\tconst downloadableItems = hasPermission\n\t\t\t? getInstallableBlocks( filterValue )\n\t\t\t: [];\n\t\tconst isLoading = isRequestingDownloadableBlocks( filterValue );\n\n\t\treturn {\n\t\t\tdownloadableItems,\n\t\t\thasPermission,\n\t\t\tisLoading,\n\t\t};\n\t} ),\n] )( DownloadableBlocksPanel );\n","/**\n * External dependencies\n */\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __unstableInserterMenuExtension } from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksPanel from '../../components/downloadable-blocks-panel';\n\nfunction InserterMenuDownloadableBlocksPanel() {\n\tconst [ debouncedFilterValue, setFilterValue ] = useState( '' );\n\tconst debouncedSetFilterValue = debounce( setFilterValue, 400 );\n\n\treturn (\n\t\t<__unstableInserterMenuExtension>\n\t\t\t{ ( {\n\t\t\t\tonSelect,\n\t\t\t\tonHover,\n\t\t\t\tfilterValue,\n\t\t\t\thasItems,\n\t\t\t\trootClientId,\n\t\t\t} ) => {\n\t\t\t\tif ( debouncedFilterValue !== filterValue ) {\n\t\t\t\t\tdebouncedSetFilterValue( filterValue );\n\t\t\t\t}\n\n\t\t\t\tif ( ! debouncedFilterValue ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlocksPanel\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tfilterValue={ debouncedFilterValue }\n\t\t\t\t\t\thasLocalBlocks={ hasItems }\n\t\t\t\t\t\tisTyping={ filterValue !== debouncedFilterValue }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</__unstableInserterMenuExtension>\n\t);\n}\n\nexport default InserterMenuDownloadableBlocksPanel;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editPost\"];","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockIcon from '../downloadable-block-icon';\n\nexport default function CompactList( { items } ) {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul className=\"block-directory-compact-list\">\n\t\t\t{ items.map( ( { icon, id, title, author } ) => (\n\t\t\t\t<li key={ id } className=\"block-directory-compact-list__item\">\n\t\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\n\t\t\t\t\t<div className=\"block-directory-compact-list__item-details\">\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-title\">\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-author\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Name of the block author. */\n\t\t\t\t\t\t\t\t__( 'By %s' ),\n\t\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { PluginPrePublishPanel } from '@wordpress/edit-post';\nimport { useSelect } from '@wordpress/data';\nimport { blockDefault } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport CompactList from '../../components/compact-list';\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstalledBlocksPrePublishPanel() {\n\tconst newBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getNewBlockTypes(),\n\t\t[]\n\t);\n\n\tif ( ! newBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PluginPrePublishPanel\n\t\t\ticon={ blockDefault }\n\t\t\ttitle={ sprintf(\n\t\t\t\t// translators: %d: number of blocks (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Added: %d block',\n\t\t\t\t\t'Added: %d blocks',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t),\n\t\t\t\tnewBlockTypes.length\n\t\t\t) }\n\t\t\tinitialOpen={ true }\n\t\t>\n\t\t\t<p className=\"installed-blocks-pre-publish-panel__copy\">\n\t\t\t\t{ _n(\n\t\t\t\t\t'The following block has been added to your site.',\n\t\t\t\t\t'The following blocks have been added to your site.',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<CompactList items={ newBlockTypes } />\n\t\t</PluginPrePublishPanel>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t\t\t__( 'Install %s' ),\n\t\t\t\tblock.title\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType } from '@wordpress/blocks';\nimport { RawHTML } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport InstallButton from './install-button';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst getInstallMissing = ( OriginalComponent ) => ( props ) => {\n\tconst { originalName } = props.attributes;\n\t// Disable reason: This is a valid component, but it's mistaken for a callback.\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst { block, hasPermission } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getDownloadableBlocks } = select( blockDirectoryStore );\n\t\t\tconst blocks = getDownloadableBlocks(\n\t\t\t\t'block:' + originalName\n\t\t\t).filter( ( { name } ) => originalName === name );\n\t\t\treturn {\n\t\t\t\thasPermission: select( coreStore ).canUser(\n\t\t\t\t\t'read',\n\t\t\t\t\t'block-directory/search'\n\t\t\t\t),\n\t\t\t\tblock: blocks.length && blocks[ 0 ],\n\t\t\t};\n\t\t},\n\t\t[ originalName ]\n\t);\n\n\t// The user can't install blocks, or the block isn't available for download.\n\tif ( ! hasPermission || ! block ) {\n\t\treturn <OriginalComponent { ...props } />;\n\t}\n\n\treturn <ModifiedWarning { ...props } originalBlock={ block } />;\n};\n\nconst ModifiedWarning = ( { originalBlock, ...props } ) => {\n\tconst { originalName, originalUndelimitedContent } = props.attributes;\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst convertToHTML = () => {\n\t\treplaceBlock(\n\t\t\tprops.clientId,\n\t\t\tcreateBlock( 'core/html', {\n\t\t\t\tcontent: originalUndelimitedContent,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst hasContent = !! originalUndelimitedContent;\n\tconst hasHTMLBlock = getBlockType( 'core/html' );\n\n\tlet messageHTML = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__(\n\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'\n\t\t),\n\t\toriginalBlock.title || originalName\n\t);\n\tconst actions = [\n\t\t<InstallButton\n\t\t\tkey=\"install\"\n\t\t\tblock={ originalBlock }\n\t\t\tattributes={ props.attributes }\n\t\t\tclientId={ props.clientId }\n\t\t/>,\n\t];\n\n\tif ( hasContent && hasHTMLBlock ) {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'\n\t\t\t),\n\t\t\toriginalBlock.title || originalName\n\t\t);\n\t\tactions.push(\n\t\t\t<Button key=\"convert\" onClick={ convertToHTML } variant=\"link\">\n\t\t\t\t{ __( 'Keep as HTML' ) }\n\t\t\t</Button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div { ...useBlockProps() }>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ originalUndelimitedContent }</RawHTML>\n\t\t</div>\n\t);\n};\n\nexport default getInstallMissing;\n","/**\n * WordPress dependencies\n */\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport AutoBlockUninstaller from '../components/auto-block-uninstaller';\nimport InserterMenuDownloadableBlocksPanel from './inserter-menu-downloadable-blocks-panel';\nimport InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel';\nimport getInstallMissing from './get-install-missing';\n\nregisterPlugin( 'block-directory', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<AutoBlockUninstaller />\n\t\t\t\t<InserterMenuDownloadableBlocksPanel />\n\t\t\t\t<InstalledBlocksPrePublishPanel />\n\t\t\t</>\n\t\t);\n\t},\n} );\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-directory/fallback',\n\t( settings, name ) => {\n\t\tif ( name !== 'core/missing' ) {\n\t\t\treturn settings;\n\t\t}\n\t\tsettings.edit = getInstallMissing( settings.edit );\n\n\t\treturn settings;\n\t}\n);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","combineReducers","downloadableBlocks","state","action","type","filterValue","isRequesting","results","blockManagement","installedBlockTypes","isInstalling","item","filter","blockType","name","blockId","errorNotices","message","isFatal","omit","hasBlockType","blocks","length","some","i","innerBlocks","isRequestingDownloadableBlocks","getDownloadableBlocks","getInstalledBlockTypes","getNewBlockTypes","createRegistrySelector","select","usedBlockTree","blockEditorStore","getBlocks","getUnusedBlockTypes","getErrorNotices","getErrorNoticeForBlock","loadAsset","el","Promise","resolve","reject","newNode","document","createElement","nodeName","forEach","attr","innerHTML","appendChild","createTextNode","onload","onerror","Error","body","toLowerCase","src","getPluginUrl","block","link","links","self","href","fetchDownloadableBlocks","receiveDownloadableBlocks","installBlockType","async","registry","dispatch","id","success","clearErrorNotice","setIsInstalling","url","apiFetch","method","data","status","path","slug","_links","addInstalledBlockType","metadataFields","addQueryArgs","_fields","catch","then","response","unstable__bootstrapServerSideBlockDefinitions","pick","location","parse","text","doc","DOMParser","parseFromString","newAssets","Array","from","querySelectorAll","asset","getElementById","newAsset","loadAssets","blocksStore","getBlockTypes","__","noticesStore","createInfoNotice","sprintf","title","speak","error","fatalAPIErrors","folder_exists","unable_to_connect_to_filesystem","code","setErrorNotice","createErrorNotice","isDismissible","uninstallBlockType","removeInstalledBlockType","map","result","mapKeys","camelCase","storeConfig","reducer","selectors","actions","resolvers","store","createReduxStore","AutoBlockUninstaller","useDispatch","blockDirectoryStore","shouldRemoveBlockTypes","useSelect","isAutosavingPost","isSavingPost","editorStore","unusedBlockTypes","useEffect","unregisterBlockType","register","_extends","assign","target","arguments","source","apply","this","icon","size","props","cloneElement","width","height","SVG","xmlns","viewBox","Path","fillRule","clipRule","rating","stars","Math","round","fullStarCount","floor","halfStarCount","ceil","emptyStarCount","times","className","starFilled","starHalf","starEmpty","match","alt","BlockIcon","showColors","errorNotice","getDownloadableBlockLabel","ratingCount","hasNotice","isInstalled","decodeEntities","_n","composite","onClick","author","description","getBlockType","isInstallable","isBlockInstalling","notice","hasFatal","statusText","role","as","Button","event","preventDefault","isBusy","disabled","label","showTooltip","tooltipPosition","Spinner","createInterpolateElement","span","VisuallyHidden","items","onHover","noop","onSelect","useCompositeState","children","downloadableItems","hasLocalBlocks","count","blockDefault","compose","withSelect","rootClientId","canInsertBlockType","hasPermission","coreStore","canUser","isLoading","isTyping","debouncedFilterValue","setFilterValue","useState","debouncedSetFilterValue","debounce","__unstableInserterMenuExtension","hasItems","CompactList","InstalledBlocksPrePublishPanel","newBlockTypes","PluginPrePublishPanel","initialOpen","InstallButton","attributes","clientId","isInstallingBlock","replaceBlock","originalBlock","originalContent","createBlock","variant","ModifiedWarning","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","messageHTML","push","content","useBlockProps","Warning","RawHTML","registerPlugin","render","addFilter","settings","edit","OriginalComponent"],"sourceRoot":""}
|
1 |
+
{"version":3,"file":"./build/block-directory/index.min.js","mappings":"yBACA,IAAIA,EAAsB,CCA1B,EAAwB,SAASC,GAChC,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,WAAa,OAAOF,EAAgB,SACpC,WAAa,OAAOA,GAErB,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLR,EAAwB,SAASI,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,SAASM,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICC/F,EAAwB,SAAST,GACX,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,q2BCLvD,IAAI,EAA+BC,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAS,MCAnD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAe,OC2GlD,GAAeC,EAAAA,EAAAA,iBAAiB,CAC/BC,mBAzFiC,WAA0B,IAAxBC,EAAwB,uDAAhB,GAAIC,EAAY,uCAC3D,OAASA,EAAOC,MACf,IAAK,4BACJ,MAAO,IACHF,EACH,CAAEC,EAAOE,aAAe,CACvBC,cAAc,IAGjB,IAAK,8BACJ,MAAO,IACHJ,EACH,CAAEC,EAAOE,aAAe,CACvBE,QAASJ,EAAOF,mBAChBK,cAAc,IAIlB,OAAOJ,GAwEPM,gBA7D8B,WAM1B,IALJN,EAKI,uDALI,CACPO,oBAAqB,GACrBC,aAAc,IAEfP,EACI,uCACJ,OAASA,EAAOC,MACf,IAAK,2BACJ,MAAO,IACHF,EACHO,oBAAqB,IACjBP,EAAMO,oBACTN,EAAOQ,OAGV,IAAK,8BACJ,MAAO,IACHT,EACHO,oBAAqBP,EAAMO,oBAAoBG,QAC5CC,GAAeA,EAAUC,OAASX,EAAOQ,KAAKG,QAGnD,IAAK,uBACJ,MAAO,IACHZ,EACHQ,aAAc,IACVR,EAAMQ,aACT,CAAEP,EAAOY,SAAWZ,EAAOO,eAI/B,OAAOR,GA8BPc,aAnB2B,WAA0B,IAAxBd,EAAwB,uDAAhB,GAAIC,EAAY,uCACrD,OAASA,EAAOC,MACf,IAAK,mBACJ,MAAO,IACHF,EACH,CAAEC,EAAOY,SAAW,CACnBE,QAASd,EAAOc,QAChBC,QAASf,EAAOe,UAGnB,IAAK,qBACJ,OAAOC,EAAAA,EAAAA,MAAMjB,EAAOC,EAAOY,SAE7B,OAAOb,KCxGJ,EAA+BH,OAAW,GAAe,YCS9C,SAASqB,EAAcP,GAAyB,IAAdQ,EAAc,uDAAL,GACzD,IAAOA,EAAOC,OACb,OAAO,EAER,GAAKD,EAAOE,MAAM,QAAE,KAAET,GAAJ,SAAgBA,IAASD,EAAUC,QACpD,OAAO,EAER,IAAM,IAAIU,EAAI,EAAGA,EAAIH,EAAOC,OAAQE,IACnC,GAAKJ,EAAcP,EAAWQ,EAAQG,GAAIC,aACzC,OAAO,EAIT,OAAO,ECHD,SAASC,EAAgCxB,EAAOG,GAAc,QACpE,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCC,oBAAhD,SAWM,SAASqB,EAAuBzB,EAAOG,GAAc,QAC3D,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCE,eAAhD,QAA2D,GAWrD,SAASqB,EAAwB1B,GACvC,OAAOA,EAAMM,gBAAgBC,oBAWvB,MAAMoB,GAAmBC,EAAAA,EAAAA,yBAC7BC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QAAUC,GACpCO,EAAcP,EAAWmB,QAafG,GAAsBL,EAAAA,EAAAA,yBAChCC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QACxBC,IAAiBO,EAAcP,EAAWmB,QAaxC,SAAStB,EAAcR,EAAOa,GACpC,OAAOb,EAAMM,gBAAgBE,aAAcK,KAAa,EAUlD,SAASqB,EAAiBlC,GAChC,OAAOA,EAAMc,aAWP,SAASqB,EAAwBnC,EAAOa,GAC9C,OAAOb,EAAMc,aAAcD,GCrH5B,IAAI,EAA+BhB,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAY,S,SCAtD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAO,ICe9C,MAAMuC,EAAcC,GACnB,IAAIC,SAAS,CAAEC,EAASC,KAK9B,MAAMC,EAAUC,SAASC,cAAeN,EAAGO,UAE3C,CAAE,KAAM,MAAO,MAAO,OAAQ,QAASC,SAAWC,IAC5CT,EAAIS,KACRL,EAASK,GAAST,EAAIS,OAKnBT,EAAGU,WACPN,EAAQO,YAAaN,SAASO,eAAgBZ,EAAGU,YAGlDN,EAAQS,OAAS,IAAMX,GAAS,GAChCE,EAAQU,QAAU,IAAMX,EAAQ,IAAIY,MAAO,yBAE3CV,SAASW,KAAKL,YAAaP,IAI1B,SAAWA,EAAQG,SAASU,eAC1B,WAAab,EAAQG,SAASU,gBAAmBb,EAAQc,MAE3DhB,OCrCY,SAASiB,EAAcC,GACrC,IAAOA,EACN,OAAO,EAER,MAAMC,EAAOD,EAAME,MAAO,cAAiBF,EAAME,MAAMC,KACvD,SAAKF,IAAQA,EAAKtC,SACVsC,EAAM,GAAIG,KCkBZ,SAASC,EAAyB3D,GACxC,MAAO,CAAED,KAAM,4BAA6BC,YAAAA,GAYtC,SAAS4D,EAA2BhE,EAAoBI,GAC9D,MAAO,CACND,KAAM,8BACNH,mBAAAA,EACAI,YAAAA,GAWK,MAAM6D,EAAqBP,GAAWQ,MAAAA,IAGtC,IAH8C,SACpDC,EADoD,SAEpDC,GACM,EACN,MAAM,GAAEC,EAAF,KAAMxD,GAAS6C,EACrB,IAAIY,GAAU,EACdF,EAASG,iBAAkBF,GAC3B,IACCD,EAASI,gBAAiBH,GAAI,GAG9B,MAAMI,EAAMhB,EAAcC,GAC1B,IAAIE,EAAQ,GACPa,QACEC,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,YASjBjB,SANuBc,GAAAA,CAAU,CAChCC,OAAQ,OACRG,KAAM,gBACNF,KAAM,CAAEG,KAAMV,EAAIQ,OAAQ,aAGVG,OAGlBZ,EAASa,sBAAuB,IAC5BvB,EACHE,MAAO,IAAKF,EAAME,SAAUA,KAI7B,MAAMsB,EAAiB,CACtB,cACA,QACA,WACA,SACA,OACA,cACA,WACA,aACA,mBACA,eACA,WACA,SACA,UACA,cAoBD,SAlBMR,GAAAA,CAAU,CACfI,MAAMK,EAAAA,EAAAA,cAAe,sBAAsBtE,IAAS,CACnDuE,QAASF,MAITG,OAAO,SACPC,MAAQC,IACDA,IAGPC,EAAAA,EAAAA,+CAA+C,CAC9C,CAAE3E,IAAQ4E,EAAAA,EAAAA,MAAMF,EAAUL,cFtExBhB,iBAQN,MAAMqB,QAAiBb,GAAAA,CAAU,CAChCD,IAAK9B,SAAS+C,SAAS5B,KACvB6B,OAAO,IAGFf,QAAaW,EAASK,OAEtBC,GAAM,IAAI/F,OAAOgG,WAAYC,gBAAiBnB,EAAM,aAEpDoB,EAAYC,MAAMC,KACvBL,EAAIM,iBAAkB,kCACrBxF,QAAUyF,GAAWA,EAAM/B,KAAQ1B,SAAS0D,eAAgBD,EAAM/B,MAMpE,IAAM,MAAMiC,KAAYN,QACjB3D,EAAWiE,GEgDXC,IACmBpC,EAASrC,OAAQ0E,EAAAA,OAAcC,gBAChCnF,MAAQC,GAAOA,EAAEV,OAASA,IACjD,MAAM,IAAIwC,OACTqD,EAAAA,EAAAA,IAAI,qDAINvC,EAASC,SAAUuC,EAAAA,OAAeC,kBACjCC,EAAAA,EAAAA;CAECH,EAAAA,EAAAA,IAAI,iCACJhD,EAAMoD,OAEP,CACCC,OAAO,EACP5G,KAAM,aAGRmE,GAAU,EACT,MAAQ0C,GACT,IAAIhG,EAAUgG,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,sBAG/BzF,EAAU+F,aAAiB3D,MAG/B,MAAM4D,EAAiB,CACtBC,eAAeR,EAAAA,EAAAA,IACd,4DAEDS,iCAAiCT,EAAAA,EAAAA,IAChC,mEAIGO,EAAgBD,EAAMI,QAC1BnG,GAAU,EACVD,EAAUiG,EAAgBD,EAAMI,OAGjChD,EAASiD,eAAgBhD,EAAIrD,EAASC,GACtCkD,EAASC,SAAUuC,EAAAA,OAAeW,kBAAmBtG,EAAS,CAC7D+F,OAAO,EACPQ,eAAe,IAIjB,OADAnD,EAASI,gBAAiBH,GAAI,GACvBC,GAQKkD,EAAuB9D,GAAWQ,MAAAA,IAGxC,IAHgD,SACtDC,EADsD,SAEtDC,GACM,EACN,IACC,MAAMK,EAAMhB,EAAcC,SACpBgB,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,oBAEXH,GAAAA,CAAU,CACfC,OAAQ,SACRF,IAAAA,IAEDL,EAASqD,yBAA0B/D,GAClC,MAAQsD,GACT7C,EACEC,SAAUuC,EAAAA,OACVW,kBAAmBN,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,yBAYrC,SAASzB,EAAuBvE,GACtC,MAAO,CACNP,KAAM,2BACNO,KAAAA,GAYK,SAAS+G,EAA0B/G,GACzC,MAAO,CACNP,KAAM,8BACNO,KAAAA,GAYK,SAAS8D,EAAiB1D,EAASL,GACzC,MAAO,CACNN,KAAM,uBACNW,QAAAA,EACAL,aAAAA,GAaK,SAAS4G,EAAgBvG,EAASE,GAA2B,IAAlBC,EAAkB,wDACnE,MAAO,CACNd,KAAM,mBACNW,QAAAA,EACAE,QAAAA,EACAC,QAAAA,GAWK,SAASsD,EAAkBzD,GACjC,MAAO,CACNX,KAAM,qBACNW,QAAAA,GCxQK,MAAMY,EAA0BtB,GAAiB8D,MAAAA,IAEjD,IAFyD,SAC/DE,GACM,EACN,GAAOhE,EAIP,IACCgE,EAAUL,EAAyB3D,IAQnCgE,EAAUJ,SAPYU,GAAAA,CAAU,CAC/BI,KAAO,qCAAqC1E,OAEtBsH,KAAOC,IAC7BC,EAAAA,EAAAA,SAASD,GAAQ,CAAE9H,EAAOb,KAAS6I,EAAAA,EAAAA,WAAW7I,OAGFoB,IAC5C,SCPU0H,EAAc,CAC1BC,QAD0B,EAE1BC,UAF0B,EAG1BC,QAH0B,EAI1BC,UAASA,GAUGC,GAAQC,EAAAA,EAAAA,kBAvBF,uBAuBgCN,GC1BpC,SAASO,IACvB,MAAM,mBAAEb,IAAuBc,EAAAA,EAAAA,aAAaC,GAEtCC,GAAyBC,EAAAA,EAAAA,YAAa3G,IAC3C,MAAM,iBAAE4G,EAAF,aAAoBC,GAAiB7G,EAAQ8G,EAAAA,OACnD,OAAOD,MAAoBD,MACzB,IAEGG,GAAmBJ,EAAAA,EAAAA,YACtB3G,GAAYA,EAAQyG,GAAsBrG,uBAC5C,IAYD,OATA4G,EAAAA,EAAAA,YAAW,KACLN,GAA0BK,EAAiBxH,QAC/CwH,EAAiB/F,SAAWlC,IAC3B4G,EAAoB5G,IACpBmI,EAAAA,EAAAA,qBAAqBnI,EAAUC,WAG/B,CAAE2H,IAEE,MDMRQ,EAAAA,EAAAA,UAAUb,GEzCV,IAAI,EAA+BrI,OAAW,GAAc,WCAxD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAY,SCA3C,SAASmJ,IAetB,OAdAA,EAAW/J,OAAOgK,QAAU,SAAUC,GACpC,IAAK,IAAI5H,EAAI,EAAGA,EAAI6H,UAAU/H,OAAQE,IAAK,CACzC,IAAI8H,EAASD,UAAU7H,GAEvB,IAAK,IAAIvC,KAAOqK,EACVnK,OAAOM,UAAUC,eAAeC,KAAK2J,EAAQrK,KAC/CmK,EAAOnK,GAAOqK,EAAOrK,IAK3B,OAAOmK,IAGOG,MAAMC,KAAMH,WCf9B,IAAI,EAA+BtJ,OAAW,GAAgB,aCwB9D,EARA,YAA+C,IAAhC,KAAE0J,EAAF,KAAQC,EAAO,MAAOC,GAAU,EAC9C,OAAOC,EAAAA,EAAAA,cAAcH,EAAM,CAC1BI,MAAOH,EACPI,OAAQJ,KACLC,KCpBD,EAA+B5J,OAAW,GAAc,WCW5D,GALC,mBAAC,EAAAgK,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,qVCIV,GALC,mBAAC,EAAAkL,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,4dCQV,GATC,mBAAC,EAAAkL,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CACCC,SAAS,UACTtL,EAAE,+jBACFuL,SAAS,aC4CZ,EA3CA,YAA6B,IAAb,OAAEC,GAAW,EAC5B,MAAMC,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAE7BI,EAAgBF,KAAKG,MAAOL,GAC5BM,EAAgBJ,KAAKK,KAAMP,EAASI,GACpCI,EAAiB,GAAMJ,EAAgBE,GAE7C,OACC,2BACC,cAAa7D,EAAAA,EAAAA;;CAEZH,EAAAA,EAAAA,IAAI,qBACJ2D,KAGCQ,EAAAA,EAAAA,OAAOL,GAAiBjJ,IACzB,mBAAC,EAAD,CACCvC,IAAO,cAAcuC,IACrBuJ,UAAU,2CACVtB,KAAOuB,EACPtB,KAAO,QAGPoB,EAAAA,EAAAA,OAAOH,GAAiBnJ,IACzB,mBAAC,EAAD,CACCvC,IAAO,cAAcuC,IACrBuJ,UAAU,gDACVtB,KAAOwB,EACPvB,KAAO,QAGPoB,EAAAA,EAAAA,OAAOD,GAAkBrJ,IAC1B,mBAAC,EAAD,CACCvC,IAAO,eAAeuC,IACtBuJ,UAAU,4CACVtB,KAAOyB,EACPxB,KAAO,SCpCZ,GAN4B,QAAE,OAAEW,GAAJ,SAC3B,2BAAMU,UAAU,kCACf,mBAAC,EAAD,CAAOV,OAASA,MCOlB,GATA,YAA2C,IAAX,KAAEZ,GAAS,EAC1C,MAAMsB,EAAY,0CAClB,OAA8D,OAAvDtB,EAAK0B,MAAO,uCAClB,0BAAKJ,UAAYA,EAAYtH,IAAMgG,EAAO2B,IAAI,MAE9C,mBAAC,EAAAC,UAAD,CAAWN,UAAYA,EAAYtB,KAAOA,EAAO6B,YAAU,KCwB7D,GAvBuC,IAAiB,IAAf,MAAE3H,GAAa,EACvD,MAAM4H,GAAc7C,EAAAA,EAAAA,YACjB3G,GACDA,EAAQyG,GAAsBnG,uBAAwBsB,EAAMW,KAC7D,CAAEX,IAGH,OAAO4H,GAKN,0BAAKR,UAAU,8CACd,0BAAKA,UAAU,sDACZQ,EAAYtK,QACZsK,EAAYrK,QACX,KAAMyF,EAAAA,EAAAA,IAAI,2BACV,OATE,MCKT,SAAS6E,GAAT,KAGE,IAFD,MAAEzE,EAAF,OAASsD,EAAT,YAAiBoB,GAEhB,GADD,UAAEC,EAAF,YAAaC,EAAb,aAA0BjL,GACzB,EACD,MAAM4J,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAEnC,OAAOsB,GAAeD,GAEd5E,EAAAA,EAAAA,SAAS,wBAAwB8E,EAAAA,EAAAA,gBAAgB7E,IAGpD4E,GAEG7E,EAAAA,EAAAA,SAAS,WAAW8E,EAAAA,EAAAA,gBAAgB7E,IAGvCrG,GAEGoG,EAAAA,EAAAA,SAAS,kBAAkB8E,EAAAA,EAAAA,gBAAgB7E,IAI9C0E,EAAc,GAEX3E,EAAAA,EAAAA,SAAS,eAAe8E,EAAAA,EAAAA,gBAAgB7E,KAGzCD,EAAAA,EAAAA;;CAEN+E,EAAAA,EAAAA,IACC,6CACA,8CACAJ,IAEDG,EAAAA,EAAAA,gBAAgB7E,GAChBuD,EACAmB,GAqGF,OAjGA,YAAmE,IAA/B,UAAEK,EAAF,KAAanL,EAAb,QAAmBoL,GAAY,EAClE,MAAM,OAAEC,EAAF,YAAUC,EAAV,KAAuBxC,EAAvB,OAA6BY,EAA7B,MAAqCtD,GAAUpG,EAE/CgL,KAAiBO,EAAAA,EAAAA,cAAcvL,EAAKG,OAEpC,UAAE4K,EAAF,aAAahL,EAAb,cAA2ByL,IAAkBzD,EAAAA,EAAAA,YAChD3G,IACD,MAAM,uBACLM,EACA3B,aAAc0L,GACXrK,EAAQyG,GACN6D,EAAShK,EAAwB1B,EAAK2D,IACtCgI,EAAWD,GAAUA,EAAOnL,QAClC,MAAO,CACNwK,YAAcW,EACd3L,aAAc0L,EAAmBzL,EAAK2D,IACtC6H,eAAiBG,KAGnB,CAAE3L,IAGH,IAAI4L,EAAa,GAOjB,OANKZ,EACJY,GAAa5F,EAAAA,EAAAA,IAAI,cACNjG,IACX6L,GAAa5F,EAAAA,EAAAA,IAAI,iBAIjB,mBAAC,0BAAD,GACC6F,KAAK,SACLC,GAAKC,EAAAA,QACAZ,EAHN,CAICf,UAAU,+CACVgB,QAAYY,IACXA,EAAMC,iBACNb,KAEDc,OAASnM,EACToM,SAAWpM,IAAkByL,EAC7BY,MAAQvB,GAA2B7K,EAAM,CACxC+K,UAAAA,EACAC,YAAAA,EACAjL,aAAAA,IAEDsM,aAAc,EACdC,gBAAgB,gBAEhB,0BAAKlC,UAAU,uDACd,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO1C,MAAQA,IAC3CrG,GACD,2BAAMqK,UAAU,0DACf,mBAAC,EAAAmC,QAAD,QAGD,mBAAC,GAAD,CAAc7C,OAASA,MAGzB,2BAAMU,UAAU,0DACf,2BAAMA,UAAU,wDACboC,EAAAA,EAAAA,2BACDrG,EAAAA,EAAAA;;CAECH,EAAAA,EAAAA,IAAI,8BACJiF,EAAAA,EAAAA,gBAAgB7E,GAChBiF,GAED,CACCoB,MACC,2BAAMrC,UAAU,4DAKlBW,GACD,mBAAC,GAAD,CAAyB/H,MAAQhD,KAEjC,oCACC,2BAAMoK,UAAU,sDACVwB,IAEFX,EAAAA,EAAAA,gBAAgBK,IAElBE,KACGR,GAAejL,KAClB,mBAAC,EAAA2M,eAAD,MACG1G,EAAAA,EAAAA,IAAI,sBCrFf,GA5CA,YAAuE,IAAtC,MAAE2G,EAAF,QAASC,EAAUC,EAAAA,KAAnB,SAAyBC,GAAa,EACtE,MAAM3B,GAAY4B,EAAAA,EAAAA,gCACZ,iBAAExJ,IAAqBqE,EAAAA,EAAAA,aAAaC,GAE1C,OAAO8E,EAAMhM,QAKZ,mBAAC,sBAAD,KACMwK,EADN,CAECU,KAAK,UACLzB,UAAU,2CACV,cAAapE,EAAAA,EAAAA,IAAI,kCAEf2G,EAAM3F,KAAOhH,IAEb,mBAAC,GAAD,CACC1B,IAAM0B,EAAK2D,GACXwH,UAAYA,EACZC,QAAU,MAIJG,EAAAA,EAAAA,cAAcvL,EAAKG,MACvB2M,EAAU9M,GAEVuD,EAAkBvD,GAAO4E,MAAQhB,IAC3BA,GACJkJ,EAAU9M,MAIb4M,EAAS,OAEVA,QAAUA,EACV5M,KAAOA,OA/BJ,MC3BL,GAA+BZ,OAAW,GAAQ,KCsDtD,GA/CA,YAII,IAJsC,SACzC4N,EADyC,kBAEzCC,EAFyC,eAGzCC,GACG,EACH,MAAMC,EAAQF,EAAkBtM,OAehC,OAdAyH,EAAAA,EAAAA,YAAW,MACV/B,EAAAA,GAAAA,QACCF,EAAAA,EAAAA;;CAEC+E,EAAAA,EAAAA,IACC,+CACA,iDACAiC,GAEDA,MAGA,CAAEA,KAGJ,oCACKD,IACH,wBAAG9C,UAAU,wDACVpE,EAAAA,EAAAA,IAAI,sDAIR,0BAAKoE,UAAU,qDAEf,0BAAKA,UAAU,8CACd,0BAAKA,UAAU,sDACd,yBAAIA,UAAU,qDACXpE,EAAAA,EAAAA,IAAI,0BAEP,wBAAGoE,UAAU,2DACVpE,EAAAA,EAAAA,IACD,wDAIDgH,KCrCN,IALC,mBAAC,EAAA5D,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,oLCWV,GAZA,WACC,OACC,0BAAKkM,UAAU,sCACd,mBAAC,EAAD,CACCA,UAAU,yCACVtB,KAAOsE,MAER,6BAAKpH,EAAAA,EAAAA,IAAI,wBC0DZ,IAAeqH,EAAAA,EAAAA,SAAS,EACvBC,EAAAA,EAAAA,aAAY,CAAElM,EAAF,KAAoD,IAA1C,YAAE1B,EAAF,aAAe6N,EAAe,MAAY,EAC/D,MAAM,sBACLvM,EADK,+BAELD,GACGK,EAAQyG,IACN,mBAAE2F,GAAuBpM,EAAQE,EAAAA,OAEjCmM,EAAgBrM,EAAQsM,EAAAA,OAAYC,QACzC,OACA,0BAcD,MAAO,CACNV,kBANyBQ,EALlBzM,EAMiBtB,GANaO,QAAU+C,GAC9CwK,EAAoBxK,EAAOuK,GAAc,KAMxC,GAKFE,cAAAA,EACAG,UALiB7M,EAAgCrB,QAtBpD,EArDA,YAQI,IAR8B,kBACjCuN,EADiC,SAEjCH,EAFiC,QAGjCF,EAHiC,eAIjCM,EAJiC,cAKjCO,EALiC,UAMjCG,EANiC,SAOjCC,GACG,EACH,YAA8B,IAAlBJ,GAAiCG,GAAaC,GAExD,mCACGJ,IAAmBP,IACpB,oCACC,wBAAG9C,UAAU,wDACVpE,EAAAA,EAAAA,IACD,sDAGF,0BAAKoE,UAAU,sDAGjB,0BAAKA,UAAU,iEACd,mBAAC,EAAAmC,QAAD,SAMC,IAAUkB,EACPP,EAIA,MAHC,mBAAC,GAAD,MAMCD,EAAkBtM,QAC3B,mBAAC,GAAD,CACCsM,kBAAoBA,EACpBC,eAAiBA,IAEjB,mBAAC,GAAD,CACCP,MAAQM,EACRH,SAAWA,EACXF,QAAUA,MAIVM,IAAkB,mBAAC,GAAD,SCftB,GApCA,WACC,MAAQY,EAAsBC,IAAmBC,EAAAA,EAAAA,UAAU,IACrDC,GAA0BC,EAAAA,EAAAA,UAAUH,EAAgB,KAE1D,OACC,mBAAC,EAAAI,gCAAD,MACG,IAMK,IANH,SACHrB,EADG,QAEHF,EAFG,YAGHlN,EAHG,SAIH0O,EAJG,aAKHb,GACM,EAKN,OAJKO,IAAyBpO,GAC7BuO,EAAyBvO,GAGnBoO,GAKN,mBAAC,GAAD,CACChB,SAAWA,EACXF,QAAUA,EACVW,aAAeA,EACf7N,YAAcoO,EACdZ,eAAiBkB,EACjBP,SAAWnO,IAAgBoO,IAVrB,SClCR,GAA+B1O,OAAW,GAAY,SCU3C,SAASiP,GAAT,GAAkC,IAAZ,MAAE1B,GAAU,EAChD,OAAOA,EAAMhM,QAKZ,yBAAIyJ,UAAU,gCACXuC,EAAM3F,KAAK,QAAE,KAAE8B,EAAF,GAAQnF,EAAR,MAAYyC,EAAZ,OAAmBiF,GAArB,SACZ,yBAAI/M,IAAMqF,EAAKyG,UAAU,uCACxB,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO1C,MAAQA,KAE7C,0BAAKgE,UAAU,+CACd,0BAAKA,UAAU,4CACZhE,IAEH,0BAAKgE,UAAU,8CACZjE,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,SACJqF,UAjBC,KCEM,SAASiD,KACvB,MAAMC,GAAgBxG,EAAAA,EAAAA,YACnB3G,GAAYA,EAAQyG,GAAsB3G,oBAC5C,IAGD,OAAOqN,EAAc5N,QAKpB,mBAAC,GAAA6N,sBAAD,CACC1F,KAAOsE,GACPhH,OAAQD,EAAAA,EAAAA;CAEP+E,EAAAA,EAAAA,IACC,kBACA,mBACAqD,EAAc5N,QAEf4N,EAAc5N,QAEf8N,aAAc,IAEd,wBAAGrE,UAAU,6CACVc,EAAAA,EAAAA,IACD,mDACA,qDACAqD,EAAc5N,UAGhB,mBAAC0N,GAAD,CAAa1B,MAAQ4B,KAxBf,KCPM,SAASG,GAAT,GAA0D,IAAlC,WAAEC,EAAF,MAAc3L,EAAd,SAAqB4L,GAAa,EACxE,MAAMC,GAAoB9G,EAAAA,EAAAA,YACvB3G,GAAYA,EAAQyG,GAAsB9H,aAAciD,EAAMW,KAChE,CAAEX,EAAMW,MAEH,iBAAEJ,IAAqBqE,EAAAA,EAAAA,aAAaC,IACpC,aAAEiH,IAAiBlH,EAAAA,EAAAA,aAAatG,EAAAA,OAEtC,OACC,mBAAC,EAAAyK,OAAD,CACCX,QAAU,IACT7H,EAAkBP,GAAQ4B,MAAQhB,IACjC,GAAKA,EAAU,CACd,MAAM1D,GAAYqL,EAAAA,EAAAA,cAAcvI,EAAM7C,OAC9B4O,IAAkB9J,EAAAA,EAAAA,OACzB0J,EAAWK,iBAEPD,GAAiB7O,GACrB4O,EACCF,GACAK,EAAAA,EAAAA,aACC/O,EAAUC,KACV4O,EAAcJ,WACdI,EAAcjO,kBAOpBqL,SAAW0C,EACX3C,OAAS2C,EACTK,QAAQ,YAEN/I,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,cACJhD,EAAMoD,QC9BV,MA6BM+I,GAAkB,IAAmC,IAAjC,cAAEJ,KAAkB/F,GAAa,EAC1D,MAAM,aAAEoG,EAAF,2BAAgBC,GAA+BrG,EAAM2F,YACrD,aAAEG,IAAiBlH,EAAAA,EAAAA,aAAatG,EAAAA,OAUhCgO,IAAgBD,EAChBE,GAAehE,EAAAA,EAAAA,cAAc,aAEnC,IAAIiE,GAAcrJ,EAAAA,EAAAA;;CAEjBH,EAAAA,EAAAA,IACC,+GAED+I,EAAc3I,OAASgJ,GAExB,MAAM7H,EAAU,EACf,mBAACmH,GAAD,CACCpQ,IAAI,UACJ0E,MAAQ+L,EACRJ,WAAa3F,EAAM2F,WACnBC,SAAW5F,EAAM4F,YAmBnB,OAfKU,GAAcC,IAClBC,GAAcrJ,EAAAA,EAAAA;;CAEbH,EAAAA,EAAAA,IACC,mJAED+I,EAAc3I,OAASgJ,GAExB7H,EAAQkI,MACP,mBAAC,EAAA1D,OAAD,CAAQzN,IAAI,UAAU8M,QArCF,KACrB0D,EACC9F,EAAM4F,UACNK,EAAAA,EAAAA,aAAa,YAAa,CACzBS,QAASL,MAiCsCH,QAAQ,SACrDlJ,EAAAA,EAAAA,IAAI,oBAMR,0BAAU2J,EAAAA,EAAAA,kBACT,mBAAC,EAAAC,QAAD,CAASrI,QAAUA,GAAYiI,IAC/B,mBAAC,EAAAK,QAAD,KAAWR,MCrFdS,EAAAA,EAAAA,gBAAgB,kBAAmB,CAClCC,OAAM,KAEJ,oCACC,mBAACpI,EAAD,OACA,mBAAC,GAAD,OACA,mBAAC2G,GAAD,UAMJ0B,EAAAA,EAAAA,WACC,2BACA,4BACA,CAAEC,EAAU9P,KACX,MAAc,iBAATA,IAGL8P,EAASC,MDZiBC,ECYSF,EAASC,KDZOlH,IACpD,MAAM,aAAEoG,GAAiBpG,EAAM2F,YAGzB,MAAE3L,EAAF,cAASyK,IAAkB1F,EAAAA,EAAAA,YAC9B3G,IACD,MAAM,sBAAEJ,GAA0BI,EAAQyG,GACpCnH,EAASM,EACd,SAAWoO,GACVnP,QAAQ,QAAE,KAAEE,GAAJ,SAAgBiP,IAAiBjP,KAC3C,MAAO,CACNsN,cAAerM,EAAQsM,EAAAA,OAAYC,QAClC,OACA,0BAED3K,MAAOtC,EAAOC,QAAUD,EAAQ,MAGlC,CAAE0O,IAIH,OAAO3B,GAAmBzK,GAInB,mBAACmM,GAAD,KAAsBnG,EAAtB,CAA8B+F,cAAgB/L,MAH7C,mBAACmN,EAAuBnH,MCbvBiH,EDVkBE,IAAAA,M","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/compat get default export","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/runtime/make namespace object","webpack://wp/external window [\"wp\",\"element\"]","webpack://wp/external window [\"wp\",\"plugins\"]","webpack://wp/external window [\"wp\",\"hooks\"]","webpack://wp/external window [\"wp\",\"blocks\"]","webpack://wp/external window [\"wp\",\"data\"]","webpack://wp/external window [\"wp\",\"editor\"]","webpack://wp/external window \"lodash\"","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/reducer.js","webpack://wp/external window [\"wp\",\"blockEditor\"]","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/has-block-type.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/selectors.js","webpack://wp/external window [\"wp\",\"i18n\"]","webpack://wp/external window [\"wp\",\"apiFetch\"]","webpack://wp/external window [\"wp\",\"notices\"]","webpack://wp/external window [\"wp\",\"url\"]","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/load-assets.js","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/get-plugin-url.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/actions.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/resolvers.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/index.js","webpack://wp/./packages/block-directory/build-module/components/auto-block-uninstaller/@wordpress/block-directory/src/components/auto-block-uninstaller/index.js","webpack://wp/external window [\"wp\",\"components\"]","webpack://wp/external window [\"wp\",\"compose\"]","webpack://wp/external window [\"wp\",\"coreData\"]","webpack://wp/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://wp/external window [\"wp\",\"htmlEntities\"]","webpack://wp/./packages/icons/build-module/icon/@wordpress/icons/src/icon/index.js","webpack://wp/external window [\"wp\",\"primitives\"]","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-filled.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-half.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-empty.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/stars.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-icon/@wordpress/block-directory/src/components/downloadable-block-icon/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-notice/@wordpress/block-directory/src/components/downloadable-block-notice/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-list-item/@wordpress/block-directory/src/components/downloadable-block-list-item/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-list/@wordpress/block-directory/src/components/downloadable-blocks-list/index.js","webpack://wp/external window [\"wp\",\"a11y\"]","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/inserter-panel.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/block-default.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/no-results.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/@wordpress/block-directory/src/plugins/inserter-menu-downloadable-blocks-panel/index.js","webpack://wp/external window [\"wp\",\"editPost\"]","webpack://wp/./packages/block-directory/build-module/components/compact-list/@wordpress/block-directory/src/components/compact-list/index.js","webpack://wp/./packages/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/@wordpress/block-directory/src/plugins/installed-blocks-pre-publish-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/install-button.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/index.js","webpack://wp/./packages/block-directory/build-module/plugins/@wordpress/block-directory/src/plugins/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"plugins\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editor\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"lodash\"];","/**\n * External dependencies\n */\n\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning an array of downloadable blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const downloadableBlocks = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'FETCH_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tisRequesting: true,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'RECEIVE_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tresults: action.downloadableBlocks,\n\t\t\t\t\tisRequesting: false,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer managing the installation and deletion of blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const blockManagement = (\n\tstate = {\n\t\tinstalledBlockTypes: [],\n\t\tisInstalling: {},\n\t},\n\taction\n) => {\n\tswitch ( action.type ) {\n\t\tcase 'ADD_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: [\n\t\t\t\t\t...state.installedBlockTypes,\n\t\t\t\t\taction.item,\n\t\t\t\t],\n\t\t\t};\n\t\tcase 'REMOVE_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: state.installedBlockTypes.filter(\n\t\t\t\t\t( blockType ) => blockType.name !== action.item.name\n\t\t\t\t),\n\t\t\t};\n\t\tcase 'SET_INSTALLING_BLOCK':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisInstalling: {\n\t\t\t\t\t...state.isInstalling,\n\t\t\t\t\t[ action.blockId ]: action.isInstalling,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer returning an object of error notices.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const errorNotices = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'SET_ERROR_NOTICE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.blockId ]: {\n\t\t\t\t\tmessage: action.message,\n\t\t\t\t\tisFatal: action.isFatal,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'CLEAR_ERROR_NOTICE':\n\t\t\treturn omit( state, action.blockId );\n\t}\n\treturn state;\n};\n\nexport default combineReducers( {\n\tdownloadableBlocks,\n\tblockManagement,\n\terrorNotices,\n} );\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * Check if a block list contains a specific block type. Recursively searches\n * through `innerBlocks` if they exist.\n *\n * @param {Object} blockType A block object to search for.\n * @param {Object[]} blocks The list of blocks to look through.\n *\n * @return {boolean} Whether the blockType is found.\n */\nexport default function hasBlockType( blockType, blocks = [] ) {\n\tif ( ! blocks.length ) {\n\t\treturn false;\n\t}\n\tif ( blocks.some( ( { name } ) => name === blockType.name ) ) {\n\t\treturn true;\n\t}\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( hasBlockType( blockType, blocks[ i ].innerBlocks ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport hasBlockType from './utils/has-block-type';\n\n/**\n * Returns true if application is requesting for downloadable blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {boolean} Whether a request is in progress for the blocks list.\n */\nexport function isRequestingDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.isRequesting ?? false;\n}\n\n/**\n * Returns the available uninstalled blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {Array} Downloadable blocks.\n */\nexport function getDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.results ?? [];\n}\n\n/**\n * Returns the block types that have been installed on the server in this\n * session.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items\n */\nexport function getInstalledBlockTypes( state ) {\n\treturn state.blockManagement.installedBlockTypes;\n}\n\n/**\n * Returns block types that have been installed on the server and used in the\n * current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getNewBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter( ( blockType ) =>\n\t\t\thasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns the block types that have been installed on the server but are not\n * used in the current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getUnusedBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter(\n\t\t\t( blockType ) => ! hasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if a block plugin install is in progress.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId Id of the block.\n *\n * @return {boolean} Whether this block is currently being installed.\n */\nexport function isInstalling( state, blockId ) {\n\treturn state.blockManagement.isInstalling[ blockId ] || false;\n}\n\n/**\n * Returns all block error notices.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Object with error notices.\n */\nexport function getErrorNotices( state ) {\n\treturn state.errorNotices;\n}\n\n/**\n * Returns the error notice for a given block.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {string|boolean} The error text, or false if no error.\n */\nexport function getErrorNoticeForBlock( state, blockId ) {\n\treturn state.errorNotices[ blockId ];\n}\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"apiFetch\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"notices\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Load an asset for a block.\n *\n * This function returns a Promise that will resolve once the asset is loaded,\n * or in the case of Stylesheets and Inline JavaScript, will resolve immediately.\n *\n * @param {HTMLElement} el A HTML Element asset to inject.\n *\n * @return {Promise} Promise which will resolve when the asset is loaded.\n */\nexport const loadAsset = ( el ) => {\n\treturn new Promise( ( resolve, reject ) => {\n\t\t/*\n\t\t * Reconstruct the passed element, this is required as inserting the Node directly\n\t\t * won't always fire the required onload events, even if the asset wasn't already loaded.\n\t\t */\n\t\tconst newNode = document.createElement( el.nodeName );\n\n\t\t[ 'id', 'rel', 'src', 'href', 'type' ].forEach( ( attr ) => {\n\t\t\tif ( el[ attr ] ) {\n\t\t\t\tnewNode[ attr ] = el[ attr ];\n\t\t\t}\n\t\t} );\n\n\t\t// Append inline <script> contents.\n\t\tif ( el.innerHTML ) {\n\t\t\tnewNode.appendChild( document.createTextNode( el.innerHTML ) );\n\t\t}\n\n\t\tnewNode.onload = () => resolve( true );\n\t\tnewNode.onerror = () => reject( new Error( 'Error loading asset.' ) );\n\n\t\tdocument.body.appendChild( newNode );\n\n\t\t// Resolve Stylesheets and Inline JavaScript immediately.\n\t\tif (\n\t\t\t'link' === newNode.nodeName.toLowerCase() ||\n\t\t\t( 'script' === newNode.nodeName.toLowerCase() && ! newNode.src )\n\t\t) {\n\t\t\tresolve();\n\t\t}\n\t} );\n};\n\n/**\n * Load the asset files for a block\n */\nexport async function loadAssets() {\n\t/*\n\t * Fetch the current URL (post-new.php, or post.php?post=1&action=edit) and compare the\n\t * JavaScript and CSS assets loaded between the pages. This imports the required assets\n\t * for the block into the current page while not requiring that we know them up-front.\n\t * In the future this can be improved by reliance upon block.json and/or a script-loader\n\t * dependency API.\n\t */\n\tconst response = await apiFetch( {\n\t\turl: document.location.href,\n\t\tparse: false,\n\t} );\n\n\tconst data = await response.text();\n\n\tconst doc = new window.DOMParser().parseFromString( data, 'text/html' );\n\n\tconst newAssets = Array.from(\n\t\tdoc.querySelectorAll( 'link[rel=\"stylesheet\"],script' )\n\t).filter( ( asset ) => asset.id && ! document.getElementById( asset.id ) );\n\n\t/*\n\t * Load each asset in order, as they may depend upon an earlier loaded script.\n\t * Stylesheets and Inline Scripts will resolve immediately upon insertion.\n\t */\n\tfor ( const newAsset of newAssets ) {\n\t\tawait loadAsset( newAsset );\n\t}\n}\n","/**\n * Get the plugin's direct API link out of a block-directory response.\n *\n * @param {Object} block The block object\n *\n * @return {string} The plugin URL, if exists.\n */\nexport default function getPluginUrl( block ) {\n\tif ( ! block ) {\n\t\treturn false;\n\t}\n\tconst link = block.links[ 'wp:plugin' ] || block.links.self;\n\tif ( link && link.length ) {\n\t\treturn link[ 0 ].href;\n\t}\n\treturn false;\n}\n","/**\n * External dependencies\n */\nimport { pick } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tstore as blocksStore,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n} from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { loadAssets } from './load-assets';\nimport getPluginUrl from './utils/get-plugin-url';\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been requested and are loading.\n *\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function fetchDownloadableBlocks( filterValue ) {\n\treturn { type: 'FETCH_DOWNLOADABLE_BLOCKS', filterValue };\n}\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been updated.\n *\n * @param {Array} downloadableBlocks Downloadable blocks.\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function receiveDownloadableBlocks( downloadableBlocks, filterValue ) {\n\treturn {\n\t\ttype: 'RECEIVE_DOWNLOADABLE_BLOCKS',\n\t\tdownloadableBlocks,\n\t\tfilterValue,\n\t};\n}\n\n/**\n * Action triggered to install a block plugin.\n *\n * @param {Object} block The block item returned by search.\n *\n * @return {boolean} Whether the block was successfully installed & loaded.\n */\nexport const installBlockType = ( block ) => async ( {\n\tregistry,\n\tdispatch,\n} ) => {\n\tconst { id, name } = block;\n\tlet success = false;\n\tdispatch.clearErrorNotice( id );\n\ttry {\n\t\tdispatch.setIsInstalling( id, true );\n\n\t\t// If we have a wp:plugin link, the plugin is installed but inactive.\n\t\tconst url = getPluginUrl( block );\n\t\tlet links = {};\n\t\tif ( url ) {\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'PUT',\n\t\t\t\turl,\n\t\t\t\tdata: { status: 'active' },\n\t\t\t} );\n\t\t} else {\n\t\t\tconst response = await apiFetch( {\n\t\t\t\tmethod: 'POST',\n\t\t\t\tpath: 'wp/v2/plugins',\n\t\t\t\tdata: { slug: id, status: 'active' },\n\t\t\t} );\n\t\t\t// Add the `self` link for newly-installed blocks.\n\t\t\tlinks = response._links;\n\t\t}\n\n\t\tdispatch.addInstalledBlockType( {\n\t\t\t...block,\n\t\t\tlinks: { ...block.links, ...links },\n\t\t} );\n\n\t\t// Ensures that the block metadata is propagated to the editor when registered on the server.\n\t\tconst metadataFields = [\n\t\t\t'api_version',\n\t\t\t'title',\n\t\t\t'category',\n\t\t\t'parent',\n\t\t\t'icon',\n\t\t\t'description',\n\t\t\t'keywords',\n\t\t\t'attributes',\n\t\t\t'provides_context',\n\t\t\t'uses_context',\n\t\t\t'supports',\n\t\t\t'styles',\n\t\t\t'example',\n\t\t\t'variations',\n\t\t];\n\t\tawait apiFetch( {\n\t\t\tpath: addQueryArgs( `/wp/v2/block-types/${ name }`, {\n\t\t\t\t_fields: metadataFields,\n\t\t\t} ),\n\t\t} )\n\t\t\t// Ignore when the block is not registered on the server.\n\t\t\t.catch( () => {} )\n\t\t\t.then( ( response ) => {\n\t\t\t\tif ( ! response ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tunstable__bootstrapServerSideBlockDefinitions( {\n\t\t\t\t\t[ name ]: pick( response, metadataFields ),\n\t\t\t\t} );\n\t\t\t} );\n\n\t\tawait loadAssets();\n\t\tconst registeredBlocks = registry.select( blocksStore ).getBlockTypes();\n\t\tif ( ! registeredBlocks.some( ( i ) => i.name === name ) ) {\n\t\t\tthrow new Error(\n\t\t\t\t__( 'Error registering block. Try reloading the page.' )\n\t\t\t);\n\t\t}\n\n\t\tregistry.dispatch( noticesStore ).createInfoNotice(\n\t\t\tsprintf(\n\t\t\t\t// translators: %s is the block title.\n\t\t\t\t__( 'Block %s installed and added.' ),\n\t\t\t\tblock.title\n\t\t\t),\n\t\t\t{\n\t\t\t\tspeak: true,\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t\tsuccess = true;\n\t} catch ( error ) {\n\t\tlet message = error.message || __( 'An error occurred.' );\n\n\t\t// Errors we throw are fatal.\n\t\tlet isFatal = error instanceof Error;\n\n\t\t// Specific API errors that are fatal.\n\t\tconst fatalAPIErrors = {\n\t\t\tfolder_exists: __(\n\t\t\t\t'This block is already installed. Try reloading the page.'\n\t\t\t),\n\t\t\tunable_to_connect_to_filesystem: __(\n\t\t\t\t'Error installing block. You can reload the page and try again.'\n\t\t\t),\n\t\t};\n\n\t\tif ( fatalAPIErrors[ error.code ] ) {\n\t\t\tisFatal = true;\n\t\t\tmessage = fatalAPIErrors[ error.code ];\n\t\t}\n\n\t\tdispatch.setErrorNotice( id, message, isFatal );\n\t\tregistry.dispatch( noticesStore ).createErrorNotice( message, {\n\t\t\tspeak: true,\n\t\t\tisDismissible: true,\n\t\t} );\n\t}\n\tdispatch.setIsInstalling( id, false );\n\treturn success;\n};\n\n/**\n * Action triggered to uninstall a block plugin.\n *\n * @param {Object} block The blockType object.\n */\nexport const uninstallBlockType = ( block ) => async ( {\n\tregistry,\n\tdispatch,\n} ) => {\n\ttry {\n\t\tconst url = getPluginUrl( block );\n\t\tawait apiFetch( {\n\t\t\tmethod: 'PUT',\n\t\t\turl,\n\t\t\tdata: { status: 'inactive' },\n\t\t} );\n\t\tawait apiFetch( {\n\t\t\tmethod: 'DELETE',\n\t\t\turl,\n\t\t} );\n\t\tdispatch.removeInstalledBlockType( block );\n\t} catch ( error ) {\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createErrorNotice( error.message || __( 'An error occurred.' ) );\n\t}\n};\n\n/**\n * Returns an action object used to add a block type to the \"newly installed\"\n * tracking list.\n *\n * @param {Object} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function addInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'ADD_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to remove a block type from the \"newly installed\"\n * tracking list.\n *\n * @param {string} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function removeInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'REMOVE_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to indicate install in progress.\n *\n * @param {string} blockId\n * @param {boolean} isInstalling\n *\n * @return {Object} Action object.\n */\nexport function setIsInstalling( blockId, isInstalling ) {\n\treturn {\n\t\ttype: 'SET_INSTALLING_BLOCK',\n\t\tblockId,\n\t\tisInstalling,\n\t};\n}\n\n/**\n * Sets an error notice to be displayed to the user for a given block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n * @param {string} message The message shown in the notice.\n * @param {boolean} isFatal Whether the user can recover from the error.\n *\n * @return {Object} Action object.\n */\nexport function setErrorNotice( blockId, message, isFatal = false ) {\n\treturn {\n\t\ttype: 'SET_ERROR_NOTICE',\n\t\tblockId,\n\t\tmessage,\n\t\tisFatal,\n\t};\n}\n\n/**\n * Sets the error notice to empty for specific block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {Object} Action object.\n */\nexport function clearErrorNotice( blockId ) {\n\treturn {\n\t\ttype: 'CLEAR_ERROR_NOTICE',\n\t\tblockId,\n\t};\n}\n","/**\n * External dependencies\n */\nimport { camelCase, mapKeys } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport { fetchDownloadableBlocks, receiveDownloadableBlocks } from './actions';\n\nexport const getDownloadableBlocks = ( filterValue ) => async ( {\n\tdispatch,\n} ) => {\n\tif ( ! filterValue ) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tdispatch( fetchDownloadableBlocks( filterValue ) );\n\t\tconst results = await apiFetch( {\n\t\t\tpath: `wp/v2/block-directory/search?term=${ filterValue }`,\n\t\t} );\n\t\tconst blocks = results.map( ( result ) =>\n\t\t\tmapKeys( result, ( value, key ) => camelCase( key ) )\n\t\t);\n\n\t\tdispatch( receiveDownloadableBlocks( blocks, filterValue ) );\n\t} catch {}\n};\n","/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as resolvers from './resolvers';\n\n/**\n * Module Constants\n */\nconst STORE_NAME = 'core/block-directory';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n\tresolvers,\n};\n\n/**\n * Store definition for the block directory namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\n\nregister( store );\n","/**\n * WordPress dependencies\n */\nimport { unregisterBlockType } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function AutoBlockUninstaller() {\n\tconst { uninstallBlockType } = useDispatch( blockDirectoryStore );\n\n\tconst shouldRemoveBlockTypes = useSelect( ( select ) => {\n\t\tconst { isAutosavingPost, isSavingPost } = select( editorStore );\n\t\treturn isSavingPost() && ! isAutosavingPost();\n\t}, [] );\n\n\tconst unusedBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getUnusedBlockTypes(),\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldRemoveBlockTypes && unusedBlockTypes.length ) {\n\t\t\tunusedBlockTypes.forEach( ( blockType ) => {\n\t\t\t\tuninstallBlockType( blockType );\n\t\t\t\tunregisterBlockType( blockType.name );\n\t\t\t} );\n\t\t}\n\t}, [ shouldRemoveBlockTypes ] );\n\n\treturn null;\n}\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"compose\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"htmlEntities\"];","/**\n * WordPress dependencies\n */\nimport { cloneElement } from '@wordpress/element';\n\n/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */\n\n/**\n * Return an SVG icon.\n *\n * @param {IconProps} props icon is the SVG component to render\n * size is a number specifiying the icon size in pixels\n * Other props will be passed to wrapped SVG component\n *\n * @return {JSX.Element} Icon component\n */\nfunction Icon( { icon, size = 24, ...props } ) {\n\treturn cloneElement( icon, {\n\t\twidth: size,\n\t\theight: size,\n\t\t...props,\n\t} );\n}\n\nexport default Icon;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starFilled = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z\" />\n\t</SVG>\n);\n\nexport default starFilled;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starHalf = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z\" />\n\t</SVG>\n);\n\nexport default starHalf;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starEmpty = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path\n\t\t\tfillRule=\"evenodd\"\n\t\t\td=\"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z\"\n\t\t\tclipRule=\"evenodd\"\n\t\t/>\n\t</SVG>\n);\n\nexport default starEmpty;\n","/**\n * External dependencies\n */\nimport { times } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Icon, starEmpty, starFilled, starHalf } from '@wordpress/icons';\n\nfunction Stars( { rating } ) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tconst fullStarCount = Math.floor( rating );\n\tconst halfStarCount = Math.ceil( rating - fullStarCount );\n\tconst emptyStarCount = 5 - ( fullStarCount + halfStarCount );\n\n\treturn (\n\t\t<span\n\t\t\taria-label={ sprintf(\n\t\t\t\t/* translators: %s: number of stars. */\n\t\t\t\t__( '%s out of 5 stars' ),\n\t\t\t\tstars\n\t\t\t) }\n\t\t>\n\t\t\t{ times( fullStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `full_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-full\"\n\t\t\t\t\ticon={ starFilled }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ times( halfStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `half_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-half-full\"\n\t\t\t\t\ticon={ starHalf }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ times( emptyStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `empty_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-empty\"\n\t\t\t\t\ticon={ starEmpty }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</span>\n\t);\n}\n\nexport default Stars;\n","/**\n * Internal dependencies\n */\nimport Stars from './stars';\n\nexport const BlockRatings = ( { rating } ) => (\n\t<span className=\"block-directory-block-ratings\">\n\t\t<Stars rating={ rating } />\n\t</span>\n);\n\nexport default BlockRatings;\n","/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\n\nfunction DownloadableBlockIcon( { icon } ) {\n\tconst className = 'block-directory-downloadable-block-icon';\n\treturn icon.match( /\\.(jpeg|jpg|gif|png|svg)(?:\\?.*)?$/ ) !== null ? (\n\t\t<img className={ className } src={ icon } alt=\"\" />\n\t) : (\n\t\t<BlockIcon className={ className } icon={ icon } showColors />\n\t);\n}\n\nexport default DownloadableBlockIcon;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport const DownloadableBlockNotice = ( { block } ) => {\n\tconst errorNotice = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockDirectoryStore ).getErrorNoticeForBlock( block.id ),\n\t\t[ block ]\n\t);\n\n\tif ( ! errorNotice ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"block-directory-downloadable-block-notice\">\n\t\t\t<div className=\"block-directory-downloadable-block-notice__content\">\n\t\t\t\t{ errorNotice.message }\n\t\t\t\t{ errorNotice.isFatal\n\t\t\t\t\t? ' ' + __( 'Try reloading the page.' )\n\t\t\t\t\t: null }\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default DownloadableBlockNotice;\n","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tSpinner,\n\tVisuallyHidden,\n\t__unstableCompositeItem as CompositeItem,\n} from '@wordpress/components';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockRatings from '../block-ratings';\nimport DownloadableBlockIcon from '../downloadable-block-icon';\nimport DownloadableBlockNotice from '../downloadable-block-notice';\nimport { store as blockDirectoryStore } from '../../store';\n\n// Return the appropriate block item label, given the block data and status.\nfunction getDownloadableBlockLabel(\n\t{ title, rating, ratingCount },\n\t{ hasNotice, isInstalled, isInstalling }\n) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tif ( ! isInstalled && hasNotice ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Retry installing %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalled ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Add %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalling ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Installing %s.', decodeEntities( title ) );\n\t}\n\n\t// No ratings yet, just use the title.\n\tif ( ratingCount < 1 ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Install %s.', decodeEntities( title ) );\n\t}\n\n\treturn sprintf(\n\t\t/* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */\n\t\t_n(\n\t\t\t'Install %1$s. %2$s stars with %3$s review.',\n\t\t\t'Install %1$s. %2$s stars with %3$s reviews.',\n\t\t\tratingCount\n\t\t),\n\t\tdecodeEntities( title ),\n\t\tstars,\n\t\tratingCount\n\t);\n}\n\nfunction DownloadableBlockListItem( { composite, item, onClick } ) {\n\tconst { author, description, icon, rating, title } = item;\n\t// getBlockType returns a block object if this block exists, or null if not.\n\tconst isInstalled = !! getBlockType( item.name );\n\n\tconst { hasNotice, isInstalling, isInstallable } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetErrorNoticeForBlock,\n\t\t\t\tisInstalling: isBlockInstalling,\n\t\t\t} = select( blockDirectoryStore );\n\t\t\tconst notice = getErrorNoticeForBlock( item.id );\n\t\t\tconst hasFatal = notice && notice.isFatal;\n\t\t\treturn {\n\t\t\t\thasNotice: !! notice,\n\t\t\t\tisInstalling: isBlockInstalling( item.id ),\n\t\t\t\tisInstallable: ! hasFatal,\n\t\t\t};\n\t\t},\n\t\t[ item ]\n\t);\n\n\tlet statusText = '';\n\tif ( isInstalled ) {\n\t\tstatusText = __( 'Installed!' );\n\t} else if ( isInstalling ) {\n\t\tstatusText = __( 'Installing…' );\n\t}\n\n\treturn (\n\t\t<CompositeItem\n\t\t\trole=\"option\"\n\t\t\tas={ Button }\n\t\t\t{ ...composite }\n\t\t\tclassName=\"block-directory-downloadable-block-list-item\"\n\t\t\tonClick={ ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick();\n\t\t\t} }\n\t\t\tisBusy={ isInstalling }\n\t\t\tdisabled={ isInstalling || ! isInstallable }\n\t\t\tlabel={ getDownloadableBlockLabel( item, {\n\t\t\t\thasNotice,\n\t\t\t\tisInstalled,\n\t\t\t\tisInstalling,\n\t\t\t} ) }\n\t\t\tshowTooltip={ true }\n\t\t\ttooltipPosition=\"top center\"\n\t\t>\n\t\t\t<div className=\"block-directory-downloadable-block-list-item__icon\">\n\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\t\t\t\t{ isInstalling ? (\n\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__spinner\">\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockRatings rating={ rating } />\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<span className=\"block-directory-downloadable-block-list-item__details\">\n\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__title\">\n\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %1$s: block title, %2$s: author name. */\n\t\t\t\t\t\t\t__( '%1$s <span>by %2$s</span>' ),\n\t\t\t\t\t\t\tdecodeEntities( title ),\n\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__author\" />\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t\t{ hasNotice ? (\n\t\t\t\t\t<DownloadableBlockNotice block={ item } />\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__desc\">\n\t\t\t\t\t\t\t{ !! statusText\n\t\t\t\t\t\t\t\t? statusText\n\t\t\t\t\t\t\t\t: decodeEntities( description ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{ isInstallable &&\n\t\t\t\t\t\t\t! ( isInstalled || isInstalling ) && (\n\t\t\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t\t\t{ __( 'Install block' ) }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</CompositeItem>\n\t);\n}\n\nexport default DownloadableBlockListItem;\n","/**\n * External dependencies\n */\nimport { noop } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n} from '@wordpress/components';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockListItem from '../downloadable-block-list-item';\nimport { store as blockDirectoryStore } from '../../store';\n\nfunction DownloadableBlocksList( { items, onHover = noop, onSelect } ) {\n\tconst composite = useCompositeState();\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-directory-downloadable-blocks-list\"\n\t\t\taria-label={ __( 'Blocks available for install' ) }\n\t\t>\n\t\t\t{ items.map( ( item ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlockListItem\n\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t// Check if the block is registered (`getBlockType`\n\t\t\t\t\t\t\t// will return an object). If so, insert the block.\n\t\t\t\t\t\t\t// This prevents installing existing plugins.\n\t\t\t\t\t\t\tif ( getBlockType( item.name ) ) {\n\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tinstallBlockType( item ).then( ( success ) => {\n\t\t\t\t\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\titem={ item }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Composite>\n\t);\n}\n\nexport default DownloadableBlocksList;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"a11y\"];","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\nfunction DownloadableBlocksInserterPanel( {\n\tchildren,\n\tdownloadableItems,\n\thasLocalBlocks,\n} ) {\n\tconst count = downloadableItems.length;\n\tuseEffect( () => {\n\t\tspeak(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %d: number of available blocks. */\n\t\t\t\t_n(\n\t\t\t\t\t'%d additional block is available to install.',\n\t\t\t\t\t'%d additional blocks are available to install.',\n\t\t\t\t\tcount\n\t\t\t\t),\n\t\t\t\tcount\n\t\t\t)\n\t\t);\n\t}, [ count ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! hasLocalBlocks && (\n\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t{ __( 'No results available from your installed blocks.' ) }\n\t\t\t\t</p>\n\t\t\t) }\n\n\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\n\t\t\t<div className=\"block-directory-downloadable-blocks-panel\">\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel__header\">\n\t\t\t\t\t<h2 className=\"block-directory-downloadable-blocks-panel__title\">\n\t\t\t\t\t\t{ __( 'Available to install' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__description\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Select a block to install and add it to your post.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksInserterPanel;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst blockDefault = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z\" />\n\t</SVG>\n);\n\nexport default blockDefault;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, blockDefault } from '@wordpress/icons';\n\nfunction DownloadableBlocksNoResults() {\n\treturn (\n\t\t<div className=\"block-editor-inserter__no-results\">\n\t\t\t<Icon\n\t\t\t\tclassName=\"block-editor-inserter__no-results-icon\"\n\t\t\t\ticon={ blockDefault }\n\t\t\t/>\n\t\t\t<p>{ __( 'No results found.' ) }</p>\n\t\t</div>\n\t);\n}\n\nexport default DownloadableBlocksNoResults;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Spinner } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksList from '../downloadable-blocks-list';\nimport DownloadableBlocksInserterPanel from './inserter-panel';\nimport DownloadableBlocksNoResults from './no-results';\nimport { store as blockDirectoryStore } from '../../store';\n\nfunction DownloadableBlocksPanel( {\n\tdownloadableItems,\n\tonSelect,\n\tonHover,\n\thasLocalBlocks,\n\thasPermission,\n\tisLoading,\n\tisTyping,\n} ) {\n\tif ( typeof hasPermission === 'undefined' || isLoading || isTyping ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ hasPermission && ! hasLocalBlocks && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'No results available from your installed blocks.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel has-blocks-loading\">\n\t\t\t\t\t<Spinner />\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( false === hasPermission ) {\n\t\tif ( ! hasLocalBlocks ) {\n\t\t\treturn <DownloadableBlocksNoResults />;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\treturn !! downloadableItems.length ? (\n\t\t<DownloadableBlocksInserterPanel\n\t\t\tdownloadableItems={ downloadableItems }\n\t\t\thasLocalBlocks={ hasLocalBlocks }\n\t\t>\n\t\t\t<DownloadableBlocksList\n\t\t\t\titems={ downloadableItems }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tonHover={ onHover }\n\t\t\t/>\n\t\t</DownloadableBlocksInserterPanel>\n\t) : (\n\t\t! hasLocalBlocks && <DownloadableBlocksNoResults />\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select, { filterValue, rootClientId = null } ) => {\n\t\tconst {\n\t\t\tgetDownloadableBlocks,\n\t\t\tisRequestingDownloadableBlocks,\n\t\t} = select( blockDirectoryStore );\n\t\tconst { canInsertBlockType } = select( blockEditorStore );\n\n\t\tconst hasPermission = select( coreStore ).canUser(\n\t\t\t'read',\n\t\t\t'block-directory/search'\n\t\t);\n\n\t\tfunction getInstallableBlocks( term ) {\n\t\t\treturn getDownloadableBlocks( term ).filter( ( block ) =>\n\t\t\t\tcanInsertBlockType( block, rootClientId, true )\n\t\t\t);\n\t\t}\n\n\t\tconst downloadableItems = hasPermission\n\t\t\t? getInstallableBlocks( filterValue )\n\t\t\t: [];\n\t\tconst isLoading = isRequestingDownloadableBlocks( filterValue );\n\n\t\treturn {\n\t\t\tdownloadableItems,\n\t\t\thasPermission,\n\t\t\tisLoading,\n\t\t};\n\t} ),\n] )( DownloadableBlocksPanel );\n","/**\n * External dependencies\n */\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __unstableInserterMenuExtension } from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksPanel from '../../components/downloadable-blocks-panel';\n\nfunction InserterMenuDownloadableBlocksPanel() {\n\tconst [ debouncedFilterValue, setFilterValue ] = useState( '' );\n\tconst debouncedSetFilterValue = debounce( setFilterValue, 400 );\n\n\treturn (\n\t\t<__unstableInserterMenuExtension>\n\t\t\t{ ( {\n\t\t\t\tonSelect,\n\t\t\t\tonHover,\n\t\t\t\tfilterValue,\n\t\t\t\thasItems,\n\t\t\t\trootClientId,\n\t\t\t} ) => {\n\t\t\t\tif ( debouncedFilterValue !== filterValue ) {\n\t\t\t\t\tdebouncedSetFilterValue( filterValue );\n\t\t\t\t}\n\n\t\t\t\tif ( ! debouncedFilterValue ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlocksPanel\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tfilterValue={ debouncedFilterValue }\n\t\t\t\t\t\thasLocalBlocks={ hasItems }\n\t\t\t\t\t\tisTyping={ filterValue !== debouncedFilterValue }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</__unstableInserterMenuExtension>\n\t);\n}\n\nexport default InserterMenuDownloadableBlocksPanel;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editPost\"];","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockIcon from '../downloadable-block-icon';\n\nexport default function CompactList( { items } ) {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul className=\"block-directory-compact-list\">\n\t\t\t{ items.map( ( { icon, id, title, author } ) => (\n\t\t\t\t<li key={ id } className=\"block-directory-compact-list__item\">\n\t\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\n\t\t\t\t\t<div className=\"block-directory-compact-list__item-details\">\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-title\">\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-author\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Name of the block author. */\n\t\t\t\t\t\t\t\t__( 'By %s' ),\n\t\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { PluginPrePublishPanel } from '@wordpress/edit-post';\nimport { useSelect } from '@wordpress/data';\nimport { blockDefault } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport CompactList from '../../components/compact-list';\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstalledBlocksPrePublishPanel() {\n\tconst newBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getNewBlockTypes(),\n\t\t[]\n\t);\n\n\tif ( ! newBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PluginPrePublishPanel\n\t\t\ticon={ blockDefault }\n\t\t\ttitle={ sprintf(\n\t\t\t\t// translators: %d: number of blocks (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Added: %d block',\n\t\t\t\t\t'Added: %d blocks',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t),\n\t\t\t\tnewBlockTypes.length\n\t\t\t) }\n\t\t\tinitialOpen={ true }\n\t\t>\n\t\t\t<p className=\"installed-blocks-pre-publish-panel__copy\">\n\t\t\t\t{ _n(\n\t\t\t\t\t'The following block has been added to your site.',\n\t\t\t\t\t'The following blocks have been added to your site.',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<CompactList items={ newBlockTypes } />\n\t\t</PluginPrePublishPanel>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t\t\t__( 'Install %s' ),\n\t\t\t\tblock.title\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType } from '@wordpress/blocks';\nimport { RawHTML } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport InstallButton from './install-button';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst getInstallMissing = ( OriginalComponent ) => ( props ) => {\n\tconst { originalName } = props.attributes;\n\t// Disable reason: This is a valid component, but it's mistaken for a callback.\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst { block, hasPermission } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getDownloadableBlocks } = select( blockDirectoryStore );\n\t\t\tconst blocks = getDownloadableBlocks(\n\t\t\t\t'block:' + originalName\n\t\t\t).filter( ( { name } ) => originalName === name );\n\t\t\treturn {\n\t\t\t\thasPermission: select( coreStore ).canUser(\n\t\t\t\t\t'read',\n\t\t\t\t\t'block-directory/search'\n\t\t\t\t),\n\t\t\t\tblock: blocks.length && blocks[ 0 ],\n\t\t\t};\n\t\t},\n\t\t[ originalName ]\n\t);\n\n\t// The user can't install blocks, or the block isn't available for download.\n\tif ( ! hasPermission || ! block ) {\n\t\treturn <OriginalComponent { ...props } />;\n\t}\n\n\treturn <ModifiedWarning { ...props } originalBlock={ block } />;\n};\n\nconst ModifiedWarning = ( { originalBlock, ...props } ) => {\n\tconst { originalName, originalUndelimitedContent } = props.attributes;\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst convertToHTML = () => {\n\t\treplaceBlock(\n\t\t\tprops.clientId,\n\t\t\tcreateBlock( 'core/html', {\n\t\t\t\tcontent: originalUndelimitedContent,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst hasContent = !! originalUndelimitedContent;\n\tconst hasHTMLBlock = getBlockType( 'core/html' );\n\n\tlet messageHTML = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__(\n\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'\n\t\t),\n\t\toriginalBlock.title || originalName\n\t);\n\tconst actions = [\n\t\t<InstallButton\n\t\t\tkey=\"install\"\n\t\t\tblock={ originalBlock }\n\t\t\tattributes={ props.attributes }\n\t\t\tclientId={ props.clientId }\n\t\t/>,\n\t];\n\n\tif ( hasContent && hasHTMLBlock ) {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'\n\t\t\t),\n\t\t\toriginalBlock.title || originalName\n\t\t);\n\t\tactions.push(\n\t\t\t<Button key=\"convert\" onClick={ convertToHTML } variant=\"link\">\n\t\t\t\t{ __( 'Keep as HTML' ) }\n\t\t\t</Button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div { ...useBlockProps() }>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ originalUndelimitedContent }</RawHTML>\n\t\t</div>\n\t);\n};\n\nexport default getInstallMissing;\n","/**\n * WordPress dependencies\n */\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport AutoBlockUninstaller from '../components/auto-block-uninstaller';\nimport InserterMenuDownloadableBlocksPanel from './inserter-menu-downloadable-blocks-panel';\nimport InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel';\nimport getInstallMissing from './get-install-missing';\n\nregisterPlugin( 'block-directory', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<AutoBlockUninstaller />\n\t\t\t\t<InserterMenuDownloadableBlocksPanel />\n\t\t\t\t<InstalledBlocksPrePublishPanel />\n\t\t\t</>\n\t\t);\n\t},\n} );\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-directory/fallback',\n\t( settings, name ) => {\n\t\tif ( name !== 'core/missing' ) {\n\t\t\treturn settings;\n\t\t}\n\t\tsettings.edit = getInstallMissing( settings.edit );\n\n\t\treturn settings;\n\t}\n);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","combineReducers","downloadableBlocks","state","action","type","filterValue","isRequesting","results","blockManagement","installedBlockTypes","isInstalling","item","filter","blockType","name","blockId","errorNotices","message","isFatal","omit","hasBlockType","blocks","length","some","i","innerBlocks","isRequestingDownloadableBlocks","getDownloadableBlocks","getInstalledBlockTypes","getNewBlockTypes","createRegistrySelector","select","usedBlockTree","blockEditorStore","getBlocks","getUnusedBlockTypes","getErrorNotices","getErrorNoticeForBlock","loadAsset","el","Promise","resolve","reject","newNode","document","createElement","nodeName","forEach","attr","innerHTML","appendChild","createTextNode","onload","onerror","Error","body","toLowerCase","src","getPluginUrl","block","link","links","self","href","fetchDownloadableBlocks","receiveDownloadableBlocks","installBlockType","async","registry","dispatch","id","success","clearErrorNotice","setIsInstalling","url","apiFetch","method","data","status","path","slug","_links","addInstalledBlockType","metadataFields","addQueryArgs","_fields","catch","then","response","unstable__bootstrapServerSideBlockDefinitions","pick","location","parse","text","doc","DOMParser","parseFromString","newAssets","Array","from","querySelectorAll","asset","getElementById","newAsset","loadAssets","blocksStore","getBlockTypes","__","noticesStore","createInfoNotice","sprintf","title","speak","error","fatalAPIErrors","folder_exists","unable_to_connect_to_filesystem","code","setErrorNotice","createErrorNotice","isDismissible","uninstallBlockType","removeInstalledBlockType","map","result","mapKeys","camelCase","storeConfig","reducer","selectors","actions","resolvers","store","createReduxStore","AutoBlockUninstaller","useDispatch","blockDirectoryStore","shouldRemoveBlockTypes","useSelect","isAutosavingPost","isSavingPost","editorStore","unusedBlockTypes","useEffect","unregisterBlockType","register","_extends","assign","target","arguments","source","apply","this","icon","size","props","cloneElement","width","height","SVG","xmlns","viewBox","Path","fillRule","clipRule","rating","stars","Math","round","fullStarCount","floor","halfStarCount","ceil","emptyStarCount","times","className","starFilled","starHalf","starEmpty","match","alt","BlockIcon","showColors","errorNotice","getDownloadableBlockLabel","ratingCount","hasNotice","isInstalled","decodeEntities","_n","composite","onClick","author","description","getBlockType","isInstallable","isBlockInstalling","notice","hasFatal","statusText","role","as","Button","event","preventDefault","isBusy","disabled","label","showTooltip","tooltipPosition","Spinner","createInterpolateElement","span","VisuallyHidden","items","onHover","noop","onSelect","useCompositeState","children","downloadableItems","hasLocalBlocks","count","blockDefault","compose","withSelect","rootClientId","canInsertBlockType","hasPermission","coreStore","canUser","isLoading","isTyping","debouncedFilterValue","setFilterValue","useState","debouncedSetFilterValue","debounce","__unstableInserterMenuExtension","hasItems","CompactList","InstalledBlocksPrePublishPanel","newBlockTypes","PluginPrePublishPanel","initialOpen","InstallButton","attributes","clientId","isInstallingBlock","replaceBlock","originalBlock","originalContent","createBlock","variant","ModifiedWarning","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","messageHTML","push","content","useBlockProps","Warning","RawHTML","registerPlugin","render","addFilter","settings","edit","OriginalComponent"],"sourceRoot":""}
|
build/block-editor/index.js
CHANGED
@@ -2638,7 +2638,7 @@ const SETTINGS_DEFAULTS = {
|
|
2638 |
slug: 'full',
|
2639 |
name: (0,external_wp_i18n_namespaceObject.__)('Full Size')
|
2640 |
}],
|
2641 |
-
// Allow plugin to disable Image Editor if need be
|
2642 |
imageEditing: true,
|
2643 |
// This is current max width of the block inner area
|
2644 |
// It's used to constraint image resizing and this value could be overridden later by themes
|
@@ -2955,7 +2955,7 @@ function updateParentInnerBlocksInTree(state, tree, updatedClientIds) {
|
|
2955 |
controlledParents.add(current);
|
2956 |
break;
|
2957 |
} else {
|
2958 |
-
//
|
2959 |
uncontrolledParents.add(current);
|
2960 |
current = state.parents[current];
|
2961 |
}
|
@@ -3268,7 +3268,7 @@ const withBlockReset = reducer => (state, action) => {
|
|
3268 |
};
|
3269 |
const subTree = buildBlockTree(newState, action.blocks);
|
3270 |
newState.tree = { ...subTree,
|
3271 |
-
// Root
|
3272 |
'': {
|
3273 |
innerBlocks: action.blocks.map(subBlock => subTree[subBlock.clientId])
|
3274 |
}
|
@@ -3373,7 +3373,7 @@ const withSaveReusableBlock = reducer => (state, action) => {
|
|
3373 |
const {
|
3374 |
id,
|
3375 |
updatedId
|
3376 |
-
} = action; // If a temporary reusable block is saved, we swap the temporary id with the final one
|
3377 |
|
3378 |
if (id === updatedId) {
|
3379 |
return state;
|
@@ -3431,9 +3431,9 @@ const withResetControlledBlocks = reducer => (state, action) => {
|
|
3431 |
*/
|
3432 |
|
3433 |
|
3434 |
-
const blocks = (0,external_lodash_namespaceObject.flow)(external_wp_data_namespaceObject.combineReducers, withSaveReusableBlock, //
|
3435 |
-
withBlockTree, //
|
3436 |
-
withInnerBlocksRemoveCascade, withReplaceInnerBlocks, //
|
3437 |
withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetControlledBlocks)({
|
3438 |
byClientId() {
|
3439 |
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -3447,7 +3447,7 @@ withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetCont
|
|
3447 |
};
|
3448 |
|
3449 |
case 'UPDATE_BLOCK':
|
3450 |
-
// Ignore updates if block isn't known
|
3451 |
if (!state[action.clientId]) {
|
3452 |
return state;
|
3453 |
} // Do nothing if only attributes change.
|
@@ -3587,7 +3587,7 @@ withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetCont
|
|
3587 |
} = action;
|
3588 |
const {
|
3589 |
index = state[toRootClientId].length
|
3590 |
-
} = action; // Moving inside the same parent block
|
3591 |
|
3592 |
if (fromRootClientId === toRootClientId) {
|
3593 |
const subState = state[toRootClientId];
|
@@ -3595,7 +3595,7 @@ withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetCont
|
|
3595 |
return { ...state,
|
3596 |
[toRootClientId]: moveTo(state[toRootClientId], fromIndex, index, clientIds.length)
|
3597 |
};
|
3598 |
-
} // Moving from a parent block to another
|
3599 |
|
3600 |
|
3601 |
return { ...state,
|
@@ -3670,8 +3670,8 @@ withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetCont
|
|
3670 |
}
|
3671 |
|
3672 |
case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN':
|
3673 |
-
return (0,external_lodash_namespaceObject.flow)([// Remove inner block ordering for removed blocks
|
3674 |
-
nextState => (0,external_lodash_namespaceObject.omit)(nextState, action.removedClientIds), // Remove deleted blocks from other blocks' orderings
|
3675 |
nextState => (0,external_lodash_namespaceObject.mapValues)(nextState, subState => (0,external_lodash_namespaceObject.without)(subState, ...action.removedClientIds))])(state);
|
3676 |
}
|
3677 |
|
@@ -4750,7 +4750,7 @@ const symbol = (0,external_wp_element_namespaceObject.createElement)(external_wp
|
|
4750 |
* @property {number} offset An attribute value offset, based on the rich
|
4751 |
* text value. See `wp.richText.create`.
|
4752 |
*/
|
4753 |
-
// Module constants
|
4754 |
|
4755 |
const MILLISECONDS_PER_HOUR = 3600 * 1000;
|
4756 |
const MILLISECONDS_PER_DAY = 24 * 3600 * 1000;
|
@@ -6004,7 +6004,7 @@ function canRemoveBlock(state, clientId) {
|
|
6004 |
|
6005 |
if (lock === undefined || (lock === null || lock === void 0 ? void 0 : lock.remove) === undefined) {
|
6006 |
return !parentIsLocked;
|
6007 |
-
} //
|
6008 |
|
6009 |
|
6010 |
return !(lock !== null && lock !== void 0 && lock.remove);
|
@@ -6048,7 +6048,7 @@ function canMoveBlock(state, clientId) {
|
|
6048 |
|
6049 |
if (lock === undefined || (lock === null || lock === void 0 ? void 0 : lock.move) === undefined) {
|
6050 |
return !parentIsLocked;
|
6051 |
-
} //
|
6052 |
|
6053 |
|
6054 |
return !(lock !== null && lock !== void 0 && lock.move);
|
@@ -6215,7 +6215,7 @@ const buildBlockTypeItem = (state, _ref3) => {
|
|
6215 |
keywords: blockType.keywords,
|
6216 |
variations: inserterVariations,
|
6217 |
example: blockType.example,
|
6218 |
-
utility: 1 //
|
6219 |
|
6220 |
};
|
6221 |
};
|
@@ -6315,7 +6315,7 @@ const getInserterItems = rememo(function (state) {
|
|
6315 |
keywords: [],
|
6316 |
isDisabled: false,
|
6317 |
utility: 1,
|
6318 |
-
//
|
6319 |
frecency
|
6320 |
};
|
6321 |
};
|
@@ -6325,7 +6325,7 @@ const getInserterItems = rememo(function (state) {
|
|
6325 |
const items = blockTypeInserterItems.reduce((accumulator, item) => {
|
6326 |
const {
|
6327 |
variations = []
|
6328 |
-
} = item; // Exclude any block type item that is to be replaced by a default variation
|
6329 |
|
6330 |
if (!variations.some(_ref4 => {
|
6331 |
let {
|
@@ -7580,7 +7580,7 @@ const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref12 => {
|
|
7580 |
});
|
7581 |
const [clientIdA, clientIdB] = blocks;
|
7582 |
const blockA = select.getBlock(clientIdA);
|
7583 |
-
const blockAType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockA.name); // Only focus the previous block if it's not mergeable
|
7584 |
|
7585 |
if (blockAType && !blockAType.merge) {
|
7586 |
dispatch.selectBlock(blockA.clientId);
|
@@ -7637,14 +7637,14 @@ const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref12 => {
|
|
7637 |
preserveWhiteSpace
|
7638 |
});
|
7639 |
} // We can only merge blocks with similar types
|
7640 |
-
// thus, we transform the block to merge first
|
7641 |
|
7642 |
|
7643 |
-
const blocksWithTheSameType = blockA.name === blockB.name ? [cloneB] : (0,external_wp_blocks_namespaceObject.switchToBlockType)(cloneB, blockA.name); // If the block types can not match, do nothing
|
7644 |
|
7645 |
if (!blocksWithTheSameType || !blocksWithTheSameType.length) {
|
7646 |
return;
|
7647 |
-
} // Calling the merge to update the attributes and remove the block to be merged
|
7648 |
|
7649 |
|
7650 |
const updatedAttributes = blockAType.merge(cloneA.attributes, blocksWithTheSameType[0].attributes);
|
@@ -8416,7 +8416,7 @@ function BlockControlsSlot(_ref) {
|
|
8416 |
|
8417 |
|
8418 |
const BlockControls = BlockControlsFill;
|
8419 |
-
BlockControls.Slot = BlockControlsSlot; // This is just here for backward compatibility
|
8420 |
|
8421 |
const BlockFormatControls = props => {
|
8422 |
return (0,external_wp_element_namespaceObject.createElement)(BlockControlsFill, _extends({
|
@@ -9758,7 +9758,7 @@ function getValidAlignments(blockAlign) {
|
|
9758 |
*/
|
9759 |
|
9760 |
function addAttribute(settings) {
|
9761 |
-
//
|
9762 |
if ((0,external_lodash_namespaceObject.has)(settings.attributes, ['align', 'type'])) {
|
9763 |
return settings;
|
9764 |
}
|
@@ -9916,7 +9916,7 @@ function addAssignedAlign(props, blockType, attributes) {
|
|
9916 |
*/
|
9917 |
|
9918 |
function lock_addAttribute(settings) {
|
9919 |
-
//
|
9920 |
if ((0,external_lodash_namespaceObject.has)(settings.attributes, ['lock', 'type'])) {
|
9921 |
return settings;
|
9922 |
} // Gracefully handle if settings.attributes is undefined.
|
@@ -10290,7 +10290,7 @@ const ANCHOR_REGEX = /[\s#]/g;
|
|
10290 |
*/
|
10291 |
|
10292 |
function anchor_addAttribute(settings) {
|
10293 |
-
//
|
10294 |
if ((0,external_lodash_namespaceObject.has)(settings.attributes, ['anchor', 'type'])) {
|
10295 |
return settings;
|
10296 |
}
|
@@ -10532,15 +10532,15 @@ function addTransforms(result, source, index, results) {
|
|
10532 |
*/
|
10533 |
|
10534 |
function addGeneratedClassName(extraProps, blockType) {
|
10535 |
-
// Adding the generated className
|
10536 |
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'className', true)) {
|
10537 |
if (typeof extraProps.className === 'string') {
|
10538 |
// We have some extra classes and want to add the default classname
|
10539 |
-
// We use uniq to prevent duplicate classnames
|
10540 |
extraProps.className = (0,external_lodash_namespaceObject.uniq)([(0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(blockType.name), ...extraProps.className.split(' ')]).join(' ').trim();
|
10541 |
} else {
|
10542 |
// There is no string in the className variable,
|
10543 |
-
// so we just dump the default name in there
|
10544 |
extraProps.className = (0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(blockType.name);
|
10545 |
}
|
10546 |
}
|
@@ -10760,7 +10760,7 @@ const Edit = props => {
|
|
10760 |
return (0,external_wp_element_namespaceObject.createElement)(Component, _extends({}, props, {
|
10761 |
context: context
|
10762 |
}));
|
10763 |
-
} // Generate a class name for the block's editable form
|
10764 |
|
10765 |
|
10766 |
const generatedClassName = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'className', true) ? (0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(name) : null;
|
@@ -10970,8 +10970,8 @@ function BlockCompare(_ref) {
|
|
10970 |
}
|
10971 |
|
10972 |
function getConvertedContent(convertedBlock) {
|
10973 |
-
// The convertor may return an array of items or a single item
|
10974 |
-
const newBlocks = (0,external_lodash_namespaceObject.castArray)(convertedBlock); // Get converted block details
|
10975 |
|
10976 |
const newContent = newBlocks.map(item => (0,external_wp_blocks_namespaceObject.getSaveContent)(item.name, item.attributes, item.innerBlocks));
|
10977 |
return newContent.join('');
|
@@ -11030,7 +11030,7 @@ function BlockInvalidWarning(_ref) {
|
|
11030 |
const hasHTMLBlock = !!(0,external_wp_blocks_namespaceObject.getBlockType)('core/html');
|
11031 |
const [compare, setCompare] = (0,external_wp_element_namespaceObject.useState)(false);
|
11032 |
const onCompare = (0,external_wp_element_namespaceObject.useCallback)(() => setCompare(true), []);
|
11033 |
-
const onCompareClose = (0,external_wp_element_namespaceObject.useCallback)(() => setCompare(false), []); // We memo the array here to prevent the children components from being updated unexpectedly
|
11034 |
|
11035 |
const hiddenActions = (0,external_wp_element_namespaceObject.useMemo)(() => [{
|
11036 |
// translators: Button to fix block content
|
@@ -11215,7 +11215,7 @@ function BlockHTML(_ref) {
|
|
11215 |
attributes,
|
11216 |
originalContent: content,
|
11217 |
isValid
|
11218 |
-
}); // Ensure the state is updated if we reset so it displays the default content
|
11219 |
|
11220 |
if (!html) {
|
11221 |
setHtml({
|
@@ -15336,7 +15336,7 @@ function useMovingAnimation(_ref) {
|
|
15336 |
}
|
15337 |
|
15338 |
if (prefersReducedMotion) {
|
15339 |
-
//
|
15340 |
// just move directly to the final scroll position.
|
15341 |
preserveScrollPosition();
|
15342 |
return;
|
@@ -15860,7 +15860,7 @@ function useBlockClassNames(clientId) {
|
|
15860 |
const isDragging = isBlockBeingDragged(clientId);
|
15861 |
const isSelected = isBlockSelected(clientId);
|
15862 |
const name = getBlockName(clientId);
|
15863 |
-
const checkDeep = true; // "ancestor" is the more appropriate label due to "deep" check
|
15864 |
|
15865 |
const isAncestorOfSelectedBlock = hasSelectedInnerBlock(clientId, checkDeep);
|
15866 |
const activeEntityBlockId = getActiveBlockIdByBlockNames(spotlightEntityBlocks);
|
@@ -16900,7 +16900,7 @@ const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dis
|
|
16900 |
|
16901 |
};
|
16902 |
});
|
16903 |
-
/* harmony default export */ var block = ((0,external_wp_compose_namespaceObject.compose)(external_wp_compose_namespaceObject.pure, applyWithSelect, applyWithDispatch, //
|
16904 |
// see issue for more info
|
16905 |
// https://github.com/WordPress/gutenberg/issues/17013
|
16906 |
(0,external_wp_compose_namespaceObject.ifCondition)(_ref5 => {
|
@@ -17731,14 +17731,15 @@ function useTabNav() {
|
|
17731 |
// will no longer send focus through the focus capture element.
|
17732 |
if (event.target === node) setNavigationMode(true);
|
17733 |
return;
|
17734 |
-
} // Allow tabbing
|
|
|
17735 |
// such as inside a placeholder. Form elements are generally
|
17736 |
// meant to be UI rather than part of the content. Ideally
|
17737 |
// these are not rendered in the content and perhaps in the
|
17738 |
// future they can be rendered in an iframe or shadow DOM.
|
17739 |
|
17740 |
|
17741 |
-
if (isFormElement(event.target) && isFormElement(external_wp_dom_namespaceObject.focus.tabbable[direction](event.target))) {
|
17742 |
return;
|
17743 |
}
|
17744 |
|
@@ -17792,7 +17793,7 @@ function useTabNav() {
|
|
17792 |
|
17793 |
const isShift = event.shiftKey;
|
17794 |
const direction = isShift ? 'findPrevious' : 'findNext';
|
17795 |
-
const target = external_wp_dom_namespaceObject.focus.tabbable[direction](event.target); //
|
17796 |
|
17797 |
if (target === focusCaptureBeforeRef.current || target === focusCaptureAfterRef.current) {
|
17798 |
event.preventDefault();
|
@@ -18760,7 +18761,7 @@ const commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
|
18760 |
|
18761 |
|
18762 |
function declaration() {
|
18763 |
-
const pos = position(); // prop
|
18764 |
|
18765 |
let prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
|
18766 |
|
@@ -18772,7 +18773,7 @@ const commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
|
18772 |
|
18773 |
if (!match(/^:\s*/)) {
|
18774 |
return error("property missing ':'");
|
18775 |
-
} // val
|
18776 |
|
18777 |
|
18778 |
const val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);
|
@@ -18797,7 +18798,7 @@ const commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
|
18797 |
return error("missing '{'");
|
18798 |
}
|
18799 |
|
18800 |
-
comments(decls); // declarations
|
18801 |
|
18802 |
let decl; // eslint-disable-next-line no-cond-assign
|
18803 |
|
@@ -19013,7 +19014,7 @@ const commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
|
19013 |
return error("@page missing '{'");
|
19014 |
}
|
19015 |
|
19016 |
-
let decls = comments(); // declarations
|
19017 |
|
19018 |
let decl; // eslint-disable-next-line no-cond-assign
|
19019 |
|
@@ -19082,7 +19083,7 @@ const commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
|
19082 |
return error("@font-face missing '{'");
|
19083 |
}
|
19084 |
|
19085 |
-
let decls = comments(); // declarations
|
19086 |
|
19087 |
let decl; // eslint-disable-next-line no-cond-assign
|
19088 |
|
@@ -19730,14 +19731,14 @@ function isAbsolutePath(filePath) {
|
|
19730 |
|
19731 |
|
19732 |
function isValidURL(meta) {
|
19733 |
-
//
|
19734 |
if (meta.value.indexOf('data:') === 0 || meta.value.indexOf('#') === 0) {
|
19735 |
return false;
|
19736 |
}
|
19737 |
|
19738 |
if (isAbsolutePath(meta.value)) {
|
19739 |
return false;
|
19740 |
-
} //
|
19741 |
|
19742 |
|
19743 |
if (isRemotePath(meta.value)) {
|
@@ -20346,12 +20347,12 @@ function InserterListboxItem(_ref, ref) {
|
|
20346 |
*/
|
20347 |
|
20348 |
const dragHandle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
20349 |
-
width: "
|
20350 |
-
height: "
|
20351 |
xmlns: "http://www.w3.org/2000/svg",
|
20352 |
-
viewBox: "0 0
|
20353 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
20354 |
-
d: "
|
20355 |
}));
|
20356 |
/* harmony default export */ var drag_handle = (dragHandle);
|
20357 |
|
@@ -20870,7 +20871,7 @@ function BlockTypesTab(_ref) {
|
|
20870 |
*/
|
20871 |
|
20872 |
const currentlyRenderedCategories = (0,external_wp_compose_namespaceObject.useAsyncList)(categories);
|
20873 |
-
const didRenderAllCategories = categories.length === currentlyRenderedCategories.length; // Async List requires an array
|
20874 |
|
20875 |
const collectionEntries = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
20876 |
return Object.entries(collections);
|
@@ -21386,7 +21387,7 @@ function useInsertionPoint(_ref) {
|
|
21386 |
/**
|
21387 |
* External dependencies
|
21388 |
*/
|
21389 |
-
// Default search helpers
|
21390 |
|
21391 |
const defaultGetName = item => item.name || '';
|
21392 |
|
@@ -21792,7 +21793,7 @@ function BlockPatternsTabs(_ref3) {
|
|
21792 |
}
|
21793 |
|
21794 |
return pattern.categories.some(cat => allCategories.some(category => category.name === cat));
|
21795 |
-
}, [allCategories]); // Remove any empty categories
|
21796 |
|
21797 |
const populatedCategories = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
21798 |
const categories = allCategories.filter(category => allPatterns.some(pattern => {
|
@@ -22026,7 +22027,7 @@ function InserterSearchResults(_ref) {
|
|
22026 |
|
22027 |
const results = searchBlockItems((0,external_lodash_namespaceObject.orderBy)(blockTypes, ['frecency'], ['desc']), blockTypeCategories, blockTypeCollections, filterValue);
|
22028 |
return maxBlockTypesToShow !== undefined ? results.slice(0, maxBlockTypesToShow) : results;
|
22029 |
-
}, [filterValue, blockTypes, blockTypeCategories, blockTypeCollections, maxBlockTypes]); // Announce search results on change
|
22030 |
|
22031 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
22032 |
if (!filterValue) {
|
@@ -22367,7 +22368,7 @@ function QuickInserter(_ref) {
|
|
22367 |
setInserterIsOpened(false);
|
22368 |
}
|
22369 |
}, [setInserterIsOpened]); // When clicking Browse All select the appropriate block so as
|
22370 |
-
// the insertion point can work as expected
|
22371 |
|
22372 |
const onBrowseAll = () => {
|
22373 |
setInserterIsOpened({
|
@@ -22465,7 +22466,7 @@ const defaultRenderToggle = _ref => {
|
|
22465 |
const {
|
22466 |
onClick,
|
22467 |
...rest
|
22468 |
-
} = toggleProps; // Handle both onClick functions from the toggle and the parent component
|
22469 |
|
22470 |
function handleClick(event) {
|
22471 |
if (onToggle) {
|
@@ -22500,7 +22501,7 @@ class Inserter extends external_wp_element_namespaceObject.Component {
|
|
22500 |
onToggle(isOpen) {
|
22501 |
const {
|
22502 |
onToggle
|
22503 |
-
} = this.props; // Surface toggle callback to parent component
|
22504 |
|
22505 |
if (onToggle) {
|
22506 |
onToggle(isOpen);
|
@@ -22740,7 +22741,7 @@ class Inserter extends external_wp_element_namespaceObject.Component {
|
|
22740 |
|
22741 |
if (!isAppender && end && getBlockRootClientId(end) === rootClientId) {
|
22742 |
return getBlockIndex(end) + 1;
|
22743 |
-
} // Otherwise, we insert at the end of the current rootClientId
|
22744 |
|
22745 |
|
22746 |
return getBlockOrder(rootClientId).length;
|
@@ -23735,7 +23736,7 @@ function useBlockDisplayInformation(clientId) {
|
|
23735 |
}, [clientId]);
|
23736 |
}
|
23737 |
|
23738 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-title/
|
23739 |
/**
|
23740 |
* External dependencies
|
23741 |
*/
|
@@ -23753,25 +23754,21 @@ function useBlockDisplayInformation(clientId) {
|
|
23753 |
|
23754 |
|
23755 |
/**
|
23756 |
-
*
|
23757 |
* cannot be determined.
|
23758 |
*
|
23759 |
* @example
|
23760 |
*
|
23761 |
-
* ```
|
23762 |
-
*
|
23763 |
* ```
|
23764 |
*
|
23765 |
-
* @param {
|
23766 |
-
* @param {
|
23767 |
-
*
|
23768 |
* @return {?string} Block title.
|
23769 |
*/
|
23770 |
|
23771 |
-
function
|
23772 |
-
let {
|
23773 |
-
clientId
|
23774 |
-
} = _ref;
|
23775 |
const {
|
23776 |
attributes,
|
23777 |
name,
|
@@ -23800,7 +23797,11 @@ function BlockTitle(_ref) {
|
|
23800 |
};
|
23801 |
}, [clientId]);
|
23802 |
const blockInformation = useBlockDisplayInformation(clientId);
|
23803 |
-
|
|
|
|
|
|
|
|
|
23804 |
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
|
23805 |
const blockLabel = blockType ? (0,external_wp_blocks_namespaceObject.__experimentalGetBlockLabel)(blockType, attributes) : null;
|
23806 |
const label = reusableBlockTitle || blockLabel; // Label will fallback to the title if no label is defined for the current
|
@@ -23808,14 +23809,44 @@ function BlockTitle(_ref) {
|
|
23808 |
// possible block variation title match.
|
23809 |
|
23810 |
if (label && label !== blockType.title) {
|
23811 |
-
return (0,external_lodash_namespaceObject.truncate)(label, {
|
23812 |
-
length:
|
23813 |
-
});
|
23814 |
}
|
23815 |
|
23816 |
return blockInformation.title;
|
23817 |
}
|
23818 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23819 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-draggable/use-scroll-when-dragging.js
|
23820 |
/**
|
23821 |
* WordPress dependencies
|
@@ -23952,7 +23983,7 @@ const BlockDraggable = _ref => {
|
|
23952 |
const {
|
23953 |
startDraggingBlocks,
|
23954 |
stopDraggingBlocks
|
23955 |
-
} = (0,external_wp_data_namespaceObject.useDispatch)(store); // Stop dragging blocks if the block draggable is unmounted
|
23956 |
|
23957 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
23958 |
return () => {
|
@@ -24258,7 +24289,8 @@ function BlockSelectionButton(_ref) {
|
|
24258 |
label: label,
|
24259 |
className: "block-selection-button_select-button"
|
24260 |
}, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
24261 |
-
clientId: clientId
|
|
|
24262 |
})))));
|
24263 |
}
|
24264 |
|
@@ -24333,7 +24365,7 @@ function useIsAccessibleToolbar(ref) {
|
|
24333 |
}, []);
|
24334 |
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
|
24335 |
// Toolbar buttons may be rendered asynchronously, so we use
|
24336 |
-
// MutationObserver to check if the toolbar subtree has been modified
|
24337 |
const observer = new window.MutationObserver(determineIsAccessibleToolbar);
|
24338 |
observer.observe(ref.current, {
|
24339 |
childList: true,
|
@@ -24345,12 +24377,12 @@ function useIsAccessibleToolbar(ref) {
|
|
24345 |
}
|
24346 |
|
24347 |
function useToolbarFocus(ref, focusOnMount, isAccessibleToolbar, defaultIndex, onIndexChange) {
|
24348 |
-
// Make sure we don't use modified versions of this prop
|
24349 |
const [initialFocusOnMount] = (0,external_wp_element_namespaceObject.useState)(focusOnMount);
|
24350 |
const [initialIndex] = (0,external_wp_element_namespaceObject.useState)(defaultIndex);
|
24351 |
const focusToolbar = (0,external_wp_element_namespaceObject.useCallback)(() => {
|
24352 |
focusFirstTabbableIn(ref.current);
|
24353 |
-
}, []); // Focus on toolbar when pressing alt+F10 when the toolbar is visible
|
24354 |
|
24355 |
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', focusToolbar);
|
24356 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
@@ -24529,7 +24561,7 @@ function getBlockMoverDescription(selectedCount, type, firstIndex, isFirst, isLa
|
|
24529 |
}
|
24530 |
|
24531 |
if (dir > 0 && !isLast) {
|
24532 |
-
//
|
24533 |
const movementDirection = getMovementDirection('down');
|
24534 |
|
24535 |
if (movementDirection === 'down') {
|
@@ -24549,7 +24581,7 @@ function getBlockMoverDescription(selectedCount, type, firstIndex, isFirst, isLa
|
|
24549 |
}
|
24550 |
|
24551 |
if (dir > 0 && isLast) {
|
24552 |
-
//
|
24553 |
const movementDirection = getMovementDirection('down');
|
24554 |
|
24555 |
if (movementDirection === 'down') {
|
@@ -24569,7 +24601,7 @@ function getBlockMoverDescription(selectedCount, type, firstIndex, isFirst, isLa
|
|
24569 |
}
|
24570 |
|
24571 |
if (dir < 0 && !isFirst) {
|
24572 |
-
//
|
24573 |
const movementDirection = getMovementDirection('up');
|
24574 |
|
24575 |
if (movementDirection === 'up') {
|
@@ -24589,7 +24621,7 @@ function getBlockMoverDescription(selectedCount, type, firstIndex, isFirst, isLa
|
|
24589 |
}
|
24590 |
|
24591 |
if (dir < 0 && isFirst) {
|
24592 |
-
//
|
24593 |
const movementDirection = getMovementDirection('up');
|
24594 |
|
24595 |
if (movementDirection === 'up') {
|
@@ -24999,7 +25031,15 @@ function useDebouncedShowMovers(_ref) {
|
|
24999 |
}, debounceTimeout);
|
25000 |
};
|
25001 |
|
25002 |
-
(0,external_wp_element_namespaceObject.useEffect)(() => () =>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25003 |
return {
|
25004 |
showMovers,
|
25005 |
debouncedShowMovers,
|
@@ -25729,7 +25769,6 @@ const getPatternTransformedBlocks = (selectedBlocks, patternBlocks) => {
|
|
25729 |
* @param {WPBlock[]} selectedBlocks The currently selected blocks.
|
25730 |
* @return {TransformedBlockPattern[]} Returns the eligible matched patterns with all the selected blocks.
|
25731 |
*/
|
25732 |
-
// TODO tests
|
25733 |
|
25734 |
const useTransformedPatterns = (patterns, selectedBlocks) => {
|
25735 |
return (0,external_wp_element_namespaceObject.useMemo)(() => patterns.reduce((accumulator, _pattern) => {
|
@@ -25999,7 +26038,8 @@ const BlockSwitcherDropdownMenu = _ref => {
|
|
25999 |
}), (isReusable || isTemplate) && (0,external_wp_element_namespaceObject.createElement)("span", {
|
26000 |
className: "block-editor-block-switcher__toggle-text"
|
26001 |
}, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
26002 |
-
clientId: clientIds
|
|
|
26003 |
}))),
|
26004 |
toggleProps: {
|
26005 |
describedBy: blockSwitcherDescription,
|
@@ -26262,7 +26302,7 @@ function useClipboardHandler() {
|
|
26262 |
removeBlocks(selectedBlockClientIds);
|
26263 |
} else if (event.type === 'paste') {
|
26264 |
if (eventDefaultPrevented) {
|
26265 |
-
// This was likely already handled in rich-text/use-paste-handler.js
|
26266 |
return;
|
26267 |
}
|
26268 |
|
@@ -26394,7 +26434,7 @@ function BlockActions(_ref) {
|
|
26394 |
return;
|
26395 |
}
|
26396 |
|
26397 |
-
const groupingBlockName = getGroupingBlockName(); // Activate the `transform` on `core/group` which does the conversion
|
26398 |
|
26399 |
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, groupingBlockName);
|
26400 |
|
@@ -26608,7 +26648,7 @@ function ConvertToGroupButton(_ref) {
|
|
26608 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
26609 |
|
26610 |
const onConvertToGroup = () => {
|
26611 |
-
// Activate the `transform` on the Grouping Block which does the conversion
|
26612 |
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocksSelection, groupingBlockName);
|
26613 |
|
26614 |
if (newBlocks) {
|
@@ -26707,10 +26747,8 @@ function useConvertToGroupButtonProps() {
|
|
26707 |
const isSingleGroupingBlock = _blocksSelection.length === 1 && ((_blocksSelection$ = _blocksSelection[0]) === null || _blocksSelection$ === void 0 ? void 0 : _blocksSelection$.name) === _groupingBlockName; // Do we have
|
26708 |
// 1. Grouping block available to be inserted?
|
26709 |
// 2. One or more blocks selected
|
26710 |
-
// (we allow single Blocks to become groups unless
|
26711 |
-
// they are a soltiary group block themselves)
|
26712 |
|
26713 |
-
const _isGroupable = groupingBlockAvailable && _blocksSelection.length
|
26714 |
|
26715 |
|
26716 |
const _isUngroupable = isSingleGroupingBlock && !!_blocksSelection[0].innerBlocks.length;
|
@@ -26846,6 +26884,7 @@ BlockSettingsMenuControls.Slot = BlockSettingsMenuControlsSlot;
|
|
26846 |
|
26847 |
|
26848 |
|
|
|
26849 |
const block_settings_dropdown_POPOVER_PROPS = {
|
26850 |
className: 'block-editor-block-settings-menu__popover',
|
26851 |
position: 'bottom right',
|
@@ -26874,21 +26913,13 @@ function BlockSettingsDropdown(_ref2) {
|
|
26874 |
const count = blockClientIds.length;
|
26875 |
const firstBlockClientId = blockClientIds[0];
|
26876 |
const {
|
26877 |
-
onlyBlock
|
26878 |
-
title
|
26879 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
26880 |
-
var _getBlockType;
|
26881 |
-
|
26882 |
const {
|
26883 |
-
getBlockCount
|
26884 |
-
getBlockName
|
26885 |
} = select(store);
|
26886 |
-
const {
|
26887 |
-
getBlockType
|
26888 |
-
} = select(external_wp_blocks_namespaceObject.store);
|
26889 |
return {
|
26890 |
-
onlyBlock: 1 === getBlockCount()
|
26891 |
-
title: (_getBlockType = getBlockType(getBlockName(firstBlockClientId))) === null || _getBlockType === void 0 ? void 0 : _getBlockType.title
|
26892 |
};
|
26893 |
}, [firstBlockClientId]);
|
26894 |
const shortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
@@ -26909,9 +26940,10 @@ function BlockSettingsDropdown(_ref2) {
|
|
26909 |
__experimentalSelectBlock(ids[0]);
|
26910 |
}
|
26911 |
} : external_lodash_namespaceObject.noop, [__experimentalSelectBlock]);
|
|
|
26912 |
const label = (0,external_wp_i18n_namespaceObject.sprintf)(
|
26913 |
/* translators: %s: block name */
|
26914 |
-
(0,external_wp_i18n_namespaceObject.__)('Remove %s'),
|
26915 |
const removeBlockLabel = count === 1 ? label : (0,external_wp_i18n_namespaceObject.__)('Remove blocks');
|
26916 |
return (0,external_wp_element_namespaceObject.createElement)(BlockActions, {
|
26917 |
clientIds: clientIds,
|
@@ -27470,7 +27502,7 @@ function wrapperSelector(select) {
|
|
27470 |
attributes = {},
|
27471 |
isValid
|
27472 |
} = getBlock(clientId) || {};
|
27473 |
-
const blockParentsClientIds = getBlockParents(clientId); // Get Block List Settings for all ancestors of the current Block clientId
|
27474 |
|
27475 |
const parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(blockParentsClientIds); // Get the clientId of the topmost parent with the capture toolbars setting.
|
27476 |
|
@@ -27925,13 +27957,13 @@ function onBlockDrop(targetRootClientId, targetBlockIndex, getBlockIndex, getCli
|
|
27925 |
srcClientIds: sourceClientIds,
|
27926 |
type: dropType,
|
27927 |
blocks
|
27928 |
-
} = parseDropEvent(event); // If the user is inserting a block
|
27929 |
|
27930 |
if (dropType === 'inserter') {
|
27931 |
clearSelectedBlock();
|
27932 |
const blocksToInsert = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block));
|
27933 |
insertBlocks(blocksToInsert, targetBlockIndex, targetRootClientId, true, null);
|
27934 |
-
} // If the user is moving a block
|
27935 |
|
27936 |
|
27937 |
if (dropType === 'block') {
|
@@ -29288,12 +29320,12 @@ function getAllUnit() {
|
|
29288 |
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
29289 |
|
29290 |
if (typeof values === 'string') {
|
29291 |
-
const [, unit] = (0,external_wp_components_namespaceObject.
|
29292 |
return unit || 'px';
|
29293 |
}
|
29294 |
|
29295 |
const allUnits = Object.values(values).map(value => {
|
29296 |
-
const [, unit] = (0,external_wp_components_namespaceObject.
|
29297 |
return unit;
|
29298 |
});
|
29299 |
return mode(allUnits) || 'px';
|
@@ -29317,12 +29349,16 @@ function getAllValue() {
|
|
29317 |
return values;
|
29318 |
}
|
29319 |
|
29320 |
-
const
|
29321 |
-
const allValues =
|
29322 |
-
|
|
|
|
|
|
|
|
|
29323 |
const value = allValues.every(v => v === allValues[0]) ? allValues[0] : '';
|
29324 |
const unit = mode(allUnits);
|
29325 |
-
const allValue = value === 0 || value ? `${value}${unit}` :
|
29326 |
return allValue;
|
29327 |
}
|
29328 |
/**
|
@@ -29561,7 +29597,7 @@ function BorderRadiusControl(_ref) {
|
|
29561 |
const unit = getAllUnit(values);
|
29562 |
const unitConfig = units && units.find(item => item.value === unit);
|
29563 |
const step = (unitConfig === null || unitConfig === void 0 ? void 0 : unitConfig.step) || 1;
|
29564 |
-
const [allValue] = (0,external_wp_components_namespaceObject.
|
29565 |
|
29566 |
const toggleLinked = () => setIsLinked(!isLinked);
|
29567 |
|
@@ -29582,7 +29618,7 @@ function BorderRadiusControl(_ref) {
|
|
29582 |
units: units
|
29583 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
|
29584 |
className: "components-border-radius-control__range-control",
|
29585 |
-
value: allValue,
|
29586 |
min: MIN_BORDER_RADIUS_VALUE,
|
29587 |
max: MAX_BORDER_RADIUS_VALUES[unit],
|
29588 |
initialPosition: 0,
|
@@ -30045,14 +30081,13 @@ function BorderPanel(props) {
|
|
30045 |
const {
|
30046 |
clientId
|
30047 |
} = props;
|
30048 |
-
const isDisabled = useIsBorderDisabled(props);
|
30049 |
-
const isSupported = hasBorderSupport(props.name);
|
30050 |
const isColorSupported = useSetting('border.color') && hasBorderSupport(props.name, 'color');
|
30051 |
const isRadiusSupported = useSetting('border.radius') && hasBorderSupport(props.name, 'radius');
|
30052 |
const isStyleSupported = useSetting('border.style') && hasBorderSupport(props.name, 'style');
|
30053 |
const isWidthSupported = useSetting('border.width') && hasBorderSupport(props.name, 'width');
|
|
|
30054 |
|
30055 |
-
if (isDisabled
|
30056 |
return null;
|
30057 |
}
|
30058 |
|
@@ -30150,16 +30185,6 @@ function shouldSkipSerialization(blockType) {
|
|
30150 |
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, BORDER_SUPPORT_KEY);
|
30151 |
return support === null || support === void 0 ? void 0 : support.__experimentalSkipSerialization;
|
30152 |
}
|
30153 |
-
/**
|
30154 |
-
* Determines if all border support features have been disabled.
|
30155 |
-
*
|
30156 |
-
* @return {boolean} If border support is completely disabled.
|
30157 |
-
*/
|
30158 |
-
|
30159 |
-
const useIsBorderDisabled = () => {
|
30160 |
-
const configs = [!useSetting('border.color'), !useSetting('border.radius'), !useSetting('border.style'), !useSetting('border.width')];
|
30161 |
-
return configs.every(Boolean);
|
30162 |
-
};
|
30163 |
/**
|
30164 |
* Returns a new style object where the specified border attribute has been
|
30165 |
* removed.
|
@@ -30170,7 +30195,6 @@ const useIsBorderDisabled = () => {
|
|
30170 |
* @return {Object} Style object with the specified attribute removed.
|
30171 |
*/
|
30172 |
|
30173 |
-
|
30174 |
function removeBorderAttribute(style, attribute) {
|
30175 |
return cleanEmptyObject({ ...style,
|
30176 |
border: { ...(style === null || style === void 0 ? void 0 : style.border),
|
@@ -30321,7 +30345,7 @@ function ContrastChecker(_ref) {
|
|
30321 |
fallbackTextColor,
|
30322 |
fallbackLinkColor,
|
30323 |
fontSize,
|
30324 |
-
//
|
30325 |
isLargeText,
|
30326 |
textColor,
|
30327 |
linkColor,
|
@@ -30373,8 +30397,8 @@ function ContrastChecker(_ref) {
|
|
30373 |
continue;
|
30374 |
}
|
30375 |
|
30376 |
-
message = backgroundColorBrightness < colordTextColor.brightness() ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s is a type of text color, e.g., "text color" or "link color"
|
30377 |
-
(0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s.'), item.description) : (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s is a type of text color, e.g., "text color" or "link color"
|
30378 |
(0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s.'), item.description);
|
30379 |
speakMessage = (0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read.'); // Break from the loop when we have a contrast warning.
|
30380 |
// These messages take priority over the transparency warning.
|
@@ -30772,7 +30796,7 @@ const resetBackgroundAndGradient = _ref3 => {
|
|
30772 |
function color_addAttributes(settings) {
|
30773 |
if (!hasColorSupport(settings)) {
|
30774 |
return settings;
|
30775 |
-
} //
|
30776 |
|
30777 |
|
30778 |
if (!settings.attributes.backgroundColor) {
|
@@ -30833,7 +30857,7 @@ function color_addSaveProps(props, blockType, attributes) {
|
|
30833 |
|
30834 |
const textClass = getColorClassName('color', textColor);
|
30835 |
const newClassName = classnames_default()(props.className, textClass, gradientClass, {
|
30836 |
-
// Don't apply the background class if there's a custom gradient
|
30837 |
[backgroundClass]: (!hasGradient || !(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.gradient)) && !!backgroundClass,
|
30838 |
'has-text-color': textColor || (style === null || style === void 0 ? void 0 : (_style$color2 = style.color) === null || _style$color2 === void 0 ? void 0 : _style$color2.text),
|
30839 |
'has-background': backgroundColor || (style === null || style === void 0 ? void 0 : (_style$color3 = style.color) === null || _style$color3 === void 0 ? void 0 : _style$color3.background) || hasGradient && (gradient || (style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.gradient)),
|
@@ -31389,7 +31413,7 @@ function LineHeightControl(_ref) {
|
|
31389 |
const isDefined = isLineHeightDefined(lineHeight);
|
31390 |
|
31391 |
const adjustNextValue = (nextValue, wasTypedOrPasted) => {
|
31392 |
-
// Set the next value without modification if lineHeight has been defined
|
31393 |
if (isDefined) return nextValue;
|
31394 |
/**
|
31395 |
* The following logic handles the initial step up/down action
|
@@ -31403,14 +31427,14 @@ function LineHeightControl(_ref) {
|
|
31403 |
|
31404 |
switch (nextValue) {
|
31405 |
case `${STEP}`:
|
31406 |
-
// Increment by step value
|
31407 |
return BASE_DEFAULT_VALUE + STEP;
|
31408 |
|
31409 |
case '0':
|
31410 |
{
|
31411 |
// This means the user explicitly input '0', rather than stepped down
|
31412 |
-
// from an undefined value state
|
31413 |
-
if (wasTypedOrPasted) return nextValue; // Decrement by step value
|
31414 |
|
31415 |
return BASE_DEFAULT_VALUE - STEP;
|
31416 |
}
|
@@ -32749,9 +32773,9 @@ function LetterSpacingControl(_ref) {
|
|
32749 |
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
32750 |
availableUnits: useSetting('spacing.units') || ['px', 'em', 'rem'],
|
32751 |
defaultValues: {
|
32752 |
-
px:
|
32753 |
-
em:
|
32754 |
-
rem:
|
32755 |
}
|
32756 |
});
|
32757 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
|
@@ -33711,7 +33735,10 @@ function compileElementsStyles(selector) {
|
|
33711 |
const elementStyles = getInlineStyles(styles);
|
33712 |
|
33713 |
if (!(0,external_lodash_namespaceObject.isEmpty)(elementStyles)) {
|
33714 |
-
|
|
|
|
|
|
|
33715 |
}
|
33716 |
|
33717 |
return '';
|
@@ -33729,7 +33756,7 @@ function compileElementsStyles(selector) {
|
|
33729 |
function style_addAttribute(settings) {
|
33730 |
if (!hasStyleSupport(settings)) {
|
33731 |
return settings;
|
33732 |
-
} //
|
33733 |
|
33734 |
|
33735 |
if (!settings.attributes.style) {
|
@@ -34071,17 +34098,35 @@ ${selector} {
|
|
34071 |
}));
|
34072 |
}
|
34073 |
|
34074 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34075 |
var _style$color;
|
34076 |
|
34077 |
let {
|
34078 |
attributes,
|
34079 |
setAttributes
|
34080 |
-
} =
|
34081 |
const style = attributes === null || attributes === void 0 ? void 0 : attributes.style;
|
34082 |
const duotone = style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.duotone;
|
34083 |
-
const duotonePalette =
|
34084 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
34085 |
const disableCustomColors = !useSetting('color.custom');
|
34086 |
const disableCustomDuotone = !useSetting('color.customDuotone') || (colorPalette === null || colorPalette === void 0 ? void 0 : colorPalette.length) === 0 && disableCustomColors;
|
34087 |
|
@@ -35000,14 +35045,14 @@ const DEFAULT_FONT_SIZES = [];
|
|
35000 |
|
35001 |
const didAttributesChange = (customFontSizeAttributeName, fontSizeAttributeName) => {
|
35002 |
if (previousState[fontSizeAttributeName]) {
|
35003 |
-
//
|
35004 |
if (attributes[fontSizeAttributeName]) {
|
35005 |
return attributes[fontSizeAttributeName] !== previousState[fontSizeAttributeName].slug;
|
35006 |
-
} //
|
35007 |
|
35008 |
|
35009 |
return previousState[fontSizeAttributeName].size !== attributes[customFontSizeAttributeName];
|
35010 |
-
} //
|
35011 |
|
35012 |
|
35013 |
return true;
|
@@ -35296,6 +35341,104 @@ function createBlockCompleter() {
|
|
35296 |
|
35297 |
/* harmony default export */ var autocompleters_block = (createBlockCompleter());
|
35298 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35299 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/autocomplete/index.js
|
35300 |
|
35301 |
|
@@ -35318,6 +35461,7 @@ function createBlockCompleter() {
|
|
35318 |
|
35319 |
|
35320 |
|
|
|
35321 |
/**
|
35322 |
* Shared reference to an empty array for cases where it is important to avoid
|
35323 |
* returning a new array reference on every invocation.
|
@@ -35338,7 +35482,7 @@ function useCompleters(_ref) {
|
|
35338 |
let filteredCompleters = completers;
|
35339 |
|
35340 |
if (name === (0,external_wp_blocks_namespaceObject.getDefaultBlockName)() || (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, '__experimentalSlashInserter', false)) {
|
35341 |
-
filteredCompleters = filteredCompleters.concat([autocompleters_block]);
|
35342 |
}
|
35343 |
|
35344 |
if ((0,external_wp_hooks_namespaceObject.hasFilter)('editor.Autocomplete.completers')) {
|
@@ -35585,7 +35729,8 @@ function BlockBreadcrumb(_ref) {
|
|
35585 |
variant: "tertiary",
|
35586 |
onClick: () => selectBlock(parentClientId)
|
35587 |
}, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
35588 |
-
clientId: parentClientId
|
|
|
35589 |
})), (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
|
35590 |
icon: chevron_right_small,
|
35591 |
className: "block-editor-block-breadcrumb__separator"
|
@@ -35593,7 +35738,8 @@ function BlockBreadcrumb(_ref) {
|
|
35593 |
className: "block-editor-block-breadcrumb__current",
|
35594 |
"aria-current": "true"
|
35595 |
}, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
35596 |
-
clientId: clientId
|
|
|
35597 |
})))
|
35598 |
/* eslint-enable jsx-a11y/no-redundant-roles */
|
35599 |
;
|
@@ -36008,7 +36154,8 @@ function ListViewBlockSelectButton(_ref, ref) {
|
|
36008 |
icon: blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon,
|
36009 |
showColors: true
|
36010 |
}), (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
36011 |
-
clientId: clientId
|
|
|
36012 |
}), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && (0,external_wp_element_namespaceObject.createElement)("span", {
|
36013 |
className: "block-editor-list-view-block-select-button__anchor"
|
36014 |
}, blockInformation.anchor), isSelected && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, (0,external_wp_i18n_namespaceObject.__)('(selected block)'))), (0,external_wp_element_namespaceObject.createElement)("div", {
|
@@ -36218,7 +36365,7 @@ function ListViewBlock(_ref) {
|
|
36218 |
expand(clientId);
|
36219 |
}
|
36220 |
}, [clientId, expand, collapse, isExpanded]);
|
36221 |
-
const showBlockActions = withExperimentalFeatures && ( //hide actions for blocks like core/widget-areas
|
36222 |
!hideContainerBlockActions || hideContainerBlockActions && level > 1);
|
36223 |
const hideBlockActions = withExperimentalFeatures && !showBlockActions;
|
36224 |
let colSpan;
|
@@ -39294,9 +39441,6 @@ const constants_POPOVER_PROPS = {
|
|
39294 |
isAlternate: true
|
39295 |
};
|
39296 |
|
39297 |
-
;// CONCATENATED MODULE: external ["wp","apiFetch"]
|
39298 |
-
var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
|
39299 |
-
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
|
39300 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/image-editor/use-save-image.js
|
39301 |
/**
|
39302 |
* WordPress dependencies
|
@@ -40190,8 +40334,8 @@ class URLInput extends external_wp_element_namespaceObject.Component {
|
|
40190 |
const {
|
40191 |
value,
|
40192 |
__experimentalShowInitialSuggestions = false
|
40193 |
-
} = this.props; //
|
40194 |
-
// when already expanded
|
40195 |
|
40196 |
if (showSuggestions && selectedSuggestion !== null && this.suggestionNodes[selectedSuggestion] && !this.scrollingIntoView) {
|
40197 |
this.scrollingIntoView = true;
|
@@ -40201,15 +40345,15 @@ class URLInput extends external_wp_element_namespaceObject.Component {
|
|
40201 |
this.props.setTimeout(() => {
|
40202 |
this.scrollingIntoView = false;
|
40203 |
}, 100);
|
40204 |
-
} // Update suggestions when the value changes
|
40205 |
|
40206 |
|
40207 |
if (prevProps.value !== value && !this.props.disableSuggestions && !this.isUpdatingSuggestions) {
|
40208 |
if (value !== null && value !== void 0 && value.length) {
|
40209 |
-
// If the new value is not empty we need to update with suggestions for it
|
40210 |
this.updateSuggestions(value);
|
40211 |
} else if (__experimentalShowInitialSuggestions) {
|
40212 |
-
// If the new value is empty and we can show initial suggestions, then show initial suggestions
|
40213 |
this.updateSuggestions();
|
40214 |
}
|
40215 |
}
|
@@ -40341,7 +40485,7 @@ class URLInput extends external_wp_element_namespaceObject.Component {
|
|
40341 |
// Don't re-run the suggestions on focus if there are already suggestions present (prevents searching again when tabbing between the input and buttons)
|
40342 |
|
40343 |
if (value && !disableSuggestions && !this.isUpdatingSuggestions && !(suggestions && suggestions.length)) {
|
40344 |
-
// Ensure the suggestions are updated with the current input value
|
40345 |
this.updateSuggestions(value);
|
40346 |
}
|
40347 |
}
|
@@ -40353,7 +40497,7 @@ class URLInput extends external_wp_element_namespaceObject.Component {
|
|
40353 |
suggestions,
|
40354 |
loading
|
40355 |
} = this.state; // If the suggestions are not shown or loading, we shouldn't handle the arrow keys
|
40356 |
-
// We shouldn't preventDefault to allow block arrow keys navigation
|
40357 |
|
40358 |
if (!showSuggestions || !suggestions.length || loading) {
|
40359 |
// In the Windows version of Firefox the up and down arrows don't move the caret
|
@@ -40367,7 +40511,7 @@ class URLInput extends external_wp_element_namespaceObject.Component {
|
|
40367 |
case external_wp_keycodes_namespaceObject.UP:
|
40368 |
{
|
40369 |
if (0 !== event.target.selectionStart) {
|
40370 |
-
event.preventDefault(); // Set the input caret to position 0
|
40371 |
|
40372 |
event.target.setSelectionRange(0, 0);
|
40373 |
}
|
@@ -40380,14 +40524,14 @@ class URLInput extends external_wp_element_namespaceObject.Component {
|
|
40380 |
case external_wp_keycodes_namespaceObject.DOWN:
|
40381 |
{
|
40382 |
if (this.props.value.length !== event.target.selectionStart) {
|
40383 |
-
event.preventDefault(); // Set the input caret to the last position
|
40384 |
|
40385 |
event.target.setSelectionRange(this.props.value.length, this.props.value.length);
|
40386 |
}
|
40387 |
|
40388 |
break;
|
40389 |
}
|
40390 |
-
// Submitting while loading should trigger onSubmit
|
40391 |
|
40392 |
case external_wp_keycodes_namespaceObject.ENTER:
|
40393 |
{
|
@@ -40618,7 +40762,7 @@ class URLInput extends external_wp_element_namespaceObject.Component {
|
|
40618 |
|
40619 |
/* harmony default export */ var url_input = ((0,external_wp_compose_namespaceObject.compose)(external_wp_compose_namespaceObject.withSafeTimeout, external_wp_components_namespaceObject.withSpokenMessages, external_wp_compose_namespaceObject.withInstanceId, (0,external_wp_data_namespaceObject.withSelect)((select, props) => {
|
40620 |
// If a link suggestions handler is already provided then
|
40621 |
-
// bail
|
40622 |
if ((0,external_lodash_namespaceObject.isFunction)(props.__experimentalFetchLinkSuggestions)) {
|
40623 |
return;
|
40624 |
}
|
@@ -40834,7 +40978,7 @@ function LinkControlSearchResults(_ref) {
|
|
40834 |
// so we conditionally render it as a wrapper to visually hide the label
|
40835 |
// when that is required.
|
40836 |
|
40837 |
-
const searchResultsLabel = (0,external_wp_element_namespaceObject.createElement)(isInitialSuggestions ? external_wp_element_namespaceObject.Fragment : external_wp_components_namespaceObject.VisuallyHidden, {}, //
|
40838 |
(0,external_wp_element_namespaceObject.createElement)("span", {
|
40839 |
className: "block-editor-link-control__search-results-label",
|
40840 |
id: searchResultsLabelId
|
@@ -40858,7 +41002,7 @@ function LinkControlSearchResults(_ref) {
|
|
40858 |
isSelected: index === selectedSuggestion
|
40859 |
});
|
40860 |
} // If we're not handling "Create" suggestions above then
|
40861 |
-
// we don't want them in the main results so exit early
|
40862 |
|
40863 |
|
40864 |
if (CREATE_TYPE === suggestion.type) {
|
@@ -41003,9 +41147,9 @@ const handleEntitySearch = async (val, suggestionsQuery, fetchSearchSuggestions,
|
|
41003 |
// is never exposed as part of the component's public API.
|
41004 |
// see: https://github.com/WordPress/gutenberg/pull/19775#discussion_r378931316.
|
41005 |
title: val,
|
41006 |
-
//
|
41007 |
url: val,
|
41008 |
-
//
|
41009 |
type: CREATE_TYPE
|
41010 |
});
|
41011 |
};
|
@@ -41121,7 +41265,7 @@ const LinkControlSearchInput = (0,external_wp_element_namespaceObject.forwardRef
|
|
41121 |
let suggestion = selectedSuggestion;
|
41122 |
|
41123 |
if (CREATE_TYPE === selectedSuggestion.type) {
|
41124 |
-
// Create a new page and call onSelect with the output from the onCreateSuggestion callback
|
41125 |
try {
|
41126 |
var _suggestion;
|
41127 |
|
@@ -41301,7 +41445,7 @@ function useRemoteUrlData(url) {
|
|
41301 |
type: 'ERROR'
|
41302 |
});
|
41303 |
}
|
41304 |
-
}); // Cleanup: when the URL changes the abort the current request
|
41305 |
|
41306 |
return () => {
|
41307 |
controller.abort();
|
@@ -41752,7 +41896,7 @@ function LinkControl(_ref) {
|
|
41752 |
keyCode
|
41753 |
} = event;
|
41754 |
|
41755 |
-
if (keyCode === external_wp_keycodes_namespaceObject.ENTER && !currentInputIsEmpty //
|
41756 |
) {
|
41757 |
event.preventDefault();
|
41758 |
handleSubmit();
|
@@ -41806,7 +41950,7 @@ function LinkControl(_ref) {
|
|
41806 |
label: (0,external_wp_i18n_namespaceObject.__)('Submit'),
|
41807 |
icon: keyboard_return,
|
41808 |
className: "block-editor-link-control__search-submit",
|
41809 |
-
disabled: currentInputIsEmpty //
|
41810 |
|
41811 |
})))), errorMessage && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
|
41812 |
className: "block-editor-link-control__search-error",
|
@@ -41932,6 +42076,7 @@ function MediaUploadCheck(_ref) {
|
|
41932 |
|
41933 |
|
41934 |
|
|
|
41935 |
/**
|
41936 |
* Internal dependencies
|
41937 |
*/
|
@@ -41948,6 +42093,7 @@ const MediaReplaceFlow = _ref => {
|
|
41948 |
mediaIds,
|
41949 |
allowedTypes,
|
41950 |
accept,
|
|
|
41951 |
onSelect,
|
41952 |
onSelectURL,
|
41953 |
onFilesUpload = external_lodash_namespaceObject.noop,
|
@@ -41964,25 +42110,25 @@ const MediaReplaceFlow = _ref => {
|
|
41964 |
const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
41965 |
return select(store).getSettings().mediaUpload;
|
41966 |
}, []);
|
41967 |
-
const editMediaButtonRef = (0,external_wp_element_namespaceObject.
|
41968 |
const errorNoticeID = (0,external_lodash_namespaceObject.uniqueId)('block-editor/media-replace-flow/error-notice/');
|
41969 |
|
41970 |
-
const
|
41971 |
-
const
|
41972 |
-
errorElement.innerHTML = (0,external_wp_element_namespaceObject.renderToString)(message); // The default error contains some HTML that,
|
41973 |
-
// for example, makes the filename bold.
|
41974 |
-
// The notice, by default, accepts strings only and so
|
41975 |
-
// we need to remove the html from the error.
|
41976 |
|
41977 |
-
|
|
|
|
|
|
|
41978 |
// so that VoiceOver and possibly other screen readers
|
41979 |
// can announce the error afer the toolbar button
|
41980 |
// regains focus once the upload dialog closes.
|
41981 |
// Otherwise VO simply skips over the notice and announces
|
41982 |
// the focused element and the open menu.
|
41983 |
|
|
|
41984 |
setTimeout(() => {
|
41985 |
-
createNotice('error',
|
41986 |
speak: true,
|
41987 |
id: errorNoticeID,
|
41988 |
isDismissible: true
|
@@ -41992,17 +42138,13 @@ const MediaReplaceFlow = _ref => {
|
|
41992 |
|
41993 |
const selectMedia = (media, closeMenu) => {
|
41994 |
closeMenu();
|
41995 |
-
setMediaURLValue(media.url); // Calling `onSelect` after the state update since it might unmount the component.
|
41996 |
|
41997 |
onSelect(media);
|
41998 |
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('The media file has been replaced'));
|
41999 |
removeNotice(errorNoticeID);
|
42000 |
};
|
42001 |
|
42002 |
-
const selectURL = newURL => {
|
42003 |
-
onSelectURL(newURL);
|
42004 |
-
};
|
42005 |
-
|
42006 |
const uploadFiles = (event, closeMenu) => {
|
42007 |
const files = event.target.files;
|
42008 |
|
@@ -42012,17 +42154,14 @@ const MediaReplaceFlow = _ref => {
|
|
42012 |
}
|
42013 |
|
42014 |
onFilesUpload(files);
|
42015 |
-
|
42016 |
-
const setMedia = _ref2 => {
|
42017 |
-
let [media] = _ref2;
|
42018 |
-
selectMedia(media, closeMenu);
|
42019 |
-
};
|
42020 |
-
|
42021 |
mediaUpload({
|
42022 |
allowedTypes,
|
42023 |
filesList: files,
|
42024 |
-
onFileChange:
|
42025 |
-
|
|
|
|
|
|
|
42026 |
});
|
42027 |
};
|
42028 |
|
@@ -42117,7 +42256,7 @@ const MediaReplaceFlow = _ref => {
|
|
42117 |
url
|
42118 |
} = _ref7;
|
42119 |
setMediaURLValue(url);
|
42120 |
-
|
42121 |
editMediaButtonRef.current.focus();
|
42122 |
}
|
42123 |
})));
|
@@ -42815,7 +42954,7 @@ const FormatToolbarContainer = _ref => {
|
|
42815 |
} = _ref;
|
42816 |
|
42817 |
if (inline) {
|
42818 |
-
// Render in popover
|
42819 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
|
42820 |
noArrow: true,
|
42821 |
position: "top center",
|
@@ -42826,7 +42965,7 @@ const FormatToolbarContainer = _ref => {
|
|
42826 |
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
42827 |
className: "block-editor-rich-text__inline-format-toolbar-group"
|
42828 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(format_toolbar, null))));
|
42829 |
-
} // Render regular toolbar
|
42830 |
|
42831 |
|
42832 |
return (0,external_wp_element_namespaceObject.createElement)(block_controls, {
|
@@ -45776,7 +45915,7 @@ function KeyboardShortcuts() {
|
|
45776 |
}
|
45777 |
|
45778 |
function KeyboardShortcutsRegister() {
|
45779 |
-
// Registering the shortcuts
|
45780 |
const {
|
45781 |
registerShortcut
|
45782 |
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store);
|
@@ -46647,7 +46786,7 @@ function parseUnitFunction(cssUnit) {
|
|
46647 |
if (matches[0]) {
|
46648 |
const functionUnitValue = getFunctionUnitValue(matches[0]);
|
46649 |
cssUnit = cssUnit.replace(matches[0], functionUnitValue);
|
46650 |
-
} //
|
46651 |
|
46652 |
|
46653 |
if (cssUnit === currentCssUnit || parseFloat(cssUnit)) {
|
@@ -46692,7 +46831,7 @@ function evalMathExpression(cssUnit) {
|
|
46692 |
const parsedUnit = parseUnit(getPxFromCssUnit(unit));
|
46693 |
|
46694 |
if (!parseFloat(parsedUnit.value)) {
|
46695 |
-
errorFound = true; //
|
46696 |
|
46697 |
break;
|
46698 |
}
|
@@ -46733,7 +46872,7 @@ function convertParsedUnitToPx(parsedUnit, options) {
|
|
46733 |
ch: 8,
|
46734 |
// The advance measure (width) of the glyph "0" of the element's font. Approximate
|
46735 |
ex: 7.15625,
|
46736 |
-
//
|
46737 |
lh: setOptions.lineHeight
|
46738 |
};
|
46739 |
const absoluteUnits = {
|
2638 |
slug: 'full',
|
2639 |
name: (0,external_wp_i18n_namespaceObject.__)('Full Size')
|
2640 |
}],
|
2641 |
+
// Allow plugin to disable Image Editor if need be.
|
2642 |
imageEditing: true,
|
2643 |
// This is current max width of the block inner area
|
2644 |
// It's used to constraint image resizing and this value could be overridden later by themes
|
2955 |
controlledParents.add(current);
|
2956 |
break;
|
2957 |
} else {
|
2958 |
+
// Else continue traversing up through parents.
|
2959 |
uncontrolledParents.add(current);
|
2960 |
current = state.parents[current];
|
2961 |
}
|
3268 |
};
|
3269 |
const subTree = buildBlockTree(newState, action.blocks);
|
3270 |
newState.tree = { ...subTree,
|
3271 |
+
// Root.
|
3272 |
'': {
|
3273 |
innerBlocks: action.blocks.map(subBlock => subTree[subBlock.clientId])
|
3274 |
}
|
3373 |
const {
|
3374 |
id,
|
3375 |
updatedId
|
3376 |
+
} = action; // If a temporary reusable block is saved, we swap the temporary id with the final one.
|
3377 |
|
3378 |
if (id === updatedId) {
|
3379 |
return state;
|
3431 |
*/
|
3432 |
|
3433 |
|
3434 |
+
const blocks = (0,external_lodash_namespaceObject.flow)(external_wp_data_namespaceObject.combineReducers, withSaveReusableBlock, // Needs to be before withBlockCache.
|
3435 |
+
withBlockTree, // Needs to be before withInnerBlocksRemoveCascade.
|
3436 |
+
withInnerBlocksRemoveCascade, withReplaceInnerBlocks, // Needs to be after withInnerBlocksRemoveCascade.
|
3437 |
withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetControlledBlocks)({
|
3438 |
byClientId() {
|
3439 |
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
3447 |
};
|
3448 |
|
3449 |
case 'UPDATE_BLOCK':
|
3450 |
+
// Ignore updates if block isn't known.
|
3451 |
if (!state[action.clientId]) {
|
3452 |
return state;
|
3453 |
} // Do nothing if only attributes change.
|
3587 |
} = action;
|
3588 |
const {
|
3589 |
index = state[toRootClientId].length
|
3590 |
+
} = action; // Moving inside the same parent block.
|
3591 |
|
3592 |
if (fromRootClientId === toRootClientId) {
|
3593 |
const subState = state[toRootClientId];
|
3595 |
return { ...state,
|
3596 |
[toRootClientId]: moveTo(state[toRootClientId], fromIndex, index, clientIds.length)
|
3597 |
};
|
3598 |
+
} // Moving from a parent block to another.
|
3599 |
|
3600 |
|
3601 |
return { ...state,
|
3670 |
}
|
3671 |
|
3672 |
case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN':
|
3673 |
+
return (0,external_lodash_namespaceObject.flow)([// Remove inner block ordering for removed blocks.
|
3674 |
+
nextState => (0,external_lodash_namespaceObject.omit)(nextState, action.removedClientIds), // Remove deleted blocks from other blocks' orderings.
|
3675 |
nextState => (0,external_lodash_namespaceObject.mapValues)(nextState, subState => (0,external_lodash_namespaceObject.without)(subState, ...action.removedClientIds))])(state);
|
3676 |
}
|
3677 |
|
4750 |
* @property {number} offset An attribute value offset, based on the rich
|
4751 |
* text value. See `wp.richText.create`.
|
4752 |
*/
|
4753 |
+
// Module constants.
|
4754 |
|
4755 |
const MILLISECONDS_PER_HOUR = 3600 * 1000;
|
4756 |
const MILLISECONDS_PER_DAY = 24 * 3600 * 1000;
|
6004 |
|
6005 |
if (lock === undefined || (lock === null || lock === void 0 ? void 0 : lock.remove) === undefined) {
|
6006 |
return !parentIsLocked;
|
6007 |
+
} // When remove is true, it means we cannot remove it.
|
6008 |
|
6009 |
|
6010 |
return !(lock !== null && lock !== void 0 && lock.remove);
|
6048 |
|
6049 |
if (lock === undefined || (lock === null || lock === void 0 ? void 0 : lock.move) === undefined) {
|
6050 |
return !parentIsLocked;
|
6051 |
+
} // When move is true, it means we cannot move it.
|
6052 |
|
6053 |
|
6054 |
return !(lock !== null && lock !== void 0 && lock.move);
|
6215 |
keywords: blockType.keywords,
|
6216 |
variations: inserterVariations,
|
6217 |
example: blockType.example,
|
6218 |
+
utility: 1 // Deprecated.
|
6219 |
|
6220 |
};
|
6221 |
};
|
6315 |
keywords: [],
|
6316 |
isDisabled: false,
|
6317 |
utility: 1,
|
6318 |
+
// Deprecated.
|
6319 |
frecency
|
6320 |
};
|
6321 |
};
|
6325 |
const items = blockTypeInserterItems.reduce((accumulator, item) => {
|
6326 |
const {
|
6327 |
variations = []
|
6328 |
+
} = item; // Exclude any block type item that is to be replaced by a default variation.
|
6329 |
|
6330 |
if (!variations.some(_ref4 => {
|
6331 |
let {
|
7580 |
});
|
7581 |
const [clientIdA, clientIdB] = blocks;
|
7582 |
const blockA = select.getBlock(clientIdA);
|
7583 |
+
const blockAType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockA.name); // Only focus the previous block if it's not mergeable.
|
7584 |
|
7585 |
if (blockAType && !blockAType.merge) {
|
7586 |
dispatch.selectBlock(blockA.clientId);
|
7637 |
preserveWhiteSpace
|
7638 |
});
|
7639 |
} // We can only merge blocks with similar types
|
7640 |
+
// thus, we transform the block to merge first.
|
7641 |
|
7642 |
|
7643 |
+
const blocksWithTheSameType = blockA.name === blockB.name ? [cloneB] : (0,external_wp_blocks_namespaceObject.switchToBlockType)(cloneB, blockA.name); // If the block types can not match, do nothing.
|
7644 |
|
7645 |
if (!blocksWithTheSameType || !blocksWithTheSameType.length) {
|
7646 |
return;
|
7647 |
+
} // Calling the merge to update the attributes and remove the block to be merged.
|
7648 |
|
7649 |
|
7650 |
const updatedAttributes = blockAType.merge(cloneA.attributes, blocksWithTheSameType[0].attributes);
|
8416 |
|
8417 |
|
8418 |
const BlockControls = BlockControlsFill;
|
8419 |
+
BlockControls.Slot = BlockControlsSlot; // This is just here for backward compatibility.
|
8420 |
|
8421 |
const BlockFormatControls = props => {
|
8422 |
return (0,external_wp_element_namespaceObject.createElement)(BlockControlsFill, _extends({
|
9758 |
*/
|
9759 |
|
9760 |
function addAttribute(settings) {
|
9761 |
+
// Allow blocks to specify their own attribute definition with default values if needed.
|
9762 |
if ((0,external_lodash_namespaceObject.has)(settings.attributes, ['align', 'type'])) {
|
9763 |
return settings;
|
9764 |
}
|
9916 |
*/
|
9917 |
|
9918 |
function lock_addAttribute(settings) {
|
9919 |
+
// Allow blocks to specify their own attribute definition with default values if needed.
|
9920 |
if ((0,external_lodash_namespaceObject.has)(settings.attributes, ['lock', 'type'])) {
|
9921 |
return settings;
|
9922 |
} // Gracefully handle if settings.attributes is undefined.
|
10290 |
*/
|
10291 |
|
10292 |
function anchor_addAttribute(settings) {
|
10293 |
+
// Allow blocks to specify their own attribute definition with default values if needed.
|
10294 |
if ((0,external_lodash_namespaceObject.has)(settings.attributes, ['anchor', 'type'])) {
|
10295 |
return settings;
|
10296 |
}
|
10532 |
*/
|
10533 |
|
10534 |
function addGeneratedClassName(extraProps, blockType) {
|
10535 |
+
// Adding the generated className.
|
10536 |
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'className', true)) {
|
10537 |
if (typeof extraProps.className === 'string') {
|
10538 |
// We have some extra classes and want to add the default classname
|
10539 |
+
// We use uniq to prevent duplicate classnames.
|
10540 |
extraProps.className = (0,external_lodash_namespaceObject.uniq)([(0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(blockType.name), ...extraProps.className.split(' ')]).join(' ').trim();
|
10541 |
} else {
|
10542 |
// There is no string in the className variable,
|
10543 |
+
// so we just dump the default name in there.
|
10544 |
extraProps.className = (0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(blockType.name);
|
10545 |
}
|
10546 |
}
|
10760 |
return (0,external_wp_element_namespaceObject.createElement)(Component, _extends({}, props, {
|
10761 |
context: context
|
10762 |
}));
|
10763 |
+
} // Generate a class name for the block's editable form.
|
10764 |
|
10765 |
|
10766 |
const generatedClassName = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'className', true) ? (0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(name) : null;
|
10970 |
}
|
10971 |
|
10972 |
function getConvertedContent(convertedBlock) {
|
10973 |
+
// The convertor may return an array of items or a single item.
|
10974 |
+
const newBlocks = (0,external_lodash_namespaceObject.castArray)(convertedBlock); // Get converted block details.
|
10975 |
|
10976 |
const newContent = newBlocks.map(item => (0,external_wp_blocks_namespaceObject.getSaveContent)(item.name, item.attributes, item.innerBlocks));
|
10977 |
return newContent.join('');
|
11030 |
const hasHTMLBlock = !!(0,external_wp_blocks_namespaceObject.getBlockType)('core/html');
|
11031 |
const [compare, setCompare] = (0,external_wp_element_namespaceObject.useState)(false);
|
11032 |
const onCompare = (0,external_wp_element_namespaceObject.useCallback)(() => setCompare(true), []);
|
11033 |
+
const onCompareClose = (0,external_wp_element_namespaceObject.useCallback)(() => setCompare(false), []); // We memo the array here to prevent the children components from being updated unexpectedly.
|
11034 |
|
11035 |
const hiddenActions = (0,external_wp_element_namespaceObject.useMemo)(() => [{
|
11036 |
// translators: Button to fix block content
|
11215 |
attributes,
|
11216 |
originalContent: content,
|
11217 |
isValid
|
11218 |
+
}); // Ensure the state is updated if we reset so it displays the default content.
|
11219 |
|
11220 |
if (!html) {
|
11221 |
setHtml({
|
15336 |
}
|
15337 |
|
15338 |
if (prefersReducedMotion) {
|
15339 |
+
// If the animation is disabled and the scroll needs to be adjusted,
|
15340 |
// just move directly to the final scroll position.
|
15341 |
preserveScrollPosition();
|
15342 |
return;
|
15860 |
const isDragging = isBlockBeingDragged(clientId);
|
15861 |
const isSelected = isBlockSelected(clientId);
|
15862 |
const name = getBlockName(clientId);
|
15863 |
+
const checkDeep = true; // "ancestor" is the more appropriate label due to "deep" check.
|
15864 |
|
15865 |
const isAncestorOfSelectedBlock = hasSelectedInnerBlock(clientId, checkDeep);
|
15866 |
const activeEntityBlockId = getActiveBlockIdByBlockNames(spotlightEntityBlocks);
|
16900 |
|
16901 |
};
|
16902 |
});
|
16903 |
+
/* harmony default export */ var block = ((0,external_wp_compose_namespaceObject.compose)(external_wp_compose_namespaceObject.pure, applyWithSelect, applyWithDispatch, // Block is sometimes not mounted at the right time, causing it be undefined
|
16904 |
// see issue for more info
|
16905 |
// https://github.com/WordPress/gutenberg/issues/17013
|
16906 |
(0,external_wp_compose_namespaceObject.ifCondition)(_ref5 => {
|
17731 |
// will no longer send focus through the focus capture element.
|
17732 |
if (event.target === node) setNavigationMode(true);
|
17733 |
return;
|
17734 |
+
} // Allow tabbing from the block wrapper to a form element,
|
17735 |
+
// and between form elements rendered in a block,
|
17736 |
// such as inside a placeholder. Form elements are generally
|
17737 |
// meant to be UI rather than part of the content. Ideally
|
17738 |
// these are not rendered in the content and perhaps in the
|
17739 |
// future they can be rendered in an iframe or shadow DOM.
|
17740 |
|
17741 |
|
17742 |
+
if ((isFormElement(event.target) || event.target.getAttribute('data-block') === getSelectedBlockClientId()) && isFormElement(external_wp_dom_namespaceObject.focus.tabbable[direction](event.target))) {
|
17743 |
return;
|
17744 |
}
|
17745 |
|
17793 |
|
17794 |
const isShift = event.shiftKey;
|
17795 |
const direction = isShift ? 'findPrevious' : 'findNext';
|
17796 |
+
const target = external_wp_dom_namespaceObject.focus.tabbable[direction](event.target); // Only do something when the next tabbable is a focus capture div (before/after)
|
17797 |
|
17798 |
if (target === focusCaptureBeforeRef.current || target === focusCaptureAfterRef.current) {
|
17799 |
event.preventDefault();
|
18761 |
|
18762 |
|
18763 |
function declaration() {
|
18764 |
+
const pos = position(); // prop.
|
18765 |
|
18766 |
let prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
|
18767 |
|
18773 |
|
18774 |
if (!match(/^:\s*/)) {
|
18775 |
return error("property missing ':'");
|
18776 |
+
} // val.
|
18777 |
|
18778 |
|
18779 |
const val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);
|
18798 |
return error("missing '{'");
|
18799 |
}
|
18800 |
|
18801 |
+
comments(decls); // declarations.
|
18802 |
|
18803 |
let decl; // eslint-disable-next-line no-cond-assign
|
18804 |
|
19014 |
return error("@page missing '{'");
|
19015 |
}
|
19016 |
|
19017 |
+
let decls = comments(); // declarations.
|
19018 |
|
19019 |
let decl; // eslint-disable-next-line no-cond-assign
|
19020 |
|
19083 |
return error("@font-face missing '{'");
|
19084 |
}
|
19085 |
|
19086 |
+
let decls = comments(); // declarations.
|
19087 |
|
19088 |
let decl; // eslint-disable-next-line no-cond-assign
|
19089 |
|
19731 |
|
19732 |
|
19733 |
function isValidURL(meta) {
|
19734 |
+
// Ignore hashes or data uris.
|
19735 |
if (meta.value.indexOf('data:') === 0 || meta.value.indexOf('#') === 0) {
|
19736 |
return false;
|
19737 |
}
|
19738 |
|
19739 |
if (isAbsolutePath(meta.value)) {
|
19740 |
return false;
|
19741 |
+
} // Do not handle the http/https urls if `includeRemote` is false.
|
19742 |
|
19743 |
|
19744 |
if (isRemotePath(meta.value)) {
|
20347 |
*/
|
20348 |
|
20349 |
const dragHandle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
20350 |
+
width: "24",
|
20351 |
+
height: "24",
|
20352 |
xmlns: "http://www.w3.org/2000/svg",
|
20353 |
+
viewBox: "0 0 24 24"
|
20354 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
20355 |
+
d: "M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"
|
20356 |
}));
|
20357 |
/* harmony default export */ var drag_handle = (dragHandle);
|
20358 |
|
20871 |
*/
|
20872 |
|
20873 |
const currentlyRenderedCategories = (0,external_wp_compose_namespaceObject.useAsyncList)(categories);
|
20874 |
+
const didRenderAllCategories = categories.length === currentlyRenderedCategories.length; // Async List requires an array.
|
20875 |
|
20876 |
const collectionEntries = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
20877 |
return Object.entries(collections);
|
21387 |
/**
|
21388 |
* External dependencies
|
21389 |
*/
|
21390 |
+
// Default search helpers.
|
21391 |
|
21392 |
const defaultGetName = item => item.name || '';
|
21393 |
|
21793 |
}
|
21794 |
|
21795 |
return pattern.categories.some(cat => allCategories.some(category => category.name === cat));
|
21796 |
+
}, [allCategories]); // Remove any empty categories.
|
21797 |
|
21798 |
const populatedCategories = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
21799 |
const categories = allCategories.filter(category => allPatterns.some(pattern => {
|
22027 |
|
22028 |
const results = searchBlockItems((0,external_lodash_namespaceObject.orderBy)(blockTypes, ['frecency'], ['desc']), blockTypeCategories, blockTypeCollections, filterValue);
|
22029 |
return maxBlockTypesToShow !== undefined ? results.slice(0, maxBlockTypesToShow) : results;
|
22030 |
+
}, [filterValue, blockTypes, blockTypeCategories, blockTypeCollections, maxBlockTypes]); // Announce search results on change.
|
22031 |
|
22032 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
22033 |
if (!filterValue) {
|
22368 |
setInserterIsOpened(false);
|
22369 |
}
|
22370 |
}, [setInserterIsOpened]); // When clicking Browse All select the appropriate block so as
|
22371 |
+
// the insertion point can work as expected.
|
22372 |
|
22373 |
const onBrowseAll = () => {
|
22374 |
setInserterIsOpened({
|
22466 |
const {
|
22467 |
onClick,
|
22468 |
...rest
|
22469 |
+
} = toggleProps; // Handle both onClick functions from the toggle and the parent component.
|
22470 |
|
22471 |
function handleClick(event) {
|
22472 |
if (onToggle) {
|
22501 |
onToggle(isOpen) {
|
22502 |
const {
|
22503 |
onToggle
|
22504 |
+
} = this.props; // Surface toggle callback to parent component.
|
22505 |
|
22506 |
if (onToggle) {
|
22507 |
onToggle(isOpen);
|
22741 |
|
22742 |
if (!isAppender && end && getBlockRootClientId(end) === rootClientId) {
|
22743 |
return getBlockIndex(end) + 1;
|
22744 |
+
} // Otherwise, we insert at the end of the current rootClientId.
|
22745 |
|
22746 |
|
22747 |
return getBlockOrder(rootClientId).length;
|
23736 |
}, [clientId]);
|
23737 |
}
|
23738 |
|
23739 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-title/use-block-display-title.js
|
23740 |
/**
|
23741 |
* External dependencies
|
23742 |
*/
|
23754 |
|
23755 |
|
23756 |
/**
|
23757 |
+
* Returns the block's configured title as a string, or empty if the title
|
23758 |
* cannot be determined.
|
23759 |
*
|
23760 |
* @example
|
23761 |
*
|
23762 |
+
* ```js
|
23763 |
+
* useBlockDisplayTitle( 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1', 17 );
|
23764 |
* ```
|
23765 |
*
|
23766 |
+
* @param {string} clientId Client ID of block.
|
23767 |
+
* @param {number|undefined} maximumLength The maximum length that the block title string may be before truncated.
|
|
|
23768 |
* @return {?string} Block title.
|
23769 |
*/
|
23770 |
|
23771 |
+
function useBlockDisplayTitle(clientId, maximumLength) {
|
|
|
|
|
|
|
23772 |
const {
|
23773 |
attributes,
|
23774 |
name,
|
23797 |
};
|
23798 |
}, [clientId]);
|
23799 |
const blockInformation = useBlockDisplayInformation(clientId);
|
23800 |
+
|
23801 |
+
if (!name || !blockInformation) {
|
23802 |
+
return null;
|
23803 |
+
}
|
23804 |
+
|
23805 |
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
|
23806 |
const blockLabel = blockType ? (0,external_wp_blocks_namespaceObject.__experimentalGetBlockLabel)(blockType, attributes) : null;
|
23807 |
const label = reusableBlockTitle || blockLabel; // Label will fallback to the title if no label is defined for the current
|
23809 |
// possible block variation title match.
|
23810 |
|
23811 |
if (label && label !== blockType.title) {
|
23812 |
+
return maximumLength && maximumLength > 0 ? (0,external_lodash_namespaceObject.truncate)(label, {
|
23813 |
+
length: maximumLength
|
23814 |
+
}) : label;
|
23815 |
}
|
23816 |
|
23817 |
return blockInformation.title;
|
23818 |
}
|
23819 |
|
23820 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-title/index.js
|
23821 |
+
/**
|
23822 |
+
* Internal dependencies
|
23823 |
+
*/
|
23824 |
+
|
23825 |
+
/**
|
23826 |
+
* Renders the block's configured title as a string, or empty if the title
|
23827 |
+
* cannot be determined.
|
23828 |
+
*
|
23829 |
+
* @example
|
23830 |
+
*
|
23831 |
+
* ```jsx
|
23832 |
+
* <BlockTitle clientId="afd1cb17-2c08-4e7a-91be-007ba7ddc3a1" maximumLength={ 17 }/>
|
23833 |
+
* ```
|
23834 |
+
*
|
23835 |
+
* @param {Object} props
|
23836 |
+
* @param {string} props.clientId Client ID of block.
|
23837 |
+
* @param {number|undefined} props.maximumLength The maximum length that the block title string may be before truncated.
|
23838 |
+
*
|
23839 |
+
* @return {JSX.Element} Block title.
|
23840 |
+
*/
|
23841 |
+
|
23842 |
+
function BlockTitle(_ref) {
|
23843 |
+
let {
|
23844 |
+
clientId,
|
23845 |
+
maximumLength
|
23846 |
+
} = _ref;
|
23847 |
+
return useBlockDisplayTitle(clientId, maximumLength);
|
23848 |
+
}
|
23849 |
+
|
23850 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-draggable/use-scroll-when-dragging.js
|
23851 |
/**
|
23852 |
* WordPress dependencies
|
23983 |
const {
|
23984 |
startDraggingBlocks,
|
23985 |
stopDraggingBlocks
|
23986 |
+
} = (0,external_wp_data_namespaceObject.useDispatch)(store); // Stop dragging blocks if the block draggable is unmounted.
|
23987 |
|
23988 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
23989 |
return () => {
|
24289 |
label: label,
|
24290 |
className: "block-selection-button_select-button"
|
24291 |
}, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
24292 |
+
clientId: clientId,
|
24293 |
+
maximumLength: 35
|
24294 |
})))));
|
24295 |
}
|
24296 |
|
24365 |
}, []);
|
24366 |
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
|
24367 |
// Toolbar buttons may be rendered asynchronously, so we use
|
24368 |
+
// MutationObserver to check if the toolbar subtree has been modified.
|
24369 |
const observer = new window.MutationObserver(determineIsAccessibleToolbar);
|
24370 |
observer.observe(ref.current, {
|
24371 |
childList: true,
|
24377 |
}
|
24378 |
|
24379 |
function useToolbarFocus(ref, focusOnMount, isAccessibleToolbar, defaultIndex, onIndexChange) {
|
24380 |
+
// Make sure we don't use modified versions of this prop.
|
24381 |
const [initialFocusOnMount] = (0,external_wp_element_namespaceObject.useState)(focusOnMount);
|
24382 |
const [initialIndex] = (0,external_wp_element_namespaceObject.useState)(defaultIndex);
|
24383 |
const focusToolbar = (0,external_wp_element_namespaceObject.useCallback)(() => {
|
24384 |
focusFirstTabbableIn(ref.current);
|
24385 |
+
}, []); // Focus on toolbar when pressing alt+F10 when the toolbar is visible.
|
24386 |
|
24387 |
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', focusToolbar);
|
24388 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
24561 |
}
|
24562 |
|
24563 |
if (dir > 0 && !isLast) {
|
24564 |
+
// Moving down.
|
24565 |
const movementDirection = getMovementDirection('down');
|
24566 |
|
24567 |
if (movementDirection === 'down') {
|
24581 |
}
|
24582 |
|
24583 |
if (dir > 0 && isLast) {
|
24584 |
+
// Moving down, and is the last item.
|
24585 |
const movementDirection = getMovementDirection('down');
|
24586 |
|
24587 |
if (movementDirection === 'down') {
|
24601 |
}
|
24602 |
|
24603 |
if (dir < 0 && !isFirst) {
|
24604 |
+
// Moving up.
|
24605 |
const movementDirection = getMovementDirection('up');
|
24606 |
|
24607 |
if (movementDirection === 'up') {
|
24621 |
}
|
24622 |
|
24623 |
if (dir < 0 && isFirst) {
|
24624 |
+
// Moving up, and is the first item.
|
24625 |
const movementDirection = getMovementDirection('up');
|
24626 |
|
24627 |
if (movementDirection === 'up') {
|
25031 |
}, debounceTimeout);
|
25032 |
};
|
25033 |
|
25034 |
+
(0,external_wp_element_namespaceObject.useEffect)(() => () => {
|
25035 |
+
/**
|
25036 |
+
* We need to call the change handler with `isFocused`
|
25037 |
+
* set to false on unmount because we also clear the
|
25038 |
+
* timeout that would handle that.
|
25039 |
+
*/
|
25040 |
+
handleOnChange(false);
|
25041 |
+
clearTimeoutRef();
|
25042 |
+
}, []);
|
25043 |
return {
|
25044 |
showMovers,
|
25045 |
debouncedShowMovers,
|
25769 |
* @param {WPBlock[]} selectedBlocks The currently selected blocks.
|
25770 |
* @return {TransformedBlockPattern[]} Returns the eligible matched patterns with all the selected blocks.
|
25771 |
*/
|
|
|
25772 |
|
25773 |
const useTransformedPatterns = (patterns, selectedBlocks) => {
|
25774 |
return (0,external_wp_element_namespaceObject.useMemo)(() => patterns.reduce((accumulator, _pattern) => {
|
26038 |
}), (isReusable || isTemplate) && (0,external_wp_element_namespaceObject.createElement)("span", {
|
26039 |
className: "block-editor-block-switcher__toggle-text"
|
26040 |
}, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
26041 |
+
clientId: clientIds,
|
26042 |
+
maximumLength: 35
|
26043 |
}))),
|
26044 |
toggleProps: {
|
26045 |
describedBy: blockSwitcherDescription,
|
26302 |
removeBlocks(selectedBlockClientIds);
|
26303 |
} else if (event.type === 'paste') {
|
26304 |
if (eventDefaultPrevented) {
|
26305 |
+
// This was likely already handled in rich-text/use-paste-handler.js.
|
26306 |
return;
|
26307 |
}
|
26308 |
|
26434 |
return;
|
26435 |
}
|
26436 |
|
26437 |
+
const groupingBlockName = getGroupingBlockName(); // Activate the `transform` on `core/group` which does the conversion.
|
26438 |
|
26439 |
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, groupingBlockName);
|
26440 |
|
26648 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
26649 |
|
26650 |
const onConvertToGroup = () => {
|
26651 |
+
// Activate the `transform` on the Grouping Block which does the conversion.
|
26652 |
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocksSelection, groupingBlockName);
|
26653 |
|
26654 |
if (newBlocks) {
|
26747 |
const isSingleGroupingBlock = _blocksSelection.length === 1 && ((_blocksSelection$ = _blocksSelection[0]) === null || _blocksSelection$ === void 0 ? void 0 : _blocksSelection$.name) === _groupingBlockName; // Do we have
|
26748 |
// 1. Grouping block available to be inserted?
|
26749 |
// 2. One or more blocks selected
|
|
|
|
|
26750 |
|
26751 |
+
const _isGroupable = groupingBlockAvailable && _blocksSelection.length; // Do we have a single Group Block selected and does that group have inner blocks?
|
26752 |
|
26753 |
|
26754 |
const _isUngroupable = isSingleGroupingBlock && !!_blocksSelection[0].innerBlocks.length;
|
26884 |
|
26885 |
|
26886 |
|
26887 |
+
|
26888 |
const block_settings_dropdown_POPOVER_PROPS = {
|
26889 |
className: 'block-editor-block-settings-menu__popover',
|
26890 |
position: 'bottom right',
|
26913 |
const count = blockClientIds.length;
|
26914 |
const firstBlockClientId = blockClientIds[0];
|
26915 |
const {
|
26916 |
+
onlyBlock
|
|
|
26917 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
|
|
|
|
26918 |
const {
|
26919 |
+
getBlockCount
|
|
|
26920 |
} = select(store);
|
|
|
|
|
|
|
26921 |
return {
|
26922 |
+
onlyBlock: 1 === getBlockCount()
|
|
|
26923 |
};
|
26924 |
}, [firstBlockClientId]);
|
26925 |
const shortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
26940 |
__experimentalSelectBlock(ids[0]);
|
26941 |
}
|
26942 |
} : external_lodash_namespaceObject.noop, [__experimentalSelectBlock]);
|
26943 |
+
const blockTitle = useBlockDisplayTitle(firstBlockClientId, 25);
|
26944 |
const label = (0,external_wp_i18n_namespaceObject.sprintf)(
|
26945 |
/* translators: %s: block name */
|
26946 |
+
(0,external_wp_i18n_namespaceObject.__)('Remove %s'), blockTitle);
|
26947 |
const removeBlockLabel = count === 1 ? label : (0,external_wp_i18n_namespaceObject.__)('Remove blocks');
|
26948 |
return (0,external_wp_element_namespaceObject.createElement)(BlockActions, {
|
26949 |
clientIds: clientIds,
|
27502 |
attributes = {},
|
27503 |
isValid
|
27504 |
} = getBlock(clientId) || {};
|
27505 |
+
const blockParentsClientIds = getBlockParents(clientId); // Get Block List Settings for all ancestors of the current Block clientId.
|
27506 |
|
27507 |
const parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(blockParentsClientIds); // Get the clientId of the topmost parent with the capture toolbars setting.
|
27508 |
|
27957 |
srcClientIds: sourceClientIds,
|
27958 |
type: dropType,
|
27959 |
blocks
|
27960 |
+
} = parseDropEvent(event); // If the user is inserting a block.
|
27961 |
|
27962 |
if (dropType === 'inserter') {
|
27963 |
clearSelectedBlock();
|
27964 |
const blocksToInsert = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block));
|
27965 |
insertBlocks(blocksToInsert, targetBlockIndex, targetRootClientId, true, null);
|
27966 |
+
} // If the user is moving a block.
|
27967 |
|
27968 |
|
27969 |
if (dropType === 'block') {
|
29320 |
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
29321 |
|
29322 |
if (typeof values === 'string') {
|
29323 |
+
const [, unit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values);
|
29324 |
return unit || 'px';
|
29325 |
}
|
29326 |
|
29327 |
const allUnits = Object.values(values).map(value => {
|
29328 |
+
const [, unit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
|
29329 |
return unit;
|
29330 |
});
|
29331 |
return mode(allUnits) || 'px';
|
29349 |
return values;
|
29350 |
}
|
29351 |
|
29352 |
+
const parsedQuantitiesAndUnits = Object.values(values).map(value => (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value));
|
29353 |
+
const allValues = parsedQuantitiesAndUnits.map(value => {
|
29354 |
+
var _value$;
|
29355 |
+
|
29356 |
+
return (_value$ = value[0]) !== null && _value$ !== void 0 ? _value$ : '';
|
29357 |
+
});
|
29358 |
+
const allUnits = parsedQuantitiesAndUnits.map(value => value[1]);
|
29359 |
const value = allValues.every(v => v === allValues[0]) ? allValues[0] : '';
|
29360 |
const unit = mode(allUnits);
|
29361 |
+
const allValue = value === 0 || value ? `${value}${unit}` : undefined;
|
29362 |
return allValue;
|
29363 |
}
|
29364 |
/**
|
29597 |
const unit = getAllUnit(values);
|
29598 |
const unitConfig = units && units.find(item => item.value === unit);
|
29599 |
const step = (unitConfig === null || unitConfig === void 0 ? void 0 : unitConfig.step) || 1;
|
29600 |
+
const [allValue] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(getAllValue(values));
|
29601 |
|
29602 |
const toggleLinked = () => setIsLinked(!isLinked);
|
29603 |
|
29618 |
units: units
|
29619 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
|
29620 |
className: "components-border-radius-control__range-control",
|
29621 |
+
value: allValue !== null && allValue !== void 0 ? allValue : '',
|
29622 |
min: MIN_BORDER_RADIUS_VALUE,
|
29623 |
max: MAX_BORDER_RADIUS_VALUES[unit],
|
29624 |
initialPosition: 0,
|
30081 |
const {
|
30082 |
clientId
|
30083 |
} = props;
|
|
|
|
|
30084 |
const isColorSupported = useSetting('border.color') && hasBorderSupport(props.name, 'color');
|
30085 |
const isRadiusSupported = useSetting('border.radius') && hasBorderSupport(props.name, 'radius');
|
30086 |
const isStyleSupported = useSetting('border.style') && hasBorderSupport(props.name, 'style');
|
30087 |
const isWidthSupported = useSetting('border.width') && hasBorderSupport(props.name, 'width');
|
30088 |
+
const isDisabled = [!isColorSupported, !isRadiusSupported, !isStyleSupported, !isWidthSupported].every(Boolean);
|
30089 |
|
30090 |
+
if (isDisabled) {
|
30091 |
return null;
|
30092 |
}
|
30093 |
|
30185 |
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, BORDER_SUPPORT_KEY);
|
30186 |
return support === null || support === void 0 ? void 0 : support.__experimentalSkipSerialization;
|
30187 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30188 |
/**
|
30189 |
* Returns a new style object where the specified border attribute has been
|
30190 |
* removed.
|
30195 |
* @return {Object} Style object with the specified attribute removed.
|
30196 |
*/
|
30197 |
|
|
|
30198 |
function removeBorderAttribute(style, attribute) {
|
30199 |
return cleanEmptyObject({ ...style,
|
30200 |
border: { ...(style === null || style === void 0 ? void 0 : style.border),
|
30345 |
fallbackTextColor,
|
30346 |
fallbackLinkColor,
|
30347 |
fontSize,
|
30348 |
+
// Font size value in pixels.
|
30349 |
isLargeText,
|
30350 |
textColor,
|
30351 |
linkColor,
|
30397 |
continue;
|
30398 |
}
|
30399 |
|
30400 |
+
message = backgroundColorBrightness < colordTextColor.brightness() ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s is a type of text color, e.g., "text color" or "link color".
|
30401 |
+
(0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s.'), item.description) : (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s is a type of text color, e.g., "text color" or "link color".
|
30402 |
(0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s.'), item.description);
|
30403 |
speakMessage = (0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read.'); // Break from the loop when we have a contrast warning.
|
30404 |
// These messages take priority over the transparency warning.
|
30796 |
function color_addAttributes(settings) {
|
30797 |
if (!hasColorSupport(settings)) {
|
30798 |
return settings;
|
30799 |
+
} // Allow blocks to specify their own attribute definition with default values if needed.
|
30800 |
|
30801 |
|
30802 |
if (!settings.attributes.backgroundColor) {
|
30857 |
|
30858 |
const textClass = getColorClassName('color', textColor);
|
30859 |
const newClassName = classnames_default()(props.className, textClass, gradientClass, {
|
30860 |
+
// Don't apply the background class if there's a custom gradient.
|
30861 |
[backgroundClass]: (!hasGradient || !(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.gradient)) && !!backgroundClass,
|
30862 |
'has-text-color': textColor || (style === null || style === void 0 ? void 0 : (_style$color2 = style.color) === null || _style$color2 === void 0 ? void 0 : _style$color2.text),
|
30863 |
'has-background': backgroundColor || (style === null || style === void 0 ? void 0 : (_style$color3 = style.color) === null || _style$color3 === void 0 ? void 0 : _style$color3.background) || hasGradient && (gradient || (style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.gradient)),
|
31413 |
const isDefined = isLineHeightDefined(lineHeight);
|
31414 |
|
31415 |
const adjustNextValue = (nextValue, wasTypedOrPasted) => {
|
31416 |
+
// Set the next value without modification if lineHeight has been defined.
|
31417 |
if (isDefined) return nextValue;
|
31418 |
/**
|
31419 |
* The following logic handles the initial step up/down action
|
31427 |
|
31428 |
switch (nextValue) {
|
31429 |
case `${STEP}`:
|
31430 |
+
// Increment by step value.
|
31431 |
return BASE_DEFAULT_VALUE + STEP;
|
31432 |
|
31433 |
case '0':
|
31434 |
{
|
31435 |
// This means the user explicitly input '0', rather than stepped down
|
31436 |
+
// from an undefined value state.
|
31437 |
+
if (wasTypedOrPasted) return nextValue; // Decrement by step value.
|
31438 |
|
31439 |
return BASE_DEFAULT_VALUE - STEP;
|
31440 |
}
|
32773 |
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
32774 |
availableUnits: useSetting('spacing.units') || ['px', 'em', 'rem'],
|
32775 |
defaultValues: {
|
32776 |
+
px: 2,
|
32777 |
+
em: 0.2,
|
32778 |
+
rem: 0.2
|
32779 |
}
|
32780 |
});
|
32781 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
|
33735 |
const elementStyles = getInlineStyles(styles);
|
33736 |
|
33737 |
if (!(0,external_lodash_namespaceObject.isEmpty)(elementStyles)) {
|
33738 |
+
// The .editor-styles-wrapper selector is required on elements styles. As it is
|
33739 |
+
// added to all other editor styles, not providing it causes reset and global
|
33740 |
+
// styles to override element styles because of higher specificity.
|
33741 |
+
return [`.editor-styles-wrapper .${selector} ${external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[element]}{`, ...(0,external_lodash_namespaceObject.map)(elementStyles, (value, property) => `\t${(0,external_lodash_namespaceObject.kebabCase)(property)}: ${value};`), '}'].join('\n');
|
33742 |
}
|
33743 |
|
33744 |
return '';
|
33756 |
function style_addAttribute(settings) {
|
33757 |
if (!hasStyleSupport(settings)) {
|
33758 |
return settings;
|
33759 |
+
} // Allow blocks to specify their own attribute definition with default values if needed.
|
33760 |
|
33761 |
|
33762 |
if (!settings.attributes.style) {
|
34098 |
}));
|
34099 |
}
|
34100 |
|
34101 |
+
function useMultiOriginPresets(_ref2) {
|
34102 |
+
let {
|
34103 |
+
presetSetting,
|
34104 |
+
defaultSetting
|
34105 |
+
} = _ref2;
|
34106 |
+
const disableDefault = !useSetting(defaultSetting);
|
34107 |
+
const userPresets = useSetting(`${presetSetting}.custom`) || duotone_EMPTY_ARRAY;
|
34108 |
+
const themePresets = useSetting(`${presetSetting}.theme`) || duotone_EMPTY_ARRAY;
|
34109 |
+
const defaultPresets = useSetting(`${presetSetting}.default`) || duotone_EMPTY_ARRAY;
|
34110 |
+
return (0,external_wp_element_namespaceObject.useMemo)(() => [...userPresets, ...themePresets, ...(disableDefault ? duotone_EMPTY_ARRAY : defaultPresets)], [disableDefault, userPresets, themePresets, defaultPresets]);
|
34111 |
+
}
|
34112 |
+
|
34113 |
+
function DuotonePanel(_ref3) {
|
34114 |
var _style$color;
|
34115 |
|
34116 |
let {
|
34117 |
attributes,
|
34118 |
setAttributes
|
34119 |
+
} = _ref3;
|
34120 |
const style = attributes === null || attributes === void 0 ? void 0 : attributes.style;
|
34121 |
const duotone = style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.duotone;
|
34122 |
+
const duotonePalette = useMultiOriginPresets({
|
34123 |
+
presetSetting: 'color.duotone',
|
34124 |
+
defaultSetting: 'color.defaultDuotone'
|
34125 |
+
});
|
34126 |
+
const colorPalette = useMultiOriginPresets({
|
34127 |
+
presetSetting: 'color.palette',
|
34128 |
+
defaultSetting: 'color.defaultPalette'
|
34129 |
+
});
|
34130 |
const disableCustomColors = !useSetting('color.custom');
|
34131 |
const disableCustomDuotone = !useSetting('color.customDuotone') || (colorPalette === null || colorPalette === void 0 ? void 0 : colorPalette.length) === 0 && disableCustomColors;
|
34132 |
|
35045 |
|
35046 |
const didAttributesChange = (customFontSizeAttributeName, fontSizeAttributeName) => {
|
35047 |
if (previousState[fontSizeAttributeName]) {
|
35048 |
+
// If new font size is name compare with the previous slug.
|
35049 |
if (attributes[fontSizeAttributeName]) {
|
35050 |
return attributes[fontSizeAttributeName] !== previousState[fontSizeAttributeName].slug;
|
35051 |
+
} // If font size is not named, update when the font size value changes.
|
35052 |
|
35053 |
|
35054 |
return previousState[fontSizeAttributeName].size !== attributes[customFontSizeAttributeName];
|
35055 |
+
} // In this case we need to build the font size object.
|
35056 |
|
35057 |
|
35058 |
return true;
|
35341 |
|
35342 |
/* harmony default export */ var autocompleters_block = (createBlockCompleter());
|
35343 |
|
35344 |
+
;// CONCATENATED MODULE: external ["wp","apiFetch"]
|
35345 |
+
var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
|
35346 |
+
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
|
35347 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/page.js
|
35348 |
+
|
35349 |
+
|
35350 |
+
/**
|
35351 |
+
* WordPress dependencies
|
35352 |
+
*/
|
35353 |
+
|
35354 |
+
const page = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
35355 |
+
xmlns: "http://www.w3.org/2000/svg",
|
35356 |
+
viewBox: "0 0 24 24"
|
35357 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
35358 |
+
d: "M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"
|
35359 |
+
}));
|
35360 |
+
/* harmony default export */ var library_page = (page);
|
35361 |
+
|
35362 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/post.js
|
35363 |
+
|
35364 |
+
|
35365 |
+
/**
|
35366 |
+
* WordPress dependencies
|
35367 |
+
*/
|
35368 |
+
|
35369 |
+
const post = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
35370 |
+
xmlns: "http://www.w3.org/2000/svg",
|
35371 |
+
viewBox: "0 0 24 24"
|
35372 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
35373 |
+
d: "m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"
|
35374 |
+
}));
|
35375 |
+
/* harmony default export */ var library_post = (post);
|
35376 |
+
|
35377 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/autocompleters/link.js
|
35378 |
+
|
35379 |
+
|
35380 |
+
/**
|
35381 |
+
* WordPress dependencies
|
35382 |
+
*/
|
35383 |
+
|
35384 |
+
|
35385 |
+
|
35386 |
+
const SHOWN_SUGGESTIONS = 10;
|
35387 |
+
/** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */
|
35388 |
+
|
35389 |
+
/**
|
35390 |
+
* Creates a suggestion list for links to posts or pages.
|
35391 |
+
*
|
35392 |
+
* @return {WPCompleter} A links completer.
|
35393 |
+
*/
|
35394 |
+
|
35395 |
+
function createLinkCompleter() {
|
35396 |
+
return {
|
35397 |
+
name: 'links',
|
35398 |
+
className: 'block-editor-autocompleters__link',
|
35399 |
+
triggerPrefix: '[[',
|
35400 |
+
options: async letters => {
|
35401 |
+
let options = await external_wp_apiFetch_default()({
|
35402 |
+
path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/search', {
|
35403 |
+
per_page: SHOWN_SUGGESTIONS,
|
35404 |
+
search: letters,
|
35405 |
+
type: 'post',
|
35406 |
+
order_by: 'menu_order'
|
35407 |
+
})
|
35408 |
+
});
|
35409 |
+
options = options.filter(option => option.title !== '');
|
35410 |
+
return options;
|
35411 |
+
},
|
35412 |
+
|
35413 |
+
getOptionKeywords(item) {
|
35414 |
+
const expansionWords = item.title.split(/\s+/);
|
35415 |
+
return [...expansionWords];
|
35416 |
+
},
|
35417 |
+
|
35418 |
+
getOptionLabel(item) {
|
35419 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
|
35420 |
+
key: "icon",
|
35421 |
+
icon: item.subtype === 'page' ? library_page : library_post
|
35422 |
+
}), item.title);
|
35423 |
+
},
|
35424 |
+
|
35425 |
+
getOptionCompletion(item) {
|
35426 |
+
return (0,external_wp_element_namespaceObject.createElement)("a", {
|
35427 |
+
href: item.url
|
35428 |
+
}, item.title);
|
35429 |
+
}
|
35430 |
+
|
35431 |
+
};
|
35432 |
+
}
|
35433 |
+
/**
|
35434 |
+
* Creates a suggestion list for links to posts or pages..
|
35435 |
+
*
|
35436 |
+
* @return {WPCompleter} A link completer.
|
35437 |
+
*/
|
35438 |
+
|
35439 |
+
|
35440 |
+
/* harmony default export */ var autocompleters_link = (createLinkCompleter());
|
35441 |
+
|
35442 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/autocomplete/index.js
|
35443 |
|
35444 |
|
35461 |
|
35462 |
|
35463 |
|
35464 |
+
|
35465 |
/**
|
35466 |
* Shared reference to an empty array for cases where it is important to avoid
|
35467 |
* returning a new array reference on every invocation.
|
35482 |
let filteredCompleters = completers;
|
35483 |
|
35484 |
if (name === (0,external_wp_blocks_namespaceObject.getDefaultBlockName)() || (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, '__experimentalSlashInserter', false)) {
|
35485 |
+
filteredCompleters = filteredCompleters.concat([autocompleters_block, autocompleters_link]);
|
35486 |
}
|
35487 |
|
35488 |
if ((0,external_wp_hooks_namespaceObject.hasFilter)('editor.Autocomplete.completers')) {
|
35729 |
variant: "tertiary",
|
35730 |
onClick: () => selectBlock(parentClientId)
|
35731 |
}, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
35732 |
+
clientId: parentClientId,
|
35733 |
+
maximumLength: 35
|
35734 |
})), (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
|
35735 |
icon: chevron_right_small,
|
35736 |
className: "block-editor-block-breadcrumb__separator"
|
35738 |
className: "block-editor-block-breadcrumb__current",
|
35739 |
"aria-current": "true"
|
35740 |
}, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
35741 |
+
clientId: clientId,
|
35742 |
+
maximumLength: 35
|
35743 |
})))
|
35744 |
/* eslint-enable jsx-a11y/no-redundant-roles */
|
35745 |
;
|
36154 |
icon: blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon,
|
36155 |
showColors: true
|
36156 |
}), (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
36157 |
+
clientId: clientId,
|
36158 |
+
maximumLength: 35
|
36159 |
}), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && (0,external_wp_element_namespaceObject.createElement)("span", {
|
36160 |
className: "block-editor-list-view-block-select-button__anchor"
|
36161 |
}, blockInformation.anchor), isSelected && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, (0,external_wp_i18n_namespaceObject.__)('(selected block)'))), (0,external_wp_element_namespaceObject.createElement)("div", {
|
36365 |
expand(clientId);
|
36366 |
}
|
36367 |
}, [clientId, expand, collapse, isExpanded]);
|
36368 |
+
const showBlockActions = withExperimentalFeatures && ( // hide actions for blocks like core/widget-areas
|
36369 |
!hideContainerBlockActions || hideContainerBlockActions && level > 1);
|
36370 |
const hideBlockActions = withExperimentalFeatures && !showBlockActions;
|
36371 |
let colSpan;
|
39441 |
isAlternate: true
|
39442 |
};
|
39443 |
|
|
|
|
|
|
|
39444 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/image-editor/use-save-image.js
|
39445 |
/**
|
39446 |
* WordPress dependencies
|
40334 |
const {
|
40335 |
value,
|
40336 |
__experimentalShowInitialSuggestions = false
|
40337 |
+
} = this.props; // Only have to worry about scrolling selected suggestion into view
|
40338 |
+
// when already expanded.
|
40339 |
|
40340 |
if (showSuggestions && selectedSuggestion !== null && this.suggestionNodes[selectedSuggestion] && !this.scrollingIntoView) {
|
40341 |
this.scrollingIntoView = true;
|
40345 |
this.props.setTimeout(() => {
|
40346 |
this.scrollingIntoView = false;
|
40347 |
}, 100);
|
40348 |
+
} // Update suggestions when the value changes.
|
40349 |
|
40350 |
|
40351 |
if (prevProps.value !== value && !this.props.disableSuggestions && !this.isUpdatingSuggestions) {
|
40352 |
if (value !== null && value !== void 0 && value.length) {
|
40353 |
+
// If the new value is not empty we need to update with suggestions for it.
|
40354 |
this.updateSuggestions(value);
|
40355 |
} else if (__experimentalShowInitialSuggestions) {
|
40356 |
+
// If the new value is empty and we can show initial suggestions, then show initial suggestions.
|
40357 |
this.updateSuggestions();
|
40358 |
}
|
40359 |
}
|
40485 |
// Don't re-run the suggestions on focus if there are already suggestions present (prevents searching again when tabbing between the input and buttons)
|
40486 |
|
40487 |
if (value && !disableSuggestions && !this.isUpdatingSuggestions && !(suggestions && suggestions.length)) {
|
40488 |
+
// Ensure the suggestions are updated with the current input value.
|
40489 |
this.updateSuggestions(value);
|
40490 |
}
|
40491 |
}
|
40497 |
suggestions,
|
40498 |
loading
|
40499 |
} = this.state; // If the suggestions are not shown or loading, we shouldn't handle the arrow keys
|
40500 |
+
// We shouldn't preventDefault to allow block arrow keys navigation.
|
40501 |
|
40502 |
if (!showSuggestions || !suggestions.length || loading) {
|
40503 |
// In the Windows version of Firefox the up and down arrows don't move the caret
|
40511 |
case external_wp_keycodes_namespaceObject.UP:
|
40512 |
{
|
40513 |
if (0 !== event.target.selectionStart) {
|
40514 |
+
event.preventDefault(); // Set the input caret to position 0.
|
40515 |
|
40516 |
event.target.setSelectionRange(0, 0);
|
40517 |
}
|
40524 |
case external_wp_keycodes_namespaceObject.DOWN:
|
40525 |
{
|
40526 |
if (this.props.value.length !== event.target.selectionStart) {
|
40527 |
+
event.preventDefault(); // Set the input caret to the last position.
|
40528 |
|
40529 |
event.target.setSelectionRange(this.props.value.length, this.props.value.length);
|
40530 |
}
|
40531 |
|
40532 |
break;
|
40533 |
}
|
40534 |
+
// Submitting while loading should trigger onSubmit.
|
40535 |
|
40536 |
case external_wp_keycodes_namespaceObject.ENTER:
|
40537 |
{
|
40762 |
|
40763 |
/* harmony default export */ var url_input = ((0,external_wp_compose_namespaceObject.compose)(external_wp_compose_namespaceObject.withSafeTimeout, external_wp_components_namespaceObject.withSpokenMessages, external_wp_compose_namespaceObject.withInstanceId, (0,external_wp_data_namespaceObject.withSelect)((select, props) => {
|
40764 |
// If a link suggestions handler is already provided then
|
40765 |
+
// bail.
|
40766 |
if ((0,external_lodash_namespaceObject.isFunction)(props.__experimentalFetchLinkSuggestions)) {
|
40767 |
return;
|
40768 |
}
|
40978 |
// so we conditionally render it as a wrapper to visually hide the label
|
40979 |
// when that is required.
|
40980 |
|
40981 |
+
const searchResultsLabel = (0,external_wp_element_namespaceObject.createElement)(isInitialSuggestions ? external_wp_element_namespaceObject.Fragment : external_wp_components_namespaceObject.VisuallyHidden, {}, // Empty props.
|
40982 |
(0,external_wp_element_namespaceObject.createElement)("span", {
|
40983 |
className: "block-editor-link-control__search-results-label",
|
40984 |
id: searchResultsLabelId
|
41002 |
isSelected: index === selectedSuggestion
|
41003 |
});
|
41004 |
} // If we're not handling "Create" suggestions above then
|
41005 |
+
// we don't want them in the main results so exit early.
|
41006 |
|
41007 |
|
41008 |
if (CREATE_TYPE === suggestion.type) {
|
41147 |
// is never exposed as part of the component's public API.
|
41148 |
// see: https://github.com/WordPress/gutenberg/pull/19775#discussion_r378931316.
|
41149 |
title: val,
|
41150 |
+
// Must match the existing `<input>`s text value.
|
41151 |
url: val,
|
41152 |
+
// Must match the existing `<input>`s text value.
|
41153 |
type: CREATE_TYPE
|
41154 |
});
|
41155 |
};
|
41265 |
let suggestion = selectedSuggestion;
|
41266 |
|
41267 |
if (CREATE_TYPE === selectedSuggestion.type) {
|
41268 |
+
// Create a new page and call onSelect with the output from the onCreateSuggestion callback.
|
41269 |
try {
|
41270 |
var _suggestion;
|
41271 |
|
41445 |
type: 'ERROR'
|
41446 |
});
|
41447 |
}
|
41448 |
+
}); // Cleanup: when the URL changes the abort the current request.
|
41449 |
|
41450 |
return () => {
|
41451 |
controller.abort();
|
41896 |
keyCode
|
41897 |
} = event;
|
41898 |
|
41899 |
+
if (keyCode === external_wp_keycodes_namespaceObject.ENTER && !currentInputIsEmpty // Disallow submitting empty values.
|
41900 |
) {
|
41901 |
event.preventDefault();
|
41902 |
handleSubmit();
|
41950 |
label: (0,external_wp_i18n_namespaceObject.__)('Submit'),
|
41951 |
icon: keyboard_return,
|
41952 |
className: "block-editor-link-control__search-submit",
|
41953 |
+
disabled: currentInputIsEmpty // Disallow submitting empty values.
|
41954 |
|
41955 |
})))), errorMessage && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
|
41956 |
className: "block-editor-link-control__search-error",
|
42076 |
|
42077 |
|
42078 |
|
42079 |
+
|
42080 |
/**
|
42081 |
* Internal dependencies
|
42082 |
*/
|
42093 |
mediaIds,
|
42094 |
allowedTypes,
|
42095 |
accept,
|
42096 |
+
onError,
|
42097 |
onSelect,
|
42098 |
onSelectURL,
|
42099 |
onFilesUpload = external_lodash_namespaceObject.noop,
|
42110 |
const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
42111 |
return select(store).getSettings().mediaUpload;
|
42112 |
}, []);
|
42113 |
+
const editMediaButtonRef = (0,external_wp_element_namespaceObject.useRef)();
|
42114 |
const errorNoticeID = (0,external_lodash_namespaceObject.uniqueId)('block-editor/media-replace-flow/error-notice/');
|
42115 |
|
42116 |
+
const onUploadError = message => {
|
42117 |
+
const safeMessage = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(message);
|
|
|
|
|
|
|
|
|
42118 |
|
42119 |
+
if (onError) {
|
42120 |
+
onError(safeMessage);
|
42121 |
+
return;
|
42122 |
+
} // We need to set a timeout for showing the notice
|
42123 |
// so that VoiceOver and possibly other screen readers
|
42124 |
// can announce the error afer the toolbar button
|
42125 |
// regains focus once the upload dialog closes.
|
42126 |
// Otherwise VO simply skips over the notice and announces
|
42127 |
// the focused element and the open menu.
|
42128 |
|
42129 |
+
|
42130 |
setTimeout(() => {
|
42131 |
+
createNotice('error', safeMessage, {
|
42132 |
speak: true,
|
42133 |
id: errorNoticeID,
|
42134 |
isDismissible: true
|
42138 |
|
42139 |
const selectMedia = (media, closeMenu) => {
|
42140 |
closeMenu();
|
42141 |
+
setMediaURLValue(media === null || media === void 0 ? void 0 : media.url); // Calling `onSelect` after the state update since it might unmount the component.
|
42142 |
|
42143 |
onSelect(media);
|
42144 |
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('The media file has been replaced'));
|
42145 |
removeNotice(errorNoticeID);
|
42146 |
};
|
42147 |
|
|
|
|
|
|
|
|
|
42148 |
const uploadFiles = (event, closeMenu) => {
|
42149 |
const files = event.target.files;
|
42150 |
|
42154 |
}
|
42155 |
|
42156 |
onFilesUpload(files);
|
|
|
|
|
|
|
|
|
|
|
|
|
42157 |
mediaUpload({
|
42158 |
allowedTypes,
|
42159 |
filesList: files,
|
42160 |
+
onFileChange: _ref2 => {
|
42161 |
+
let [media] = _ref2;
|
42162 |
+
selectMedia(media, closeMenu);
|
42163 |
+
},
|
42164 |
+
onError: onUploadError
|
42165 |
});
|
42166 |
};
|
42167 |
|
42256 |
url
|
42257 |
} = _ref7;
|
42258 |
setMediaURLValue(url);
|
42259 |
+
onSelectURL(url);
|
42260 |
editMediaButtonRef.current.focus();
|
42261 |
}
|
42262 |
})));
|
42954 |
} = _ref;
|
42955 |
|
42956 |
if (inline) {
|
42957 |
+
// Render in popover.
|
42958 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
|
42959 |
noArrow: true,
|
42960 |
position: "top center",
|
42965 |
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
42966 |
className: "block-editor-rich-text__inline-format-toolbar-group"
|
42967 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(format_toolbar, null))));
|
42968 |
+
} // Render regular toolbar.
|
42969 |
|
42970 |
|
42971 |
return (0,external_wp_element_namespaceObject.createElement)(block_controls, {
|
45915 |
}
|
45916 |
|
45917 |
function KeyboardShortcutsRegister() {
|
45918 |
+
// Registering the shortcuts.
|
45919 |
const {
|
45920 |
registerShortcut
|
45921 |
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store);
|
46786 |
if (matches[0]) {
|
46787 |
const functionUnitValue = getFunctionUnitValue(matches[0]);
|
46788 |
cssUnit = cssUnit.replace(matches[0], functionUnitValue);
|
46789 |
+
} // If the unit hasn't been modified or we have a single value break free.
|
46790 |
|
46791 |
|
46792 |
if (cssUnit === currentCssUnit || parseFloat(cssUnit)) {
|
46831 |
const parsedUnit = parseUnit(getPxFromCssUnit(unit));
|
46832 |
|
46833 |
if (!parseFloat(parsedUnit.value)) {
|
46834 |
+
errorFound = true; // End early since we are dealing with a null value.
|
46835 |
|
46836 |
break;
|
46837 |
}
|
46872 |
ch: 8,
|
46873 |
// The advance measure (width) of the glyph "0" of the element's font. Approximate
|
46874 |
ex: 7.15625,
|
46875 |
+
// X-height of the element's font. Approximate.
|
46876 |
lh: setOptions.lineHeight
|
46877 |
};
|
46878 |
const absoluteUnits = {
|
build/block-editor/index.min.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'ad946b6e8ed6801dbff91f1d18f469c5');
|
build/block-editor/index.min.js
CHANGED
@@ -1,33 +1,33 @@
|
|
1 |
-
!function(){var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:function(e,t){var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:function(e,t){"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=a&&f+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();f()||e()}),0)}();else for(;u<=d;){var g=f();if(g)return g}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:function(e,t,n){"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:function(e,t,n){"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),f=o.offset(e),g=o.outerHeight(e),h=o.outerWidth(e),v=void 0,b=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,_.left+y.left):!1===s?o.scrollLeft(t,_.left+E.left):y.left<0?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left)))}},5425:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function f(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function g(e){return null!=e&&e==e.window}var h={};function v(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function k(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function _(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(t,["padding","border"],n)),_(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(_(e,l))||0,o[l]=r+t[l]-n[l]);_(e,o)}(e,t)},isWindow:g,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(g(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(g(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},h)},8575:function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:function(e,t,n){var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},5372:function(e,t,n){"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:function(e,t,n){e.exports=n(5372)()},9567:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:function(e){var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},f=!0,g={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var v=t.call(g,g.node);return void 0!==v&&g.update&&g.update(v),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return zh},AlignmentToolbar:function(){return Vh},Autocomplete:function(){return Wh},BlockAlignmentControl:function(){return zo},BlockAlignmentToolbar:function(){return Vo},BlockBreadcrumb:function(){return Yh},BlockColorsStyleSelector:function(){return ev},BlockContextProvider:function(){return ur},BlockControls:function(){return Yn},BlockEdit:function(){return fr},BlockEditorKeyboardShortcuts:function(){return C_},BlockEditorProvider:function(){return Ya},BlockFormatControls:function(){return qn},BlockIcon:function(){return ja},BlockInspector:function(){return b_},BlockList:function(){return km},BlockMover:function(){return ep},BlockNavigationDropdown:function(){return _v},BlockPreview:function(){return vu},BlockSelectionClearer:function(){return Qa},BlockSettingsMenu:function(){return jp},BlockSettingsMenuControls:function(){return Gp},BlockStyles:function(){return Sv},BlockTitle:function(){return Vd},BlockToolbar:function(){return Kp},BlockTools:function(){return k_},BlockVerticalAlignmentControl:function(){return $v},BlockVerticalAlignmentToolbar:function(){return jv},ButtonBlockAppender:function(){return Nd},ButtonBlockerAppender:function(){return Td},ColorPalette:function(){return qv},ColorPaletteControl:function(){return Yv},ContrastChecker:function(){return gf},CopyHandler:function(){return Pp},DefaultBlockAppender:function(){return Id},FontSizePicker:function(){return rg},InnerBlocks:function(){return gm},Inserter:function(){return Bd},InspectorAdvancedControls:function(){return tr},InspectorControls:function(){return nr},JustifyContentControl:function(){return ho},JustifyToolbar:function(){return vo},LineHeightControl:function(){return Vf},MediaPlaceholder:function(){return vk},MediaReplaceFlow:function(){return pk},MediaUpload:function(){return uk},MediaUploadCheck:function(){return dk},MultiSelectScrollIntoView:function(){return S_},NavigableToolbar:function(){return Wd},ObserveTyping:function(){return x_},PanelColorSettings:function(){return bk},PlainText:function(){return Wk},RichText:function(){return Hk},RichTextShortcut:function(){return Kk},RichTextToolbarButton:function(){return qk},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return p_},ToolSelector:function(){return Zk},Typewriter:function(){return M_},URLInput:function(){return Hb},URLInputButton:function(){return t_},URLPopover:function(){return gk},Warning:function(){return hr},WritingFlow:function(){return ac},__experimentalBlockAlignmentMatrixControl:function(){return Kh},__experimentalBlockContentOverlay:function(){return Xh},__experimentalBlockFullHeightAligmentControl:function(){return jh},__experimentalBlockPatternSetup:function(){return Dv},__experimentalBlockPatternsList:function(){return Vu},__experimentalBlockVariationPicker:function(){return Bv},__experimentalBlockVariationTransforms:function(){return Fv},__experimentalBorderRadiusControl:function(){return qm},__experimentalBorderStyleControl:function(){return ef},__experimentalColorGradientControl:function(){return wm},__experimentalColorGradientSettingsDropdown:function(){return Bm},__experimentalDuotoneControl:function(){return ih},__experimentalFontAppearanceControl:function(){return zf},__experimentalFontFamilyControl:function(){return Xf},__experimentalGetBorderClassesAndStyles:function(){return kh},__experimentalGetColorClassesAndStyles:function(){return yh},__experimentalGetGradientClass:function(){return uf},__experimentalGetGradientObjectByGradientValue:function(){return pf},__experimentalGetMatchingVariation:function(){return Ov},__experimentalGetSpacingClassesAndStyles:function(){return Sh},__experimentalImageEditingProvider:function(){return wb},__experimentalImageEditor:function(){return Ab},__experimentalImageSizeControl:function(){return Ob},__experimentalImageURLInputUI:function(){return c_},__experimentalLayoutStyle:function(){return Mo},__experimentalLetterSpacingControl:function(){return Bg},__experimentalLibrary:function(){return y_},__experimentalLinkControl:function(){return sk},__experimentalLinkControlSearchInput:function(){return Jb},__experimentalLinkControlSearchItem:function(){return Wb},__experimentalLinkControlSearchResults:function(){return Kb},__experimentalListView:function(){return bv},__experimentalPanelColorGradientSettings:function(){return ob},__experimentalPreviewOptions:function(){return u_},__experimentalResponsiveBlockControl:function(){return jk},__experimentalTextDecorationControl:function(){return fg},__experimentalTextTransformControl:function(){return Eg},__experimentalToolsPanelColorDropdown:function(){return hf},__experimentalUnitControl:function(){return Qk},__experimentalUseBlockPreview:function(){return bu},__experimentalUseBorderProps:function(){return _h},__experimentalUseColorProps:function(){return Ch},__experimentalUseCustomSides:function(){return qg},__experimentalUseGradient:function(){return ff},__experimentalUseNoRecursiveRenders:function(){return A_},__experimentalUseResizeCanvas:function(){return d_},__unstableBlockSettingsMenuFirstItem:function(){return Op},__unstableEditorStyles:function(){return mu},__unstableIframe:function(){return dc},__unstableInserterMenuExtension:function(){return gd},__unstableRichTextInputEvent:function(){return Yk},__unstableUseBlockSelectionClearer:function(){return Za},__unstableUseClipboardHandler:function(){return Np},__unstableUseMouseMoveTypingReset:function(){return B_},__unstableUseTypewriter:function(){return P_},__unstableUseTypingObserver:function(){return I_},createCustomColorsHOC:function(){return Th},getColorClassName:function(){return Pm},getColorObjectByAttributeValues:function(){return Tm},getColorObjectByColorValue:function(){return Nm},getFontSize:function(){return tg},getFontSizeClass:function(){return og},getFontSizeObjectByValue:function(){return ng},getGradientSlugByValue:function(){return mf},getGradientValueBySlug:function(){return df},getPxFromCssUnit:function(){return $_},store:function(){return zn},storeConfig:function(){return Fn},transformStyles:function(){return uu},useBlockDisplayInformation:function(){return zd},useBlockEditContext:function(){return Un},useBlockProps:function(){return Aa},useCachedTruthy:function(){return wh},useInnerBlocksProps:function(){return fm},useSetting:function(){return mo},withColorContext:function(){return Kv},withColors:function(){return Nh},withFontSizes:function(){return Mh}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return xt},__experimentalGetAllowedBlocks:function(){return at},__experimentalGetAllowedPatterns:function(){return pt},__experimentalGetBlockListSettingsForBlocks:function(){return bt},__experimentalGetDirectInsertBlock:function(){return ct},__experimentalGetLastBlockAttributeChanges:function(){return yt},__experimentalGetParsedPattern:function(){return ut},__experimentalGetPatternTransformItems:function(){return ft},__experimentalGetPatternsByBlockTypes:function(){return mt},__experimentalGetReusableBlockTitle:function(){return kt},__unstableGetBlockWithoutInnerBlocks:function(){return W},__unstableGetClientIdWithClientIdsTree:function(){return j},__unstableGetClientIdsTree:function(){return K},__unstableIsLastBlockChangeIgnored:function(){return _t},areInnerBlocksControlled:function(){return It},canInsertBlockType:function(){return qe},canInsertBlocks:function(){return Ye},canMoveBlock:function(){return Qe},canMoveBlocks:function(){return Je},canRemoveBlock:function(){return Xe},canRemoveBlocks:function(){return Ze},didAutomaticChange:function(){return wt},getAdjacentBlockClientId:function(){return pe},getBlock:function(){return U},getBlockAttributes:function(){return G},getBlockCount:function(){return Q},getBlockHierarchyRootClientId:function(){return ue},getBlockIndex:function(){return Ie},getBlockInsertionPoint:function(){return He},getBlockListSettings:function(){return gt},getBlockMode:function(){return Le},getBlockName:function(){return V},getBlockOrder:function(){return Be},getBlockParents:function(){return ae},getBlockParentsByBlockName:function(){return ce},getBlockRootClientId:function(){return se},getBlockSelectionEnd:function(){return ne},getBlockSelectionStart:function(){return te},getBlockTransformItems:function(){return it},getBlocks:function(){return $},getBlocksByClientId:function(){return Z},getClientIdsOfDescendants:function(){return q},getClientIdsWithDescendants:function(){return Y},getDraggedBlockClientIds:function(){return Oe},getFirstMultiSelectedBlockClientId:function(){return ke},getGlobalBlockCount:function(){return X},getInserterItems:function(){return lt},getLastMultiSelectedBlockClientId:function(){return _e},getLowestCommonAncestorWithSelectedBlock:function(){return de},getMultiSelectedBlockClientIds:function(){return ve},getMultiSelectedBlocks:function(){return be},getMultiSelectedBlocksEndClientId:function(){return we},getMultiSelectedBlocksStartClientId:function(){return Se},getNextBlockClientId:function(){return fe},getPreviousBlockClientId:function(){return me},getSelectedBlock:function(){return ie},getSelectedBlockClientId:function(){return le},getSelectedBlockClientIds:function(){return he},getSelectedBlockCount:function(){return oe},getSelectedBlocksInitialCaretPosition:function(){return ge},getSelectionEnd:function(){return ee},getSelectionStart:function(){return J},getSettings:function(){return ht},getTemplate:function(){return We},getTemplateLock:function(){return $e},hasBlockMovingClientId:function(){return St},hasInserterItems:function(){return st},hasMultiSelection:function(){return Pe},hasSelectedBlock:function(){return re},hasSelectedInnerBlock:function(){return Te},isAncestorBeingDragged:function(){return ze},isAncestorMultiSelected:function(){return Ce},isBlockBeingDragged:function(){return Fe},isBlockHighlighted:function(){return Bt},isBlockInsertionPointVisible:function(){return Ge},isBlockMultiSelected:function(){return Ee},isBlockSelected:function(){return xe},isBlockValid:function(){return H},isBlockWithinSelection:function(){return Ne},isCaretWithinFormattedText:function(){return Ve},isDraggingBlocks:function(){return De},isFirstMultiSelectedBlock:function(){return ye},isLastBlockChangePersistent:function(){return vt},isMultiSelecting:function(){return Me},isNavigationMode:function(){return Ct},isSelectionEnabled:function(){return Re},isTyping:function(){return Ae},isValidTemplate:function(){return Ue},wasBlockJustInserted:function(){return Tt}});var t={};n.r(t),n.d(t,{__unstableMarkAutomaticChange:function(){return xn},__unstableMarkLastChangeAsPersistent:function(){return Bn},__unstableMarkNextChangeAsNotPersistent:function(){return In},__unstableSaveReusableBlock:function(){return wn},clearSelectedBlock:function(){return jt},duplicateBlocks:function(){return Pn},enterFormattedText:function(){return bn},exitFormattedText:function(){return kn},flashBlock:function(){return An},hideInsertionPoint:function(){return ln},insertAfterBlock:function(){return Rn},insertBeforeBlock:function(){return Mn},insertBlock:function(){return nn},insertBlocks:function(){return on},insertDefaultBlock:function(){return En},mergeBlocks:function(){return cn},moveBlockToPosition:function(){return tn},moveBlocksDown:function(){return Qt},moveBlocksToPosition:function(){return en},moveBlocksUp:function(){return Jt},multiSelect:function(){return $t},receiveBlocks:function(){return Ot},removeBlock:function(){return dn},removeBlocks:function(){return un},replaceBlock:function(){return Xt},replaceBlocks:function(){return Yt},replaceInnerBlocks:function(){return pn},resetBlocks:function(){return Lt},resetSelection:function(){return Dt},selectBlock:function(){return Vt},selectNextBlock:function(){return Gt},selectPreviousBlock:function(){return Ht},selectionChange:function(){return yn},setBlockMovingClientId:function(){return Nn},setHasControlledInnerBlocks:function(){return Dn},setNavigationMode:function(){return Tn},setTemplateValidity:function(){return sn},showInsertionPoint:function(){return rn},startDraggingBlocks:function(){return hn},startMultiSelect:function(){return Ut},startTyping:function(){return fn},stopDraggingBlocks:function(){return vn},stopMultiSelect:function(){return Wt},stopTyping:function(){return gn},synchronizeTemplate:function(){return an},toggleBlockHighlight:function(){return Ln},toggleBlockMode:function(){return mn},toggleSelection:function(){return Kt},updateBlock:function(){return zt},updateBlockAttributes:function(){return Ft},updateBlockListSettings:function(){return Cn},updateSettings:function(){return Sn},validateBlocksToTemplate:function(){return At}});var r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var s=window.wp.element,a=n(4403),c=n.n(a),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,f={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},g=window.wp.i18n;const h={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__experimentalGenerateAnchors:!1,__unstableGalleryWithImageBlocks:!1,gradients:[{name:(0,g.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,g.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,g.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,g.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,g.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,g.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,g.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,g.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function k(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function S(e){return E(e,(e=>e.attributes))}function w(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function I(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const x=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=B(o,n.blocks);o.tree=I(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=I(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=I(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=I(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=I(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=I(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=I(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=I(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=I(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:S(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{}},o=B(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!w(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const s=i.indexOf(r);return{...e,[o]:k(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var N,P,M=(0,m.combineReducers)({blocks:x,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},isCaretWithinFormattedText:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENTER_FORMATTED_TEXT":return!0;case"EXIT_FORMATTED_TEXT":return!1}return e},selection:function(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;switch(o.type){case"SELECTION_CHANGE":return{selectionStart:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.startOffset},selectionEnd:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.endOffset}};case"RESET_SELECTION":const{selectionStart:r,selectionEnd:l}=o;return{selectionStart:r,selectionEnd:l};case"MULTI_SELECT":const{start:i,end:s}=o;return{selectionStart:{clientId:i},selectionEnd:{clientId:s}};case"RESET_BLOCKS":const a=null==n||null===(e=n.selectionStart)||void 0===e?void 0:e.clientId,c=null==n||null===(t=n.selectionEnd)||void 0===t?void 0:t.clientId;if(!a&&!c)return n;if(!o.blocks.some((e=>e.clientId===a)))return{selectionStart:{},selectionEnd:{}};if(!o.blocks.some((e=>e.clientId===c)))return{...n,selectionEnd:n.selectionStart}}return{selectionStart:T(n.selectionStart,o),selectionEnd:T(n.selectionEnd,o)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,m.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":return n.blocks.length?{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source}:t;case"RESET_BLOCKS":return{}}return t}});function R(e){return[e]}function L(){var e={clear:function(){e.head=null}};return e}function A(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function D(e,t){var n,o;function r(){n=P?new WeakMap:L()}function l(){var n,r,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for(s=t.apply(null,i),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!A(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),r=n.head;r;){if(A(r.args,i,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,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=R),o=P?function(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(N)||((l=L()).isUniqueByDependants=a,s.set(N,l)),s.get(N)}:function(){return n},l.getDependants=t,l.clear=r,r(),l}N={},P="undefined"!=typeof WeakMap;var O=window.wp.primitives,F=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));const z=[];function V(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function H(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function G(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function U(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const W=D(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:G(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function $(e,t){var n;const o=t&&It(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||z}const j=D(((e,t)=>({clientId:t,innerBlocks:K(e,t)})),(e=>[e.blocks.order])),K=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Be(e,t),(t=>j(e,t)))}),(e=>[e.blocks.order])),q=(e,t)=>(0,u.flatMap)(t,(t=>{const n=Be(e,t);return[...n,...q(e,n)]})),Y=D((e=>{const t=Be(e);return[...t,...q(e,t)]}),(e=>[e.blocks.order])),X=D(((e,t)=>{const n=Y(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),Z=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>U(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function Q(e,t){return Be(e,t).length}function J(e){return e.selection.selectionStart}function ee(e){return e.selection.selectionEnd}function te(e){return e.selection.selectionStart.clientId}function ne(e){return e.selection.selectionEnd.clientId}function oe(e){return ve(e).length||(e.selection.selectionStart.clientId?1:0)}function re(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function le(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ie(e){const t=le(e);return t?U(e,t):null}function se(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const ae=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),ce=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ae(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:V(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ue(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function de(e,t){const n=le(e),o=[...ae(e,t),t],r=[...ae(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function pe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=le(e)),void 0===t&&(t=n<0?ke(e):_e(e)),!t)return null;const o=se(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function me(e,t){return pe(e,t,-1)}function fe(e,t){return pe(e,t,1)}function ge(e){return e.initialPosition}const he=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return z;if(t.clientId===n.clientId)return[t.clientId];const o=se(e,t.clientId);if(null===o)return z;const r=Be(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?z:he(e)}const be=D((e=>{const t=ve(e);return t.length?t.map((t=>U(e,t))):z}),(e=>[...he.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function ke(e){return(0,u.first)(ve(e))||null}function _e(e){return(0,u.last)(ve(e))||null}function ye(e,t){return ke(e)===t}function Ee(e,t){return-1!==ve(e).indexOf(t)}const Ce=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=se(e,n),o=Ee(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Se(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function we(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Be(e,t){return e.blocks.order[t||""]||z}function Ie(e,t){return Be(e,se(e,t)).indexOf(t)}function xe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Te(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Be(e,t),(t=>xe(e,t)||Ee(e,t)||n&&Te(e,t,n)))}function Ne(e,t){if(!t)return!1;const n=ve(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Pe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Me(e){return e.isMultiSelecting}function Re(e){return e.isSelectionEnabled}function Le(e,t){return e.blocksMode[t]||"visual"}function Ae(e){return e.isTyping}function De(e){return!!e.draggedBlocks.length}function Oe(e){return e.draggedBlocks}function Fe(e,t){return e.draggedBlocks.includes(t)}function ze(e,t){if(!De(e))return!1;const n=ae(e,t);return(0,u.some)(n,(t=>Fe(e,t)))}function Ve(e){return e.isCaretWithinFormattedText}function He(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=se(e,l)||void 0,n=Ie(e,r.clientId)+1):n=Be(e).length,{rootClientId:t,index:n}}function Ge(e){return null!==e.insertionPoint}function Ue(e){return e.template.isValid}function We(e){return e.settings.template}function $e(e,t){if(!t)return e.settings.templateLock;const n=gt(e,t);return n?n.templateLock:null}const je=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},Ke=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=ht(e),s=je(i,t,!0);if(!s)return!1;const a=!!$e(e,o);if(a)return!1;const c=gt(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=je(u,t),p=n.parent,m=V(e,o),f=je(p,m),g=null===d&&null===f||!0===d||!0===f;return g?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",g,n,o,{getBlock:U.bind(null,e),getBlockParentsByBlockName:ce.bind(null,e)}):g},qe=D(Ke,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function Ye(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>qe(e,V(e,t),n)))}function Xe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=G(e,t);if(null===o)return!0;const{lock:r}=o,l=!!$e(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function Ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Xe(e,t,n)))}function Qe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=G(e,t);if(null===o)return;const{lock:r}=o,l="all"===$e(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function Je(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Qe(e,t,n)))}function et(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const tt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&Ke(e,t.name,n),nt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=et(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:ot(r,l)}},ot=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},rt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(Z(e,Y(e)),{name:t.name}));const{time:i,count:s=0}=et(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:ot(i,s)};if("transform"===n)return a;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},lt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=rt(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=F;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=et(e,l)||{},c=ot(i,a);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>tt(e,n,t))).map(n),a=Ke(e,"core/block",t)?Et(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=nt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Et(e),(0,r.getBlockTypes)()])),it=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=rt(e,{buildScope:"transform"}),l=(0,r.getBlockTypes)().filter((t=>tt(e,t,n))).map(o),i=(0,u.mapKeys)(l,(e=>{let{name:t}=e;return t})),s=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>(i[null==t?void 0:t.name]&&e.push(i[t.name]),e)),[]),a=(0,u.orderBy)(s,(e=>i[e.name].frecency),"desc");return a}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),st=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>tt(e,n,t)));if(n)return!0;const o=Ke(e,"core/block",t)&&Et(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Et(e),(0,r.getBlockTypes)()])),at=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>tt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),ct=D((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(U(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),ut=D(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content)}:null}),(e=>[e.settings.__experimentalBlockPatterns])),dt=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=ht(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return ut(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!je(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),pt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=dt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return qe(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),mt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;const o=pt(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...pt.getDependants(e,t)])),ft=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||It(e,n)})))return z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return mt(e,o,n)}),((e,t)=>[...mt.getDependants(e,t)]));function gt(e,t){return e.blockListSettings[t]}function ht(e){return e.settings}function vt(e){return e.blocks.isPersistentChange}const bt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),kt=D(((e,t)=>{var n;const o=(0,u.find)(Et(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Et(e)]));function _t(e){return e.blocks.isIgnoredChange}function yt(e){return e.lastBlockAttributesChange}function Et(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:z}function Ct(e){return e.isNavigationMode}function St(e){return e.hasBlockMovingClientId}function wt(e){return!!e.automaticChangeStatus}function Bt(e,t){return e.highlightedBlock===t}function It(e,t){return!!e.blocks.controlledInnerBlocks[t]}const xt=D(((e,t)=>{if(!t.length)return null;const n=le(e);if(t.includes(V(e,n)))return n;const o=ve(e),r=ce(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Tt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Nt=window.wp.a11y,Pt=window.wp.richText,Mt=window.wp.deprecated,Rt=n.n(Mt);const Lt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(At(e))},At=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),s=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function Dt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Ot(e){return Rt()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Ft(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function zt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Vt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Ht=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Gt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Ut(){return{type:"START_MULTI_SELECT"}}function Wt(){return{type:"STOP_MULTI_SELECT"}}const $t=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,Nt.speak)((0,g.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
-
(0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function jt(){return{type:"CLEAR_SELECTED_BLOCK"}}function Kt(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function qt(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const Yt=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=(0,u.castArray)(e),t=qt((0,u.castArray)(t),i.getSettings());const a=i.getBlockRootClientId((0,u.first)(e));for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function Xt(e,t){return Yt(e,t)}const Zt=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},Qt=Zt("MOVE_BLOCKS_DOWN"),Jt=Zt("MOVE_BLOCKS_UP"),en=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function tn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return en([e],t,n,o)}function nn(e,t,n,o,r){return on([e],t,n,o,0,r)}const on=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;(0,u.isObject)(r)&&(l=r,r=0,Rt()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=qt((0,u.castArray)(e),s.getSettings());const c=[];for(const t of e)s.canInsertBlockType(t.name,n)&&c.push(t);c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function rn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function ln(){return{type:"HIDE_INSERTION_POINT"}}function sn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const an=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)},cn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,a]=i,c=o.getBlock(s),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(a),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:g,offset:h}=o.getSelectionStart(),v=(f===s?d:m).attributes[g],b=(f===s||f===a)&&void 0!==g&&void 0!==h&&!!v;v||("number"==typeof g?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof g):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===s?k:_,t=e.attributes[g],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=v,l=(0,Pt.insert)((0,Pt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),"",h,h);e.attributes[g]=(0,Pt.toHTMLString)({value:l,multilineTag:n,preserveWhiteSpace:r})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=E[e],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=d.attributes[e],i=(0,Pt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),s=i.text.indexOf(""),a=(0,Pt.remove)(i,s,s+1),p=(0,Pt.toHTMLString)({value:a,multilineTag:n,preserveWhiteSpace:r});E[e]=p,l.selectionChange(c.clientId,e,s,s)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},un=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=(0,u.castArray)(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function dn(e,t){return un([e],t)}function pn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function mn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function fn(){return{type:"START_TYPING"}}function gn(){return{type:"STOP_TYPING"}}function hn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function vn(){return{type:"STOP_DRAGGING_BLOCKS"}}function bn(){return{type:"ENTER_FORMATTED_TEXT"}}function kn(){return{type:"EXIT_FORMATTED_TEXT"}}function yn(e,t,n,o){return{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}}const En=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const s=(0,r.createBlock)(i,e);return l.insertBlock(s,n,t)};function Cn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Sn(e){return{type:"UPDATE_SETTINGS",settings:e}}function wn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Bn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function In(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const xn=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Tn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Nt.speak)((0,g.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Nt.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Nn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Nt.speak)((0,g.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},Pn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if((0,u.some)(i,(e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),c=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(c,a+1,s,t),c.length>1&&t&&l.multiSelect((0,u.first)(c).clientId,(0,u.last)(c).clientId),c.map((e=>e.clientId))}},Mn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},Rn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function Ln(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const An=e=>async t=>{let{dispatch:n}=t;n(Ln(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Ln(e,!1))};function Dn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const On="core/block-editor",Fn={reducer:M,selectors:e,actions:t},zn=(0,m.createReduxStore)(On,{...Fn,persist:["preferences"]});(0,m.registerStore)(On,{...Fn,persist:["preferences"]});const Vn={name:"",isSelected:!1},Hn=(0,s.createContext)(Vn),{Provider:Gn}=Hn;function Un(){return(0,s.useContext)(Hn)}function Wn(){const{isSelected:e,clientId:t,name:n}=Un();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(zn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function $n(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=Wn(),{clientId:o}=Un(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(zn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,s.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function jn(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=f[t].Slot,l=(0,p.__experimentalUseSlot)(r.__unstableName);return Boolean(l.fills&&l.fills.length)?"default"===t?(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const Kn=$n;Kn.Slot=jn;const qn=e=>(0,s.createElement)($n,i({group:"inline"},e));qn.Slot=e=>(0,s.createElement)(jn,i({group:"inline"},e));var Yn=Kn,Xn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),Zn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Qn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),Jn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),eo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),to=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),no=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),oo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),ro=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),lo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),io=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"})),so=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function ao(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const co=["color","border","typography","spacing"],uo={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0:e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>void 0===e.fontSizes?void 0:e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},po={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function mo(e){const{name:t}=Un();return(0,m.useSelect)((n=>{var o;if(co.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(zn).getSettings(),i=(e=>po[e]||e)(e),s=`__experimentalFeatures.${i}`,a=`__experimentalFeatures.blocks.${t}.${i}`,c=null!==(o=(0,u.get)(l,a))&&void 0!==o?o:(0,u.get)(l,s);var d,p;if(void 0!==c)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(d=null!==(p=c.custom)&&void 0!==p?p:c.theme)&&void 0!==d?d:c.default:c;const m=uo[i]?uo[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e])}const fo={left:no,center:oo,right:ro,"space-between":lo};var go=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:a}=e;const c=e=>{o(e===r?void 0:e)},u=r?fo[r]:fo.left,d=[{name:"left",icon:no,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:oo,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ro,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:lo,title:(0,g.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};function ho(e){return(0,s.createElement)(go,i({},e,{isToolbar:!1}))}function vo(e){return(0,s.createElement)(go,i({},e,{isToolbar:!0}))}const bo={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},ko={left:"flex-start",right:"flex-end",center:"center"},_o=["wrap","nowrap"];var yo={name:"flex",label:(0,g.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n}=e;const{allowOrientation:o=!0}=t;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Eo,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,o&&(0,s.createElement)(So,{layout:t,onChange:n}))),(0,s.createElement)(Co,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;return null!=o&&o.allowSwitching?null:(0,s.createElement)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Eo,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:r,style:l}=e;const{orientation:i="horizontal"}=r,a=null!==mo("spacing.blockGap"),c=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap, 0.5em )",u=bo[r.justifyContent]||bo.left,d=_o.includes(r.flexWrap)?r.flexWrap:"wrap",p=`\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tjustify-content: ${u};\n\t\t`,m=`\n\t\tflex-direction: column;\n\t\talign-items: ${ko[r.justifyContent]||ko.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${ao(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tgap: ${a?c:"0.5em"};\n\t\t\t\t\tflex-wrap: ${d};\n\t\t\t\t\t${"horizontal"===i?p:m}\n\t\t\t\t}\n\n\t\t\t\t${ao(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Eo(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l&&a.push("space-between"),o)return(0,s.createElement)(ho,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:no,label:(0,g.__)("Justify items left")},{value:"center",icon:oo,label:(0,g.__)("Justify items center")},{value:"right",icon:ro,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:lo,label:(0,g.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Co(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function So(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,g.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:io,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:so,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var wo=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})};const Bo=[{name:"default",label:(0,g.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,s.createElement)(wo,{icon:Qn})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(wo,{icon:eo}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t,n;let{selector:o,layout:r={},style:l}=e;const{contentSize:i,wideSize:a}=r,c=null!==mo("spacing.blockGap"),u=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap )";let d=i||a?`\n\t\t\t\t\t${ao(o,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\n\t\t\t\t\t${ao(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\n\t\t\t\t\t${ao(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return d+=`\n\t\t\t${ao(o,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-right: 2em;\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\n\t\t\t${ao(o,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-left: 2em;\n\t\t\t\tmargin-right: 0;\n\t\t\t}\n\n\t\t`,c&&(d+=`\n\t\t\t\t${ao(o,"> *")} {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t}\n\t\t\t\t${ao(o,"> * + *")} {\n\t\t\t\t\tmargin-top: ${u};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,d)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
5 |
o.none=(0,g.sprintf)((0,g.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
-
o.wide=(0,g.sprintf)((0,g.__)("Max %s wide"),n)),o}(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},yo];function Io(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Bo.find((t=>t.name===e))}const xo={type:"default"},To=(0,s.createContext)(xo),No=To.Provider;function Po(){return(0,s.useContext)(To)}function Mo(e){let{layout:t={},...n}=e;const o=Io(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const Ro=["none","left","center","right","wide","full"],Lo=["wide","full"];function Ao(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ro;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Po(),r=Io(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name)return[];const{alignments:i=Ro}=o,s=e.filter((e=>(o.alignments||t||!Lo.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Do={none:{icon:Xn,title:(0,g.__)("None")},left:{icon:Zn,title:(0,g.__)("Align left")},center:{icon:Qn,title:(0,g.__)("Align center")},right:{icon:Jn,title:(0,g.__)("Align right")},wide:{icon:eo,title:(0,g.__)("Wide width")},full:{icon:to,title:(0,g.__)("Full width")}},Oo={isAlternate:!0};var Fo=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=Ao(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Do[t],m=Do.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:Oo,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r||s.Platform.isNative?{isCollapsed:r?l:void 0,controls:a.map((e=>{let{name:n}=e;return{...Do[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Do[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(p.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,s.createElement)(f,i({},h,v))};function zo(e){return(0,s.createElement)(Fo,i({},e,{isToolbar:!1}))}function Vo(e){return(0,s.createElement)(Fo,i({},e,{isToolbar:!0}))}const Ho=["left","center","right","wide","full"],Go=["wide","full"];function Uo(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?Ho.filter((t=>e.includes(t))):!0===e?[...Ho]:[],!o||!0===e&&!n?(0,u.without)(t,...Go):t}const Wo=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Ao(Uo((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,s.createElement)(s.Fragment,null,!!o.length&&(0,s.createElement)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(zo,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,s.createElement)(e,t))}),"withToolbarControls"),$o=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Ao(Uo((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Ho,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",$o),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Wo),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Uo((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e})),window.wp.warning;var jo={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function Ko(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=Wn(),l=null===(t=jo[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const qo=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,qo),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Yo(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Xo(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:Yo(c.attributes,e,t)})}))})),c}function Zo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(zn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(zn),u=a(),d=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:qo(r.style)},t[n]=r})),r(n,t,!0)}),[qo,l,i,c,u,r]);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Qo(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(p.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function Jo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=jo[n])||void 0===t?void 0:t.Slot,a=(0,p.__experimentalUseSlot)(null==l?void 0:l.__unstableName);return l&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(Zo,{group:n,label:o},(0,s.createElement)(Qo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const er=Ko;er.Slot=Jo;const tr=e=>(0,s.createElement)(Ko,i({},e,{__experimentalGroup:"advanced"}));tr.Slot=e=>(0,s.createElement)(Jo,i({},e,{__experimentalGroup:"advanced"})),tr.slotName="InspectorAdvancedControls";var nr=er;const or=/[\s#]/g,rr=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(p.TextControl,{className:"html-anchor-control",label:(0,g.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,g.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("Add an anchor"),onChange:e=>{e=e.replace(or,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(nr,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(nr,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string",source:"attribute",attribute:"id",selector:"*"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",rr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const lr=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(nr,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",lr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const ir=[{name:"padding",generate:(e,t)=>function(e,t,n,o){const r=(0,u.get)(e,["spacing","padding"]);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const o=(0,u.get)(r,[n]);return o&&e.push({selector:t.selector,key:`padding${(0,u.upperFirst)(n)}`,value:o}),e}),[]);l.push(...e)}return l}(e,t,0,"padding")}];function sr(e,t){const n=[];return ir.forEach((o=>{n.push(...o.generate(e,t))})),n}var ar=window.wp.dom;const cr=(0,s.createContext)({});function ur(e){let{value:t,children:n}=e;const o=(0,s.useContext)(cr),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(cr.Provider,{value:r,children:n})}var dr=cr;const pr={};var mr=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(dr),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):pr),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(d,i({},e,{context:a}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function fr(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Gn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(mr,e))}var gr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),hr=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:gr,label:(0,g.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title)))))))))},vr=n(1973);function br(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,s.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,s.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,s.createElement)(s.RawHTML,null,(0,ar.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var kr=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,f=a,(0,vr.Kx)(m,f).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,f;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(br,{title:(0,g.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,g.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(br,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const _r=e=>(0,r.rawHandler)({HTML:e.originalContent});var yr=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(zn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(zn);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,_r(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,r.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:l,block:i}=e;const a=!!(0,r.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),m=(0,s.useCallback)((()=>u(!1)),[]),f=(0,s.useMemo)((()=>[{
|
8 |
// translators: Button to fix block content
|
9 |
title:(0,g._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,g.__)("Convert to HTML"),onClick:t},{title:(0,g.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(hr,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,g.__)("Attempt Block Recovery"))],secondaryActions:f},(0,g.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
|
10 |
-
(0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(kr,{block:i,onKeep:t,onConvert:n,convertor:_r,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const Er=(0,s.createElement)(hr,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var Cr=()=>Er;class Sr extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var wr=Sr,Br=n(773),Ir=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(zn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(zn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(Br.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const s=(0,r.getBlockAttributes)(e,n,l.attributes),a=n||(0,r.getSaveContent)(e,s),c=!n||(0,r.isValidBlockContent)(e,s,a);i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let xr=Ur();const Tr=e=>zr(e,xr);let Nr=Ur();Tr.write=e=>zr(e,Nr);let Pr=Ur();Tr.onStart=e=>zr(e,Pr);let Mr=Ur();Tr.onFrame=e=>zr(e,Mr);let Rr=Ur();Tr.onFinish=e=>zr(e,Rr);let Lr=[];Tr.setTimeout=(e,t)=>{let n=Tr.now()+t,o=()=>{let e=Lr.findIndex((e=>e.cancel==o));~e&&Lr.splice(e,1),$r.count-=~e?1:0},r={time:n,handler:e,cancel:o};return Lr.splice(Ar(n),0,r),$r.count+=1,Vr(),r};let Ar=e=>~(~Lr.findIndex((t=>t.time>e))||~Lr.length);Tr.cancel=e=>{xr.delete(e),Nr.delete(e)},Tr.sync=e=>{Fr=!0,Tr.batchedUpdates(e),Fr=!1},Tr.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Tr.onStart(n)}return o.handler=e,o.cancel=()=>{Pr.delete(n),t=null},o};let Dr="undefined"!=typeof window?window.requestAnimationFrame:()=>{};Tr.use=e=>Dr=e,Tr.now="undefined"!=typeof performance?()=>performance.now():Date.now,Tr.batchedUpdates=e=>e(),Tr.catch=console.error,Tr.frameLoop="always",Tr.advance=()=>{"demand"!==Tr.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Gr()};let Or=-1,Fr=!1;function zr(e,t){Fr?(t.delete(e),e(0)):(t.add(e),Vr())}function Vr(){Or<0&&(Or=0,"demand"!==Tr.frameLoop&&Dr(Hr))}function Hr(){~Or&&(Dr(Hr),Tr.batchedUpdates(Gr))}function Gr(){let e=Or;Or=Tr.now();let t=Ar(Or);t&&(Wr(Lr.splice(0,t),(e=>e.handler())),$r.count-=t),Pr.flush(),xr.flush(e?Math.min(64,Or-e):16.667),Mr.flush(),Nr.flush(),Rr.flush()}function Ur(){let e=new Set,t=e;return{add(n){$r.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>($r.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,$r.count-=t.size,Wr(t,(t=>t(n)&&e.add(t))),$r.count+=e.size,t=e)}}}function Wr(e,t){e.forEach((e=>{try{t(e)}catch(e){Tr.catch(e)}}))}const $r={count:0,clear(){Or=-1,Lr=[],Pr=Ur(),xr=Ur(),Mr=Ur(),Nr=Ur(),Rr=Ur(),$r.count=0}};var jr=n(9196),Kr=n.n(jr);function qr(){}const Yr={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Xr(e,t){if(Yr.arr(e)){if(!Yr.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const Zr=(e,t)=>e.forEach(t);function Qr(e,t,n){for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Jr=e=>Yr.und(e)?[]:Yr.arr(e)?e:[e];function el(e,t){if(e.size){const n=Array.from(e);e.clear(),Zr(n,t)}}const tl=(e,...t)=>el(e,(e=>e(...t)));let nl,ol,rl=null,ll=!1,il=qr;var sl=Object.freeze({__proto__:null,get createStringInterpolator(){return nl},get to(){return ol},get colors(){return rl},get skipAnimation(){return ll},get willAdvance(){return il},assign:e=>{e.to&&(ol=e.to),e.now&&(Tr.now=e.now),void 0!==e.colors&&(rl=e.colors),null!=e.skipAnimation&&(ll=e.skipAnimation),e.createStringInterpolator&&(nl=e.createStringInterpolator),e.requestAnimationFrame&&Tr.use(e.requestAnimationFrame),e.batchedUpdates&&(Tr.batchedUpdates=e.batchedUpdates),e.willAdvance&&(il=e.willAdvance),e.frameLoop&&(Tr.frameLoop=e.frameLoop)}});const al=new Set;let cl=[],ul=[],dl=0;const pl={get idle(){return!al.size&&!cl.length},start(e){dl>e.priority?(al.add(e),Tr.onStart(ml)):(fl(e),Tr(hl))},advance:hl,sort(e){if(dl)Tr.onFrame((()=>pl.sort(e)));else{const t=cl.indexOf(e);~t&&(cl.splice(t,1),gl(e))}},clear(){cl=[],al.clear()}};function ml(){al.forEach(fl),al.clear(),Tr(hl)}function fl(e){cl.includes(e)||gl(e)}function gl(e){cl.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(cl),0,e)}function hl(e){const t=ul;for(let n=0;n<cl.length;n++){const o=cl[n];dl=o.priority,o.idle||(il(o),o.advance(e),o.idle||t.push(o))}return dl=0,ul=cl,ul.length=0,cl=t,cl.length>0}const vl="[-+]?\\d*\\.?\\d+",bl=vl+"%";function kl(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const _l=new RegExp("rgb"+kl(vl,vl,vl)),yl=new RegExp("rgba"+kl(vl,vl,vl,vl)),El=new RegExp("hsl"+kl(vl,bl,bl)),Cl=new RegExp("hsla"+kl(vl,bl,bl,vl)),Sl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,wl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Bl=/^#([0-9a-fA-F]{6})$/,Il=/^#([0-9a-fA-F]{8})$/;function xl(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Tl(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=xl(r,o,e+1/3),i=xl(r,o,e),s=xl(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Nl(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Pl(e){return(parseFloat(e)%360+360)%360/360}function Ml(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Rl(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ll(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Bl.exec(e))?parseInt(t[1]+"ff",16)>>>0:rl&&void 0!==rl[e]?rl[e]:(t=_l.exec(e))?(Nl(t[1])<<24|Nl(t[2])<<16|Nl(t[3])<<8|255)>>>0:(t=yl.exec(e))?(Nl(t[1])<<24|Nl(t[2])<<16|Nl(t[3])<<8|Ml(t[4]))>>>0:(t=Sl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Il.exec(e))?parseInt(t[1],16)>>>0:(t=wl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=El.exec(e))?(255|Tl(Pl(t[1]),Rl(t[2]),Rl(t[3])))>>>0:(t=Cl.exec(e))?(Tl(Pl(t[1]),Rl(t[2]),Rl(t[3]))|Ml(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const Al=(e,t,n)=>{if(Yr.fun(e))return e;if(Yr.arr(e))return Al({range:e,output:t,extrapolate:n});if(Yr.str(e.output[0]))return nl(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,s,a){let c=a?a(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};function Dl(){return(Dl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const Ol=Symbol.for("FluidValue.get"),Fl=Symbol.for("FluidValue.observers"),zl=e=>Boolean(e&&e[Ol]),Vl=e=>e&&e[Ol]?e[Ol]():e,Hl=e=>e[Fl]||null;function Gl(e,t){let n=e[Fl];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Ul{constructor(e){if(this[Ol]=void 0,this[Fl]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Wl(this,e)}}const Wl=(e,t)=>Kl(e,Ol,t);function $l(e,t){if(e[Ol]){let n=e[Fl];n||Kl(e,Fl,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function jl(e,t){let n=e[Fl];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Fl]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Kl=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),ql=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Yl=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let Xl;const Zl=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Ql=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Jl=e=>{Xl||(Xl=rl?new RegExp(`(${Object.keys(rl).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Vl(e).replace(Yl,Ll).replace(Xl,Ll))),n=t.map((e=>e.match(ql).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>Al(Dl({},e,{output:t}))));return e=>{let n=0;return t[0].replace(ql,(()=>String(o[n++](e)))).replace(Zl,Ql)}},ei="react-spring: ",ti=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${ei}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},ni=ti(console.warn),oi=ti(console.warn);function ri(e){return Yr.str(e)&&("#"==e[0]||/\d/.test(e)||e in(rl||{}))}const li=e=>(0,jr.useEffect)(e,ii),ii=[];function si(){const e=(0,jr.useState)()[1],t=(0,jr.useState)(ai)[0];return li(t.unmount),()=>{t.current&&e({})}}function ai(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function ci(e){const t=(0,jr.useRef)();return(0,jr.useEffect)((()=>{t.current=e})),t.current}const ui="undefined"!=typeof window&&window.document&&window.document.createElement?jr.useLayoutEffect:jr.useEffect,di=Symbol.for("Animated:node"),pi=e=>e&&e[di],mi=(e,t)=>{return n=e,o=di,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},fi=e=>e&&e[di]&&e[di].getPayload();class gi{constructor(){this.payload=void 0,mi(this,this)}getPayload(){return this.payload||[]}}class hi extends gi{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,Yr.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new hi(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Yr.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,Yr.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class vi extends hi{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Al({output:[e,e]})}static create(e){return new vi(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Yr.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=Al({output:[this.getValue(),e]})),this._value=0,super.reset()}}const bi={dependencies:null};class ki extends gi{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Qr(this.source,((n,o)=>{var r;(r=n)&&r[di]===r?t[o]=n.getValue(e):zl(n)?t[o]=Vl(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Zr(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Qr(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){bi.dependencies&&zl(e)&&bi.dependencies.add(e);const t=fi(e);t&&Zr(t,(e=>this.add(e)))}}class _i extends ki{constructor(e){super(e)}static create(e){return new _i(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(yi)),!0)}}function yi(e){return(ri(e)?vi:hi).create(e)}function Ei(e){const t=pi(e);return t?t.constructor:Yr.arr(e)?_i:ri(e)?vi:hi}function Ci(){return(Ci=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const Si=(e,t)=>{const n=!Yr.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,jr.forwardRef)(((o,r)=>{const l=(0,jr.useRef)(null),i=n&&(0,jr.useCallback)((e=>{l.current=function(e,t){return e&&(Yr.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return bi.dependencies=n,e.style&&(e=Ci({},e,{style:t.createAnimatedStyle(e.style)})),e=new ki(e),bi.dependencies=null,[e,n]}(o,t),c=si(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new wi(u,a),p=(0,jr.useRef)();ui((()=>{const e=p.current;p.current=d,Zr(a,(e=>$l(e,d))),e&&(Zr(e.deps,(t=>jl(t,e))),Tr.cancel(e.update))})),(0,jr.useEffect)(u,[]),li((()=>()=>{const e=p.current;Zr(e.deps,(t=>jl(t,e)))}));const m=t.getComponentProps(s.getValue());return jr.createElement(e,Ci({},m,{ref:i}))}))};class wi{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Tr.write(this.update)}}const Bi=Symbol.for("AnimatedComponent"),Ii=e=>Yr.str(e)?e:e&&Yr.str(e.displayName)?e.displayName:Yr.fun(e)&&e.name||null;function xi(){return(xi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function Ti(e,...t){return Yr.fun(e)?e(...t):e}const Ni=(e,t)=>!0===e||!!(t&&e&&(Yr.fun(e)?e(t):Jr(e).includes(t))),Pi=(e,t)=>Yr.obj(e)?t&&e[t]:e,Mi=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ri=e=>e,Li=(e,t=Ri)=>{let n=Ai;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);Yr.und(n)||(o[r]=n)}return o},Ai=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Di={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Oi(e){const t=function(e){const t={};let n=0;if(Qr(e,((e,o)=>{Di[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Qr(e,((e,o)=>o in t||(n[o]=e))),n}return xi({},e)}function Fi(e){return e=Vl(e),Yr.arr(e)?e.map(Fi):ri(e)?sl.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function zi(e){for(const t in e)return!0;return!1}function Vi(e){return Yr.fun(e)||Yr.arr(e)&&Yr.obj(e[0])}function Hi(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Gi(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Ui=xi({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Wi{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,Ui)}}function $i(e,t){if(Yr.und(t.decay)){const n=!Yr.und(t.tension)||!Yr.und(t.friction);!n&&Yr.und(t.frequency)&&Yr.und(t.damping)&&Yr.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const ji=[];class Ki{constructor(){this.changed=!1,this.values=ji,this.toValues=null,this.fromValues=ji,this.to=void 0,this.from=void 0,this.config=new Wi,this.immediate=!1}}function qi(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Ni(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{Yr.und(n.pause)||(r.paused=Ni(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Ni(e,t)),c=Ti(n.delay||0,t),e?(r.resumeQueue.add(m),l.pause()):(l.resume(),m())}function p(){r.resumeQueue.add(m),r.timeouts.delete(u),u.cancel(),c=u.time-Tr.now()}function m(){c>0?(u=Tr.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(xi({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Yi=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Qi(e.get()):t.every((e=>e.noop))?Xi(e.get()):Zi(e.get(),t.every((e=>e.finished))),Xi=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Zi=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Qi=e=>({value:e,cancelled:!0,finished:!1});function Ji(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=Li(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&Qi(o)||r!==n.asyncId&&Zi(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new ts,i=new ns;return(async()=>{if(sl.skipAnimation)throw es(n),i.result=Zi(o,!1),d(i),i;m(l);const s=Yr.obj(e)?xi({},e):xi({},t,{to:e});s.parentId=r,Qr(c,((e,t)=>{Yr.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let g;if(sl.skipAnimation)return es(n),Zi(o,!1);try{let t;t=Yr.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),g=Zi(o.get(),!0,!1)}catch(e){if(e instanceof ts)g=e.result;else{if(!(e instanceof ns))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Yr.fun(i)&&Tr.batchedUpdates((()=>{i(g,o,o.item)})),g})():a}function es(e,t){el(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class ts extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class ns extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const os=e=>e instanceof ls;let rs=1;class ls extends Ul{constructor(...e){super(...e),this.id=rs++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=pi(this);return e&&e.getValue()}to(...e){return sl.to(this,e)}interpolate(...e){return ni(`${ei}The "interpolate" function is deprecated in v9 (use "to" instead)`),sl.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Gl(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||pl.sort(this),Gl(this,{type:"priority",parent:this,priority:e})}}const is=Symbol.for("SpringPhase"),ss=e=>(1&e[is])>0,as=e=>(2&e[is])>0,cs=e=>(4&e[is])>0,us=(e,t)=>t?e[is]|=3:e[is]&=-3,ds=(e,t)=>t?e[is]|=4:e[is]&=-5;class ps extends ls{constructor(e,t){if(super(),this.key=void 0,this.animation=new Ki,this.queue=void 0,this.defaultProps={},this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Yr.und(e)||!Yr.und(t)){const n=Yr.obj(e)?xi({},e):xi({},t,{from:e});Yr.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(as(this)||this._state.asyncTo)||cs(this)}get goal(){return Vl(this.animation.to)}get velocity(){const e=pi(this);return e instanceof hi?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return ss(this)}get isAnimating(){return as(this)}get isPaused(){return cs(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=fi(o.to);!i&&zl(o.to)&&(l=Jr(Vl(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==vi?1:i?i[a].lastPosition:l[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],l=null!=s.v0?s.v0:s.v0=Yr.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(Yr.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,a=r.clamp?0:r.bounce,p=!Yr.und(a),m=n==c?s.v0>0:n<c;let f,g=!1;const h=1,v=Math.ceil(e/h);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(g=d==c||d>c==m,g&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*h,d+=i*h}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=pi(this),a=s.getValue();if(t){const e=Vl(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return Tr.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(as(this)){const{to:e,config:t}=this.animation;Tr.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Yr.und(e)?(n=this.queue||[],this.queue=[]):n=[Yr.obj(e)?e:xi({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Yi(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),es(this._state,e&&this._lastCallId),Tr.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=Yr.obj(n)?n[t]:n,(null==n||Vi(n))&&(n=void 0),o=Yr.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return ss(this)||(e.reverse&&([n,o]=[o,n]),o=Vl(o),Yr.und(o)?pi(this)||this._set(n):this._set(o)),r}_update(e,t){let n=xi({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Li(n,((e,t)=>/^on/.test(t)?Pi(e,o):e))),ks(this,n,"onProps"),_s(this,"onProps",n,this);const l=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return qi(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{cs(this)||(ds(this,!0),tl(i.pauseQueue),_s(this,"onPause",Zi(this,ms(this,this.animation.to)),this))},resume:()=>{cs(this)&&(ds(this,!1),as(this)&&this._resume(),tl(i.resumeQueue),_s(this,"onResume",Zi(this,ms(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=fs(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Qi(this));const o=!Yr.und(e.to),r=!Yr.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Qi(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!Yr.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Xr(d,c);p&&(s.from=d),d=Vl(d);const m=!Xr(u,a);m&&this._focus(u);const f=Vi(t.to),{config:g}=s,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&($i(n=xi({},n),t),t=xi({},n,t)),$i(e,t),Object.assign(e,t);for(const t in Ui)null==e[t]&&(e[t]=Ui[t]);let{mass:o,frequency:r,damping:l}=e;Yr.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(g,Ti(t.config,l),t.config!==i.config?Ti(i.config,l):void 0);let b=pi(this);if(!b||Yr.und(u))return n(Zi(this,!0));const k=Yr.und(t.reset)?r&&!t.default:!Yr.und(d)&&Ni(t.reset,l),_=k?d:this.get(),y=Fi(u),E=Yr.num(y)||Yr.arr(y)||ri(y),C=!f&&(!E||Ni(i.immediate||t.immediate,l));if(m){const e=Ei(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}const S=b.constructor;let w=zl(u),B=!1;if(!w){const e=k||!ss(this)&&p;(m||e)&&(B=Xr(Fi(_),y),w=!B),(Xr(s.immediate,C)||C)&&Xr(g.decay,h)&&Xr(g.velocity,v)||(w=!0)}if(B&&as(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||zl(a))&&(s.values=b.getPayload(),s.toValues=zl(u)?null:S==vi?[1]:Jr(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Zr(bs,(e=>ks(this,t,e)));const o=Zi(this,ms(this,a));tl(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&Tr.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?Ti(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(Ji(t.to,t,this._state,this)):w?this._start():as(this)&&!m?this._pendingCalls.add(n):n(Xi(_))}_focus(e){const t=this.animation;e!==t.to&&(Hl(this)&&this._detach(),t.to=e,Hl(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;zl(t)&&($l(t,this),os(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;zl(e)&&jl(e,this)}_set(e,t=!0){const n=Vl(e);if(!Yr.und(n)){const e=pi(this);if(!e||!Xr(n,e.getValue())){const o=Ei(n);e&&e.constructor==o?e.setValue(n):mi(this,o.create(n)),e&&Tr.batchedUpdates((()=>{this._onChange(n,t)}))}}return pi(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,_s(this,"onStart",Zi(this,ms(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Ti(this.animation.onChange,e,this)),Ti(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;pi(this).reset(Vl(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),as(this)||(us(this,!0),cs(this)||this._resume())}_resume(){sl.skipAnimation?this.finish():pl.start(this)}_stop(e,t){if(as(this)){us(this,!1);const n=this.animation;Zr(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Gl(this,{type:"idle",parent:this});const o=t?Qi(this.get()):Zi(this.get(),ms(this,null!=e?e:n.to));tl(this._pendingCalls,o),n.changed&&(n.changed=!1,_s(this,"onRest",o,this))}}}function ms(e,t){const n=Fi(t);return Xr(Fi(e.get()),n)}function fs(e,t=e.loop,n=e.to){let o=Ti(t);if(o){const r=!0!==o&&Oi(o),l=(r||e).reverse,i=!r||r.reset;return gs(xi({},e,{loop:t,default:!1,pause:void 0,to:!l||Vi(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function gs(e){const{to:t,from:n}=e=Oi(e),o=new Set;return Yr.obj(t)&&vs(t,o),Yr.obj(n)&&vs(n,o),e.keys=o.size?Array.from(o):null,e}function hs(e){const t=gs(e);return Yr.und(t.default)&&(t.default=Li(t)),t}function vs(e,t){Qr(e,((e,n)=>null!=e&&t.add(n)))}const bs=["onStart","onRest","onChange","onPause","onResume"];function ks(e,t,n){e.animation[n]=t[n]!==Mi(t,n)?Pi(t[n],e.key):void 0}function _s(e,t,...n){var o,r,l,i;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(l=(i=e.defaultProps)[t])||l.call(i,...n)}const ys=["onStart","onChange","onRest"];let Es=1;class Cs{constructor(e,t){this.id=Es++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(xi({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];Yr.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(gs(e)),this}start(e){let{queue:t}=this;return e?t=Jr(e).map(gs):this.queue=[],this._flush?this._flush(this,t):(Ns(this,t),Ss(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Zr(Jr(t),(t=>n[t].stop(!!e)))}else es(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Yr.und(e))this.start({pause:!0});else{const t=this.springs;Zr(Jr(e),(e=>t[e].pause()))}return this}resume(e){if(Yr.und(e))this.start({pause:!1});else{const t=this.springs;Zr(Jr(e),(e=>t[e].resume()))}return this}each(e){Qr(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,el(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&el(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,el(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}Tr.onFrame(this._onFrame)}}function Ss(e,t){return Promise.all(t.map((t=>ws(e,t)))).then((t=>Yi(e,t)))}async function ws(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Yr.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Yr.arr(r)||Yr.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Zr(ys,(n=>{const o=t[n];if(Yr.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,tl(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===Mi(t,"cancel");(u||m&&d.asyncId)&&p.push(qi(++e._lastAsyncId,{props:t,state:d,actions:{pause:qr,resume:qr,start(t,n){m?(es(d,e._lastAsyncId),n(Qi(e))):(t.onRest=s,n(Ji(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Yi(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=fs(t,i,r);if(n)return Ns(e,[n]),ws(e,n,!0)}return a&&Tr.batchedUpdates((()=>a(f,e,e.item))),f}function Bs(e,t){const n=xi({},e.springs);return t&&Zr(Jr(t),(e=>{Yr.und(e.keys)&&(e=gs(e)),Yr.obj(e.to)||(e=xi({},e,{to:void 0})),Ts(n,e,(e=>xs(e)))})),Is(e,n),n}function Is(e,t){Qr(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,$l(t,e))}))}function xs(e,t){const n=new ps;return n.key=e,t&&$l(n,t),n}function Ts(e,t,n){t.keys&&Zr(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Ns(e,t){Zr(t,(t=>{Ts(e.springs,t,(t=>xs(t,e)))}))}const Ps=["children"],Ms=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,Ps);const o=(0,jr.useContext)(Rs),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,jr.useState)((()=>({inputs:t,result:e()}))),o=(0,jr.useRef)(),r=o.current;let l=r;return l?Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs))||(l={inputs:t,result:e()}):l=n,(0,jr.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Rs;return jr.createElement(i,{value:n},t)},Rs=(Ls=Ms,As={},Object.assign(Ls,jr.createContext(As)),Ls.Provider._context=Ls,Ls.Consumer._context=Ls,Ls);var Ls,As;Ms.Provider=Rs.Provider,Ms.Consumer=Rs.Consumer;const Ds=()=>{const e=[],t=function(t){oi(`${ei}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return Zr(e,((e,r)=>{if(Yr.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Zr(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Zr(e,(e=>e.resume(...arguments))),this},t.set=function(t){Zr(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Zr(e,((e,o)=>{if(Yr.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return Zr(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Zr(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Yr.fun(e)?e(n,t):e};return t._getProps=n,t};function Os(e,t,n){const o=Yr.fun(t)&&t;o&&!n&&(n=[]);const r=(0,jr.useMemo)((()=>o||3==arguments.length?Ds():void 0),[]),l=(0,jr.useRef)(0),i=si(),s=(0,jr.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Bs(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Ss(e,t):new Promise((o=>{Is(e,n),s.queue.push((()=>{o(Ss(e,t))})),i()}))}})),[]),a=(0,jr.useRef)([...s.ctrls]),c=[],u=ci(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new Cs(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=hs(n))}}(0,jr.useMemo)((()=>{Zr(a.current.slice(e,u),(e=>{Hi(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,jr.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Bs(e,c[t]))),m=(0,jr.useContext)(Ms),f=ci(m),g=m!==f&&zi(m);ui((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Zr(e,(e=>e()))),Zr(a.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(Gi(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),li((()=>()=>{Zr(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>xi({},e)));return r?[h,r]:h}let Fs;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Fs||(Fs={}));class zs extends ls{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Al(...t);const n=this._get(),o=Ei(n);mi(this,o.create(n))}advance(e){const t=this._get();Xr(t,this.get())||(pi(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Hs(this._active)&&Gs(this)}_get(){const e=Yr.arr(this.source)?this.source.map(Vl):Jr(Vl(this.source));return this.calc(...e)}_start(){this.idle&&!Hs(this._active)&&(this.idle=!1,Zr(fi(this),(e=>{e.done=!1})),sl.skipAnimation?(Tr.batchedUpdates((()=>this.advance())),Gs(this)):pl.start(this))}_attach(){let e=1;Zr(Jr(this.source),(t=>{zl(t)&&$l(t,this),os(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Zr(Jr(this.source),(e=>{zl(e)&&jl(e,this)})),this._active.clear(),Gs(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=Jr(this.source).reduce(((e,t)=>Math.max(e,(os(t)?t.priority:0)+1)),0))}}function Vs(e){return!1!==e.idle}function Hs(e){return!e.size||Array.from(e).every(Vs)}function Gs(e){e.idle||(e.idle=!0,Zr(fi(e),(e=>{e.done=!0})),Gl(e,{type:"idle",parent:e}))}sl.assign({createStringInterpolator:Jl,to:(e,t)=>new zs(e,t)}),pl.advance;var Us=window.ReactDOM;function Ws(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}const $s=["style","children","scrollTop","scrollLeft"],js=/^--/;function Ks(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||js.test(e)||Ys.hasOwnProperty(e)&&Ys[e]?(""+t).trim():t+"px"}const qs={};let Ys={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const Xs=["Webkit","Ms","Moz","O"];Ys=Object.keys(Ys).reduce(((e,t)=>(Xs.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Ys);const Zs=["x","y","z"],Qs=/^(matrix|translate|scale|rotate|skew)/,Js=/^(translate)/,ea=/^(rotate|skew)/,ta=(e,t)=>Yr.num(e)&&0!==e?e+t:e,na=(e,t)=>Yr.arr(e)?e.every((e=>na(e,t))):Yr.num(e)?e===t:parseFloat(e)===t;class oa extends ki{constructor(e){let{x:t,y:n,z:o}=e,r=Ws(e,Zs);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>ta(e,"px"))).join(",")})`,na(e,0)]))),Qr(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Qs.test(t)){if(delete r[t],Yr.und(e))return;const n=Js.test(t)?"px":ea.test(t)?"deg":"";l.push(Jr(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${ta(r,n)})`,na(r,0)]:e=>[`${t}(${e.map((e=>ta(e,n))).join(",")})`,na(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new ra(l,i)),super(r)}}class ra extends Ul{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Zr(this.inputs,((n,o)=>{const r=Vl(n[0]),[l,i]=this.transforms[o](Yr.arr(r)?r:n.map(Vl));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Zr(this.inputs,(e=>Zr(e,(e=>zl(e)&&$l(e,this)))))}observerRemoved(e){0==e&&Zr(this.inputs,(e=>Zr(e,(e=>zl(e)&&jl(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Gl(this,e)}}const la=["scrollTop","scrollLeft"];sl.assign({batchedUpdates:Us.unstable_batchedUpdates,createStringInterpolator:Jl,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});const ia=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new ki(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Ii(e)||"Anonymous";return(e=Yr.str(e)?l[e]||(l[e]=Si(e,r)):e[Bi]||(e[Bi]=Si(e,r))).displayName=`Animated(${t})`,e};return Qr(e,((t,n)=>{Yr.arr(e)&&(n=Ii(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:l,scrollTop:i,scrollLeft:s}=o,a=Ws(o,$s),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:qs[t]||(qs[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==l&&(e.textContent=l);for(let t in r)if(r.hasOwnProperty(t)){const n=Ks(t,r[t]);js.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new oa(e),getComponentProps:e=>Ws(e,la)}).animated,sa=e=>e+1,aa=e=>({top:e.offsetTop,left:e.offsetLeft});var ca=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(sa,0),[u,p]=(0,s.useReducer)(sa,0),[m,f]=(0,s.useState)({x:0,y:0}),g=(0,s.useMemo)((()=>l.current?aa(l.current):null),[r]),h=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,ar.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=aa(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=Yr.fun(e),[[o],r]=Os(1,n?e:[e],n?t||[]:t)}({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:a!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:v}),l};const ua=".block-editor-block-list__block",da=".block-list-appender";function pa(e,t){return t.closest([ua,da].join(","))===e}function ma(e,t){e.parentElement.closest("[contenteditable]").contentEditable=t}function fa(e){const{startMultiSelect:t,stopMultiSelect:n,multiSelect:o,selectBlock:r}=(0,m.useDispatch)(zn),{isSelectionEnabled:l,isBlockSelected:i,getBlockParents:s,getBlockSelectionStart:a,hasMultiSelection:c}=(0,m.useSelect)(zn);return(0,d.useRefEffect)((u=>{const{ownerDocument:d}=u,{defaultView:p}=d;let m,f;function g(t){let{isSelectionEnd:n}=t;const l=p.getSelection();if(!l.rangeCount||l.isCollapsed)return void ma(u,!1);const i=function(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(ua);return t?t.id.slice("block-".length):void 0}(l.focusNode);if(e===i){if(r(e),n&&(ma(u,!1),l.rangeCount)){const{commonAncestorContainer:e}=l.getRangeAt(0);m.contains(e)&&m.focus()}}else{const t=[...s(e),e],n=[...s(i),i],r=Math.min(t.length,n.length)-1;o(t[r],n[r])}}function h(){d.removeEventListener("selectionchange",g),p.removeEventListener("mouseup",h),f=p.requestAnimationFrame((()=>{g({isSelectionEnd:!0}),n()}))}function v(n){let{buttons:o}=n;1===o&&l()&&i(e)&&(m=d.activeElement,t(),d.addEventListener("selectionchange",g),p.addEventListener("mouseup",h),ma(u,!0))}function b(t){if(l()&&0===t.button)if(t.shiftKey){const n=a(),r=s(n);if(n&&n!==e&&(null==r||!r.includes(e))){const l=[...r,n],i=[...s(e),e],a=Math.min(l.length,i.length)-1,c=l[a],d=i[a];c!==d&&(ma(u,!0),o(c,d),t.preventDefault())}}else c()&&r(e)}return u.addEventListener("mousedown",b),u.addEventListener("mouseleave",v),()=>{u.removeEventListener("mousedown",b),u.removeEventListener("mouseleave",v),d.removeEventListener("selectionchange",g),p.removeEventListener("mouseup",h),p.cancelAnimationFrame(f)}}),[e,t,n,o,r,l,i,s])}function ga(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isMultiSelecting:o,isNavigationMode:r,isBlockSelected:l}=t(zn);if(l(e)&&!o()&&!r())return n()}),[e])}(e);return(0,s.useEffect)((()=>{if(null==n)return;if(!t.current)return;const{ownerDocument:e}=t.current;if(t.current.contains(e.activeElement))return;const o=ar.focus.tabbable.find(t.current).filter((e=>(0,ar.isTextField)(e))),r=-1===n,l=(r?u.last:u.first)(o)||t.current;pa(t.current,l)?(ma(t.current,!1),(0,ar.placeCaretAtHorizontalEdge)(l,r)):t.current.focus()}),[n]),t}function ha(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function va(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(zn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",ha),t.addEventListener("mouseover",ha),()=>{t.removeEventListener("mouseout",ha),t.removeEventListener("mouseover",ha),t.classList.remove("is-hovered")}}),[e])}function ba(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__experimentalGetActiveBlockIdByBlockNames:p}=t(zn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=a(),g=n(e),h=l(e),v=s(e),b=u(e,!0),k=p(m);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":g,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":h&&f&&d()})}),[e])}function ka(e){return(0,m.useSelect)((t=>{const n=t(zn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function _a(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(zn),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function ya(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(zn);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(s),l(e))}):void 0}),[e])}function Ea(e){const{isBlockSelected:t}=(0,m.useSelect)(zn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((r=>{function l(l){t(e)?l.target.isContentEditable||o(e):pa(r,l.target)&&n(e)}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Ca=window.wp.keycodes;function Sa(e){const t=(0,m.useSelect)((t=>t(zn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(zn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==Ca.ENTER&&s!==Ca.BACKSPACE&&s!==Ca.DELETE||a!==i||(0,ar.isTextField)(a)||(t.preventDefault(),s===Ca.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function wa(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(zn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}var Ba=n(5425),Ia=n.n(Ba);function xa(e){const t=(0,s.useRef)(),n=(0,m.useSelect)((t=>{const{isBlockSelected:n,getBlockSelectionEnd:o}=t(zn);return n(e)||o()===e}),[e]);return(0,s.useEffect)((()=>{if(!n)return;const e=t.current;if(!e)return;if(e.contains(e.ownerDocument.activeElement))return;const o=(0,ar.getScrollContainer)(e)||e.ownerDocument.defaultView;o&&Ia()(e,o,{onlyScrollIfNeeded:!0})}),[n]),t}const Ta=(0,s.createContext)({refs:new Map,callbacks:new Map});function Na(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(Ta.Provider,{value:n},t)}function Pa(e){const{refs:t,callbacks:n}=(0,s.useContext)(Ta),o=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,d.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function Ma(e){const{refs:t}=(0,s.useContext)(Ta),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function Ra(e){const{callbacks:t}=(0,s.useContext)(Ta),n=Ma(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function La(){const e=(0,s.useContext)(vm);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Aa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:l={},isAligned:i}=(0,s.useContext)(Da),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:h,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(zn),p=a(n),m=c(n)||u(n),f=l(n),g=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:null==g?void 0:g.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),_=(0,g.sprintf)((0,g.__)("Block: %s"),h),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,ga(n),xa(n),Pa(n),Ea(n),fa(n),Sa(n),wa(n),va(),La(),ca({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a})]),C=Un();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,ba(n),ka(n),_a(n),ya(n)),style:{...l.style,...e.style}}}Aa.save=r.__unstableGetBlockProps;const Da=(0,s.createContext)();function Oa(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Aa(o,{__unstableIsHtml:n}),t)}const Fa=(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(zn),d=a(n),p=r(n),m=s(o),f=c(n,o),g=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:g,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),za=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(zn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(zn),r=n(),{clientId:i}=t,s=r.length?r:[i];l(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(zn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(zn);if(e){const e=l(n);e&&s(n,e)}else{const e=r(n);e&&s(e,n)}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}}));var Va=(0,d.compose)(d.pure,Fa,za,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{mode:n,isLocked:o,canRemove:l,clientId:i,isSelected:a,isSelectionEnabled:d,className:p,name:f,isValid:g,attributes:h,wrapperProps:v,setAttributes:b,onReplace:k,onInsertBlocksAfter:_,onMerge:y,toggleSelection:E}=e;const C=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return t().supportsLayout}),[]),{removeBlock:S}=(0,m.useDispatch)(zn),w=(0,s.useCallback)((()=>S(i)),[i]);let B=(0,s.createElement)(fr,{name:f,isSelected:a,attributes:h,setAttributes:b,insertBlocksAfter:o?void 0:_,onReplace:l?k:void 0,onRemove:l?w:void 0,mergeBlocks:l?y:void 0,clientId:i,isSelectionEnabled:d,toggleSelection:E});const I=(0,r.getBlockType)(f);null!=I&&I.getEditWrapperProps&&(v=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(v,I.getEditWrapperProps(h)));const x=v&&!!v["data-align"]&&!C;let T;if(x&&(B=(0,s.createElement)("div",{className:"wp-block","data-align":v["data-align"]},B)),g)T="html"===n?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},B),(0,s.createElement)(Oa,{isHtml:!0},(0,s.createElement)(Ir,{clientId:i}))):(null==I?void 0:I.apiVersion)>1?B:(0,s.createElement)(Oa,v,B);else{const e=(0,r.getSaveContent)(I,h);T=(0,s.createElement)(Oa,{className:"has-warning"},(0,s.createElement)(yr,{clientId:i}),(0,s.createElement)(s.RawHTML,null,(0,ar.safeHTML)(e)))}const N={clientId:i,className:null!==(t=v)&&void 0!==t&&t["data-align"]&&C?c()(p,`align${v["data-align"]}`):p,wrapperProps:(0,u.omit)(v,["data-align"]),isAligned:x},P=(0,s.useMemo)((()=>N),Object.values(N));return(0,s.createElement)(Da.Provider,{value:P},(0,s.createElement)(wr,{fallback:(0,s.createElement)(Oa,{className:"has-warning"},(0,s.createElement)(Cr,null))},T))})),Ha=window.wp.htmlEntities,Ga=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Ua=[(0,s.createInterpolateElement)((0,g.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,g.__)("Drag files into the editor to automatically insert media blocks."),(0,g.__)("Change a block's type by pressing the block icon on the toolbar.")];var Wa=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Ua.length));return(0,s.createElement)(p.Tip,null,Ua[e])},$a=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),ja=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:$a});const l=(0,s.createElement)(p.Icon,{icon:n&&n.src?n.src:n}),i=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,s.createElement)("span",{style:i,className:c()("block-editor-block-icon",r,{"has-colors":o})},l)})),Ka=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(Rt()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(ja,{icon:n,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-block-card__content"},(0,s.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,s.createElement)("span",{className:"block-editor-block-card__description"},o)))};function qa(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(zn),{getBlockName:h,getBlocks:v}=a.select(zn),b=(0,m.useSelect)((e=>!t||e(zn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(g(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,s.useRef)(i),C=(0,s.useRef)(l);(0,s.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,s.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(zn);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(t))return;if(t&&!i(t))return;const a=r(),d=v(t),p=d!==s;if(s=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,k.current.outgoing.push(s),(c?C.current:E.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}var Ya=(0,d.createHigherOrderComponent)((e=>(0,m.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,s.createElement)(e,i({registry:o},r));const[l,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,m.createRegistry)({},o);e.registerStore(On,Fn),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(zn);return(0,s.useEffect)((()=>{o(n)}),[n]),qa(e),(0,s.createElement)(Na,null,t)}));function Xa(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(p.Disabled,null,(0,s.createElement)(km,null)))}function Za(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(zn),{clearSelectedBlock:n}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function Qa(e){return(0,s.createElement)("div",i({ref:Za()},e))}function Ja(e,t){const n="start"===t?"firstChild":"lastChild",o="start"===t?"nextSibling":"previousSibling";for(;e[n];)for(e=e[n];e.nodeType===e.TEXT_NODE&&/^[ \t\n]*$/.test(e.data)&&e[o];)e=e[o];return e}function ec(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l}=e(zn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l()}}function tc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r}=(0,m.useSelect)(ec,[]),l=Ma(r),i=Ma((0,u.first)(n)),s=Ma((0,u.last)(n));return(0,d.useRefEffect)((a=>{const{ownerDocument:c}=a,{defaultView:u}=c;if(null==e)return;if(!o||t){if(!r||t)return;const e=u.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=l.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:d}=n;if(d<2)return;if(!i.current||!s.current)return;a.contentEditable=!0,a.focus();const p=u.getSelection(),m=c.createRange(),f=Ja(i.current,"start"),g=Ja(s.current,"end");m.setStartBefore(f),m.setEndAfter(g),p.removeAllRanges(),p.addRange(m)}),[o,t,n,r,e])}function nc(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}function oc(e,t,n,o){let r,l=ar.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!ar.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function rc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksStartClientId:t,getMultiSelectedBlocksEndClientId:n,getPreviousBlockClientId:o,getNextBlockClientId:r,getFirstMultiSelectedBlockClientId:l,getLastMultiSelectedBlockClientId:i,getSettings:s,hasMultiSelection:a}=(0,m.useSelect)(zn),{multiSelect:c,selectBlock:u}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((d=>{let p;function m(){p=null}function f(l){const i=e(),s=t(),a=n(),d=o(a||i),p=r(a||i),m=l?d:p;m&&(s===m?u(m):c(s||i,m))}function g(e){const t=l(),n=i(),o=e?t:n;o&&u(o)}function h(t){const{keyCode:l,target:i}=t,c=l===Ca.UP,u=l===Ca.DOWN,m=l===Ca.LEFT,h=l===Ca.RIGHT,v=c||m,b=m||h,k=c||u,_=b||k,y=t.shiftKey,E=y||t.ctrlKey||t.altKey||t.metaKey,C=k?ar.isVerticalEdge:ar.isHorizontalEdge,{ownerDocument:S}=d,{defaultView:w}=S;if(a())return void(_&&((y?f:g)(v),t.preventDefault()));if(k?p||(p=(0,ar.computeCaretRect)(w)):p=null,t.defaultPrevented)return;if(!_)return;if(!function(e,t,n){if((t===Ca.UP||t===Ca.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(i,l,E))return;const B=(0,ar.isRTL)(i)?!v:v,{keepCaretInsideBlock:I}=s(),x=e();if(y){const e=n(),l=o(e||x),s=r(e||x);(v&&l||!v&&s)&&function(e,t){const n=oc(e,t,d);return!n||!function(e,t){return e.closest(ua)===t.closest(ua)}(e,n)}(i,v)&&C(i,v)&&(f(v),t.preventDefault())}else if(k&&(0,ar.isVerticalEdge)(i,v)&&!I){const e=oc(i,v,d,!0);e&&((0,ar.placeCaretAtVerticalEdge)(e,v,p),t.preventDefault())}else if(b&&w.getSelection().isCollapsed&&(0,ar.isHorizontalEdge)(i,B)&&!I){const e=oc(i,B,d);(0,ar.placeCaretAtHorizontalEdge)(e,v),t.preventDefault()}}return d.addEventListener("mousedown",m),d.addEventListener("keydown",h),()=>{d.removeEventListener("mousedown",m),d.removeEventListener("keydown",h)}}),[])}var lc=window.wp.keyboardShortcuts;function ic(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(zn),{multiSelect:o}=(0,m.useDispatch)(zn),r=(0,lc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,ar.isEntirelySelected)(l.target))return;const[s]=i,a=n(s);let c=e(a);i.length===c.length&&(c=e(n(a)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function sc(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,m.useSelect)(zn),{setNavigationMode:a}=(0,m.useDispatch)(zn),c=(0,m.useSelect)((e=>e(zn).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function p(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";ar.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),g=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===Ca.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==Ca.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(nc(e.target)&&nc(ar.focus.tabbable[i](e.target)))return;const c=o?t:n;u.current=!0,c.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==Ca.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=ar.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,h]),g]}(),o=(0,m.useSelect)((e=>e(zn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,tc(),ic(),rc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var ac=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=sc();return(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)}));const cc="editor-styles-wrapper";function uc(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var dc=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,...u}=e;const[,m]=(0,s.useReducer)((()=>({}))),[f,h]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=uc(null==a?void 0:a.styles),_=uc(null==a?void 0:a.scripts),y=Za(),[E,C,S]=sc(),w=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),h(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}t()||e.addEventListener("load",(()=>{t()}))}),[]),B=(0,d.useRefEffect)((e=>{_.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{m()}))}),[]),I=(0,d.useMergeRefs)([n,y,C]);return(0,s.useEffect)((()=>{var e;f&&(e=f,Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${cc}`)||t.includes(".wp-block"))}))&&!e.getElementById(n.id)){e.head.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.head.appendChild(o.cloneNode(!0))}})))}),[f]),r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,title:(0,g.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(cc,...v)},(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),pc={grad:.9,turn:360,rad:360/(2*Math.PI)},mc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},fc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},gc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},hc=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},vc=function(e){return{r:gc(e.r,0,255),g:gc(e.g,0,255),b:gc(e.b,0,255),a:gc(e.a)}},bc=function(e){return{r:fc(e.r),g:fc(e.g),b:fc(e.b),a:fc(e.a,3)}},kc=/^#([0-9a-f]{3,8})$/i,_c=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},yc=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),s=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:l?i/l*100:0,v:l/255*100,a:r}},Ec=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,i,i,a,o][c],g:255*[a,o,o,s,i,i][c],b:255*[i,i,a,o,o,s][c],a:r}},Cc=function(e){return{h:hc(e.h),s:gc(e.s,0,100),l:gc(e.l,0,100),a:gc(e.a)}},Sc=function(e){return{h:fc(e.h),s:fc(e.s),l:fc(e.l),a:fc(e.a,3)}},wc=function(e){return Ec((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},Bc=function(e){return{h:(t=yc(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},Ic=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,xc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Tc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Pc={string:[[function(e){var t=kc.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?fc(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?fc(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Tc.exec(e)||Nc.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:vc({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Ic.exec(e)||xc.exec(e);if(!t)return null;var n,o,r=Cc({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(pc[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return wc(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return mc(t)&&mc(n)&&mc(o)?vc({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!mc(t)||!mc(n)||!mc(o))return null;var i=Cc({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return wc(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!mc(t)||!mc(n)||!mc(o))return null;var i=function(e){return{h:hc(e.h),s:gc(e.s,0,100),v:gc(e.v,0,100),a:gc(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Ec(i)},"hsv"]]},Mc=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},Rc=function(e,t){var n=Bc(e);return{h:n.h,s:gc(n.s+100*t,0,100),l:n.l,a:n.a}},Lc=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Ac=function(e,t){var n=Bc(e);return{h:n.h,s:n.s,l:gc(n.l+100*t,0,100),a:n.a}},Dc=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Mc(e.trim(),Pc.string):"object"==typeof e&&null!==e?Mc(e,Pc.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return fc(Lc(this.rgba),2)},e.prototype.isDark=function(){return Lc(this.rgba)<.5},e.prototype.isLight=function(){return Lc(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=bc(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?_c(fc(255*r)):"","#"+_c(t)+_c(n)+_c(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return bc(this.rgba)},e.prototype.toRgbString=function(){return t=(e=bc(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return Sc(Bc(this.rgba))},e.prototype.toHslString=function(){return t=(e=Sc(Bc(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=yc(this.rgba),{h:fc(e.h),s:fc(e.s),v:fc(e.v),a:fc(e.a,3)};var e},e.prototype.invert=function(){return Oc({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),Oc(Rc(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Oc(Rc(this.rgba,-e))},e.prototype.grayscale=function(){return Oc(Rc(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Oc(Ac(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Oc(Ac(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?Oc({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):fc(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Bc(this.rgba);return"number"==typeof e?Oc({h:e,s:t.s,l:t.l,a:t.a}):fc(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Oc(e).toHex()},e}(),Oc=function(e){return e instanceof Dc?e:new Dc(e)},Fc=[],zc=function(e){e.forEach((function(e){Fc.indexOf(e)<0&&(e(Dc,Pc),Fc.push(e))}))};function Vc(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var Hc=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Gc=function(e){return.2126*Hc(e.r)+.7152*Hc(e.g)+.0722*Hc(e.b)};function Uc(e){e.prototype.luminance=function(){return e=Gc(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,l,i,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(s=Gc(l))>(a=Gc(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var Wc=n(3124),$c=n.n(Wc);const jc=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Kc(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),f(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function h(){const e=p(/^([^{]+)/);if(e)return qc(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=qc(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(jc,""),value:n?qc(n[0]).replace(jc,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(e));return u()?e:a("missing '}'")}function k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return a("@keyframes missing name");const o=t[1];if(!c())return a("@keyframes missing '{'");let r,i=f();for(;r=k();)i.push(r),i=i.concat(f());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=qc(t[1]);if(!c())return a("@media missing '{'");const o=f().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:qc(t[1]),media:qc(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=qc(t[1]);if(!c())return a("@supports missing '{'");const o=f().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=qc(t[1]),o=qc(t[2]);if(!c())return a("@document missing '{'");const r=f().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=h()||[];if(!c())return a("@page missing '{'");let n,o=f();for(;n=v();)o.push(n),o=o.concat(f());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Yc(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function qc(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Yc(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){Yc(e,o)})):n&&"object"==typeof n&&Yc(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Xc=n(8575),Zc=n.n(Xc),Qc=Jc;function Jc(e){this.options=e||{}}Jc.prototype.emit=function(e){return e},Jc.prototype.visit=function(e){return this[e.type](e)},Jc.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};var eu=tu;function tu(e){Qc.call(this,e)}Zc()(tu,Qc),tu.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},tu.prototype.comment=function(e){return this.emit("",e.position)},tu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},tu.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},tu.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},tu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},tu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},tu.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},tu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},tu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},tu.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},tu.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},tu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},tu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},tu.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},tu.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var nu=ou;function ou(e){e=e||{},Qc.call(this,e),this.indentation=e.indent}Zc()(ou,Qc),ou.prototype.compile=function(e){return this.stylesheet(e)},ou.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},ou.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},ou.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},ou.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ou.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ou.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},ou.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},ou.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ou.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},ou.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},ou.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},ou.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},ou.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ou.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},ou.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},ou.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},ou.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var ru=function(e,t){try{const r=Kc(e);return n=$c().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new eu(o):new nu(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function lu(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function iu(e,t){return new URL(e,t).toString()}var su=e=>t=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};lu(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+iu(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t};const au=/^(body|html|:root).*$/;var cu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(au)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},uu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(cu(t)),o&&r.push(su(o)),r.length?ru(n,(0,d.compose)(r)):n}))};const du=".editor-styles-wrapper";function pu(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(du);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=Oc(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function mu(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>uu(t,du)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:pu(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let fu;zc([Vc,Uc]);const gu=2e3;var hu=function(e){let{viewportWidth:t,__experimentalPadding:n}=e;const[o,{width:r}]=(0,d.useResizeObserver)(),[l,{height:i}]=(0,d.useResizeObserver)(),{styles:a,assets:c}=(0,m.useSelect)((e=>{const t=e(zn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),u=(0,s.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:a),[a]);fu=fu||(0,d.pure)(km);const f=r/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},o,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${f})`,height:i*f,maxHeight:i>gu?gu*f:void 0}},(0,s.createElement)(dc,{head:(0,s.createElement)(mu,{styles:u}),assets:c,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:gu}},l,(0,s.createElement)(fu,{renderAppender:!1}))))},vu=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l}=e;const i=(0,m.useSelect)((e=>e(zn).getSettings()),[]),a=(0,s.useMemo)((()=>{const e={...i};return e.__experimentalBlockPatterns=[],e}),[i]),c=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(Ya,{value:c,settings:a},r?(0,s.createElement)(Xa,{onClick:l}):(0,s.createElement)(hu,{viewportWidth:o,__experimentalPadding:n})):null}));function bu(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(zn).getSettings()),[]),l=(0,d.__experimentalUseDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,s.createElement)(Ya,{value:p,settings:a},(0,s.createElement)(ym,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?f:null}}var ku=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:a,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(vu,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,g.__)("No Preview Available."))),!p&&(0,s.createElement)(Ka,{title:i,icon:a,description:c}))},_u=(0,s.createContext)(),yu=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(_u);return(0,s.createElement)(p.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,r):"function"==typeof r?r(t):(0,s.createElement)(p.Button,t,r)}))})),Eu=(0,s.createElement)(O.SVG,{width:"18",height:"18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18"},(0,s.createElement)(O.Path,{d:"M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z"}));function Cu(e){let{count:t,icon:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip"},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(p.FlexItem,null,n?(0,s.createElement)(ja,{icon:n}):(0,g.sprintf)(
|
11 |
/* translators: %d: Number of blocks. */
|
12 |
-
(0,g._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(ja,{icon:Eu})))))}var Su=e=>{let{isEnabled:t,blocks:n,icon:o,children:r}=e;const l={type:"inserter",blocks:n};return(0,s.createElement)(p.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,__experimentalDragComponent:(0,s.createElement)(Cu,{count:n.length,icon:o})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};function wu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var Bu=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:a,isDraggable:u,...d}=e;const p=(0,s.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},f=(0,s.useMemo)((()=>[(0,r.createBlock)(o.name,o.initialAttributes,(0,r.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,s.createElement)(Su,{isEnabled:u&&!o.disabled,blocks:f,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:f}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{p.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{p.current=!1,f&&f(e)}},(0,s.createElement)(yu,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,wu()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Ca.ENTER&&(e.preventDefault(),l(o,wu()?e.metaKey:e.ctrlKey),a(null))},onFocus:()=>{p.current||a(o)},onMouseEnter:()=>{p.current||a(o)},onMouseLeave:()=>a(null),onBlur:()=>a(null)},d),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:m},(0,s.createElement)(ja,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))})),
|
13 |
/* translators: %s: block pattern title. */
|
14 |
(0,g.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function Fu(e){let{isDraggable:t,pattern:n,onClick:o,composite:r}=e;const{blocks:l,viewportWidth:a}=n,c=`block-editor-block-patterns-list__item-description-${(0,d.useInstanceId)(Fu)}`;return(0,s.createElement)(Su,{isEnabled:t,blocks:l},(e=>{let{draggable:t,onDragStart:u,onDragEnd:d}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__list-item","aria-label":n.title,"aria-describedby":n.description?c:void 0,draggable:t,onDragStart:u,onDragEnd:d},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},r,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,l)}),(0,s.createElement)(vu,{blocks:l,viewportWidth:a}),(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,s.createElement)(p.VisuallyHidden,{id:c},n.description)))}))}function zu(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Vu=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,g.__)("Block Patterns")}=e;const c=(0,p.__unstableUseCompositeState)({orientation:l});return(0,s.createElement)(p.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,s.createElement)(Fu,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(zu,{key:e.name}))))};function Hu(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,s.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,s.createElement)(p.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function Gu(e){let{filterValue:t,setFilterValue:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,s.createElement)(p.SearchControl,{onChange:n,value:t,label:(0,g.__)("Search for patterns"),placeholder:(0,g.__)("Search")}))}var Uu=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,s.createElement)(Gu,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(Hu,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},Wu=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(wo,{className:"block-editor-inserter__no-results-icon",icon:$a}),(0,s.createElement)("p",null,(0,g.__)("No results found.")))},$u=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(zn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(zn),c=r();let u,d=t;return void 0!==n?u=n:o?u=s(o):!l&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,l]),{replaceBlocks:f,insertBlocks:h,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(zn),k=(0,s.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!l&&o&&(0,r.isUnmodifiedDefaultBlock)(o)?f(o.clientId,e,null,a||n?0:null,t):h(e,p,d,!0,a||n?0:null,t);const s=(0,g.sprintf)(// translators: %d: the name of the block that has been added
|
15 |
-
(0,g._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,
|
16 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
17 |
-
(0,g._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var ld=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(
|
18 |
/* translators: %d: number of results. */
|
19 |
-
(0,g._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),f=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&(0,s.createElement)(rd,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(Mu,null,!f&&(0,s.createElement)(Wu,null),f&&(0,s.createElement)(Vu,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function id(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,s.useState)(""),[l,i]=(0,s.useState)(null==t?void 0:t.name);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,s.createElement)(Uu,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(ld,{filterValue:o,selectedCategory:l,patternCategories:n}))}var sd=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,g.__)("Patterns"),closeLabel:(0,g.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(id,n))};function ad(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=Ou(n,t),a=(0,s.useCallback)((e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=r.reduce(((e,t,n)=>{let{name:o}=t;return e[o]=n,e}),{});return Math.min(...e.categories.map((e=>void 0!==n[e]?n[e]:1/0)))}),[r]),c=(0,s.useMemo)((()=>l.filter((e=>{var t;return"uncategorized"===o.name?a(e)===1/0:null===(t=e.categories)||void 0===t?void 0:t.includes(o.name)}))),[l,o]),u=(0,s.useMemo)((()=>c.sort(((e,t)=>a(e)-a(t)))),[c,a]),p=(0,d.useAsyncList)(u);return c.length?(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},(0,s.createElement)(Vu,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var cd=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=Ou(),u=(0,s.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>c.some((t=>t.name===e))))),[c]),d=(0,s.useMemo)((()=>{const e=c.filter((e=>a.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:o}=t;return[n,o].includes("featured")?"featured"===n?-1:1:0}));return a.some((e=>!u(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,g._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Au,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(ad,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(sd,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},ud=window.wp.url;function dd(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=
|
20 |
/* translators: %d: number of results. */
|
21 |
-
(0,g._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const
|
22 |
/* translators: Blocks tab title in the block inserter. */
|
23 |
title:(0,g.__)("Blocks")},kd={name:"patterns",
|
24 |
/* translators: Patterns tab title in the block inserter. */
|
25 |
title:(0,g.__)("Patterns")},_d={name:"reusable",
|
26 |
/* translators: Reusable blocks tab title in the block inserter. */
|
27 |
-
title:(0,g.__)("Reusable")};var yd=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[bd];return n&&e.push(kd),o&&e.push(_d),e}),[bd,n,kd,o,_d]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},Ed=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:c,__experimentalFilterValue:u="",shouldFocusBlock:d=!0}=e;const[f,h]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=$u({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:S,hasReusableBlocks:w}=(0,m.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(zn);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[y]),B=(0,s.useCallback)(((e,t,n)=>{E(e,t,n),i()}),[E,i]),
|
28 |
(0,g._x)("Add %s","directly add the only allowed block"),l):(0,g._x)("Add block","Generic label for block inserter button");const{onClick:u,...d}=c;return(0,s.createElement)(p.Button,i({icon:Ga,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),u&&u(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&r,disabled:o},d))};class wd extends s.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:o,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,hasItems:a,renderToggle:c=Sd}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i}=this.props;return i?(0,s.createElement)(Cd,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r}):(0,s.createElement)(Ed,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,s.createElement)(p.Dropdown,{className:"block-editor-inserter",contentClassName:c()("block-editor-inserter__popover",{"is-quick":r}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,g.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var Bd=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:s,__experimentalGetDirectInsertBlock:a}=e(zn),{getBlockVariations:c}=e(r.store);o=o||l(n)||void 0;const d=s(o),p=a(o),m=1===(0,u.size)(d)&&0===(0,u.size)(c(d[0].name,"inserter"));let f=!1;return m&&(f=d[0]),{hasItems:i(o),hasSingleBlockType:m,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:p,rootClientId:o}})),(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:l,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u}=t;if(!s&&!c)return;const{insertBlock:d}=e(zn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(zn);if(!e||!l&&!n)return{};const i={};let s={};if(l){const e=t(l),n=t(r(l));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(s=(null==n?void 0:n.attributes)||{})}else{var a;const e=t(n);if(null!=e&&null!==(a=e.innerBlocks)&&void 0!==a&&a.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(s=t.attributes)}}return e.forEach((e=>{s.hasOwnProperty(e)&&(i[e]=s[e])})),i}(c.attributesToCopy);p=(0,r.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,r.createBlock)(a.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:r,getBlockRootClientId:s}=o(zn);if(l)return e(l);const a=t();return!i&&a&&s(a)===n?e(a)+1:r(n).length}(),n),u&&u();const m=(0,g.sprintf)(// translators: %s: the name of the block that has been added
|
29 |
-
(0,g.__)("%s block added"),a.title);(0,
|
30 |
-
(0,g._x)("Add %s","directly add the only allowed block"),d):(0,g._x)("Add block","Generic label for block inserter button");const f=!m;let h=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(wo,{icon:Ga}));return(f||m)&&(h=(0,s.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const Td=(0,s.forwardRef)(((e,t)=>(Rt()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),xd(e,t))));var Nd=(0,s.forwardRef)(xd),Pd=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(zn);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:a,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,s.createElement)(l,null);else{if(a!==n&&(n||a))return null;t=o?(0,s.createElement)(Id,{rootClientId:n}):(0,s.createElement)(Nd,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),"data-block":!0},t)}));function Md(e){return(0,d.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])}const Rd=(0,s.createContext)();function Ld(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(zn),l=(0,s.useContext)(Rd),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:h,isInserterShown:v}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(zn),a=r(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;l(u);)u=i(u);for(;l(d);)d=s(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(a.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:a.rootClientId,isInserterShown:null==a?void 0:a.__unstableWithInserter}}),[]),b=Ra(u),k=Ra(f),_="vertical"===a,y=(0,s.useMemo)((()=>{if(!b&&!k)return{};const e=b?b.getBoundingClientRect():null,t=k?k.getBoundingClientRect():null;if(_)return{width:b?b.offsetWidth:k.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:b?b.offsetHeight:k.offsetHeight}}),[b,k]),E=(0,s.useCallback)((()=>{if(!b&&!k)return{};const{ownerDocument:e}=b||k,t=b?b.getBoundingClientRect():null,n=k?k.getBoundingClientRect():null;return _?(0,g.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,ownerDocument:e}:(0,g.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,ownerDocument:e}}),[b,k]),C=Md(n),S=(0,d.useReducedMotion)(),w=c()("block-editor-block-list__insertion-point","is-"+a),B=b&&k&&v,I={start:{..._?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:B?.4:0}},hover:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},x={start:{scale:S?1:0},rest:{scale:1,transition:{delay:.2}}};return(0,s.createElement)(p.Popover,{ref:C,noArrow:!0,animate:!1,getAnchorRect:E,focusOnMount:!1,className:"block-editor-block-list__insertion-point-popover",__unstableSlotName:t||null,key:f+"--"+h},(0,s.createElement)(p.__unstableMotion.div,{layout:!S,initial:S?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&f&&o(f,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(w,{"is-with-inserter":B}),onHoverEnd:function(e){e.target!==i.current||l.current||r()},style:y},(0,s.createElement)(p.__unstableMotion.div,{variants:I,className:"block-editor-block-list__insertion-point-indicator"}),B&&(0,s.createElement)(p.__unstableMotion.div,{variants:x,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Bd,{position:"bottom center",clientId:f,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Ad(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(zn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(Rd.Provider,{value:(0,s.useRef)(!1)},r&&(0,s.createElement)(Ld,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function Dd(){const e=(0,s.useContext)(Rd),t=(0,m.useSelect)((e=>e(zn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(zn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o,s;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(t.target.classList.contains("is-root-container")||(d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(s=v.parentElement)||void 0===s?void 0:s.closest(".block-editor-block-content-overlay.overlay-active"))return;const b=v.id.slice("block-".length);if(!b)return;if(a().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientY<k.top)||"vertical"===m&&(t.clientX>k.right||t.clientX<k.left))return void(l()&&p());const _=r(b);0!==_?u(d,_,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,a])}const Od="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Fd="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function zd(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(zn),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),s=n(e),a=l(s);if(!a)return null;const c=o(e),u=i(s,c),d={title:a.title,icon:a.icon,description:a.description,anchor:null==c?void 0:c.anchor};return u?{title:u.title||a.title,icon:u.icon||a.icon,description:u.description||a.description}:d}),[e])}function Vd(e){let{clientId:t}=e;const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=e(zn),i=n(t);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&l(o(t).ref)}}),[t]),i=zd(t);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a;return c&&c!==s.title?(0,u.truncate)(c,{length:35}):i.title}var Hd=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:o,getTemplateLock:l,getBlockName:i}=e(zn),s=o(n[0]),a=s?l(s):null,c=i(n[0]);return{srcRootClientId:s,isDraggable:"all"!==a,icon:null===(t=(0,r.getBlockType)(c))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[f,g,h]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,ar.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,s.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,m.useDispatch)(zn);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,s.createElement)(Cu,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Gd=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=zd(t),a=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(zn),a=l(t),{name:c,attributes:u}=r(t);return{index:a,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:u,name:d,attributes:f,blockMovingMode:h,orientation:v}=a,{setNavigationMode:b,removeBlock:k}=(0,m.useDispatch)(zn),_=(0,s.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,s.useEffect)((()=>{_.current.focus(),(0,Nt.speak)(E)}),[E]);const{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(zn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(zn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!h}),O=(0,g.__)("Drag");return(0,s.createElement)("div",{className:D},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(ja,{icon:null==l?void 0:l.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Hd,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:Eu,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{ref:_,onClick:()=>b(!1),onKeyDown:function(e){const{keyCode:n}=e,r=n===Ca.UP,l=n===Ca.DOWN,i=n===Ca.LEFT,s=n===Ca.RIGHT,a=n===Ca.TAB,c=n===Ca.ESCAPE,u=n===Ca.ENTER,d=n===Ca.SPACE,p=e.shiftKey;if(n===Ca.BACKSPACE||n===Ca.DELETE)return k(t),void e.preventDefault();const m=I(),f=x(),g=T(f||m),h=N(f||m),v=a&&p||r,b=a&&!p||l,_=i,y=s;let E;if(v)E=g;else if(b)E=h;else if(_){var D;E=null!==(D=w(m))&&void 0!==D?D:m}else if(y){var O;E=null!==(O=B([m])[0])&&void 0!==O?O:m}const F=C();if(c&&P()&&(R(),e.preventDefault()),c&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(u||d)&&F){const e=w(F),t=w(m),n=S(F);let o=S(m);n<o&&e===t&&(o-=1),A(F,e,t,o),M(F),L(null)}if(b||v||_||y)if(E)e.preventDefault(),M(E);else if(a&&m){let t;if(b){t=o;do{t=ar.focus.tabbable.findNext(t)}while(t&&o.contains(t));t||(t=o.ownerDocument.defaultView.frameElement,t=ar.focus.tabbable.findNext(t))}else t=ar.focus.tabbable.findPrevious(o);t&&(e.preventDefault(),t.focus(),R())}},label:E,className:"block-selection-button_select-button"},(0,s.createElement)(Vd,{clientId:t})))))};function Ud(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var Wd=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!ar.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||Rt()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=ar.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,lc.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{l&&a()}),[n,l,a]),(0,s.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=Ud(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus()}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=Ud(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}(a,n,c,o,r),c?(0,s.createElement)(p.Toolbar,i({label:l["aria-label"],ref:a},l),t):(0,s.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},l),t)},$d=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),jd=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Kd=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),qd=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const Yd=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?$d:jd:Kd:"down"===e?"horizontal"===t?(0,g.isRTL)()?jd:$d:qd:null,Xd=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move right"):(0,g.__)("Move left"):(0,g.__)("Move up"):"down"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move left"):(0,g.__)("Move right"):(0,g.__)("Move down"):null,Zd=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(Zd),h=(0,u.castArray)(n).length,{blockType:v,isDisabled:b,rootClientId:k,isFirst:_,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e(zn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=s(m),v=a(p),b=0===f,k=g===h.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(zn),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${f}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:Yd(o,C),label:Xd(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,k),a.onClick&&a.onClick(e)},"aria-disabled":b})),(0,s.createElement)("span",{id:I,className:"block-editor-block-mover-button__description"},function(e,t,n,o,r,l,i){const s=n+1,a=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,g.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,g.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
31 |
(0,g._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l):r>0&&!o?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
32 |
(0,g._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l):void 0}(e,n,o,r,l);if(o&&r)return(0,g.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
|
33 |
(0,g.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
@@ -42,59 +42,59 @@ title:(0,g.__)("Reusable")};var yd=function(e){let{children:t,showPatterns:n=!1,
|
|
42 |
(0,g.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=a("up");if("up"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
43 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
44 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
45 |
-
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(h,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),
|
46 |
/* translators: %s: Name of the block's parent. */
|
47 |
-
(0,g.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(ja,{icon:a.icon})}))}var
|
48 |
/* translators: %s: block title. */
|
49 |
(0,g.__)("%s: Change block type or style"),f):(0,g.sprintf)(
|
50 |
/* translators: %d: number of blocks. */
|
51 |
-
(0,g._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||k||_;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(p.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ja,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(
|
52 |
(0,g.__)('Copied "%s" to clipboard.'),s):(0,g.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
53 |
(0,g.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,g.sprintf)(// Translators: %d: Number of blocks being copied.
|
54 |
(0,g._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,g.sprintf)(// Translators: %d: Number of blocks being cut.
|
55 |
-
(0,g._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function Np(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o}=(0,m.useSelect)(zn),{flashBlock:l,removeBlocks:i,replaceBlocks:s}=(0,m.useDispatch)(zn),a=
|
56 |
/* translators: %s: block name */
|
57 |
-
(0,g.__)("Remove %s"),
|
58 |
-
/* translators: accessibility text for the block toolbar */,"aria-label":(0,g.__)("Block tools")},o),(0,s.createElement)(Kp,{hideDragHandle:n}))};function Yp(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:l,getSettings:i,getLastMultiSelectedBlockClientId:s}=e(zn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:l(),hasMultiSelection:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:s()}}function Xp(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:g,isCaretWithinFormattedText:h,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:k}=(0,m.useSelect)(Yp,[]),_=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(zn);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),y=(0,d.useViewportMatch)("medium"),[E,C]=(0,s.useState)(!1),[S,w]=(0,s.useState)(!1),{stopTyping:B}=(0,m.useDispatch)(zn),I=!g&&!u&&r&&o,x=u,T=!u&&!b&&y&&!I&&!f&&(!g||h),N=!(u||T||b||r);(0,lc.useShortcut)("core/block-editor/focus-toolbar",(()=>{C(!0),B(!0)}),{isDisabled:!N}),(0,s.useEffect)((()=>{T||C(!1)}),[T]);const P=(0,s.useRef)(),M=Ra(t),R=Ra(k),L=Ra(l),A=Md(a);if(!(x||T||E||I))return null;let D=M;if(!D)return null;l&&(D=L);let O=D;if(v){if(!R)return null;O={top:D,bottom:R}}const F=I?"top left right":"top right left",{ownerDocument:z}=D,V=I?void 0:z.defaultView.frameElement||(0,ar.getScrollContainer)(D)||z.body;return(0,s.createElement)(p.Popover,{ref:A,noArrow:!0,animate:!1,position:F,focusOnMount:!1,anchorRef:O,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":_}),__unstableStickyBoundaryElement:V,__unstableSlotName:i||null,__unstableBoundaryParent:!0,__unstableObserveElement:D,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==a?void 0:a.current},(T||E)&&(0,s.createElement)("div",{onFocus:function(){w(!0)},onBlur:function(){w(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":S})},(0,s.createElement)(Bd,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,s.createElement)(qp,{focusOnMount:E,__experimentalInitialIndex:P.current,__experimentalOnIndexChange:e=>{P.current=e},key:t}),x&&(0,s.createElement)(Gd,{clientId:t,rootClientId:n,blockElement:D}),I&&(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(Bd,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function Zp(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(zn),a=t()||n();if(!a)return;const{name:c,attributes:d={},isValid:p}=l(a)||{},m=i(a),f=s(m),g=(0,u.find)(m,(e=>{var t;return null===(t=f[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isValid:p,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function Qp(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(Zp,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,s.createElement)(Xp,{clientId:r,rootClientId:l,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Jp(e){let{children:t}=e;const n=(0,s.useContext)(Rd),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(Rt()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Ad,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Qp,{__unstablePopoverSlot:"block-toolbar"}),t))}var em=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Un();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),tm=em((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Nd,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),nm=(0,d.compose)([em,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(zn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(Id,{rootClientId:t})})),om=window.wp.isShallowEqual,rm=n.n(om);const lm=new WeakMap;function im(e,t){const n=(0,m.useSelect)((e=>e(zn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(zn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(zn),d=function(e,t,n,o,l,i,s){return a=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){s();const n=p.map((e=>(0,r.cloneBlock)(e)));i(n,t,e,!0,null)}if("block"===d){const r=n(u[0]);if(c===e&&r===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;l(u,c,e,i&&r<t?t-s:t)}}}(e,t,l,i,a,s,u),p=function(e,t,n,o,l,i){return s=>{if(!n)return;const a=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(t=>"files"===t.type&&l(t.blockName,e)&&t.isMatch(s)));if(a){const n=a.transform(s,o);i(n,t,e)}}}(e,t,n,c,o,s),f=function(e,t,n){return o=>{const l=(0,r.pasteHandler)({HTML:o,mode:"BLOCKS"});l.length&&n(l,t,e)}}(e,t,s);return e=>{const t=(0,ar.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function sm(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,s=o?l:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i<c?a:c,Math.sqrt((i-d)**2+(s-u)**2)}function am(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=sm(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function cm(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,g.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=am(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function um(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(zn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(zn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(zn),a=im(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=cm(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=r(e))||void 0===i?void 0:i.orientation);n(void 0===s?0:s),null!==s&&l(e,s)}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:a,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function dm(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(zn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(zn).getBlockRootClientId(e);return{blockListSettings:t(zn).getBlockListSettings(e),parentLock:t(zn).getTemplateLock(n)}}),[e]),p=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=Io(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),rm()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(zn),{replaceInnerBlocks:i}=(0,m.useDispatch)(zn),a=(0,m.useSelect)((t=>t(zn).getBlocks(e)),[e]),c=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{if((0===a.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(n,a)||i(e,n,0===a.length&&o&&0!==n.length,l())}}),[a,t,n,e])}(t,i,a,d);const k=(0,m.useSelect)((e=>{const n=e(zn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){lm.has(t)||lm.set(t,new WeakMap);const n=lm.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,s.createElement)(ur,{value:k},(0,s.createElement)(ym,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function pm(e){return qa(e),(0,s.createElement)(dm,e)}const mm=(0,s.forwardRef)(((e,t)=>{const n=fm({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function fm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Un(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:s}=e(zn),a=t(n),c=s()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,um({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?pm:dm;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(f,i({},p,{clientId:n})):(0,s.createElement)(ym,t)}}fm.save=r.__unstableGetInnerBlocksProps,mm.DefaultBlockAppender=nm,mm.ButtonBlockAppender=tm,mm.Content=()=>fm.save().children;var gm=mm;const hm=(0,s.createContext)(),vm=(0,s.createContext)();function bm(e){let{className:t,...n}=e;const[o,r]=(0,s.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(zn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=fm({ref:(0,d.useMergeRefs)([Za(),Dd(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":u})},n);return(0,s.createElement)(hm.Provider,{value:o},(0,s.createElement)("div",p))}function km(e){return function(){const e=(0,m.useSelect)((e=>e(zn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(zn).__experimentalGetParsedPattern(e[n].name),t=Od(o))};return t=Od(o),()=>Fd(t)}),[e])}(),(0,s.createElement)(Jp,null,(0,s.createElement)(Gn,{value:Vn},(0,s.createElement)(bm,e)))}function _m(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=xo}=e;const[i,a]=(0,s.useState)(new Set),c=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{a((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[a]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(zn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(No,{value:l},(0,s.createElement)(vm.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Va,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(Pd,{tagName:r,rootClientId:n,renderAppender:o}))}function ym(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(_m,e))}km.__unstableElementContext=hm;const Em=["colors","disableCustomColors","gradients","disableCustomGradients"];function Cm(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,S]=(0,s.useState)(v?"gradient":!!y&&"color");return y||E?(0,s.createElement)(p.BaseControl,{className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",null,(0,s.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,s.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:S,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:h,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,s.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function Sm(e){const t={};return t.colors=mo("color.palette"),t.gradients=mo("color.gradients"),t.disableCustomColors=!mo("color.custom"),t.disableCustomGradients=!mo("color.customGradient"),(0,s.createElement)(Cm,i({},t,e))}var wm=function(e){return(0,u.every)(Em,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Cm,e):(0,s.createElement)(Sm,e)};function Bm(e){let t,{colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d,settings:m}=e;return u&&(t="bottom left"),(0,s.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,className:"block-editor-panel-color-gradient-settings__item-group"},m.map(((e,m)=>e&&(0,s.createElement)(p.Dropdown,{key:m,position:t,className:"block-editor-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:t=>{var n;let{isOpen:o,onToggle:r}=t;return(0,s.createElement)(p.__experimentalItem,{onClick:r,className:c()("block-editor-panel-color-gradient-settings__item",{"is-open":o})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:null!==(n=e.gradientValue)&&void 0!==n?n:e.colorValue}),(0,s.createElement)(p.FlexItem,null,e.label)))},renderContent:()=>(0,s.createElement)(wm,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function Im(){return{disableCustomColors:!mo("color.custom"),disableCustomGradients:!mo("color.customGradient")}}function xm(){const e=Im(),t=mo("color.palette.custom"),n=mo("color.palette.theme"),o=mo("color.palette.default"),r=mo("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,g._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=mo("color.gradients.custom"),i=mo("color.gradients.theme"),a=mo("color.gradients.default"),c=mo("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,g._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}zc([Vc,Uc]);const Tm=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Nm=(e,t)=>(0,u.find)(e,{color:t});function Pm(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const Mm=[];function Rm(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=xm(),l=r.colors.reduce(((e,t)=>e.concat(t.colors)),[]),{color:a}=(null==n?void 0:n.border)||{},[c,u]=(0,s.useState)((()=>{var e;return null===(e=Tm(l,t,a))||void 0===e?void 0:e.color}));(0,s.useEffect)((()=>{var e;u(null===(e=Tm(l,t,a))||void 0===e?void 0:e.color)}),[t,a,l]);const d=[{label:(0,g.__)("Color"),onColorChange:e=>{u(e);const t=Nm(l,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},i=null!=t&&t.slug?t.slug:void 0;o({style:qo(r),borderColor:i})},colorValue:c,clearable:!1}];return(0,s.createElement)(Bm,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function Lm(e,t,n){var o;if(!lf(t,"color")||sf(t))return e;const{borderColor:r,style:l}=n,i=Pm("border-color",r),s=c()(e.className,{"has-border-color":r||(null==l||null===(o=l.border)||void 0===o?void 0:o.color),[i]:!!i});return e.className=s||void 0,e}const Am=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:a}=l,c=mo("color.palette")||Mm;if(!lf(r,"color")||sf(r))return(0,s.createElement)(e,t);const u={borderColor:a?null===(n=Tm(c,a))||void 0===n?void 0:n.color:void 0};let d=t.wrapperProps;return d={...t.wrapperProps,style:{...u,...null===(o=t.wrapperProps)||void 0===o?void 0:o.style}},(0,s.createElement)(e,i({},t,{wrapperProps:d}))}));function Dm(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Om(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseUnit)(e))),n=t.map((e=>e[0])),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=Dm(o),i=0===r||r?`${r}${l}`:null;return i}function Fm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Om(e),n=isNaN(parseFloat(t));return n}function zm(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Vm(e){let{onChange:t,values:n,...o}=e;const r=Om(n),l=zm(n)&&Fm(n),a=l?(0,g.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return lf(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Lm),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!lf(e,"color")||sf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Lm(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Am);const Hm={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function Gm(e){let{onChange:t,values:n,...o}=e;const r="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(Hm).map((e=>{let[n,l]=e;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{key:n,"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}));var a})))}var Um=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),Wm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function $m(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("Link Radii");return(0,s.createElement)(p.Tooltip,{text:o},(0,s.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?Um:Wm,iconSize:16,"aria-label":o})))}const jm={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Km={px:100,em:20,rem:20};function qm(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!zm(n)||!Fm(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseUnit)(e);return t||"px"}return Dm(Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseUnit)(e);return t})))||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseUnit)(Om(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,g.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Vm,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,unit:i,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:u,min:0,max:Km[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(Gm,{min:0,onChange:t,values:n||jm,units:l}),(0,s.createElement)($m,{onClick:()=>r(!o),isLinked:o})))}function Ym(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(qm,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=qo(t)),o({style:t})}})}var Xm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{d:"M5 11.25h14v1.5H5z"})),Zm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"})),Qm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"}));const Jm=[{label:(0,g.__)("Solid"),icon:Xm,value:"solid"},{label:(0,g.__)("Dashed"),icon:Zm,value:"dashed"},{label:(0,g.__)("Dotted"),icon:Qm,value:"dotted"}];function ef(e){let{onChange:t,value:n}=e;return(0,s.createElement)("fieldset",{className:"components-border-style-control"},(0,s.createElement)("legend",null,(0,g.__)("Style")),(0,s.createElement)("div",{className:"components-border-style-control__buttons"},Jm.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===n,onClick:()=>t(e.value===n?void 0:e.value),"aria-label":e.label})))))}const tf=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(ef,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:qo(t)})}})},nf=e=>{const{attributes:{borderColor:t,style:n},setAttributes:o}=e,{width:r,color:l,style:i}=(null==n?void 0:n.border)||{},[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),[m,f]=(0,s.useState)(),h=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"]});return(0,s.createElement)(p.__experimentalUnitControl,{value:r,label:(0,g.__)("Width"),min:0,onChange:e=>{let s={...n,border:{...null==n?void 0:n.border,width:e}},p=t;const g=0===parseFloat(e),h=0===parseFloat(r);g&&!h&&(d(t),f(l),c(i),p=void 0,s.border.color=void 0,s.border.style="none"),!g&&h&&("none"===i&&(s.border.style=a),void 0===t&&(p=u,s.border.color=m)),void 0!==e&&""!==e||(s=qo(s)),o({borderColor:p,style:s})},units:h})},of="__experimentalBorder";function rf(e){const{clientId:t}=e,n=af(e),o=lf(e.name),l=mo("border.color")&&lf(e.name,"color"),i=mo("border.radius")&&lf(e.name,"radius"),a=mo("border.style")&&lf(e.name,"style"),c=mo("border.width")&&lf(e.name,"width");if(n||!o)return null;const u=(0,r.getBlockSupport)(e.name,[of,"__experimentalDefaultControls"]),d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var o;return{...n,...t,style:{...n.style,border:{...null===(o=n.style)||void 0===o?void 0:o.border,[e]:void 0}}}}};return(0,s.createElement)(nr,{__experimentalGroup:"border"},c&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.width)}(e),label:(0,g.__)("Width"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cf(o,"width")})}(e),isShownByDefault:null==u?void 0:u.width,resetAllFilter:d("width"),panelId:t},(0,s.createElement)(nf,e)),a&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.style)}(e),label:(0,g.__)("Style"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cf(o,"style")})}(e),isShownByDefault:null==u?void 0:u.style,resetAllFilter:d("style"),panelId:t},(0,s.createElement)(tf,e)),l&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{attributes:{borderColor:n,style:o}}=e;return!!n||!(null==o||null===(t=o.border)||void 0===t||!t.color)}(e),label:(0,g.__)("Color"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({borderColor:void 0,style:cf(o,"color")})}(e),isShownByDefault:null==u?void 0:u.color,resetAllFilter:d("color",{borderColor:void 0}),panelId:t},(0,s.createElement)(Rm,e)),i&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cf(o,"radius")})}(e),isShownByDefault:null==u?void 0:u.radius,resetAllFilter:d("radius"),panelId:t},(0,s.createElement)(Ym,e)))}function lf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==s.Platform.OS)return!1;const n=(0,r.getBlockSupport)(e,of);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function sf(e){const t=(0,r.getBlockSupport)(e,of);return null==t?void 0:t.__experimentalSkipSerialization}const af=()=>[!mo("border.color"),!mo("border.radius"),!mo("border.style"),!mo("border.width")].every(Boolean);function cf(e,t){return qo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function uf(e){if(e)return`has-${e}-gradient-background`}function df(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function pf(e,t){return(0,u.find)(e,["gradient",t])}function mf(e,t){const n=pf(e,t);return n&&n.slug}function ff(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Un(),o=mo("color.gradients.custom"),r=mo("color.gradients.theme"),l=mo("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(zn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(zn),d=(0,s.useCallback)((o=>{const r=mf(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=uf(a);let f;return f=a?df(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}zc([Vc,Uc]);var gf=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const m=a||o,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=Oc(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of h){if(!e.color)continue;const t=Oc(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color"
|
59 |
-
(0,g.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color"
|
60 |
-
(0,g.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,g.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,g.__)("Transparent text may be hard for people to read."),E=(0,g.__)("Transparent text may be hard for people to read."))}return y?((0,Nt.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function hf(e){var t;let{settings:n,enableAlpha:o,...r}=e;const l={...xm(),clearable:!1,enableAlpha:o,label:n.label,onColorChange:n.onColorChange,onGradientChange:n.onGradientChange,colorValue:n.colorValue,gradientValue:n.gradientValue},a=null!==(t=n.gradientValue)&&void 0!==t?t:n.colorValue;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:n.hasValue,label:n.label,onDeselect:n.onDeselect,isShownByDefault:n.isShownByDefault,resetAllFilter:n.resetAllFilter},r,{className:"block-editor-tools-panel-color-gradient-settings__item"}),(0,s.createElement)(p.Dropdown,{className:"block-editor-tools-panel-color-dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:e=>{let{isOpen:t,onToggle:o}=e;return(0,s.createElement)(p.Button,{onClick:o,"aria-expanded":t,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":t})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:a}),(0,s.createElement)(p.FlexItem,null,n.label)))},renderContent:()=>(0,s.createElement)(wm,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function vf(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function bf(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),p=Ma(o);return(0,s.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(vf(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(vf(t).color);let n=p.current,o=vf(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=vf(n).backgroundColor;i(o)})),(0,s.createElement)(nr,{__experimentalGroup:"color"},n.map(((e,n)=>(0,s.createElement)(hf,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,s.createElement)(gf,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:u}))}const kf="color",_f=e=>{const t=(0,r.getBlockSupport)(e,kf);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},yf=e=>{const t=(0,r.getBlockSupport)(e,kf);return null==t?void 0:t.__experimentalSkipSerialization},Ef=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,kf);return(0,u.isObject)(t)&&!!t.link},Cf=e=>{const t=(0,r.getBlockSupport)(e,kf);return(0,u.isObject)(t)&&!!t.gradients},Sf=e=>{const t=(0,r.getBlockSupport)(e,kf);return t&&!1!==t.background},wf=e=>{const t=(0,r.getBlockSupport)(e,kf);return t&&!1!==t.text},Bf=e=>t=>{var n,o,r,l,i,s,a,c,u,d;return"background"===e?!!(t.attributes.backgroundColor||null!==(r=t.attributes.style)&&void 0!==r&&null!==(l=r.color)&&void 0!==l&&l.background||t.attributes.gradient||null!==(i=t.attributes.style)&&void 0!==i&&null!==(s=i.color)&&void 0!==s&&s.gradient):"link"===e?!(null===(a=t.attributes.style)||void 0===a||null===(c=a.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text):!!t.attributes[`${e}Color`]||!(null===(n=t.attributes.style)||void 0===n||null===(o=n.color)||void 0===o||!o[e])},If=(e,t)=>qo(Yo(t,e,void 0)),xf=e=>({textColor:void 0,style:If(["color","text"],e.style)}),Tf=e=>({style:If(["elements","link","color","text"],e.style)}),Nf=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function Pf(e,t,n){var o,r,l,i,s,a;if(!_f(t)||yf(t))return e;const u=Cf(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=Pm("background-color",d),h=uf(m),v=Pm("color",p),b=c()(e.className,v,h,{[g]:!(u&&null!=f&&null!==(o=f.color)&&void 0!==o&&o.gradient||!g),"has-text-color":p||(null==f||null===(r=f.color)||void 0===r?void 0:r.text),"has-background":d||(null==f||null===(l=f.color)||void 0===l?void 0:l.background)||u&&(m||(null==f||null===(i=f.color)||void 0===i?void 0:i.gradient)),"has-link-color":null==f||null===(s=f.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color});return e.className=b||void 0,e}const Mf=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Tm(e,n[1]).color:t};function Rf(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,f=mo("color.palette.custom"),h=mo("color.palette.theme"),v=mo("color.palette.default"),b=(0,s.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=mo("color.gradients.custom"),_=mo("color.gradients.theme"),y=mo("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=mo("color.custom"),S=mo("color.customGradient"),w=mo("color.background"),B=mo("color.link"),I=mo("color.text"),x=C||!h||(null==h?void 0:h.length)>0,T=S||!_||(null==_?void 0:_.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!_f(p))return null;const P=Ef(p)&&B&&x,M=wf(p)&&I&&x,R=Sf(p)&&w&&x,L=Cf(p)&&T;if(!(P||M||R||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=df(E,F);else if(L){var V;z=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=Nm(b,n),i=t+"Color",s={...N.current.style,color:{...null===(o=N.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},a=null!=l&&l.slug?l.slug:void 0,c={style:qo(s),[i]:a};e.setAttributes(c),N.current={...N.current,...c}},G=!("web"!==s.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[kf,"__experimentalDefaultControls"]);return(0,s.createElement)(bf,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:Tm(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>Bf("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:If(["color","text"],t.style)})})(e),resetAllFilter:xf}]:[],...R||L?[{label:(0,g.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:Tm(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=mf(E,t);let o;if(n){var r,l,i;const e={...null===(r=N.current)||void 0===r?void 0:r.style,color:{...null===(l=N.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:qo(e),gradient:n}}else{var s,a,c;const e={...null===(s=N.current)||void 0===s?void 0:s.style,color:{...null===(a=N.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:qo(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>Bf("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(Nf(t))})(e),resetAllFilter:Nf}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{const n=Nm(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=qo(Yo(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:Mf(b,null==A||null===(l=A.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==U?void 0:U.link,hasValue:()=>Bf("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:If(["elements","link","color","text"],t.style)})})(e),resetAllFilter:Tf}]:[]]})}const Lf=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=mo("color.palette.custom")||[],u=mo("color.palette.theme")||[],d=mo("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!_f(o)||yf(o))return(0,s.createElement)(e,t);const m={};var f,g;a&&(m.color=null===(f=Tm(p,a))||void 0===f?void 0:f.color),l&&(m.backgroundColor=null===(g=Tm(p,l))||void 0===g?void 0:g.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:h}))})),Af={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return _f(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Cf(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Pf),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!_f(e)||yf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Pf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Lf),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Xo({linkColor:Ef(r),textColor:wf(r),backgroundColor:Sf(r),gradient:Cf(r)},Af,e,t,n,o)}));const Df=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],Of=[{name:(0,g._x)("Thin","font weight"),value:"100"},{name:(0,g._x)("Extra Light","font weight"),value:"200"},{name:(0,g._x)("Light","font weight"),value:"300"},{name:(0,g._x)("Regular","font weight"),value:"400"},{name:(0,g._x)("Medium","font weight"),value:"500"},{name:(0,g._x)("Semi Bold","font weight"),value:"600"},{name:(0,g._x)("Bold","font weight"),value:"700"},{name:(0,g._x)("Extra Bold","font weight"),value:"800"},{name:(0,g._x)("Black","font weight"),value:"900"}],Ff=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function zf(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Ff(n,o),c={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return Df.forEach((t=>{let{name:n,value:o}=t;Of.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,g.sprintf)(
|
61 |
/* translators: 1: Font weight name. 2: Font style name. */
|
62 |
(0,g.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return Df.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[c];return Of.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||u[0];return i&&(0,s.createElement)(p.CustomSelectControl,{className:"components-font-appearance-control",label:a,describedBy:d?n?o?(0,g.sprintf)(// translators: %s: Currently selected font appearance.
|
63 |
(0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
|
64 |
(0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
|
65 |
-
(0,g.__)("Currently selected font weight: %s"),d.name):(0,g.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}function Vf(e){let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||Rt()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const a=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:a},(0,s.createElement)(p.__experimentalNumberControl,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType);return e.value=((e,t)=>{if(l)return e;switch(e){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o),e},onChange:n,label:(0,g.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))}const Hf="typography.lineHeight";function Gf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Vf,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:qo(t)})}})}function Uf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Hf)||t}const Wf="typography.__experimentalFontStyle",$f="typography.__experimentalFontWeight";function jf(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Kf(e),i=!qf(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,c=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,s.createElement)(zf,{onChange:e=>{r({style:qo({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function Kf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Wf),n=mo("typography.fontStyle");return!t||!n}function qf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,$f),n=mo("typography.fontWeight");return!t||!n}function Yf(e){const t=Kf(e),n=qf(e);return t&&n}function Xf(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=mo("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,g.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(p.SelectControl,i({label:(0,g.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Zf="typography.__experimentalFontFamily";function Qf(e,t,n){if(!(0,r.hasBlockSupport)(t,Zf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(pp())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function Jf(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=mo("typography.fontFamilies"),l=null===(t=(0,u.find)(r,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(Xf,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,u.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})}})}function eg(e){let{name:t}=e;const n=mo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Zf)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Zf)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Qf),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Zf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Qf(o,e,n)},e}));const tg=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function ng(e,t){return(0,u.find)(e,{size:t})||{size:t}}function og(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var rg=function(e){const t=mo("typography.fontSizes"),n=!mo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const lg="typography.fontSize";function ig(e,t,n){if(!(0,r.hasBlockSupport)(t,lg))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(pp())(e.className);o.add(og(n.fontSize));const l=o.value;return e.className=l||void 0,e}function sg(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=mo("typography.fontSizes"),a=tg(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),c=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(rg,{onChange:e=>{const t=ng(i,e).slug;l({style:qo({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function ag(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=mo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,lg)||!n}const cg=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=mo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,lg)||(0,r.hasBlockSupport)(i,"typography.__experimentalSkipSerialization")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=tg(l,a,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,s.createElement)(e,p)}),"withFontSizeInlineStyles"),ug={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,lg)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",ig),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,lg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ig(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",cg),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Xo({fontSize:(0,r.hasBlockSupport)(l,lg)},ug,e,t,n,o)}));var dg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),pg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const mg=[{name:(0,g.__)("Underline"),value:"underline",icon:dg},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:pg}];function fg(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,g.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},mg.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name})))))}const gg="typography.__experimentalTextDecoration";function hg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(fg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function vg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,gg),n=mo("typography.textDecoration");return t||!n}var bg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})),kg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})),_g=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const yg=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:bg},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:kg},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:_g}];function Eg(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,g.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},yg.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)})))))}const Cg="typography.__experimentalTextTransform";function Sg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Eg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function wg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Cg),n=mo("typography.textTransform");return t||!n}function Bg(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"],defaultValues:{px:"2",em:".2",rem:".2"}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const Ig="typography.__experimentalLetterSpacing";function xg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Bg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Tg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Ig),n=mo("typography.letterSpacing");return t||!n}const Ng="typography",Pg=[Hf,lg,Wf,$f,Zf,gg,Cg,Ig];function Mg(e){const{clientId:t}=e,n=eg(e),o=ag(e),l=Yf(e),i=Uf(e),a=vg(e),c=wg(e),u=Tg(e),d=!Kf(e),m=!qf(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Yf(e),ag(e),Uf(e),eg(e),vg(e),wg(e),Tg(e)];return t.filter(Boolean).length===t.length}(e),h=Rg(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[Ng,"__experimentalDefaultControls"]),b=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,s.createElement)(nr,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,g.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,s.createElement)(Jf,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e),label:(0,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:qo({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,s.createElement)(sg,e)),!l&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:Ff(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,s.createElement)(jf,e)),!i&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,g.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.lineHeight,resetAllFilter:b("lineHeight"),panelId:t},(0,s.createElement)(Gf,e)),!a&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,g.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textDecoration,resetAllFilter:b("textDecoration"),panelId:t},(0,s.createElement)(hg,e)),!c&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textTransform,resetAllFilter:b("textTransform"),panelId:t},(0,s.createElement)(Sg,e)),!u&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,g.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==v?void 0:v.letterSpacing,resetAllFilter:b("letterSpacing"),panelId:t},(0,s.createElement)(xg,e)))}const Rg=e=>Pg.some((t=>(0,r.hasBlockSupport)(e,t)));function Lg(e){const t=(0,r.getBlockSupport)(e,Ug);return!!(!0===t||null!=t&&t.blockGap)}function Ag(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.blockGap");return!Lg(e)||t}function Dg(e){var t;const{clientId:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=Ma(n);return Ag(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:e}};r({style:qo(n)});const l=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;i.current&&l&&(null===(s=i.current.parentNode)||void 0===s||s.replaceChild(i.current,i.current))},units:l,value:null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap})),native:null})}function Og(e){const t=(0,r.getBlockSupport)(e,Ug);return!!(!0===t||null!=t&&t.margin)}function Fg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.margin"),n=!Yg(e,"margin");return!Og(e)||t||n}function zg(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=qg(n,"margin"),a=i&&i.some((e=>$g.includes(e)));return Fg(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:qo(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Vg(e){const t=(0,r.getBlockSupport)(e,Ug);return!!(!0===t||null!=t&&t.padding)}function Hg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.padding"),n=!Yg(e,"padding");return!Vg(e)||t||n}function Gg(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=qg(n,"padding"),a=i&&i.some((e=>$g.includes(e)));return Hg(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:qo(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const Ug="spacing",Wg=["top","right","bottom","left"],$g=["vertical","horizontal"];function jg(e){const t=Ag(e),n=Hg(e),o=Fg(e),l=Kg(e),i=(a=e.name,"web"===s.Platform.OS&&(Lg(a)||Vg(a)||Og(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Ug,"__experimentalDefaultControls"]),u=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,s.createElement)(nr,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(Gg,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(zg,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,g.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(Dg,e)))}const Kg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ag(e),n=Hg(e),o=Fg(e);return t&&n&&o};function qg(e,t){const n=(0,r.getBlockSupport)(e,Ug);if(n&&"boolean"!=typeof n[t])return n[t]}function Yg(e,t){const n=qg(e,t);return!(n&&n.some((e=>Wg.includes(e)))&&n.some((e=>$g.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}const Xg=[...Pg,of,kf,Ug],Zg=e=>Xg.some((t=>(0,r.hasBlockSupport)(e,t))),Qg="var:";function Jg(e){return(0,u.startsWith)(e,Qg)?`var(--wp--${e.slice(Qg.length).split("|").join("--")})`:e}function eh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(0,u.first)(l)){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&!(0,u.isString)(s)?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=Jg(r))})):t.includes(l.join("."))||(n[o]=Jg((0,u.get)(e,l))))}}));const o=sr(e,{selector:"self"});return o.forEach((e=>{if("self"!==e.selector)throw"This style can't be added as inline style";n[e.key]=e.value})),n}const th={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[kf],"typography.__experimentalSkipSerialization":[Ng],[`${Ug}.__experimentalSkipSerialization`]:["spacing"]},nh={...th,[`${Ug}`]:["spacing.blockGap"]};function oh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:nh;if(!Zg(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{(0,r.getBlockSupport)(t,n)&&(l=(0,u.omit)(l,e))})),e.style={...eh(l),...e.style},e}const rh=(0,d.createHigherOrderComponent)((e=>t=>{const n=Wn();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Rf,t),(0,s.createElement)(Mg,t),(0,s.createElement)(rf,t),(0,s.createElement)(jg,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),lh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=null===(n=t.attributes.style)||void 0===n?void 0:n.elements,a=`wp-elements-${(0,d.useInstanceId)(e)}`,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=eh(t);return(0,u.isEmpty)(o)?"":[`.${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(a,null===(o=t.attributes.style)||void 0===o?void 0:o.elements),m=(0,s.useContext)(km.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,l&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:l?c()(t.className,a):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Zg(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",oh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Zg(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),oh(o,e,n,th)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",rh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",lh);var ih=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==Ca.DOWN||(e.preventDefault(),n())},label:(0,g.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,g.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const sh=[];function ah(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Oc(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function ch(e){let{selector:t,id:n,values:o}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:n},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"})))),(0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:r}}))}function uh(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,l=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=mo("color.duotone")||sh,a=mo("color.palette")||sh,c=!mo("color.custom"),u=!mo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(ih,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:c,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}zc([Vc]);const dh=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(uh,t))}),"withDuotoneControls"),ph=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),f=c()(null==t?void 0:t.className,p),g=(0,s.useContext)(km.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(ch,{selector:m,id:p,values:ah(u)}),g),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",dh),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",ph);const mh="__experimentalLayout";function fh(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=mo("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,mh,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:h}=c;if(!d)return null;const v=l||h||{},{inherit:b=!1,type:k="default"}=v;if("default"===k&&!a)return null;const _=Io(k),y=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(nr,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},f&&!!i&&(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!b,onChange:()=>t({layout:{inherit:!b}})}),!b&&u&&(0,s.createElement)(gh,{type:k,onChange:e=>t({layout:{type:e}})}),!b&&_&&(0,s.createElement)(_.inspectorControls,{layout:v,onChange:y,layoutBlockSupport:c}))),!b&&_&&(0,s.createElement)(_.toolBarControls,{layout:v,onChange:y,layoutBlockSupport:c}))}function gh(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Bo.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const hh=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,mh)&&(0,s.createElement)(fh,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),vh=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,mh),a=(0,d.useInstanceId)(e),u=mo("layout")||{},p=(0,s.useContext)(km.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,mh)||{},g=null!=m&&m.inherit?u:m||f||{},h=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(Mo,{selector:`.wp-container-${a}`,layout:g,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:h})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,mh)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",vh),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",hh);const bh=[];function kh(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=Pm("border-color",n);return{className:c()({[l]:!!l,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:eh({border:r})}}function _h(e){const t=mo("color.palette")||bh,n=kh(e);if(e.borderColor){const o=Tm(t,e.borderColor);n.style.borderColor=o.color}return n}function yh(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Pm("background-color",s),m=Pm("color",a),f=uf(u),g=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!g&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:eh({color:(null==d?void 0:d.color)||{}})}}const Eh={};function Ch(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=mo("color.palette.custom")||[],l=mo("color.palette.theme")||[],i=mo("color.palette.default")||[],a=mo("color.gradients")||Eh,c=(0,s.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,s.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=yh(e);if(t){const e=Tm(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=df(u,o)),n){const e=Tm(c,n);d.style.color=e.color}return d}function Sh(e){const{style:t}=e;return{style:eh({spacing:(null==t?void 0:t.spacing)||{}})}}function wh(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const Bh=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),Ih=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette.custom"),o=mo("color.palette.theme"),r=mo("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function xh(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Oc(t);return(0,u.maxBy)(e,(e=>{let{color:t}=e;return n.contrast(t)})).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Nm(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=Tm(r,o[l],o[`custom${(0,u.upperFirst)(l)}`]),s=t[l];return(null==s?void 0:s.color)===i.color&&s?e[l]=s:e[l]={...i,class:Pm(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Th(e){return function(){const t=Bh(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(xh(o,t),"withCustomColors")}}function Nh(){const e=Ih();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(xh(n,e),"withColors")}const Ph=[];var Mh=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=(0,u.reduce)(t,((e,t)=>(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("typography.fontSizes")||Ph;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(o,((e,t,n)=>(e[`set${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=tg(r,l,n[t]);return e[o]={...i,class:og(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Rh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),Lh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),Ah=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const Dh=[{icon:Rh,title:(0,g.__)("Align text left"),align:"left"},{icon:Lh,title:(0,g.__)("Align text center"),align:"center"},{icon:Ah,title:(0,g.__)("Align text right"),align:"right"}],Oh={position:"bottom right",isAlternate:!0};var Fh=function(e){let{value:t,onChange:n,alignmentControls:o=Dh,label:r=(0,g.__)("Align"),describedBy:l=(0,g.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,h=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,g.isRTL)()?Ah:Rh,label:r,toggleProps:{describedBy:l},popoverProps:Oh,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},h))};function zh(e){return(0,s.createElement)(Fh,i({},e,{isToolbar:!1}))}function Vh(e){return(0,s.createElement)(Fh,i({},e,{isToolbar:!0}))}var Hh={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(zn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Pu(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?td(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]);return[(0,s.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ja,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}};const Gh=[];function Uh(e){let{completers:t=Gh}=e;const{name:n}=Un();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Hh])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Wh=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Uh(e)}))},$h=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),jh=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:$h,label:n,onClick:()=>o(!t),disabled:r})},Kh=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",a=`${i}__popover`;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:a,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==Ca.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},qh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),Yh=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(zn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(zn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,g.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(wo,{icon:qh,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,s.createElement)(Vd,{clientId:e})),(0,s.createElement)(wo,{icon:qh,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Vd,{clientId:r})))};function Xh(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,a]=(0,s.useState)(!0),[u,d]=(0,s.useState)(!1),{isParentSelected:p,hasChildSelected:f,isDraggingBlocks:g,isParentHighlighted:h}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l}=e(zn);return{isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),v=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":h,"is-dragging-blocks":g});return(0,s.useEffect)((()=>{p||f||l||a(!0),p&&!u&&l&&a(!1),f&&l&&a(!1)}),[p,f,l,u]),(0,s.createElement)(n,i({},o,{className:v,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l?()=>a(!1):void 0}),null==o?void 0:o.children)}const Zh=()=>(0,s.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),Qh=e=>{let{style:t,className:n}=e;return(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,s.createElement)(Zh,null)))},Jh=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,g.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==Ca.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(Qh,null)))}))}};var ev=e=>{let{children:t,...n}=e;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Jh(n),renderContent:()=>t})},tv=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const nv=ia(p.__experimentalTreeGridRow);function ov(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=ca({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(nv,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function rv(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(wo,{icon:qh}))}var lv=(0,s.forwardRef)((function e(t,n){let{className:o,block:{clientId:r},isSelected:l,onClick:i,onToggleExpanded:a,position:u,siblingBlockCount:m,level:f,tabIndex:h,onFocus:v,onDragStart:b,onDragEnd:k,draggable:_,isExpanded:y}=t;const E=zd(r),C=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,S=((e,t,n)=>(0,g.sprintf)(
|
66 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
67 |
-
(0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,m,f);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",o),onClick:i,onKeyDown:function(e){e.keyCode!==Ca.ENTER&&e.keyCode!==Ca.SPACE||i(e)},"aria-describedby":C,ref:n,tabIndex:h,onFocus:v,onDragStart:e=>{e.dataTransfer.clearData(),b(e)},onDragEnd:k,draggable:_,href:`#block-${r}`,"aria-expanded":y},(0,s.createElement)(
|
68 |
-
(0,g.__)("Options for %s block"),U.title):(0,g.__)("Options"),$=b.includes(E)?b:[E];return(0,s.createElement)(
|
69 |
/* translators: %s: block name */
|
70 |
(0,g.__)("%s deselected."),e))}else w.length>1&&(B=(0,g.sprintf)(
|
71 |
/* translators: %s: number of deselected blocks */
|
72 |
-
(0,g.__)("%s blocks deselected."),w.length));B&&(0,Nt.speak)(B)}),[e,o,f,l,i,a,c,d,p,t,n])}}(),[E,C]=(0,s.useReducer)(vv,{}),{ref:S,target:w}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(zn),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=im(a,c),p=o(),f=(0,d.useThrottle)((0,s.useCallback)(((o,l)=>{const s={x:o.clientX,y:o.clientY},a=!(null==p||!p.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const s=i.element.getBoundingClientRect(),[a,c]=am(t,s,hv),u=gv(t,s);if(void 0===r||a<r||u){r=a;const t=e.indexOf(i),d=e[t-1];if("top"===c&&d&&d.rootClientId===i.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",l=d.element.getBoundingClientRect()):(o=i,n=c,l=s),u)break}}if(!o)return;const i="bottom"===n;if(i&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const s=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+s,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!a&&p.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!a||r(p,i),canInsertDraggedBlocksAsChild:!a||r(p,l)}})),s);c&&i(c)}),[p]),200);return{ref:(0,d.__experimentalUseDropZone)({onDrop:u,onDragOver(e){f(e,e.currentTarget)},onDragEnd(){f.cancel(),i(null)}}),target:l}}(),B=(0,s.useRef)(),I=(0,d.useMergeRefs)([B,S,t]),x=(0,s.useRef)(!1),{setSelectedTreeId:T}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,s.useState)(null),{selectedBlockParentClientIds:l}=(0,m.useSelect)((e=>{const{getBlockParents:n}=e(zn);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,s.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:k[0],setExpandedState:C}),N=(0,s.useCallback)(((e,t)=>{y(e,t),T(t)}),[T,y]);(0,s.useEffect)((()=>{x.current=!0}),[]);const[P]=(0,d.__experimentalUseFixedWindowList)(B,36,_,{useWindowing:l,windowOverscan:40}),M=(0,s.useCallback)((e=>{e&&C({type:"expand",clientIds:[e]})}),[C]),R=(0,s.useCallback)((e=>{e&&C({type:"collapse",clientIds:[e]})}),[C]),L=(0,s.useCallback)((e=>{var t;M(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[M]),A=(0,s.useCallback)((e=>{var t;R(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[R]),D=(0,s.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&y(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===
|
1 |
+
!function(){var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:function(e,t){var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:function(e,t){"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=a&&f+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();f()||e()}),0)}();else for(;u<=d;){var g=f();if(g)return g}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:function(e,t,n){"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:function(e,t,n){"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),f=o.offset(e),g=o.outerHeight(e),h=o.outerWidth(e),v=void 0,b=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,_.left+y.left):!1===s?o.scrollLeft(t,_.left+E.left):y.left<0?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left)))}},5425:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function f(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function g(e){return null!=e&&e==e.window}var h={};function v(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function k(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function _(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(t,["padding","border"],n)),_(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(_(e,l))||0,o[l]=r+t[l]-n[l]);_(e,o)}(e,t)},isWindow:g,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(g(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(g(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},h)},8575:function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:function(e,t,n){var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},5372:function(e,t,n){"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:function(e,t,n){e.exports=n(5372)()},9567:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:function(e){var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},f=!0,g={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var v=t.call(g,g.node);return void 0!==v&&g.update&&g.update(v),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return Vh},AlignmentToolbar:function(){return Hh},Autocomplete:function(){return Xh},BlockAlignmentControl:function(){return zo},BlockAlignmentToolbar:function(){return Vo},BlockBreadcrumb:function(){return tv},BlockColorsStyleSelector:function(){return iv},BlockContextProvider:function(){return ur},BlockControls:function(){return Yn},BlockEdit:function(){return fr},BlockEditorKeyboardShortcuts:function(){return x_},BlockEditorProvider:function(){return Ya},BlockFormatControls:function(){return qn},BlockIcon:function(){return ja},BlockInspector:function(){return C_},BlockList:function(){return _m},BlockMover:function(){return tp},BlockNavigationDropdown:function(){return Bv},BlockPreview:function(){return vu},BlockSelectionClearer:function(){return Za},BlockSettingsMenu:function(){return Kp},BlockSettingsMenuControls:function(){return Up},BlockStyles:function(){return Pv},BlockTitle:function(){return Hd},BlockToolbar:function(){return qp},BlockTools:function(){return S_},BlockVerticalAlignmentControl:function(){return Qv},BlockVerticalAlignmentToolbar:function(){return Zv},ButtonBlockAppender:function(){return Pd},ButtonBlockerAppender:function(){return Td},ColorPalette:function(){return eb},ColorPaletteControl:function(){return tb},ContrastChecker:function(){return gf},CopyHandler:function(){return Mp},DefaultBlockAppender:function(){return xd},FontSizePicker:function(){return rg},InnerBlocks:function(){return hm},Inserter:function(){return Bd},InspectorAdvancedControls:function(){return tr},InspectorControls:function(){return nr},JustifyContentControl:function(){return ho},JustifyToolbar:function(){return vo},LineHeightControl:function(){return Vf},MediaPlaceholder:function(){return yk},MediaReplaceFlow:function(){return hk},MediaUpload:function(){return fk},MediaUploadCheck:function(){return gk},MultiSelectScrollIntoView:function(){return I_},NavigableToolbar:function(){return $d},ObserveTyping:function(){return M_},PanelColorSettings:function(){return Ek},PlainText:function(){return qk},RichText:function(){return $k},RichTextShortcut:function(){return Qk},RichTextToolbarButton:function(){return Zk},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return h_},ToolSelector:function(){return t_},Typewriter:function(){return D_},URLInput:function(){return $b},URLInputButton:function(){return l_},URLPopover:function(){return kk},Warning:function(){return hr},WritingFlow:function(){return ac},__experimentalBlockAlignmentMatrixControl:function(){return Jh},__experimentalBlockContentOverlay:function(){return nv},__experimentalBlockFullHeightAligmentControl:function(){return Zh},__experimentalBlockPatternSetup:function(){return Gv},__experimentalBlockPatternsList:function(){return Vu},__experimentalBlockVariationPicker:function(){return Mv},__experimentalBlockVariationTransforms:function(){return Wv},__experimentalBorderRadiusControl:function(){return Ym},__experimentalBorderStyleControl:function(){return tf},__experimentalColorGradientControl:function(){return Bm},__experimentalColorGradientSettingsDropdown:function(){return xm},__experimentalDuotoneControl:function(){return ih},__experimentalFontAppearanceControl:function(){return zf},__experimentalFontFamilyControl:function(){return Xf},__experimentalGetBorderClassesAndStyles:function(){return _h},__experimentalGetColorClassesAndStyles:function(){return Eh},__experimentalGetGradientClass:function(){return uf},__experimentalGetGradientObjectByGradientValue:function(){return pf},__experimentalGetMatchingVariation:function(){return Uv},__experimentalGetSpacingClassesAndStyles:function(){return wh},__experimentalImageEditingProvider:function(){return Tb},__experimentalImageEditor:function(){return zb},__experimentalImageSizeControl:function(){return Hb},__experimentalImageURLInputUI:function(){return m_},__experimentalLayoutStyle:function(){return Mo},__experimentalLetterSpacingControl:function(){return Bg},__experimentalLibrary:function(){return w_},__experimentalLinkControl:function(){return dk},__experimentalLinkControlSearchInput:function(){return ok},__experimentalLinkControlSearchItem:function(){return qb},__experimentalLinkControlSearchResults:function(){return Qb},__experimentalListView:function(){return Sv},__experimentalPanelColorGradientSettings:function(){return cb},__experimentalPreviewOptions:function(){return f_},__experimentalResponsiveBlockControl:function(){return Xk},__experimentalTextDecorationControl:function(){return fg},__experimentalTextTransformControl:function(){return Eg},__experimentalToolsPanelColorDropdown:function(){return hf},__experimentalUnitControl:function(){return n_},__experimentalUseBlockPreview:function(){return bu},__experimentalUseBorderProps:function(){return yh},__experimentalUseColorProps:function(){return Sh},__experimentalUseCustomSides:function(){return qg},__experimentalUseGradient:function(){return ff},__experimentalUseNoRecursiveRenders:function(){return z_},__experimentalUseResizeCanvas:function(){return g_},__unstableBlockSettingsMenuFirstItem:function(){return Fp},__unstableEditorStyles:function(){return mu},__unstableIframe:function(){return dc},__unstableInserterMenuExtension:function(){return gd},__unstableRichTextInputEvent:function(){return Jk},__unstableUseBlockSelectionClearer:function(){return Qa},__unstableUseClipboardHandler:function(){return Np},__unstableUseMouseMoveTypingReset:function(){return P_},__unstableUseTypewriter:function(){return A_},__unstableUseTypingObserver:function(){return N_},createCustomColorsHOC:function(){return Ph},getColorClassName:function(){return Mm},getColorObjectByAttributeValues:function(){return Pm},getColorObjectByColorValue:function(){return Nm},getFontSize:function(){return tg},getFontSizeClass:function(){return og},getFontSizeObjectByValue:function(){return ng},getGradientSlugByValue:function(){return mf},getGradientValueBySlug:function(){return df},getPxFromCssUnit:function(){return Y_},store:function(){return zn},storeConfig:function(){return Fn},transformStyles:function(){return uu},useBlockDisplayInformation:function(){return zd},useBlockEditContext:function(){return Un},useBlockProps:function(){return Aa},useCachedTruthy:function(){return Bh},useInnerBlocksProps:function(){return gm},useSetting:function(){return mo},withColorContext:function(){return Jv},withColors:function(){return Nh},withFontSizes:function(){return Rh}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return It},__experimentalGetAllowedBlocks:function(){return at},__experimentalGetAllowedPatterns:function(){return pt},__experimentalGetBlockListSettingsForBlocks:function(){return bt},__experimentalGetDirectInsertBlock:function(){return ct},__experimentalGetLastBlockAttributeChanges:function(){return yt},__experimentalGetParsedPattern:function(){return ut},__experimentalGetPatternTransformItems:function(){return ft},__experimentalGetPatternsByBlockTypes:function(){return mt},__experimentalGetReusableBlockTitle:function(){return kt},__unstableGetBlockWithoutInnerBlocks:function(){return W},__unstableGetClientIdWithClientIdsTree:function(){return j},__unstableGetClientIdsTree:function(){return K},__unstableIsLastBlockChangeIgnored:function(){return _t},areInnerBlocksControlled:function(){return xt},canInsertBlockType:function(){return qe},canInsertBlocks:function(){return Ye},canMoveBlock:function(){return Ze},canMoveBlocks:function(){return Je},canRemoveBlock:function(){return Xe},canRemoveBlocks:function(){return Qe},didAutomaticChange:function(){return wt},getAdjacentBlockClientId:function(){return pe},getBlock:function(){return U},getBlockAttributes:function(){return G},getBlockCount:function(){return Z},getBlockHierarchyRootClientId:function(){return ue},getBlockIndex:function(){return xe},getBlockInsertionPoint:function(){return He},getBlockListSettings:function(){return gt},getBlockMode:function(){return Le},getBlockName:function(){return V},getBlockOrder:function(){return Be},getBlockParents:function(){return ae},getBlockParentsByBlockName:function(){return ce},getBlockRootClientId:function(){return se},getBlockSelectionEnd:function(){return ne},getBlockSelectionStart:function(){return te},getBlockTransformItems:function(){return it},getBlocks:function(){return $},getBlocksByClientId:function(){return Q},getClientIdsOfDescendants:function(){return q},getClientIdsWithDescendants:function(){return Y},getDraggedBlockClientIds:function(){return Oe},getFirstMultiSelectedBlockClientId:function(){return ke},getGlobalBlockCount:function(){return X},getInserterItems:function(){return lt},getLastMultiSelectedBlockClientId:function(){return _e},getLowestCommonAncestorWithSelectedBlock:function(){return de},getMultiSelectedBlockClientIds:function(){return ve},getMultiSelectedBlocks:function(){return be},getMultiSelectedBlocksEndClientId:function(){return we},getMultiSelectedBlocksStartClientId:function(){return Se},getNextBlockClientId:function(){return fe},getPreviousBlockClientId:function(){return me},getSelectedBlock:function(){return ie},getSelectedBlockClientId:function(){return le},getSelectedBlockClientIds:function(){return he},getSelectedBlockCount:function(){return oe},getSelectedBlocksInitialCaretPosition:function(){return ge},getSelectionEnd:function(){return ee},getSelectionStart:function(){return J},getSettings:function(){return ht},getTemplate:function(){return We},getTemplateLock:function(){return $e},hasBlockMovingClientId:function(){return St},hasInserterItems:function(){return st},hasMultiSelection:function(){return Ne},hasSelectedBlock:function(){return re},hasSelectedInnerBlock:function(){return Te},isAncestorBeingDragged:function(){return ze},isAncestorMultiSelected:function(){return Ce},isBlockBeingDragged:function(){return Fe},isBlockHighlighted:function(){return Bt},isBlockInsertionPointVisible:function(){return Ge},isBlockMultiSelected:function(){return Ee},isBlockSelected:function(){return Ie},isBlockValid:function(){return H},isBlockWithinSelection:function(){return Pe},isCaretWithinFormattedText:function(){return Ve},isDraggingBlocks:function(){return De},isFirstMultiSelectedBlock:function(){return ye},isLastBlockChangePersistent:function(){return vt},isMultiSelecting:function(){return Me},isNavigationMode:function(){return Ct},isSelectionEnabled:function(){return Re},isTyping:function(){return Ae},isValidTemplate:function(){return Ue},wasBlockJustInserted:function(){return Tt}});var t={};n.r(t),n.d(t,{__unstableMarkAutomaticChange:function(){return In},__unstableMarkLastChangeAsPersistent:function(){return Bn},__unstableMarkNextChangeAsNotPersistent:function(){return xn},__unstableSaveReusableBlock:function(){return wn},clearSelectedBlock:function(){return jt},duplicateBlocks:function(){return Nn},enterFormattedText:function(){return bn},exitFormattedText:function(){return kn},flashBlock:function(){return An},hideInsertionPoint:function(){return ln},insertAfterBlock:function(){return Rn},insertBeforeBlock:function(){return Mn},insertBlock:function(){return nn},insertBlocks:function(){return on},insertDefaultBlock:function(){return En},mergeBlocks:function(){return cn},moveBlockToPosition:function(){return tn},moveBlocksDown:function(){return Zt},moveBlocksToPosition:function(){return en},moveBlocksUp:function(){return Jt},multiSelect:function(){return $t},receiveBlocks:function(){return Ot},removeBlock:function(){return dn},removeBlocks:function(){return un},replaceBlock:function(){return Xt},replaceBlocks:function(){return Yt},replaceInnerBlocks:function(){return pn},resetBlocks:function(){return Lt},resetSelection:function(){return Dt},selectBlock:function(){return Vt},selectNextBlock:function(){return Gt},selectPreviousBlock:function(){return Ht},selectionChange:function(){return yn},setBlockMovingClientId:function(){return Pn},setHasControlledInnerBlocks:function(){return Dn},setNavigationMode:function(){return Tn},setTemplateValidity:function(){return sn},showInsertionPoint:function(){return rn},startDraggingBlocks:function(){return hn},startMultiSelect:function(){return Ut},startTyping:function(){return fn},stopDraggingBlocks:function(){return vn},stopMultiSelect:function(){return Wt},stopTyping:function(){return gn},synchronizeTemplate:function(){return an},toggleBlockHighlight:function(){return Ln},toggleBlockMode:function(){return mn},toggleSelection:function(){return Kt},updateBlock:function(){return zt},updateBlockAttributes:function(){return Ft},updateBlockListSettings:function(){return Cn},updateSettings:function(){return Sn},validateBlocksToTemplate:function(){return At}});var r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var s=window.wp.element,a=n(4403),c=n.n(a),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,f={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},g=window.wp.i18n;const h={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__experimentalGenerateAnchors:!1,__unstableGalleryWithImageBlocks:!1,gradients:[{name:(0,g.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,g.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,g.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,g.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,g.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,g.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,g.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,g.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function k(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function S(e){return E(e,(e=>e.attributes))}function w(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function x(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const I=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=B(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=x(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=x(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=x(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=x(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=x(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=x(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=x(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:S(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{}},o=B(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!w(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const s=i.indexOf(r);return{...e,[o]:k(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var P,N,M=(0,m.combineReducers)({blocks:I,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},isCaretWithinFormattedText:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENTER_FORMATTED_TEXT":return!0;case"EXIT_FORMATTED_TEXT":return!1}return e},selection:function(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;switch(o.type){case"SELECTION_CHANGE":return{selectionStart:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.startOffset},selectionEnd:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.endOffset}};case"RESET_SELECTION":const{selectionStart:r,selectionEnd:l}=o;return{selectionStart:r,selectionEnd:l};case"MULTI_SELECT":const{start:i,end:s}=o;return{selectionStart:{clientId:i},selectionEnd:{clientId:s}};case"RESET_BLOCKS":const a=null==n||null===(e=n.selectionStart)||void 0===e?void 0:e.clientId,c=null==n||null===(t=n.selectionEnd)||void 0===t?void 0:t.clientId;if(!a&&!c)return n;if(!o.blocks.some((e=>e.clientId===a)))return{selectionStart:{},selectionEnd:{}};if(!o.blocks.some((e=>e.clientId===c)))return{...n,selectionEnd:n.selectionStart}}return{selectionStart:T(n.selectionStart,o),selectionEnd:T(n.selectionEnd,o)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,m.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":return n.blocks.length?{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source}:t;case"RESET_BLOCKS":return{}}return t}});function R(e){return[e]}function L(){var e={clear:function(){e.head=null}};return e}function A(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function D(e,t){var n,o;function r(){n=N?new WeakMap:L()}function l(){var n,r,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for(s=t.apply(null,i),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!A(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),r=n.head;r;){if(A(r.args,i,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,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=R),o=N?function(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(P)||((l=L()).isUniqueByDependants=a,s.set(P,l)),s.get(P)}:function(){return n},l.getDependants=t,l.clear=r,r(),l}P={},N="undefined"!=typeof WeakMap;var O=window.wp.primitives,F=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));const z=[];function V(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function H(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function G(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function U(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const W=D(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:G(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function $(e,t){var n;const o=t&&xt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||z}const j=D(((e,t)=>({clientId:t,innerBlocks:K(e,t)})),(e=>[e.blocks.order])),K=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Be(e,t),(t=>j(e,t)))}),(e=>[e.blocks.order])),q=(e,t)=>(0,u.flatMap)(t,(t=>{const n=Be(e,t);return[...n,...q(e,n)]})),Y=D((e=>{const t=Be(e);return[...t,...q(e,t)]}),(e=>[e.blocks.order])),X=D(((e,t)=>{const n=Y(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),Q=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>U(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function Z(e,t){return Be(e,t).length}function J(e){return e.selection.selectionStart}function ee(e){return e.selection.selectionEnd}function te(e){return e.selection.selectionStart.clientId}function ne(e){return e.selection.selectionEnd.clientId}function oe(e){return ve(e).length||(e.selection.selectionStart.clientId?1:0)}function re(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function le(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ie(e){const t=le(e);return t?U(e,t):null}function se(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const ae=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),ce=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ae(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:V(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ue(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function de(e,t){const n=le(e),o=[...ae(e,t),t],r=[...ae(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function pe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=le(e)),void 0===t&&(t=n<0?ke(e):_e(e)),!t)return null;const o=se(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function me(e,t){return pe(e,t,-1)}function fe(e,t){return pe(e,t,1)}function ge(e){return e.initialPosition}const he=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return z;if(t.clientId===n.clientId)return[t.clientId];const o=se(e,t.clientId);if(null===o)return z;const r=Be(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?z:he(e)}const be=D((e=>{const t=ve(e);return t.length?t.map((t=>U(e,t))):z}),(e=>[...he.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function ke(e){return(0,u.first)(ve(e))||null}function _e(e){return(0,u.last)(ve(e))||null}function ye(e,t){return ke(e)===t}function Ee(e,t){return-1!==ve(e).indexOf(t)}const Ce=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=se(e,n),o=Ee(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Se(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function we(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Be(e,t){return e.blocks.order[t||""]||z}function xe(e,t){return Be(e,se(e,t)).indexOf(t)}function Ie(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Te(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Be(e,t),(t=>Ie(e,t)||Ee(e,t)||n&&Te(e,t,n)))}function Pe(e,t){if(!t)return!1;const n=ve(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Ne(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Me(e){return e.isMultiSelecting}function Re(e){return e.isSelectionEnabled}function Le(e,t){return e.blocksMode[t]||"visual"}function Ae(e){return e.isTyping}function De(e){return!!e.draggedBlocks.length}function Oe(e){return e.draggedBlocks}function Fe(e,t){return e.draggedBlocks.includes(t)}function ze(e,t){if(!De(e))return!1;const n=ae(e,t);return(0,u.some)(n,(t=>Fe(e,t)))}function Ve(e){return e.isCaretWithinFormattedText}function He(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=se(e,l)||void 0,n=xe(e,r.clientId)+1):n=Be(e).length,{rootClientId:t,index:n}}function Ge(e){return null!==e.insertionPoint}function Ue(e){return e.template.isValid}function We(e){return e.settings.template}function $e(e,t){if(!t)return e.settings.templateLock;const n=gt(e,t);return n?n.templateLock:null}const je=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},Ke=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=ht(e),s=je(i,t,!0);if(!s)return!1;const a=!!$e(e,o);if(a)return!1;const c=gt(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=je(u,t),p=n.parent,m=V(e,o),f=je(p,m),g=null===d&&null===f||!0===d||!0===f;return g?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",g,n,o,{getBlock:U.bind(null,e),getBlockParentsByBlockName:ce.bind(null,e)}):g},qe=D(Ke,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function Ye(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>qe(e,V(e,t),n)))}function Xe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=G(e,t);if(null===o)return!0;const{lock:r}=o,l=!!$e(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function Qe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Xe(e,t,n)))}function Ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=G(e,t);if(null===o)return;const{lock:r}=o,l="all"===$e(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function Je(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Ze(e,t,n)))}function et(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const tt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&Ke(e,t.name,n),nt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=et(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:ot(r,l)}},ot=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},rt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(Q(e,Y(e)),{name:t.name}));const{time:i,count:s=0}=et(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:ot(i,s)};if("transform"===n)return a;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},lt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=rt(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=F;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=et(e,l)||{},c=ot(i,a);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>tt(e,n,t))).map(n),a=Ke(e,"core/block",t)?Et(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=nt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Et(e),(0,r.getBlockTypes)()])),it=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=rt(e,{buildScope:"transform"}),l=(0,r.getBlockTypes)().filter((t=>tt(e,t,n))).map(o),i=(0,u.mapKeys)(l,(e=>{let{name:t}=e;return t})),s=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>(i[null==t?void 0:t.name]&&e.push(i[t.name]),e)),[]),a=(0,u.orderBy)(s,(e=>i[e.name].frecency),"desc");return a}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),st=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>tt(e,n,t)));if(n)return!0;const o=Ke(e,"core/block",t)&&Et(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Et(e),(0,r.getBlockTypes)()])),at=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>tt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),ct=D((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(U(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),ut=D(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content)}:null}),(e=>[e.settings.__experimentalBlockPatterns])),dt=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=ht(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return ut(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!je(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),pt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=dt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return qe(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),mt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;const o=pt(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...pt.getDependants(e,t)])),ft=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||xt(e,n)})))return z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return mt(e,o,n)}),((e,t)=>[...mt.getDependants(e,t)]));function gt(e,t){return e.blockListSettings[t]}function ht(e){return e.settings}function vt(e){return e.blocks.isPersistentChange}const bt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),kt=D(((e,t)=>{var n;const o=(0,u.find)(Et(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Et(e)]));function _t(e){return e.blocks.isIgnoredChange}function yt(e){return e.lastBlockAttributesChange}function Et(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:z}function Ct(e){return e.isNavigationMode}function St(e){return e.hasBlockMovingClientId}function wt(e){return!!e.automaticChangeStatus}function Bt(e,t){return e.highlightedBlock===t}function xt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const It=D(((e,t)=>{if(!t.length)return null;const n=le(e);if(t.includes(V(e,n)))return n;const o=ve(e),r=ce(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Tt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Pt=window.wp.a11y,Nt=window.wp.richText,Mt=window.wp.deprecated,Rt=n.n(Mt);const Lt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(At(e))},At=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),s=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function Dt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Ot(e){return Rt()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Ft(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function zt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Vt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Ht=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Gt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Ut(){return{type:"START_MULTI_SELECT"}}function Wt(){return{type:"STOP_MULTI_SELECT"}}const $t=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,Pt.speak)((0,g.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
+
(0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function jt(){return{type:"CLEAR_SELECTED_BLOCK"}}function Kt(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function qt(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const Yt=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=(0,u.castArray)(e),t=qt((0,u.castArray)(t),i.getSettings());const a=i.getBlockRootClientId((0,u.first)(e));for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function Xt(e,t){return Yt(e,t)}const Qt=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},Zt=Qt("MOVE_BLOCKS_DOWN"),Jt=Qt("MOVE_BLOCKS_UP"),en=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function tn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return en([e],t,n,o)}function nn(e,t,n,o,r){return on([e],t,n,o,0,r)}const on=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;(0,u.isObject)(r)&&(l=r,r=0,Rt()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=qt((0,u.castArray)(e),s.getSettings());const c=[];for(const t of e)s.canInsertBlockType(t.name,n)&&c.push(t);c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function rn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function ln(){return{type:"HIDE_INSERTION_POINT"}}function sn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const an=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)},cn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,a]=i,c=o.getBlock(s),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(a),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:g,offset:h}=o.getSelectionStart(),v=(f===s?d:m).attributes[g],b=(f===s||f===a)&&void 0!==g&&void 0!==h&&!!v;v||("number"==typeof g?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof g):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===s?k:_,t=e.attributes[g],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=v,l=(0,Nt.insert)((0,Nt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),"",h,h);e.attributes[g]=(0,Nt.toHTMLString)({value:l,multilineTag:n,preserveWhiteSpace:r})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=E[e],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=d.attributes[e],i=(0,Nt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),s=i.text.indexOf(""),a=(0,Nt.remove)(i,s,s+1),p=(0,Nt.toHTMLString)({value:a,multilineTag:n,preserveWhiteSpace:r});E[e]=p,l.selectionChange(c.clientId,e,s,s)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},un=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=(0,u.castArray)(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function dn(e,t){return un([e],t)}function pn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function mn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function fn(){return{type:"START_TYPING"}}function gn(){return{type:"STOP_TYPING"}}function hn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function vn(){return{type:"STOP_DRAGGING_BLOCKS"}}function bn(){return{type:"ENTER_FORMATTED_TEXT"}}function kn(){return{type:"EXIT_FORMATTED_TEXT"}}function yn(e,t,n,o){return{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}}const En=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const s=(0,r.createBlock)(i,e);return l.insertBlock(s,n,t)};function Cn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Sn(e){return{type:"UPDATE_SETTINGS",settings:e}}function wn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Bn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function xn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const In=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Tn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Pt.speak)((0,g.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Pt.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Pn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Pt.speak)((0,g.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},Nn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if((0,u.some)(i,(e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),c=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(c,a+1,s,t),c.length>1&&t&&l.multiSelect((0,u.first)(c).clientId,(0,u.last)(c).clientId),c.map((e=>e.clientId))}},Mn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},Rn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function Ln(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const An=e=>async t=>{let{dispatch:n}=t;n(Ln(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Ln(e,!1))};function Dn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const On="core/block-editor",Fn={reducer:M,selectors:e,actions:t},zn=(0,m.createReduxStore)(On,{...Fn,persist:["preferences"]});(0,m.registerStore)(On,{...Fn,persist:["preferences"]});const Vn={name:"",isSelected:!1},Hn=(0,s.createContext)(Vn),{Provider:Gn}=Hn;function Un(){return(0,s.useContext)(Hn)}function Wn(){const{isSelected:e,clientId:t,name:n}=Un();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(zn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function $n(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=Wn(),{clientId:o}=Un(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(zn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,s.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function jn(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=f[t].Slot,l=(0,p.__experimentalUseSlot)(r.__unstableName);return Boolean(l.fills&&l.fills.length)?"default"===t?(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const Kn=$n;Kn.Slot=jn;const qn=e=>(0,s.createElement)($n,i({group:"inline"},e));qn.Slot=e=>(0,s.createElement)(jn,i({group:"inline"},e));var Yn=Kn,Xn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),Qn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Zn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),Jn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),eo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),to=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),no=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),oo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),ro=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),lo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),io=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"})),so=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function ao(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const co=["color","border","typography","spacing"],uo={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0:e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>void 0===e.fontSizes?void 0:e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},po={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function mo(e){const{name:t}=Un();return(0,m.useSelect)((n=>{var o;if(co.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(zn).getSettings(),i=(e=>po[e]||e)(e),s=`__experimentalFeatures.${i}`,a=`__experimentalFeatures.blocks.${t}.${i}`,c=null!==(o=(0,u.get)(l,a))&&void 0!==o?o:(0,u.get)(l,s);var d,p;if(void 0!==c)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(d=null!==(p=c.custom)&&void 0!==p?p:c.theme)&&void 0!==d?d:c.default:c;const m=uo[i]?uo[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e])}const fo={left:no,center:oo,right:ro,"space-between":lo};var go=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:a}=e;const c=e=>{o(e===r?void 0:e)},u=r?fo[r]:fo.left,d=[{name:"left",icon:no,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:oo,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ro,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:lo,title:(0,g.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};function ho(e){return(0,s.createElement)(go,i({},e,{isToolbar:!1}))}function vo(e){return(0,s.createElement)(go,i({},e,{isToolbar:!0}))}const bo={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},ko={left:"flex-start",right:"flex-end",center:"center"},_o=["wrap","nowrap"];var yo={name:"flex",label:(0,g.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n}=e;const{allowOrientation:o=!0}=t;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Eo,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,o&&(0,s.createElement)(So,{layout:t,onChange:n}))),(0,s.createElement)(Co,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;return null!=o&&o.allowSwitching?null:(0,s.createElement)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Eo,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:r,style:l}=e;const{orientation:i="horizontal"}=r,a=null!==mo("spacing.blockGap"),c=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap, 0.5em )",u=bo[r.justifyContent]||bo.left,d=_o.includes(r.flexWrap)?r.flexWrap:"wrap",p=`\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tjustify-content: ${u};\n\t\t`,m=`\n\t\tflex-direction: column;\n\t\talign-items: ${ko[r.justifyContent]||ko.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${ao(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tgap: ${a?c:"0.5em"};\n\t\t\t\t\tflex-wrap: ${d};\n\t\t\t\t\t${"horizontal"===i?p:m}\n\t\t\t\t}\n\n\t\t\t\t${ao(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Eo(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l&&a.push("space-between"),o)return(0,s.createElement)(ho,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:no,label:(0,g.__)("Justify items left")},{value:"center",icon:oo,label:(0,g.__)("Justify items center")},{value:"right",icon:ro,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:lo,label:(0,g.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Co(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function So(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,g.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:io,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:so,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var wo=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})};const Bo=[{name:"default",label:(0,g.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,s.createElement)(wo,{icon:Zn})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(wo,{icon:eo}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t,n;let{selector:o,layout:r={},style:l}=e;const{contentSize:i,wideSize:a}=r,c=null!==mo("spacing.blockGap"),u=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap )";let d=i||a?`\n\t\t\t\t\t${ao(o,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\n\t\t\t\t\t${ao(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\n\t\t\t\t\t${ao(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return d+=`\n\t\t\t${ao(o,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-right: 2em;\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\n\t\t\t${ao(o,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-left: 2em;\n\t\t\t\tmargin-right: 0;\n\t\t\t}\n\n\t\t`,c&&(d+=`\n\t\t\t\t${ao(o,"> *")} {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t}\n\t\t\t\t${ao(o,"> * + *")} {\n\t\t\t\t\tmargin-top: ${u};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,d)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
5 |
o.none=(0,g.sprintf)((0,g.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
+
o.wide=(0,g.sprintf)((0,g.__)("Max %s wide"),n)),o}(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},yo];function xo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Bo.find((t=>t.name===e))}const Io={type:"default"},To=(0,s.createContext)(Io),Po=To.Provider;function No(){return(0,s.useContext)(To)}function Mo(e){let{layout:t={},...n}=e;const o=xo(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const Ro=["none","left","center","right","wide","full"],Lo=["wide","full"];function Ao(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ro;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=No(),r=xo(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name)return[];const{alignments:i=Ro}=o,s=e.filter((e=>(o.alignments||t||!Lo.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Do={none:{icon:Xn,title:(0,g.__)("None")},left:{icon:Qn,title:(0,g.__)("Align left")},center:{icon:Zn,title:(0,g.__)("Align center")},right:{icon:Jn,title:(0,g.__)("Align right")},wide:{icon:eo,title:(0,g.__)("Wide width")},full:{icon:to,title:(0,g.__)("Full width")}},Oo={isAlternate:!0};var Fo=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=Ao(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Do[t],m=Do.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:Oo,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r||s.Platform.isNative?{isCollapsed:r?l:void 0,controls:a.map((e=>{let{name:n}=e;return{...Do[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Do[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(p.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,s.createElement)(f,i({},h,v))};function zo(e){return(0,s.createElement)(Fo,i({},e,{isToolbar:!1}))}function Vo(e){return(0,s.createElement)(Fo,i({},e,{isToolbar:!0}))}const Ho=["left","center","right","wide","full"],Go=["wide","full"];function Uo(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?Ho.filter((t=>e.includes(t))):!0===e?[...Ho]:[],!o||!0===e&&!n?(0,u.without)(t,...Go):t}const Wo=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Ao(Uo((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,s.createElement)(s.Fragment,null,!!o.length&&(0,s.createElement)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(zo,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,s.createElement)(e,t))}),"withToolbarControls"),$o=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Ao(Uo((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Ho,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",$o),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Wo),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Uo((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e})),window.wp.warning;var jo={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function Ko(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=Wn(),l=null===(t=jo[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const qo=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,qo),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Yo(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Xo(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:Yo(c.attributes,e,t)})}))})),c}function Qo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(zn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(zn),u=a(),d=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:qo(r.style)},t[n]=r})),r(n,t,!0)}),[qo,l,i,c,u,r]);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Zo(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(p.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function Jo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=jo[n])||void 0===t?void 0:t.Slot,a=(0,p.__experimentalUseSlot)(null==l?void 0:l.__unstableName);return l&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(Qo,{group:n,label:o},(0,s.createElement)(Zo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const er=Ko;er.Slot=Jo;const tr=e=>(0,s.createElement)(Ko,i({},e,{__experimentalGroup:"advanced"}));tr.Slot=e=>(0,s.createElement)(Jo,i({},e,{__experimentalGroup:"advanced"})),tr.slotName="InspectorAdvancedControls";var nr=er;const or=/[\s#]/g,rr=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(p.TextControl,{className:"html-anchor-control",label:(0,g.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,g.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("Add an anchor"),onChange:e=>{e=e.replace(or,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(nr,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(nr,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string",source:"attribute",attribute:"id",selector:"*"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",rr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const lr=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(nr,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",lr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const ir=[{name:"padding",generate:(e,t)=>function(e,t,n,o){const r=(0,u.get)(e,["spacing","padding"]);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const o=(0,u.get)(r,[n]);return o&&e.push({selector:t.selector,key:`padding${(0,u.upperFirst)(n)}`,value:o}),e}),[]);l.push(...e)}return l}(e,t,0,"padding")}];function sr(e,t){const n=[];return ir.forEach((o=>{n.push(...o.generate(e,t))})),n}var ar=window.wp.dom;const cr=(0,s.createContext)({});function ur(e){let{value:t,children:n}=e;const o=(0,s.useContext)(cr),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(cr.Provider,{value:r,children:n})}var dr=cr;const pr={};var mr=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(dr),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):pr),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(d,i({},e,{context:a}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function fr(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Gn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(mr,e))}var gr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),hr=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:gr,label:(0,g.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title)))))))))},vr=n(1973);function br(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,s.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,s.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,s.createElement)(s.RawHTML,null,(0,ar.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var kr=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,f=a,(0,vr.Kx)(m,f).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,f;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(br,{title:(0,g.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,g.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(br,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const _r=e=>(0,r.rawHandler)({HTML:e.originalContent});var yr=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(zn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(zn);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,_r(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,r.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:l,block:i}=e;const a=!!(0,r.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),m=(0,s.useCallback)((()=>u(!1)),[]),f=(0,s.useMemo)((()=>[{
|
8 |
// translators: Button to fix block content
|
9 |
title:(0,g._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,g.__)("Convert to HTML"),onClick:t},{title:(0,g.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(hr,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,g.__)("Attempt Block Recovery"))],secondaryActions:f},(0,g.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
|
10 |
+
(0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(kr,{block:i,onKeep:t,onConvert:n,convertor:_r,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const Er=(0,s.createElement)(hr,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var Cr=()=>Er;class Sr extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var wr=Sr,Br=n(773),xr=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(zn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(zn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(Br.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const s=(0,r.getBlockAttributes)(e,n,l.attributes),a=n||(0,r.getSaveContent)(e,s),c=!n||(0,r.isValidBlockContent)(e,s,a);i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let Ir=Ur();const Tr=e=>zr(e,Ir);let Pr=Ur();Tr.write=e=>zr(e,Pr);let Nr=Ur();Tr.onStart=e=>zr(e,Nr);let Mr=Ur();Tr.onFrame=e=>zr(e,Mr);let Rr=Ur();Tr.onFinish=e=>zr(e,Rr);let Lr=[];Tr.setTimeout=(e,t)=>{let n=Tr.now()+t,o=()=>{let e=Lr.findIndex((e=>e.cancel==o));~e&&Lr.splice(e,1),$r.count-=~e?1:0},r={time:n,handler:e,cancel:o};return Lr.splice(Ar(n),0,r),$r.count+=1,Vr(),r};let Ar=e=>~(~Lr.findIndex((t=>t.time>e))||~Lr.length);Tr.cancel=e=>{Ir.delete(e),Pr.delete(e)},Tr.sync=e=>{Fr=!0,Tr.batchedUpdates(e),Fr=!1},Tr.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Tr.onStart(n)}return o.handler=e,o.cancel=()=>{Nr.delete(n),t=null},o};let Dr="undefined"!=typeof window?window.requestAnimationFrame:()=>{};Tr.use=e=>Dr=e,Tr.now="undefined"!=typeof performance?()=>performance.now():Date.now,Tr.batchedUpdates=e=>e(),Tr.catch=console.error,Tr.frameLoop="always",Tr.advance=()=>{"demand"!==Tr.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Gr()};let Or=-1,Fr=!1;function zr(e,t){Fr?(t.delete(e),e(0)):(t.add(e),Vr())}function Vr(){Or<0&&(Or=0,"demand"!==Tr.frameLoop&&Dr(Hr))}function Hr(){~Or&&(Dr(Hr),Tr.batchedUpdates(Gr))}function Gr(){let e=Or;Or=Tr.now();let t=Ar(Or);t&&(Wr(Lr.splice(0,t),(e=>e.handler())),$r.count-=t),Nr.flush(),Ir.flush(e?Math.min(64,Or-e):16.667),Mr.flush(),Pr.flush(),Rr.flush()}function Ur(){let e=new Set,t=e;return{add(n){$r.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>($r.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,$r.count-=t.size,Wr(t,(t=>t(n)&&e.add(t))),$r.count+=e.size,t=e)}}}function Wr(e,t){e.forEach((e=>{try{t(e)}catch(e){Tr.catch(e)}}))}const $r={count:0,clear(){Or=-1,Lr=[],Nr=Ur(),Ir=Ur(),Mr=Ur(),Pr=Ur(),Rr=Ur(),$r.count=0}};var jr=n(9196),Kr=n.n(jr);function qr(){}const Yr={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Xr(e,t){if(Yr.arr(e)){if(!Yr.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const Qr=(e,t)=>e.forEach(t);function Zr(e,t,n){for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Jr=e=>Yr.und(e)?[]:Yr.arr(e)?e:[e];function el(e,t){if(e.size){const n=Array.from(e);e.clear(),Qr(n,t)}}const tl=(e,...t)=>el(e,(e=>e(...t)));let nl,ol,rl=null,ll=!1,il=qr;var sl=Object.freeze({__proto__:null,get createStringInterpolator(){return nl},get to(){return ol},get colors(){return rl},get skipAnimation(){return ll},get willAdvance(){return il},assign:e=>{e.to&&(ol=e.to),e.now&&(Tr.now=e.now),void 0!==e.colors&&(rl=e.colors),null!=e.skipAnimation&&(ll=e.skipAnimation),e.createStringInterpolator&&(nl=e.createStringInterpolator),e.requestAnimationFrame&&Tr.use(e.requestAnimationFrame),e.batchedUpdates&&(Tr.batchedUpdates=e.batchedUpdates),e.willAdvance&&(il=e.willAdvance),e.frameLoop&&(Tr.frameLoop=e.frameLoop)}});const al=new Set;let cl=[],ul=[],dl=0;const pl={get idle(){return!al.size&&!cl.length},start(e){dl>e.priority?(al.add(e),Tr.onStart(ml)):(fl(e),Tr(hl))},advance:hl,sort(e){if(dl)Tr.onFrame((()=>pl.sort(e)));else{const t=cl.indexOf(e);~t&&(cl.splice(t,1),gl(e))}},clear(){cl=[],al.clear()}};function ml(){al.forEach(fl),al.clear(),Tr(hl)}function fl(e){cl.includes(e)||gl(e)}function gl(e){cl.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(cl),0,e)}function hl(e){const t=ul;for(let n=0;n<cl.length;n++){const o=cl[n];dl=o.priority,o.idle||(il(o),o.advance(e),o.idle||t.push(o))}return dl=0,ul=cl,ul.length=0,cl=t,cl.length>0}const vl="[-+]?\\d*\\.?\\d+",bl=vl+"%";function kl(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const _l=new RegExp("rgb"+kl(vl,vl,vl)),yl=new RegExp("rgba"+kl(vl,vl,vl,vl)),El=new RegExp("hsl"+kl(vl,bl,bl)),Cl=new RegExp("hsla"+kl(vl,bl,bl,vl)),Sl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,wl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Bl=/^#([0-9a-fA-F]{6})$/,xl=/^#([0-9a-fA-F]{8})$/;function Il(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Tl(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Il(r,o,e+1/3),i=Il(r,o,e),s=Il(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Pl(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Nl(e){return(parseFloat(e)%360+360)%360/360}function Ml(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Rl(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ll(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Bl.exec(e))?parseInt(t[1]+"ff",16)>>>0:rl&&void 0!==rl[e]?rl[e]:(t=_l.exec(e))?(Pl(t[1])<<24|Pl(t[2])<<16|Pl(t[3])<<8|255)>>>0:(t=yl.exec(e))?(Pl(t[1])<<24|Pl(t[2])<<16|Pl(t[3])<<8|Ml(t[4]))>>>0:(t=Sl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=xl.exec(e))?parseInt(t[1],16)>>>0:(t=wl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=El.exec(e))?(255|Tl(Nl(t[1]),Rl(t[2]),Rl(t[3])))>>>0:(t=Cl.exec(e))?(Tl(Nl(t[1]),Rl(t[2]),Rl(t[3]))|Ml(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const Al=(e,t,n)=>{if(Yr.fun(e))return e;if(Yr.arr(e))return Al({range:e,output:t,extrapolate:n});if(Yr.str(e.output[0]))return nl(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,s,a){let c=a?a(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};function Dl(){return(Dl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const Ol=Symbol.for("FluidValue.get"),Fl=Symbol.for("FluidValue.observers"),zl=e=>Boolean(e&&e[Ol]),Vl=e=>e&&e[Ol]?e[Ol]():e,Hl=e=>e[Fl]||null;function Gl(e,t){let n=e[Fl];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Ul{constructor(e){if(this[Ol]=void 0,this[Fl]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Wl(this,e)}}const Wl=(e,t)=>Kl(e,Ol,t);function $l(e,t){if(e[Ol]){let n=e[Fl];n||Kl(e,Fl,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function jl(e,t){let n=e[Fl];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Fl]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Kl=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),ql=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Yl=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let Xl;const Ql=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Zl=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Jl=e=>{Xl||(Xl=rl?new RegExp(`(${Object.keys(rl).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Vl(e).replace(Yl,Ll).replace(Xl,Ll))),n=t.map((e=>e.match(ql).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>Al(Dl({},e,{output:t}))));return e=>{let n=0;return t[0].replace(ql,(()=>String(o[n++](e)))).replace(Ql,Zl)}},ei="react-spring: ",ti=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${ei}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},ni=ti(console.warn),oi=ti(console.warn);function ri(e){return Yr.str(e)&&("#"==e[0]||/\d/.test(e)||e in(rl||{}))}const li=e=>(0,jr.useEffect)(e,ii),ii=[];function si(){const e=(0,jr.useState)()[1],t=(0,jr.useState)(ai)[0];return li(t.unmount),()=>{t.current&&e({})}}function ai(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function ci(e){const t=(0,jr.useRef)();return(0,jr.useEffect)((()=>{t.current=e})),t.current}const ui="undefined"!=typeof window&&window.document&&window.document.createElement?jr.useLayoutEffect:jr.useEffect,di=Symbol.for("Animated:node"),pi=e=>e&&e[di],mi=(e,t)=>{return n=e,o=di,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},fi=e=>e&&e[di]&&e[di].getPayload();class gi{constructor(){this.payload=void 0,mi(this,this)}getPayload(){return this.payload||[]}}class hi extends gi{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,Yr.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new hi(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Yr.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,Yr.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class vi extends hi{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Al({output:[e,e]})}static create(e){return new vi(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Yr.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=Al({output:[this.getValue(),e]})),this._value=0,super.reset()}}const bi={dependencies:null};class ki extends gi{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Zr(this.source,((n,o)=>{var r;(r=n)&&r[di]===r?t[o]=n.getValue(e):zl(n)?t[o]=Vl(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Qr(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Zr(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){bi.dependencies&&zl(e)&&bi.dependencies.add(e);const t=fi(e);t&&Qr(t,(e=>this.add(e)))}}class _i extends ki{constructor(e){super(e)}static create(e){return new _i(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(yi)),!0)}}function yi(e){return(ri(e)?vi:hi).create(e)}function Ei(e){const t=pi(e);return t?t.constructor:Yr.arr(e)?_i:ri(e)?vi:hi}function Ci(){return(Ci=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const Si=(e,t)=>{const n=!Yr.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,jr.forwardRef)(((o,r)=>{const l=(0,jr.useRef)(null),i=n&&(0,jr.useCallback)((e=>{l.current=function(e,t){return e&&(Yr.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return bi.dependencies=n,e.style&&(e=Ci({},e,{style:t.createAnimatedStyle(e.style)})),e=new ki(e),bi.dependencies=null,[e,n]}(o,t),c=si(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new wi(u,a),p=(0,jr.useRef)();ui((()=>{const e=p.current;p.current=d,Qr(a,(e=>$l(e,d))),e&&(Qr(e.deps,(t=>jl(t,e))),Tr.cancel(e.update))})),(0,jr.useEffect)(u,[]),li((()=>()=>{const e=p.current;Qr(e.deps,(t=>jl(t,e)))}));const m=t.getComponentProps(s.getValue());return jr.createElement(e,Ci({},m,{ref:i}))}))};class wi{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Tr.write(this.update)}}const Bi=Symbol.for("AnimatedComponent"),xi=e=>Yr.str(e)?e:e&&Yr.str(e.displayName)?e.displayName:Yr.fun(e)&&e.name||null;function Ii(){return(Ii=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function Ti(e,...t){return Yr.fun(e)?e(...t):e}const Pi=(e,t)=>!0===e||!!(t&&e&&(Yr.fun(e)?e(t):Jr(e).includes(t))),Ni=(e,t)=>Yr.obj(e)?t&&e[t]:e,Mi=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ri=e=>e,Li=(e,t=Ri)=>{let n=Ai;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);Yr.und(n)||(o[r]=n)}return o},Ai=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Di={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Oi(e){const t=function(e){const t={};let n=0;if(Zr(e,((e,o)=>{Di[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Zr(e,((e,o)=>o in t||(n[o]=e))),n}return Ii({},e)}function Fi(e){return e=Vl(e),Yr.arr(e)?e.map(Fi):ri(e)?sl.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function zi(e){for(const t in e)return!0;return!1}function Vi(e){return Yr.fun(e)||Yr.arr(e)&&Yr.obj(e[0])}function Hi(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Gi(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Ui=Ii({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Wi{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,Ui)}}function $i(e,t){if(Yr.und(t.decay)){const n=!Yr.und(t.tension)||!Yr.und(t.friction);!n&&Yr.und(t.frequency)&&Yr.und(t.damping)&&Yr.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const ji=[];class Ki{constructor(){this.changed=!1,this.values=ji,this.toValues=null,this.fromValues=ji,this.to=void 0,this.from=void 0,this.config=new Wi,this.immediate=!1}}function qi(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Pi(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{Yr.und(n.pause)||(r.paused=Pi(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Pi(e,t)),c=Ti(n.delay||0,t),e?(r.resumeQueue.add(m),l.pause()):(l.resume(),m())}function p(){r.resumeQueue.add(m),r.timeouts.delete(u),u.cancel(),c=u.time-Tr.now()}function m(){c>0?(u=Tr.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(Ii({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Yi=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Zi(e.get()):t.every((e=>e.noop))?Xi(e.get()):Qi(e.get(),t.every((e=>e.finished))),Xi=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Qi=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Zi=e=>({value:e,cancelled:!0,finished:!1});function Ji(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=Li(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&Zi(o)||r!==n.asyncId&&Qi(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new ts,i=new ns;return(async()=>{if(sl.skipAnimation)throw es(n),i.result=Qi(o,!1),d(i),i;m(l);const s=Yr.obj(e)?Ii({},e):Ii({},t,{to:e});s.parentId=r,Zr(c,((e,t)=>{Yr.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let g;if(sl.skipAnimation)return es(n),Qi(o,!1);try{let t;t=Yr.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),g=Qi(o.get(),!0,!1)}catch(e){if(e instanceof ts)g=e.result;else{if(!(e instanceof ns))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Yr.fun(i)&&Tr.batchedUpdates((()=>{i(g,o,o.item)})),g})():a}function es(e,t){el(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class ts extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class ns extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const os=e=>e instanceof ls;let rs=1;class ls extends Ul{constructor(...e){super(...e),this.id=rs++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=pi(this);return e&&e.getValue()}to(...e){return sl.to(this,e)}interpolate(...e){return ni(`${ei}The "interpolate" function is deprecated in v9 (use "to" instead)`),sl.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Gl(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||pl.sort(this),Gl(this,{type:"priority",parent:this,priority:e})}}const is=Symbol.for("SpringPhase"),ss=e=>(1&e[is])>0,as=e=>(2&e[is])>0,cs=e=>(4&e[is])>0,us=(e,t)=>t?e[is]|=3:e[is]&=-3,ds=(e,t)=>t?e[is]|=4:e[is]&=-5;class ps extends ls{constructor(e,t){if(super(),this.key=void 0,this.animation=new Ki,this.queue=void 0,this.defaultProps={},this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Yr.und(e)||!Yr.und(t)){const n=Yr.obj(e)?Ii({},e):Ii({},t,{from:e});Yr.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(as(this)||this._state.asyncTo)||cs(this)}get goal(){return Vl(this.animation.to)}get velocity(){const e=pi(this);return e instanceof hi?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return ss(this)}get isAnimating(){return as(this)}get isPaused(){return cs(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=fi(o.to);!i&&zl(o.to)&&(l=Jr(Vl(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==vi?1:i?i[a].lastPosition:l[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],l=null!=s.v0?s.v0:s.v0=Yr.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(Yr.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,a=r.clamp?0:r.bounce,p=!Yr.und(a),m=n==c?s.v0>0:n<c;let f,g=!1;const h=1,v=Math.ceil(e/h);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(g=d==c||d>c==m,g&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*h,d+=i*h}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=pi(this),a=s.getValue();if(t){const e=Vl(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return Tr.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(as(this)){const{to:e,config:t}=this.animation;Tr.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Yr.und(e)?(n=this.queue||[],this.queue=[]):n=[Yr.obj(e)?e:Ii({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Yi(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),es(this._state,e&&this._lastCallId),Tr.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=Yr.obj(n)?n[t]:n,(null==n||Vi(n))&&(n=void 0),o=Yr.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return ss(this)||(e.reverse&&([n,o]=[o,n]),o=Vl(o),Yr.und(o)?pi(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Ii({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Li(n,((e,t)=>/^on/.test(t)?Ni(e,o):e))),ks(this,n,"onProps"),_s(this,"onProps",n,this);const l=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return qi(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{cs(this)||(ds(this,!0),tl(i.pauseQueue),_s(this,"onPause",Qi(this,ms(this,this.animation.to)),this))},resume:()=>{cs(this)&&(ds(this,!1),as(this)&&this._resume(),tl(i.resumeQueue),_s(this,"onResume",Qi(this,ms(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=fs(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Zi(this));const o=!Yr.und(e.to),r=!Yr.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Zi(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!Yr.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Xr(d,c);p&&(s.from=d),d=Vl(d);const m=!Xr(u,a);m&&this._focus(u);const f=Vi(t.to),{config:g}=s,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&($i(n=Ii({},n),t),t=Ii({},n,t)),$i(e,t),Object.assign(e,t);for(const t in Ui)null==e[t]&&(e[t]=Ui[t]);let{mass:o,frequency:r,damping:l}=e;Yr.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(g,Ti(t.config,l),t.config!==i.config?Ti(i.config,l):void 0);let b=pi(this);if(!b||Yr.und(u))return n(Qi(this,!0));const k=Yr.und(t.reset)?r&&!t.default:!Yr.und(d)&&Pi(t.reset,l),_=k?d:this.get(),y=Fi(u),E=Yr.num(y)||Yr.arr(y)||ri(y),C=!f&&(!E||Pi(i.immediate||t.immediate,l));if(m){const e=Ei(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}const S=b.constructor;let w=zl(u),B=!1;if(!w){const e=k||!ss(this)&&p;(m||e)&&(B=Xr(Fi(_),y),w=!B),(Xr(s.immediate,C)||C)&&Xr(g.decay,h)&&Xr(g.velocity,v)||(w=!0)}if(B&&as(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||zl(a))&&(s.values=b.getPayload(),s.toValues=zl(u)?null:S==vi?[1]:Jr(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Qr(bs,(e=>ks(this,t,e)));const o=Qi(this,ms(this,a));tl(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&Tr.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?Ti(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(Ji(t.to,t,this._state,this)):w?this._start():as(this)&&!m?this._pendingCalls.add(n):n(Xi(_))}_focus(e){const t=this.animation;e!==t.to&&(Hl(this)&&this._detach(),t.to=e,Hl(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;zl(t)&&($l(t,this),os(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;zl(e)&&jl(e,this)}_set(e,t=!0){const n=Vl(e);if(!Yr.und(n)){const e=pi(this);if(!e||!Xr(n,e.getValue())){const o=Ei(n);e&&e.constructor==o?e.setValue(n):mi(this,o.create(n)),e&&Tr.batchedUpdates((()=>{this._onChange(n,t)}))}}return pi(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,_s(this,"onStart",Qi(this,ms(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Ti(this.animation.onChange,e,this)),Ti(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;pi(this).reset(Vl(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),as(this)||(us(this,!0),cs(this)||this._resume())}_resume(){sl.skipAnimation?this.finish():pl.start(this)}_stop(e,t){if(as(this)){us(this,!1);const n=this.animation;Qr(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Gl(this,{type:"idle",parent:this});const o=t?Zi(this.get()):Qi(this.get(),ms(this,null!=e?e:n.to));tl(this._pendingCalls,o),n.changed&&(n.changed=!1,_s(this,"onRest",o,this))}}}function ms(e,t){const n=Fi(t);return Xr(Fi(e.get()),n)}function fs(e,t=e.loop,n=e.to){let o=Ti(t);if(o){const r=!0!==o&&Oi(o),l=(r||e).reverse,i=!r||r.reset;return gs(Ii({},e,{loop:t,default:!1,pause:void 0,to:!l||Vi(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function gs(e){const{to:t,from:n}=e=Oi(e),o=new Set;return Yr.obj(t)&&vs(t,o),Yr.obj(n)&&vs(n,o),e.keys=o.size?Array.from(o):null,e}function hs(e){const t=gs(e);return Yr.und(t.default)&&(t.default=Li(t)),t}function vs(e,t){Zr(e,((e,n)=>null!=e&&t.add(n)))}const bs=["onStart","onRest","onChange","onPause","onResume"];function ks(e,t,n){e.animation[n]=t[n]!==Mi(t,n)?Ni(t[n],e.key):void 0}function _s(e,t,...n){var o,r,l,i;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(l=(i=e.defaultProps)[t])||l.call(i,...n)}const ys=["onStart","onChange","onRest"];let Es=1;class Cs{constructor(e,t){this.id=Es++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(Ii({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];Yr.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(gs(e)),this}start(e){let{queue:t}=this;return e?t=Jr(e).map(gs):this.queue=[],this._flush?this._flush(this,t):(Ps(this,t),Ss(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Qr(Jr(t),(t=>n[t].stop(!!e)))}else es(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Yr.und(e))this.start({pause:!0});else{const t=this.springs;Qr(Jr(e),(e=>t[e].pause()))}return this}resume(e){if(Yr.und(e))this.start({pause:!1});else{const t=this.springs;Qr(Jr(e),(e=>t[e].resume()))}return this}each(e){Zr(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,el(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&el(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,el(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}Tr.onFrame(this._onFrame)}}function Ss(e,t){return Promise.all(t.map((t=>ws(e,t)))).then((t=>Yi(e,t)))}async function ws(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Yr.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Yr.arr(r)||Yr.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Qr(ys,(n=>{const o=t[n];if(Yr.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,tl(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===Mi(t,"cancel");(u||m&&d.asyncId)&&p.push(qi(++e._lastAsyncId,{props:t,state:d,actions:{pause:qr,resume:qr,start(t,n){m?(es(d,e._lastAsyncId),n(Zi(e))):(t.onRest=s,n(Ji(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Yi(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=fs(t,i,r);if(n)return Ps(e,[n]),ws(e,n,!0)}return a&&Tr.batchedUpdates((()=>a(f,e,e.item))),f}function Bs(e,t){const n=Ii({},e.springs);return t&&Qr(Jr(t),(e=>{Yr.und(e.keys)&&(e=gs(e)),Yr.obj(e.to)||(e=Ii({},e,{to:void 0})),Ts(n,e,(e=>Is(e)))})),xs(e,n),n}function xs(e,t){Zr(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,$l(t,e))}))}function Is(e,t){const n=new ps;return n.key=e,t&&$l(n,t),n}function Ts(e,t,n){t.keys&&Qr(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Ps(e,t){Qr(t,(t=>{Ts(e.springs,t,(t=>Is(t,e)))}))}const Ns=["children"],Ms=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,Ns);const o=(0,jr.useContext)(Rs),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,jr.useState)((()=>({inputs:t,result:e()}))),o=(0,jr.useRef)(),r=o.current;let l=r;return l?Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs))||(l={inputs:t,result:e()}):l=n,(0,jr.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Rs;return jr.createElement(i,{value:n},t)},Rs=(Ls=Ms,As={},Object.assign(Ls,jr.createContext(As)),Ls.Provider._context=Ls,Ls.Consumer._context=Ls,Ls);var Ls,As;Ms.Provider=Rs.Provider,Ms.Consumer=Rs.Consumer;const Ds=()=>{const e=[],t=function(t){oi(`${ei}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return Qr(e,((e,r)=>{if(Yr.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Qr(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Qr(e,(e=>e.resume(...arguments))),this},t.set=function(t){Qr(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Qr(e,((e,o)=>{if(Yr.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return Qr(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Qr(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Yr.fun(e)?e(n,t):e};return t._getProps=n,t};function Os(e,t,n){const o=Yr.fun(t)&&t;o&&!n&&(n=[]);const r=(0,jr.useMemo)((()=>o||3==arguments.length?Ds():void 0),[]),l=(0,jr.useRef)(0),i=si(),s=(0,jr.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Bs(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Ss(e,t):new Promise((o=>{xs(e,n),s.queue.push((()=>{o(Ss(e,t))})),i()}))}})),[]),a=(0,jr.useRef)([...s.ctrls]),c=[],u=ci(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new Cs(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=hs(n))}}(0,jr.useMemo)((()=>{Qr(a.current.slice(e,u),(e=>{Hi(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,jr.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Bs(e,c[t]))),m=(0,jr.useContext)(Ms),f=ci(m),g=m!==f&&zi(m);ui((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Qr(e,(e=>e()))),Qr(a.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(Gi(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),li((()=>()=>{Qr(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>Ii({},e)));return r?[h,r]:h}let Fs;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Fs||(Fs={}));class zs extends ls{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Al(...t);const n=this._get(),o=Ei(n);mi(this,o.create(n))}advance(e){const t=this._get();Xr(t,this.get())||(pi(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Hs(this._active)&&Gs(this)}_get(){const e=Yr.arr(this.source)?this.source.map(Vl):Jr(Vl(this.source));return this.calc(...e)}_start(){this.idle&&!Hs(this._active)&&(this.idle=!1,Qr(fi(this),(e=>{e.done=!1})),sl.skipAnimation?(Tr.batchedUpdates((()=>this.advance())),Gs(this)):pl.start(this))}_attach(){let e=1;Qr(Jr(this.source),(t=>{zl(t)&&$l(t,this),os(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Qr(Jr(this.source),(e=>{zl(e)&&jl(e,this)})),this._active.clear(),Gs(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=Jr(this.source).reduce(((e,t)=>Math.max(e,(os(t)?t.priority:0)+1)),0))}}function Vs(e){return!1!==e.idle}function Hs(e){return!e.size||Array.from(e).every(Vs)}function Gs(e){e.idle||(e.idle=!0,Qr(fi(e),(e=>{e.done=!0})),Gl(e,{type:"idle",parent:e}))}sl.assign({createStringInterpolator:Jl,to:(e,t)=>new zs(e,t)}),pl.advance;var Us=window.ReactDOM;function Ws(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}const $s=["style","children","scrollTop","scrollLeft"],js=/^--/;function Ks(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||js.test(e)||Ys.hasOwnProperty(e)&&Ys[e]?(""+t).trim():t+"px"}const qs={};let Ys={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const Xs=["Webkit","Ms","Moz","O"];Ys=Object.keys(Ys).reduce(((e,t)=>(Xs.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Ys);const Qs=["x","y","z"],Zs=/^(matrix|translate|scale|rotate|skew)/,Js=/^(translate)/,ea=/^(rotate|skew)/,ta=(e,t)=>Yr.num(e)&&0!==e?e+t:e,na=(e,t)=>Yr.arr(e)?e.every((e=>na(e,t))):Yr.num(e)?e===t:parseFloat(e)===t;class oa extends ki{constructor(e){let{x:t,y:n,z:o}=e,r=Ws(e,Qs);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>ta(e,"px"))).join(",")})`,na(e,0)]))),Zr(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Zs.test(t)){if(delete r[t],Yr.und(e))return;const n=Js.test(t)?"px":ea.test(t)?"deg":"";l.push(Jr(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${ta(r,n)})`,na(r,0)]:e=>[`${t}(${e.map((e=>ta(e,n))).join(",")})`,na(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new ra(l,i)),super(r)}}class ra extends Ul{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Qr(this.inputs,((n,o)=>{const r=Vl(n[0]),[l,i]=this.transforms[o](Yr.arr(r)?r:n.map(Vl));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Qr(this.inputs,(e=>Qr(e,(e=>zl(e)&&$l(e,this)))))}observerRemoved(e){0==e&&Qr(this.inputs,(e=>Qr(e,(e=>zl(e)&&jl(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Gl(this,e)}}const la=["scrollTop","scrollLeft"];sl.assign({batchedUpdates:Us.unstable_batchedUpdates,createStringInterpolator:Jl,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});const ia=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new ki(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=xi(e)||"Anonymous";return(e=Yr.str(e)?l[e]||(l[e]=Si(e,r)):e[Bi]||(e[Bi]=Si(e,r))).displayName=`Animated(${t})`,e};return Zr(e,((t,n)=>{Yr.arr(e)&&(n=xi(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:l,scrollTop:i,scrollLeft:s}=o,a=Ws(o,$s),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:qs[t]||(qs[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==l&&(e.textContent=l);for(let t in r)if(r.hasOwnProperty(t)){const n=Ks(t,r[t]);js.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new oa(e),getComponentProps:e=>Ws(e,la)}).animated,sa=e=>e+1,aa=e=>({top:e.offsetTop,left:e.offsetLeft});var ca=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(sa,0),[u,p]=(0,s.useReducer)(sa,0),[m,f]=(0,s.useState)({x:0,y:0}),g=(0,s.useMemo)((()=>l.current?aa(l.current):null),[r]),h=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,ar.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=aa(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=Yr.fun(e),[[o],r]=Os(1,n?e:[e],n?t||[]:t)}({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:a!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:v}),l};const ua=".block-editor-block-list__block",da=".block-list-appender";function pa(e,t){return t.closest([ua,da].join(","))===e}function ma(e,t){e.parentElement.closest("[contenteditable]").contentEditable=t}function fa(e){const{startMultiSelect:t,stopMultiSelect:n,multiSelect:o,selectBlock:r}=(0,m.useDispatch)(zn),{isSelectionEnabled:l,isBlockSelected:i,getBlockParents:s,getBlockSelectionStart:a,hasMultiSelection:c}=(0,m.useSelect)(zn);return(0,d.useRefEffect)((u=>{const{ownerDocument:d}=u,{defaultView:p}=d;let m,f;function g(t){let{isSelectionEnd:n}=t;const l=p.getSelection();if(!l.rangeCount||l.isCollapsed)return void ma(u,!1);const i=function(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(ua);return t?t.id.slice("block-".length):void 0}(l.focusNode);if(e===i){if(r(e),n&&(ma(u,!1),l.rangeCount)){const{commonAncestorContainer:e}=l.getRangeAt(0);m.contains(e)&&m.focus()}}else{const t=[...s(e),e],n=[...s(i),i],r=Math.min(t.length,n.length)-1;o(t[r],n[r])}}function h(){d.removeEventListener("selectionchange",g),p.removeEventListener("mouseup",h),f=p.requestAnimationFrame((()=>{g({isSelectionEnd:!0}),n()}))}function v(n){let{buttons:o}=n;1===o&&l()&&i(e)&&(m=d.activeElement,t(),d.addEventListener("selectionchange",g),p.addEventListener("mouseup",h),ma(u,!0))}function b(t){if(l()&&0===t.button)if(t.shiftKey){const n=a(),r=s(n);if(n&&n!==e&&(null==r||!r.includes(e))){const l=[...r,n],i=[...s(e),e],a=Math.min(l.length,i.length)-1,c=l[a],d=i[a];c!==d&&(ma(u,!0),o(c,d),t.preventDefault())}}else c()&&r(e)}return u.addEventListener("mousedown",b),u.addEventListener("mouseleave",v),()=>{u.removeEventListener("mousedown",b),u.removeEventListener("mouseleave",v),d.removeEventListener("selectionchange",g),p.removeEventListener("mouseup",h),p.cancelAnimationFrame(f)}}),[e,t,n,o,r,l,i,s])}function ga(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isMultiSelecting:o,isNavigationMode:r,isBlockSelected:l}=t(zn);if(l(e)&&!o()&&!r())return n()}),[e])}(e);return(0,s.useEffect)((()=>{if(null==n)return;if(!t.current)return;const{ownerDocument:e}=t.current;if(t.current.contains(e.activeElement))return;const o=ar.focus.tabbable.find(t.current).filter((e=>(0,ar.isTextField)(e))),r=-1===n,l=(r?u.last:u.first)(o)||t.current;pa(t.current,l)?(ma(t.current,!1),(0,ar.placeCaretAtHorizontalEdge)(l,r)):t.current.focus()}),[n]),t}function ha(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function va(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(zn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",ha),t.addEventListener("mouseover",ha),()=>{t.removeEventListener("mouseout",ha),t.removeEventListener("mouseover",ha),t.classList.remove("is-hovered")}}),[e])}function ba(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__experimentalGetActiveBlockIdByBlockNames:p}=t(zn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=a(),g=n(e),h=l(e),v=s(e),b=u(e,!0),k=p(m);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":g,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":h&&f&&d()})}),[e])}function ka(e){return(0,m.useSelect)((t=>{const n=t(zn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function _a(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(zn),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function ya(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(zn);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(s),l(e))}):void 0}),[e])}function Ea(e){const{isBlockSelected:t}=(0,m.useSelect)(zn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((r=>{function l(l){t(e)?l.target.isContentEditable||o(e):pa(r,l.target)&&n(e)}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Ca=window.wp.keycodes;function Sa(e){const t=(0,m.useSelect)((t=>t(zn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(zn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==Ca.ENTER&&s!==Ca.BACKSPACE&&s!==Ca.DELETE||a!==i||(0,ar.isTextField)(a)||(t.preventDefault(),s===Ca.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function wa(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(zn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}var Ba=n(5425),xa=n.n(Ba);function Ia(e){const t=(0,s.useRef)(),n=(0,m.useSelect)((t=>{const{isBlockSelected:n,getBlockSelectionEnd:o}=t(zn);return n(e)||o()===e}),[e]);return(0,s.useEffect)((()=>{if(!n)return;const e=t.current;if(!e)return;if(e.contains(e.ownerDocument.activeElement))return;const o=(0,ar.getScrollContainer)(e)||e.ownerDocument.defaultView;o&&xa()(e,o,{onlyScrollIfNeeded:!0})}),[n]),t}const Ta=(0,s.createContext)({refs:new Map,callbacks:new Map});function Pa(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(Ta.Provider,{value:n},t)}function Na(e){const{refs:t,callbacks:n}=(0,s.useContext)(Ta),o=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,d.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function Ma(e){const{refs:t}=(0,s.useContext)(Ta),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function Ra(e){const{callbacks:t}=(0,s.useContext)(Ta),n=Ma(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function La(){const e=(0,s.useContext)(bm);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Aa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:l={},isAligned:i}=(0,s.useContext)(Da),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:h,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(zn),p=a(n),m=c(n)||u(n),f=l(n),g=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:null==g?void 0:g.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),_=(0,g.sprintf)((0,g.__)("Block: %s"),h),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,ga(n),Ia(n),Na(n),Ea(n),fa(n),Sa(n),wa(n),va(),La(),ca({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a})]),C=Un();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,ba(n),ka(n),_a(n),ya(n)),style:{...l.style,...e.style}}}Aa.save=r.__unstableGetBlockProps;const Da=(0,s.createContext)();function Oa(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Aa(o,{__unstableIsHtml:n}),t)}const Fa=(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(zn),d=a(n),p=r(n),m=s(o),f=c(n,o),g=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:g,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),za=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(zn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(zn),r=n(),{clientId:i}=t,s=r.length?r:[i];l(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(zn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(zn);if(e){const e=l(n);e&&s(n,e)}else{const e=r(n);e&&s(e,n)}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}}));var Va=(0,d.compose)(d.pure,Fa,za,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{mode:n,isLocked:o,canRemove:l,clientId:i,isSelected:a,isSelectionEnabled:d,className:p,name:f,isValid:g,attributes:h,wrapperProps:v,setAttributes:b,onReplace:k,onInsertBlocksAfter:_,onMerge:y,toggleSelection:E}=e;const C=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return t().supportsLayout}),[]),{removeBlock:S}=(0,m.useDispatch)(zn),w=(0,s.useCallback)((()=>S(i)),[i]);let B=(0,s.createElement)(fr,{name:f,isSelected:a,attributes:h,setAttributes:b,insertBlocksAfter:o?void 0:_,onReplace:l?k:void 0,onRemove:l?w:void 0,mergeBlocks:l?y:void 0,clientId:i,isSelectionEnabled:d,toggleSelection:E});const x=(0,r.getBlockType)(f);null!=x&&x.getEditWrapperProps&&(v=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(v,x.getEditWrapperProps(h)));const I=v&&!!v["data-align"]&&!C;let T;if(I&&(B=(0,s.createElement)("div",{className:"wp-block","data-align":v["data-align"]},B)),g)T="html"===n?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},B),(0,s.createElement)(Oa,{isHtml:!0},(0,s.createElement)(xr,{clientId:i}))):(null==x?void 0:x.apiVersion)>1?B:(0,s.createElement)(Oa,v,B);else{const e=(0,r.getSaveContent)(x,h);T=(0,s.createElement)(Oa,{className:"has-warning"},(0,s.createElement)(yr,{clientId:i}),(0,s.createElement)(s.RawHTML,null,(0,ar.safeHTML)(e)))}const P={clientId:i,className:null!==(t=v)&&void 0!==t&&t["data-align"]&&C?c()(p,`align${v["data-align"]}`):p,wrapperProps:(0,u.omit)(v,["data-align"]),isAligned:I},N=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(Da.Provider,{value:N},(0,s.createElement)(wr,{fallback:(0,s.createElement)(Oa,{className:"has-warning"},(0,s.createElement)(Cr,null))},T))})),Ha=window.wp.htmlEntities,Ga=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Ua=[(0,s.createInterpolateElement)((0,g.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,g.__)("Drag files into the editor to automatically insert media blocks."),(0,g.__)("Change a block's type by pressing the block icon on the toolbar.")];var Wa=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Ua.length));return(0,s.createElement)(p.Tip,null,Ua[e])},$a=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),ja=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:$a});const l=(0,s.createElement)(p.Icon,{icon:n&&n.src?n.src:n}),i=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,s.createElement)("span",{style:i,className:c()("block-editor-block-icon",r,{"has-colors":o})},l)})),Ka=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(Rt()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(ja,{icon:n,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-block-card__content"},(0,s.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,s.createElement)("span",{className:"block-editor-block-card__description"},o)))};function qa(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(zn),{getBlockName:h,getBlocks:v}=a.select(zn),b=(0,m.useSelect)((e=>!t||e(zn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(g(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,s.useRef)(i),C=(0,s.useRef)(l);(0,s.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,s.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(zn);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(t))return;if(t&&!i(t))return;const a=r(),d=v(t),p=d!==s;if(s=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,k.current.outgoing.push(s),(c?C.current:E.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}var Ya=(0,d.createHigherOrderComponent)((e=>(0,m.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,s.createElement)(e,i({registry:o},r));const[l,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,m.createRegistry)({},o);e.registerStore(On,Fn),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(zn);return(0,s.useEffect)((()=>{o(n)}),[n]),qa(e),(0,s.createElement)(Pa,null,t)}));function Xa(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(p.Disabled,null,(0,s.createElement)(_m,null)))}function Qa(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(zn),{clearSelectedBlock:n}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function Za(e){return(0,s.createElement)("div",i({ref:Qa()},e))}function Ja(e,t){const n="start"===t?"firstChild":"lastChild",o="start"===t?"nextSibling":"previousSibling";for(;e[n];)for(e=e[n];e.nodeType===e.TEXT_NODE&&/^[ \t\n]*$/.test(e.data)&&e[o];)e=e[o];return e}function ec(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l}=e(zn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l()}}function tc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r}=(0,m.useSelect)(ec,[]),l=Ma(r),i=Ma((0,u.first)(n)),s=Ma((0,u.last)(n));return(0,d.useRefEffect)((a=>{const{ownerDocument:c}=a,{defaultView:u}=c;if(null==e)return;if(!o||t){if(!r||t)return;const e=u.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=l.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:d}=n;if(d<2)return;if(!i.current||!s.current)return;a.contentEditable=!0,a.focus();const p=u.getSelection(),m=c.createRange(),f=Ja(i.current,"start"),g=Ja(s.current,"end");m.setStartBefore(f),m.setEndAfter(g),p.removeAllRanges(),p.addRange(m)}),[o,t,n,r,e])}function nc(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}function oc(e,t,n,o){let r,l=ar.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!ar.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function rc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksStartClientId:t,getMultiSelectedBlocksEndClientId:n,getPreviousBlockClientId:o,getNextBlockClientId:r,getFirstMultiSelectedBlockClientId:l,getLastMultiSelectedBlockClientId:i,getSettings:s,hasMultiSelection:a}=(0,m.useSelect)(zn),{multiSelect:c,selectBlock:u}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((d=>{let p;function m(){p=null}function f(l){const i=e(),s=t(),a=n(),d=o(a||i),p=r(a||i),m=l?d:p;m&&(s===m?u(m):c(s||i,m))}function g(e){const t=l(),n=i(),o=e?t:n;o&&u(o)}function h(t){const{keyCode:l,target:i}=t,c=l===Ca.UP,u=l===Ca.DOWN,m=l===Ca.LEFT,h=l===Ca.RIGHT,v=c||m,b=m||h,k=c||u,_=b||k,y=t.shiftKey,E=y||t.ctrlKey||t.altKey||t.metaKey,C=k?ar.isVerticalEdge:ar.isHorizontalEdge,{ownerDocument:S}=d,{defaultView:w}=S;if(a())return void(_&&((y?f:g)(v),t.preventDefault()));if(k?p||(p=(0,ar.computeCaretRect)(w)):p=null,t.defaultPrevented)return;if(!_)return;if(!function(e,t,n){if((t===Ca.UP||t===Ca.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(i,l,E))return;const B=(0,ar.isRTL)(i)?!v:v,{keepCaretInsideBlock:x}=s(),I=e();if(y){const e=n(),l=o(e||I),s=r(e||I);(v&&l||!v&&s)&&function(e,t){const n=oc(e,t,d);return!n||!function(e,t){return e.closest(ua)===t.closest(ua)}(e,n)}(i,v)&&C(i,v)&&(f(v),t.preventDefault())}else if(k&&(0,ar.isVerticalEdge)(i,v)&&!x){const e=oc(i,v,d,!0);e&&((0,ar.placeCaretAtVerticalEdge)(e,v,p),t.preventDefault())}else if(b&&w.getSelection().isCollapsed&&(0,ar.isHorizontalEdge)(i,B)&&!x){const e=oc(i,B,d);(0,ar.placeCaretAtHorizontalEdge)(e,v),t.preventDefault()}}return d.addEventListener("mousedown",m),d.addEventListener("keydown",h),()=>{d.removeEventListener("mousedown",m),d.removeEventListener("keydown",h)}}),[])}var lc=window.wp.keyboardShortcuts;function ic(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(zn),{multiSelect:o}=(0,m.useDispatch)(zn),r=(0,lc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,ar.isEntirelySelected)(l.target))return;const[s]=i,a=n(s);let c=e(a);i.length===c.length&&(c=e(n(a)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function sc(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,m.useSelect)(zn),{setNavigationMode:a}=(0,m.useDispatch)(zn),c=(0,m.useSelect)((e=>e(zn).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function p(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";ar.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),g=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===Ca.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==Ca.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if((nc(e.target)||e.target.getAttribute("data-block")===l())&&nc(ar.focus.tabbable[i](e.target)))return;const c=o?t:n;u.current=!0,c.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==Ca.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=ar.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,h]),g]}(),o=(0,m.useSelect)((e=>e(zn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,tc(),ic(),rc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var ac=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=sc();return(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)}));const cc="editor-styles-wrapper";function uc(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var dc=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,...u}=e;const[,m]=(0,s.useReducer)((()=>({}))),[f,h]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=uc(null==a?void 0:a.styles),_=uc(null==a?void 0:a.scripts),y=Qa(),[E,C,S]=sc(),w=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),h(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}t()||e.addEventListener("load",(()=>{t()}))}),[]),B=(0,d.useRefEffect)((e=>{_.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{m()}))}),[]),x=(0,d.useMergeRefs)([n,y,C]);return(0,s.useEffect)((()=>{var e;f&&(e=f,Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${cc}`)||t.includes(".wp-block"))}))&&!e.getElementById(n.id)){e.head.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.head.appendChild(o.cloneNode(!0))}})))}),[f]),r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,title:(0,g.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:x,className:c()(cc,...v)},(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),pc={grad:.9,turn:360,rad:360/(2*Math.PI)},mc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},fc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},gc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},hc=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},vc=function(e){return{r:gc(e.r,0,255),g:gc(e.g,0,255),b:gc(e.b,0,255),a:gc(e.a)}},bc=function(e){return{r:fc(e.r),g:fc(e.g),b:fc(e.b),a:fc(e.a,3)}},kc=/^#([0-9a-f]{3,8})$/i,_c=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},yc=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),s=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:l?i/l*100:0,v:l/255*100,a:r}},Ec=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,i,i,a,o][c],g:255*[a,o,o,s,i,i][c],b:255*[i,i,a,o,o,s][c],a:r}},Cc=function(e){return{h:hc(e.h),s:gc(e.s,0,100),l:gc(e.l,0,100),a:gc(e.a)}},Sc=function(e){return{h:fc(e.h),s:fc(e.s),l:fc(e.l),a:fc(e.a,3)}},wc=function(e){return Ec((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},Bc=function(e){return{h:(t=yc(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},xc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ic=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Tc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Pc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nc={string:[[function(e){var t=kc.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?fc(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?fc(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Tc.exec(e)||Pc.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:vc({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=xc.exec(e)||Ic.exec(e);if(!t)return null;var n,o,r=Cc({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(pc[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return wc(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return mc(t)&&mc(n)&&mc(o)?vc({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!mc(t)||!mc(n)||!mc(o))return null;var i=Cc({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return wc(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!mc(t)||!mc(n)||!mc(o))return null;var i=function(e){return{h:hc(e.h),s:gc(e.s,0,100),v:gc(e.v,0,100),a:gc(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Ec(i)},"hsv"]]},Mc=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},Rc=function(e,t){var n=Bc(e);return{h:n.h,s:gc(n.s+100*t,0,100),l:n.l,a:n.a}},Lc=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Ac=function(e,t){var n=Bc(e);return{h:n.h,s:n.s,l:gc(n.l+100*t,0,100),a:n.a}},Dc=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Mc(e.trim(),Nc.string):"object"==typeof e&&null!==e?Mc(e,Nc.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return fc(Lc(this.rgba),2)},e.prototype.isDark=function(){return Lc(this.rgba)<.5},e.prototype.isLight=function(){return Lc(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=bc(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?_c(fc(255*r)):"","#"+_c(t)+_c(n)+_c(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return bc(this.rgba)},e.prototype.toRgbString=function(){return t=(e=bc(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return Sc(Bc(this.rgba))},e.prototype.toHslString=function(){return t=(e=Sc(Bc(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=yc(this.rgba),{h:fc(e.h),s:fc(e.s),v:fc(e.v),a:fc(e.a,3)};var e},e.prototype.invert=function(){return Oc({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),Oc(Rc(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Oc(Rc(this.rgba,-e))},e.prototype.grayscale=function(){return Oc(Rc(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Oc(Ac(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Oc(Ac(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?Oc({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):fc(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Bc(this.rgba);return"number"==typeof e?Oc({h:e,s:t.s,l:t.l,a:t.a}):fc(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Oc(e).toHex()},e}(),Oc=function(e){return e instanceof Dc?e:new Dc(e)},Fc=[],zc=function(e){e.forEach((function(e){Fc.indexOf(e)<0&&(e(Dc,Nc),Fc.push(e))}))};function Vc(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var Hc=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Gc=function(e){return.2126*Hc(e.r)+.7152*Hc(e.g)+.0722*Hc(e.b)};function Uc(e){e.prototype.luminance=function(){return e=Gc(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,l,i,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(s=Gc(l))>(a=Gc(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var Wc=n(3124),$c=n.n(Wc);const jc=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Kc(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),f(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function h(){const e=p(/^([^{]+)/);if(e)return qc(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=qc(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(jc,""),value:n?qc(n[0]).replace(jc,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(e));return u()?e:a("missing '}'")}function k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return a("@keyframes missing name");const o=t[1];if(!c())return a("@keyframes missing '{'");let r,i=f();for(;r=k();)i.push(r),i=i.concat(f());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=qc(t[1]);if(!c())return a("@media missing '{'");const o=f().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:qc(t[1]),media:qc(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=qc(t[1]);if(!c())return a("@supports missing '{'");const o=f().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=qc(t[1]),o=qc(t[2]);if(!c())return a("@document missing '{'");const r=f().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=h()||[];if(!c())return a("@page missing '{'");let n,o=f();for(;n=v();)o.push(n),o=o.concat(f());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Yc(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function qc(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Yc(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){Yc(e,o)})):n&&"object"==typeof n&&Yc(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Xc=n(8575),Qc=n.n(Xc),Zc=Jc;function Jc(e){this.options=e||{}}Jc.prototype.emit=function(e){return e},Jc.prototype.visit=function(e){return this[e.type](e)},Jc.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};var eu=tu;function tu(e){Zc.call(this,e)}Qc()(tu,Zc),tu.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},tu.prototype.comment=function(e){return this.emit("",e.position)},tu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},tu.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},tu.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},tu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},tu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},tu.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},tu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},tu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},tu.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},tu.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},tu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},tu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},tu.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},tu.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var nu=ou;function ou(e){e=e||{},Zc.call(this,e),this.indentation=e.indent}Qc()(ou,Zc),ou.prototype.compile=function(e){return this.stylesheet(e)},ou.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},ou.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},ou.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},ou.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ou.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ou.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},ou.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},ou.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ou.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},ou.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},ou.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},ou.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},ou.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ou.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},ou.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},ou.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},ou.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var ru=function(e,t){try{const r=Kc(e);return n=$c().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new eu(o):new nu(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function lu(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function iu(e,t){return new URL(e,t).toString()}var su=e=>t=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};lu(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+iu(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t};const au=/^(body|html|:root).*$/;var cu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(au)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},uu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(cu(t)),o&&r.push(su(o)),r.length?ru(n,(0,d.compose)(r)):n}))};const du=".editor-styles-wrapper";function pu(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(du);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=Oc(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function mu(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>uu(t,du)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:pu(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let fu;zc([Vc,Uc]);const gu=2e3;var hu=function(e){let{viewportWidth:t,__experimentalPadding:n}=e;const[o,{width:r}]=(0,d.useResizeObserver)(),[l,{height:i}]=(0,d.useResizeObserver)(),{styles:a,assets:c}=(0,m.useSelect)((e=>{const t=e(zn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),u=(0,s.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:a),[a]);fu=fu||(0,d.pure)(_m);const f=r/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},o,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${f})`,height:i*f,maxHeight:i>gu?gu*f:void 0}},(0,s.createElement)(dc,{head:(0,s.createElement)(mu,{styles:u}),assets:c,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:gu}},l,(0,s.createElement)(fu,{renderAppender:!1}))))},vu=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l}=e;const i=(0,m.useSelect)((e=>e(zn).getSettings()),[]),a=(0,s.useMemo)((()=>{const e={...i};return e.__experimentalBlockPatterns=[],e}),[i]),c=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(Ya,{value:c,settings:a},r?(0,s.createElement)(Xa,{onClick:l}):(0,s.createElement)(hu,{viewportWidth:o,__experimentalPadding:n})):null}));function bu(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(zn).getSettings()),[]),l=(0,d.__experimentalUseDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,s.createElement)(Ya,{value:p,settings:a},(0,s.createElement)(Em,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?f:null}}var ku=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:a,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(vu,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,g.__)("No Preview Available."))),!p&&(0,s.createElement)(Ka,{title:i,icon:a,description:c}))},_u=(0,s.createContext)(),yu=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(_u);return(0,s.createElement)(p.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,r):"function"==typeof r?r(t):(0,s.createElement)(p.Button,t,r)}))})),Eu=(0,s.createElement)(O.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Cu(e){let{count:t,icon:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip"},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(p.FlexItem,null,n?(0,s.createElement)(ja,{icon:n}):(0,g.sprintf)(
|
11 |
/* translators: %d: Number of blocks. */
|
12 |
+
(0,g._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(ja,{icon:Eu})))))}var Su=e=>{let{isEnabled:t,blocks:n,icon:o,children:r}=e;const l={type:"inserter",blocks:n};return(0,s.createElement)(p.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,__experimentalDragComponent:(0,s.createElement)(Cu,{count:n.length,icon:o})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};function wu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var Bu=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:a,isDraggable:u,...d}=e;const p=(0,s.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},f=(0,s.useMemo)((()=>[(0,r.createBlock)(o.name,o.initialAttributes,(0,r.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,s.createElement)(Su,{isEnabled:u&&!o.disabled,blocks:f,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:f}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{p.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{p.current=!1,f&&f(e)}},(0,s.createElement)(yu,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,wu()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Ca.ENTER&&(e.preventDefault(),l(o,wu()?e.metaKey:e.ctrlKey),a(null))},onFocus:()=>{p.current||a(o)},onMouseEnter:()=>{p.current||a(o)},onMouseLeave:()=>a(null),onBlur:()=>a(null)},d),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:m},(0,s.createElement)(ja,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))})),xu=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Pt.speak)((0,g.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,s.createElement)("div",i({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))})),Iu=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(_u);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),Tu=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(xu,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let t=0,o=e.length;t<o;t+=3)n.push(e.slice(t,t+3));return n}(t).map(((e,t)=>(0,s.createElement)(Iu,{key:t},e.map(((e,l)=>(0,s.createElement)(Bu,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)},Pu=function(e){let{title:t,icon:n,children:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,s.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,s.createElement)(p.Icon,{icon:n})),(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},o))},Nu=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(zn),{getCategories:o,getCollections:l}=t(r.store);return{categories:o(),collections:l(),items:n(e)}}),[e]);return[l,n,o,(0,s.useCallback)(((e,n)=>{let{name:o,initialAttributes:l,innerBlocks:i}=e;const s=(0,r.createBlock)(o,l,(0,r.createBlocksFromInnerBlocksTemplate)(i));t(s,void 0,n)}),[t])]},Mu=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(_u.Provider,{value:n},t)};const Ru=[];var Lu=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=Nu(t,n),p=(0,s.useMemo)((()=>(0,u.orderBy)(l,["frecency"],["desc"]).slice(0,6)),[l]),m=(0,s.useMemo)((()=>l.filter((e=>!e.category))),[l]),f=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),h=(0,s.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,a]);(0,s.useEffect)((()=>()=>o(null)),[]);const v=(0,d.useAsyncList)(i),b=i.length===v.length,k=(0,s.useMemo)((()=>Object.entries(a)),[a]),_=(0,d.useAsyncList)(b?k:Ru);return(0,s.createElement)(Mu,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(Pu,{title:(0,g._x)("Most used","blocks")},(0,s.createElement)(Tu,{items:p,onSelect:c,onHover:o,label:(0,g._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=f[e.slug];return t&&t.length?(0,s.createElement)(Pu,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(Tu,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(Pu,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,g.__)("Uncategorized")},(0,s.createElement)(Tu,{items:m,onSelect:c,onHover:o,label:(0,g.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=h[t];return r&&r.length?(0,s.createElement)(Pu,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(Tu,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},Au=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,openPatternExplorer:r}=e;const l=(0,d.useViewportMatch)("medium","<"),i=c()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns");return(0,s.createElement)(p.Flex,{justify:"space-between",align:"start",gap:"4",className:i},(0,s.createElement)(p.FlexItem,{isBlock:!0},(0,s.createElement)(p.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:(0,g.__)("Filter patterns"),hideLabelFromVision:!0,value:t.name,onChange:e=>{o(n.find((t=>e===t.name)))},onBlur:e=>{null!=e&&e.relatedTarget||e.stopPropagation()},options:(()=>{const e=[];return n.map((t=>e.push({value:t.name,label:t.label}))),e})()})),!l&&(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:(0,g.__)("Explore all patterns"),onClick:()=>r()},(0,g._x)("Explore","Label for showing all block patterns"))))},Du=window.wp.notices,Ou=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(zn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(Du.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,g.sprintf)(
|
13 |
/* translators: %s: block pattern title. */
|
14 |
(0,g.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function Fu(e){let{isDraggable:t,pattern:n,onClick:o,composite:r}=e;const{blocks:l,viewportWidth:a}=n,c=`block-editor-block-patterns-list__item-description-${(0,d.useInstanceId)(Fu)}`;return(0,s.createElement)(Su,{isEnabled:t,blocks:l},(e=>{let{draggable:t,onDragStart:u,onDragEnd:d}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__list-item","aria-label":n.title,"aria-describedby":n.description?c:void 0,draggable:t,onDragStart:u,onDragEnd:d},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},r,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,l)}),(0,s.createElement)(vu,{blocks:l,viewportWidth:a}),(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,s.createElement)(p.VisuallyHidden,{id:c},n.description)))}))}function zu(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Vu=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,g.__)("Block Patterns")}=e;const c=(0,p.__unstableUseCompositeState)({orientation:l});return(0,s.createElement)(p.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,s.createElement)(Fu,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(zu,{key:e.name}))))};function Hu(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,s.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,s.createElement)(p.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function Gu(e){let{filterValue:t,setFilterValue:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,s.createElement)(p.SearchControl,{onChange:n,value:t,label:(0,g.__)("Search for patterns"),placeholder:(0,g.__)("Search")}))}var Uu=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,s.createElement)(Gu,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(Hu,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},Wu=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(wo,{className:"block-editor-inserter__no-results-icon",icon:$a}),(0,s.createElement)("p",null,(0,g.__)("No results found.")))},$u=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(zn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(zn),c=r();let u,d=t;return void 0!==n?u=n:o?u=s(o):!l&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,l]),{replaceBlocks:f,insertBlocks:h,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(zn),k=(0,s.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!l&&o&&(0,r.isUnmodifiedDefaultBlock)(o)?f(o.clientId,e,null,a||n?0:null,t):h(e,p,d,!0,a||n?0:null,t);const s=(0,g.sprintf)(// translators: %d: the name of the block that has been added
|
15 |
+
(0,g._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Pt.speak)(s),i&&i()}),[l,c,f,h,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const ju=e=>e.name||"",Ku=e=>e.title,qu=e=>e.description||"",Yu=e=>e.keywords||[],Xu=e=>e.category,Qu=()=>null;function Zu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=(0,u.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const Ju=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(Zu(e))},ed=(e,t)=>(0,u.differenceWith)(e,Ju(t),((e,t)=>t.includes(e))),td=(e,t,n,o)=>0===Ju(o).length?e:nd(e,o,{getCategory:e=>{var n;return null===(n=(0,u.find)(t,{slug:e.category}))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}}),nd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=Ju(t);if(0===o.length)return e;const r=e.map((e=>[e,od(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return r.sort(((e,t)=>{let[,n]=e,[,o]=t;return o-n})),r.map((e=>{let[t]=e;return t}))};function od(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=ju,getTitle:r=Ku,getDescription:l=qu,getKeywords:i=Yu,getCategory:s=Xu,getCollection:a=Qu}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=s(e),g=a(e),h=Zu(t),v=Zu(d);let b=0;if(h===v)b+=30;else if(v.startsWith(h))b+=20;else{const e=[c,d,p,...m,f,g].join(" "),t=(0,u.words)(h);0===ed(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function rd(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,s.createElement)(p.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,g.sprintf)(
|
16 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
17 |
+
(0,g._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var ld=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Pt.speak,500),[l,i]=$u({shouldFocusBlock:!0}),[a,,c]=Ou(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?nd(a,t):a.filter((e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!u.includes(e))):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}))),[t,n,a]);(0,s.useEffect)((()=>{if(!t)return;const e=p.length,n=(0,g.sprintf)(
|
18 |
/* translators: %d: number of results. */
|
19 |
+
(0,g._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),f=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&(0,s.createElement)(rd,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(Mu,null,!f&&(0,s.createElement)(Wu,null),f&&(0,s.createElement)(Vu,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function id(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,s.useState)(""),[l,i]=(0,s.useState)(null==t?void 0:t.name);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,s.createElement)(Uu,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(ld,{filterValue:o,selectedCategory:l,patternCategories:n}))}var sd=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,g.__)("Patterns"),closeLabel:(0,g.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(id,n))};function ad(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=Ou(n,t),a=(0,s.useCallback)((e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=r.reduce(((e,t,n)=>{let{name:o}=t;return e[o]=n,e}),{});return Math.min(...e.categories.map((e=>void 0!==n[e]?n[e]:1/0)))}),[r]),c=(0,s.useMemo)((()=>l.filter((e=>{var t;return"uncategorized"===o.name?a(e)===1/0:null===(t=e.categories)||void 0===t?void 0:t.includes(o.name)}))),[l,o]),u=(0,s.useMemo)((()=>c.sort(((e,t)=>a(e)-a(t)))),[c,a]),p=(0,d.useAsyncList)(u);return c.length?(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},(0,s.createElement)(Vu,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var cd=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=Ou(),u=(0,s.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>c.some((t=>t.name===e))))),[c]),d=(0,s.useMemo)((()=>{const e=c.filter((e=>a.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:o}=t;return[n,o].includes("featured")?"featured"===n?-1:1:0}));return a.some((e=>!u(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,g._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Au,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(ad,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(sd,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},ud=window.wp.url;function dd(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Nu(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(Wu,null):(0,s.createElement)(Pu,{title:(0,g.__)("Reusable blocks")},(0,s.createElement)(Tu,{items:i,onSelect:l,onHover:t,label:(0,g.__)("Reusable blocks")}))}var pd=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(dd,{onHover:o,onInsert:n,rootClientId:t}),(0,s.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,s.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:(0,ud.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:md,Slot:fd}=(0,p.createSlotFill)("__unstableInserterMenuExtension");md.Slot=fd;var gd=md;const hd=[];var vd=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:f=!1,isDraggable:h=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Pt.speak,500),[_,y]=$u({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=Nu(_,y),[B,,x]=Ou(y,_),I=(0,s.useMemo)((()=>{if(0===c)return[];const e=nd(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=m;b&&I.length>2&&(T=0);const P=(0,s.useMemo)((()=>{if(0===T)return[];const e=td((0,u.orderBy)(E,["frecency"],["desc"]),C,S,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,S,m]);(0,s.useEffect)((()=>{if(!t)return;const e=P.length+I.length,n=(0,g.sprintf)(
|
20 |
/* translators: %d: number of results. */
|
21 |
+
(0,g._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const N=(0,d.useAsyncList)(P,{step:9}),M=(0,d.useAsyncList)(N.length===P.length?I:hd),R=!(0,u.isEmpty)(P)||!(0,u.isEmpty)(I),L=!!P.length&&(0,s.createElement)(Pu,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Blocks"))},(0,s.createElement)(Tu,{items:N,onSelect:w,onHover:o,label:(0,g.__)("Blocks"),isDraggable:h})),A=!!I.length&&(0,s.createElement)(Pu,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(Vu,{shownPatterns:M,blockPatterns:I,onClickPattern:x,isDraggable:h})));return(0,s.createElement)(Mu,null,!f&&!R&&(0,s.createElement)(Wu,null),b?A:L,!!P.length&&!!I.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?L:A,f&&(0,s.createElement)(gd.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:R,rootClientId:_}},(e=>e.length?e:R?null:(0,s.createElement)(Wu,null))))};const bd={name:"blocks",
|
22 |
/* translators: Blocks tab title in the block inserter. */
|
23 |
title:(0,g.__)("Blocks")},kd={name:"patterns",
|
24 |
/* translators: Patterns tab title in the block inserter. */
|
25 |
title:(0,g.__)("Patterns")},_d={name:"reusable",
|
26 |
/* translators: Reusable blocks tab title in the block inserter. */
|
27 |
+
title:(0,g.__)("Reusable")};var yd=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[bd];return n&&e.push(kd),o&&e.push(_d),e}),[bd,n,kd,o,_d]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},Ed=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:c,__experimentalFilterValue:u="",shouldFocusBlock:d=!0}=e;const[f,h]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=$u({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:S,hasReusableBlocks:w}=(0,m.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(zn);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[y]),B=(0,s.useCallback)(((e,t,n)=>{E(e,t,n),i()}),[E,i]),x=(0,s.useCallback)(((e,t)=>{E(e,{patternName:t}),i()}),[E,i]),I=(0,s.useCallback)((e=>{C(!!e),b(e)}),[C,b]),T=(0,s.useCallback)((e=>{_(e)}),[_]),P=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(Lu,{rootClientId:y,onInsert:B,onHover:I,showMostUsedBlocks:c})),a&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(p.VisuallyHidden,{as:"h2"},(0,g.__)("A tip for using the block editor")),(0,s.createElement)(Wa,null)))),[y,B,I,f,c,a]),N=(0,s.useMemo)((()=>(0,s.createElement)(cd,{rootClientId:y,onInsert:x,onClickCategory:T,selectedCategory:k})),[y,x,T,k]),M=(0,s.useMemo)((()=>(0,s.createElement)(pd,{rootClientId:y,onInsert:B,onHover:I})),[y,B,I]),R=(0,s.useCallback)((e=>"blocks"===e.name?P:"patterns"===e.name?N:M),[P,N,M]),L=(0,s.useRef)();return(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{L.current.focus()}}))),(0,s.createElement)("div",{className:"block-editor-inserter__menu"},(0,s.createElement)("div",{className:"block-editor-inserter__main-area"},(0,s.createElement)("div",{className:"block-editor-inserter__content"},(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{v&&b(null),h(e)},value:f,label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search"),ref:L}),!!f&&(0,s.createElement)(vd,{filterValue:f,onSelect:i,onHover:I,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!f&&(S||w)&&(0,s.createElement)(yd,{showPatterns:S,showReusableBlocks:w},R),!f&&!S&&!w&&P)),a&&v&&(0,s.createElement)(ku,{item:v}))}));function Cd(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r}=e;const[l,i]=(0,s.useState)(""),[a,u]=$u({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[d]=Nu(a,u),[f]=Ou(u,a),{setInserterIsOpened:h,insertionIndex:v,prioritizePatterns:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:r,getBlockCount:l}=e(zn),i=t(),s=r(o),a=l();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,prioritizePatterns:i.__experimentalPreferPatternsOnRoot&&!n&&s>0&&(s<a||0===a),insertionIndex:-1===s?a:s}}),[o,n]),k=f.length&&(!!l||b),_=k&&f.length>6||d.length>6;(0,s.useEffect)((()=>{h&&h(!1)}),[h]);let y=0;return k&&(y=b?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":h})},_&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:l,onChange:e=>{i(e)},label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(vd,{filterValue:l,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:b})),h&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{h({rootClientId:n,insertionIndex:v,filterValue:l})},"aria-label":(0,g.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,g.__)("Browse all")))}const Sd=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={}}=e;t=a?(0,g.sprintf)(// translators: %s: the name of the block when there is only one
|
28 |
(0,g._x)("Add %s","directly add the only allowed block"),l):(0,g._x)("Add block","Generic label for block inserter button");const{onClick:u,...d}=c;return(0,s.createElement)(p.Button,i({icon:Ga,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),u&&u(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&r,disabled:o},d))};class wd extends s.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:o,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,hasItems:a,renderToggle:c=Sd}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i}=this.props;return i?(0,s.createElement)(Cd,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r}):(0,s.createElement)(Ed,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,s.createElement)(p.Dropdown,{className:"block-editor-inserter",contentClassName:c()("block-editor-inserter__popover",{"is-quick":r}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,g.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var Bd=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:s,__experimentalGetDirectInsertBlock:a}=e(zn),{getBlockVariations:c}=e(r.store);o=o||l(n)||void 0;const d=s(o),p=a(o),m=1===(0,u.size)(d)&&0===(0,u.size)(c(d[0].name,"inserter"));let f=!1;return m&&(f=d[0]),{hasItems:i(o),hasSingleBlockType:m,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:p,rootClientId:o}})),(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:l,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u}=t;if(!s&&!c)return;const{insertBlock:d}=e(zn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(zn);if(!e||!l&&!n)return{};const i={};let s={};if(l){const e=t(l),n=t(r(l));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(s=(null==n?void 0:n.attributes)||{})}else{var a;const e=t(n);if(null!=e&&null!==(a=e.innerBlocks)&&void 0!==a&&a.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(s=t.attributes)}}return e.forEach((e=>{s.hasOwnProperty(e)&&(i[e]=s[e])})),i}(c.attributesToCopy);p=(0,r.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,r.createBlock)(a.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:r,getBlockRootClientId:s}=o(zn);if(l)return e(l);const a=t();return!i&&a&&s(a)===n?e(a)+1:r(n).length}(),n),u&&u();const m=(0,g.sprintf)(// translators: %s: the name of the block that has been added
|
29 |
+
(0,g.__)("%s block added"),a.title);(0,Pt.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(wd),xd=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(zn),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,m.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(zn);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,Ha.decodeEntities)(r)||(0,g.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":l||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,s.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,g.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Ca.ENTER!==e.keyCode&&Ca.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(Bd,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Id(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(Bd,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:a,isOpen:u,blockTitle:d,hasSingleBlockType:m}=e;n=m?(0,g.sprintf)(// translators: %s: the name of the block when there is only one
|
30 |
+
(0,g._x)("Add %s","directly add the only allowed block"),d):(0,g._x)("Add block","Generic label for block inserter button");const f=!m;let h=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(wo,{icon:Ga}));return(f||m)&&(h=(0,s.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const Td=(0,s.forwardRef)(((e,t)=>(Rt()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Id(e,t))));var Pd=(0,s.forwardRef)(Id),Nd=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(zn);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:a,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,s.createElement)(l,null);else{if(a!==n&&(n||a))return null;t=o?(0,s.createElement)(xd,{rootClientId:n}):(0,s.createElement)(Pd,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),"data-block":!0},t)}));function Md(e){return(0,d.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])}const Rd=(0,s.createContext)();function Ld(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(zn),l=(0,s.useContext)(Rd),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:h,isInserterShown:v}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(zn),a=r(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;l(u);)u=i(u);for(;l(d);)d=s(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(a.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:a.rootClientId,isInserterShown:null==a?void 0:a.__unstableWithInserter}}),[]),b=Ra(u),k=Ra(f),_="vertical"===a,y=(0,s.useMemo)((()=>{if(!b&&!k)return{};const e=b?b.getBoundingClientRect():null,t=k?k.getBoundingClientRect():null;if(_)return{width:b?b.offsetWidth:k.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:b?b.offsetHeight:k.offsetHeight}}),[b,k]),E=(0,s.useCallback)((()=>{if(!b&&!k)return{};const{ownerDocument:e}=b||k,t=b?b.getBoundingClientRect():null,n=k?k.getBoundingClientRect():null;return _?(0,g.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,ownerDocument:e}:(0,g.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,ownerDocument:e}}),[b,k]),C=Md(n),S=(0,d.useReducedMotion)(),w=c()("block-editor-block-list__insertion-point","is-"+a),B=b&&k&&v,x={start:{..._?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:B?.4:0}},hover:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},I={start:{scale:S?1:0},rest:{scale:1,transition:{delay:.2}}};return(0,s.createElement)(p.Popover,{ref:C,noArrow:!0,animate:!1,getAnchorRect:E,focusOnMount:!1,className:"block-editor-block-list__insertion-point-popover",__unstableSlotName:t||null,key:f+"--"+h},(0,s.createElement)(p.__unstableMotion.div,{layout:!S,initial:S?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&f&&o(f,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(w,{"is-with-inserter":B}),onHoverEnd:function(e){e.target!==i.current||l.current||r()},style:y},(0,s.createElement)(p.__unstableMotion.div,{variants:x,className:"block-editor-block-list__insertion-point-indicator"}),B&&(0,s.createElement)(p.__unstableMotion.div,{variants:I,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Bd,{position:"bottom center",clientId:f,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Ad(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(zn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(Rd.Provider,{value:(0,s.useRef)(!1)},r&&(0,s.createElement)(Ld,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function Dd(){const e=(0,s.useContext)(Rd),t=(0,m.useSelect)((e=>e(zn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(zn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o,s;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(t.target.classList.contains("is-root-container")||(d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(s=v.parentElement)||void 0===s?void 0:s.closest(".block-editor-block-content-overlay.overlay-active"))return;const b=v.id.slice("block-".length);if(!b)return;if(a().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientY<k.top)||"vertical"===m&&(t.clientX>k.right||t.clientX<k.left))return void(l()&&p());const _=r(b);0!==_?u(d,_,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,a])}const Od="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Fd="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function zd(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(zn),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),s=n(e),a=l(s);if(!a)return null;const c=o(e),u=i(s,c),d={title:a.title,icon:a.icon,description:a.description,anchor:null==c?void 0:c.anchor};return u?{title:u.title||a.title,icon:u.icon||a.icon,description:u.description||a.description}:d}),[e])}function Vd(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(zn),i=n(e);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:s&&l(o(e).ref)}}),[e]),i=zd(e);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a;return c&&c!==s.title?t&&t>0?(0,u.truncate)(c,{length:t}):c:i.title}function Hd(e){let{clientId:t,maximumLength:n}=e;return Vd(t,n)}var Gd=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:o,getTemplateLock:l,getBlockName:i}=e(zn),s=o(n[0]),a=s?l(s):null,c=i(n[0]);return{srcRootClientId:s,isDraggable:"all"!==a,icon:null===(t=(0,r.getBlockType)(c))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[f,g,h]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,ar.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,s.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,m.useDispatch)(zn);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,s.createElement)(Cu,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Ud=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=zd(t),a=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(zn),a=l(t),{name:c,attributes:u}=r(t);return{index:a,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:u,name:d,attributes:f,blockMovingMode:h,orientation:v}=a,{setNavigationMode:b,removeBlock:k}=(0,m.useDispatch)(zn),_=(0,s.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,s.useEffect)((()=>{_.current.focus(),(0,Pt.speak)(E)}),[E]);const{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:I,getPreviousBlockClientId:T,getNextBlockClientId:P,isNavigationMode:N}=(0,m.useSelect)(zn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(zn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!h}),O=(0,g.__)("Drag");return(0,s.createElement)("div",{className:D},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(ja,{icon:null==l?void 0:l.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Gd,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:Eu,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{ref:_,onClick:()=>b(!1),onKeyDown:function(e){const{keyCode:n}=e,r=n===Ca.UP,l=n===Ca.DOWN,i=n===Ca.LEFT,s=n===Ca.RIGHT,a=n===Ca.TAB,c=n===Ca.ESCAPE,u=n===Ca.ENTER,d=n===Ca.SPACE,p=e.shiftKey;if(n===Ca.BACKSPACE||n===Ca.DELETE)return k(t),void e.preventDefault();const m=x(),f=I(),g=T(f||m),h=P(f||m),v=a&&p||r,b=a&&!p||l,_=i,y=s;let E;if(v)E=g;else if(b)E=h;else if(_){var D;E=null!==(D=w(m))&&void 0!==D?D:m}else if(y){var O;E=null!==(O=B([m])[0])&&void 0!==O?O:m}const F=C();if(c&&N()&&(R(),e.preventDefault()),c&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(u||d)&&F){const e=w(F),t=w(m),n=S(F);let o=S(m);n<o&&e===t&&(o-=1),A(F,e,t,o),M(F),L(null)}if(b||v||_||y)if(E)e.preventDefault(),M(E);else if(a&&m){let t;if(b){t=o;do{t=ar.focus.tabbable.findNext(t)}while(t&&o.contains(t));t||(t=o.ownerDocument.defaultView.frameElement,t=ar.focus.tabbable.findNext(t))}else t=ar.focus.tabbable.findPrevious(o);t&&(e.preventDefault(),t.focus(),R())}},label:E,className:"block-selection-button_select-button"},(0,s.createElement)(Hd,{clientId:t,maximumLength:35})))))};function Wd(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var $d=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!ar.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||Rt()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=ar.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,lc.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{l&&a()}),[n,l,a]),(0,s.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=Wd(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus()}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=Wd(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}(a,n,c,o,r),c?(0,s.createElement)(p.Toolbar,i({label:l["aria-label"],ref:a},l),t):(0,s.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},l),t)},jd=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),Kd=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),qd=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),Yd=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const Xd=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?jd:Kd:qd:"down"===e?"horizontal"===t?(0,g.isRTL)()?Kd:jd:Yd:null,Qd=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move right"):(0,g.__)("Move left"):(0,g.__)("Move up"):"down"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move left"):(0,g.__)("Move right"):(0,g.__)("Move down"):null,Zd=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(Zd),h=(0,u.castArray)(n).length,{blockType:v,isDisabled:b,rootClientId:k,isFirst:_,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e(zn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=s(m),v=a(p),b=0===f,k=g===h.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(zn),B="up"===o?w:S,x=`block-editor-block-mover-button__description-${f}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:Xd(o,C),label:Qd(o,C),"aria-describedby":x},a,{onClick:b?null:e=>{B(n,k),a.onClick&&a.onClick(e)},"aria-disabled":b})),(0,s.createElement)("span",{id:x,className:"block-editor-block-mover-button__description"},function(e,t,n,o,r,l,i){const s=n+1,a=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,g.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,g.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
31 |
(0,g._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l):r>0&&!o?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
32 |
(0,g._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l):void 0}(e,n,o,r,l);if(o&&r)return(0,g.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
|
33 |
(0,g.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
42 |
(0,g.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=a("up");if("up"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
43 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
44 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
45 |
+
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(h,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),Jd=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Zd,i({direction:"up",ref:t},e)))),ep=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Zd,i({direction:"down",ref:t},e))));var tp=(0,m.withSelect)(((e,t)=>{var n;let{clientIds:o}=t;const{getBlock:l,getBlockIndex:i,getBlockListSettings:s,canMoveBlocks:a,getBlockOrder:c,getBlockRootClientId:d}=e(zn),p=(0,u.castArray)(o),m=(0,u.first)(p),f=l(m),g=d((0,u.first)(p)),h=i(m),v=0===h,b=i((0,u.last)(p))===c(g).length-1;return{blockType:f?(0,r.getBlockType)(f.name):null,canMove:a(o,g),rootClientId:g,firstIndex:h,isFirst:v,isLast:b,orientation:null===(n=s(g))||void 0===n?void 0:n.orientation}}))((function(e){let{isFirst:t,isLast:n,clientIds:o,canMove:r,isHidden:l,rootClientId:a,orientation:u,hideDragHandle:d}=e;const[m,f]=(0,s.useState)(!1),h=()=>f(!0),v=()=>f(!1);if(!r||t&&n&&!a)return null;const b=(0,g.__)("Drag");return(0,s.createElement)("div",{className:c()("block-editor-block-mover",{"is-visible":m||!l,"is-horizontal":"horizontal"===u})},!d&&(0,s.createElement)(Gd,{clientIds:o,cloneClassname:"block-editor-block-mover__drag-clone"},(e=>(0,s.createElement)(p.Button,i({icon:Eu,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:b,tabIndex:"-1"},e)))),(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-mover__move-button-container"},(0,s.createElement)(p.ToolbarItem,{onFocus:h,onBlur:v},(e=>(0,s.createElement)(Jd,i({clientIds:o},e)))),(0,s.createElement)(p.ToolbarItem,{onFocus:h,onBlur:v},(e=>(0,s.createElement)(ep,i({clientIds:o},e))))))}));const{clearTimeout:np,setTimeout:op}=window,rp=200;function lp(e){let{ref:t,isFocused:n,debounceTimeout:o=rp,onChange:r=u.noop}=e;const[l,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},d=()=>{const e=a.current;e&&np&&np(e)};return(0,s.useEffect)((()=>()=>{c(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=op((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function ip(e){let{ref:t,debounceTimeout:n=rp,onChange:o=u.noop}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=lp({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),d=(0,s.useRef)(!1),p=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{p()&&(l(!0),a())},o=()=>{p()||(l(!1),c())};return e&&!d.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),d.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,d,l,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function sp(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(zn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(zn),{hasBlockSupport:i}=e(r.store),s=n(o()),a=s[s.length-1],c=t(a),u=(0,r.getBlockType)(c),d=l();return{firstParentClientId:a,shouldHide:!i(u,"__experimentalParentSelector",!0),hasReducedUI:d.hasReducedUI}}),[]),a=zd(n),c=(0,s.useRef)(),{gestures:u}=ip({ref:c,onChange(e){e&&l||t(n,e)}});return o||void 0===n?null:(0,s.createElement)("div",i({className:"block-editor-block-parent-selector",key:n,ref:c},u),(0,s.createElement)(p.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,g.sprintf)(
|
46 |
/* translators: %s: Name of the block's parent. */
|
47 |
+
(0,g.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(ja,{icon:a.icon})}))}var ap=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function cp(e){let{blocks:t}=e;return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(p.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",focusOnMount:!1},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,g.__)("Preview")),(0,s.createElement)(vu,{viewportWidth:500,blocks:t})))))}var up=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:l}=e;const[i,a]=(0,s.useState)();return(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Transform to"),className:t},i&&(0,s.createElement)(cp,{blocks:(0,r.switchToBlockType)(l,i)}),n.map((e=>{const{name:t,icon:n,title:l,isDisabled:i}=e;return(0,s.createElement)(p.MenuItem,{key:t,className:(0,r.getBlockMenuDefaultClassName)(t),onClick:e=>{e.preventDefault(),o(t)},disabled:i,onMouseLeave:()=>a(null),onMouseEnter:()=>a(t)},(0,s.createElement)(ja,{icon:n,showColors:!0}),l)})))},dp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),pp=window.wp.tokenList,mp=n.n(pp);function fp(e,t,n){const o=new(mp())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function gp(e){return(0,u.find)(e,"isDefault")}function hp(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(zn),o=n(t);if(!o)return{};const l=(0,r.getBlockType)(o.name),{getBlockStyles:i}=e(r.store);return{block:o,blockType:l,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,m.useDispatch)(zn),d=function(e){return e&&0!==e.length?gp(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(mp())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=(0,u.find)(e,{name:t});if(o)return o}return(0,u.find)(e,"isDefault")}(d,a),f=function(e,t){return(0,s.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,r.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,r.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(l,i);return{onSelect:e=>{const o=fp(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:f,className:a}}function vp(e){let{clientId:t,onSwitch:n=u.noop}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=hp({clientId:t,onSwitch:n});return r&&0!==r.length?(0,s.createElement)(s.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.MenuItem,{key:e.name,icon:l.name===e.name?dp:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function bp(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(vp,{clientId:o,onSwitch:n}))}const kp=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:r,innerBlocks:l=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of l){const o=kp(e,t,n);if(o)return o}}},_p=(e,t)=>{const n=((e,t)=>{const n=(0,r.__experimentalGetBlockAttributesNamesByRole)(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};function yp(e){let{patterns:t,onSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(p.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,g.__)("Preview")),(0,s.createElement)(Ep,{patterns:t,onSelect:n})))))}function Ep(e){let{patterns:t,onSelect:n}=e;const o=(0,p.__unstableUseCompositeState)();return(0,s.createElement)(p.__unstableComposite,i({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,g.__)("Patterns list")}),t.map((e=>(0,s.createElement)(Cp,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Cp(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Cp,`${r}-list__item-description`);return(0,s.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,s.createElement)(vu,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,s.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,s.createElement)(p.VisuallyHidden,{id:l},t.description))}var Sp=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[l,i]=(0,s.useState)(!1),a=((e,t)=>(0,s.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,r.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=kp(r,t.name,o);if(n){e=!0,o.add(n.clientId),_p(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]))(n,t);return a.length?(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},l&&(0,s.createElement)(yp,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:jd},(0,g.__)("Patterns"))):null};const wp=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(zn),l=zd(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:f,patterns:h}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:s,__experimentalGetPatternTransformItems:a}=e(zn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(zn),m=i((0,u.castArray)(t)[0]),[{name:f}]=n,g=1===n.length,h=g&&c(f);let v;var b;g?v=null==l?void 0:l.icon:v=1===(0,u.uniq)(n.map((e=>{let{name:t}=e;return t}))).length?null===(b=d(f))||void 0===b?void 0:b.icon:ap;return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==h||!h.length),icon:v,blockTitle:null===(o=d(f))||void 0===o?void 0:o.title,patterns:a(n,m)}}),[t,n,null==l?void 0:l.icon]),v=1===n.length&&(0,r.isReusableBlock)(n[0]),b=1===n.length&&(0,r.isTemplatePart)(n[0]),k=!!i.length&&a,_=!(null==h||!h.length)&&a;if(!c&&!k)return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,s.createElement)(ja,{icon:d,showColors:!0})}));const y=f,E=1===n.length?(0,g.sprintf)(
|
48 |
/* translators: %s: block title. */
|
49 |
(0,g.__)("%s: Change block type or style"),f):(0,g.sprintf)(
|
50 |
/* translators: %d: number of blocks. */
|
51 |
+
(0,g._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||k||_;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(p.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ja,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(Hd,{clientId:t,maximumLength:35}))),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},_&&(0,s.createElement)(Sp,{blocks:n,patterns:h,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(up,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{(e=>{o(t,(0,r.switchToBlockType)(n,e))})(e),l()}}),c&&(0,s.createElement)(bp,{hoveredBlock:n[0],onSwitch:l}))})))))};var Bp=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(zn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(wp,{clientIds:t,blocks:n})},xp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Ip=window.wp.blob;function Tp(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;return 1!==(null===(n=t.match(e))||void 0===n?void 0:n.length)}return!1}function Pp(){const{getBlockName:e}=(0,m.useSelect)(zn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(Du.store);return(0,s.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],s=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,g.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
|
52 |
(0,g.__)('Copied "%s" to clipboard.'),s):(0,g.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
53 |
(0,g.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,g.sprintf)(// Translators: %d: Number of blocks being copied.
|
54 |
(0,g._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,g.sprintf)(// Translators: %d: Number of blocks being cut.
|
55 |
+
(0,g._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function Np(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o}=(0,m.useSelect)(zn),{flashBlock:l,removeBlocks:i,replaceBlocks:s}=(0,m.useDispatch)(zn),a=Pp();return(0,d.useRefEffect)((c=>{function u(u){const d=t();if(0===d.length)return;if(!n()){const{target:e}=u,{ownerDocument:t}=e;if("copy"===u.type||"cut"===u.type?(0,ar.documentHasUncollapsedSelection)(t):(0,ar.documentHasSelection)(t))return}if(!c.contains(u.target.ownerDocument.activeElement))return;const p=u.defaultPrevented;if(u.preventDefault(),"copy"===u.type||"cut"===u.type){1===d.length&&l(d[0]),a(u.type,d);const t=e(d),n=(0,r.serialize)(t);u.clipboardData.setData("text/plain",n),u.clipboardData.setData("text/html",n)}if("cut"===u.type)i(d);else if("paste"===u.type){if(p)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=(0,ar.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!Tp(r,o)&&(o=r.map((e=>`<img src="${(0,Ip.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(u),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});s(d,l,l.length-1,-1)}}return c.ownerDocument.addEventListener("copy",u),c.ownerDocument.addEventListener("cut",u),c.ownerDocument.addEventListener("paste",u),()=>{c.ownerDocument.removeEventListener("copy",u),c.ownerDocument.removeEventListener("cut",u),c.ownerDocument.removeEventListener("paste",u)}}),[])}var Mp=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:Np()},t)};function Rp(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(zn),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),f=s(t),g=i(t[0]),h=(0,u.every)(f,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,g))),v=l(d(),g),b=a(t,g),k=c(t,g),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:x,selectBlock:I}=(0,m.useDispatch)(zn),T=Pp();return n({canDuplicate:h,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:g,blocks:f,onDuplicate:()=>E(t,o),onRemove:()=>_(t,o),onInsertBefore(){S((0,u.first)((0,u.castArray)(t)))},onInsertAfter(){C((0,u.last)((0,u.castArray)(t)))},onMoveTo(){x(!0),I(t[0]),B(t[0])},onGroup(){if(!f.length)return;const e=p(),n=(0,r.switchToBlockType)(f,e);n&&y(t,n)},onUngroup(){if(!f.length)return;const e=f[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=f.map((e=>{let{clientId:t}=e;return t}));1===f.length&&w(e[0]),T("copy",e)}})}var Lp=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(zn),s=o(n),a=i().codeEditingEnabled;return{mode:l(n),blockType:s?(0,r.getBlockType)(s.name):null,isCodeEditingEnabled:a}})),(0,m.withDispatch)(((e,t)=>{let{onToggle:n=u.noop,clientId:o}=t;return{onToggleMode(){e(zn).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,g.__)("Edit as HTML"):(0,g.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),Ap=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(zn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(zn).replaceBlocks(n.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,g.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)}));const{Fill:Dp,Slot:Op}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Dp.Slot=Op;var Fp=Dp;function zp(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(zn);return n||o?(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=(0,r.switchToBlockType)(l,i);e&&c(t,e)})(),a()}},(0,g._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,g._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}const{Fill:Vp,Slot:Hp}=(0,p.createSlotFill)("BlockSettingsMenuControls");function Gp(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(Vp,t))}Gp.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:l}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o}=e(zn),r=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(r)),(e=>e.name)),selectedClientIds:r}}),[n]),a=function(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:l,getSelectedBlockClientIds:i}=e(zn),{getGroupingBlockName:s}=e(r.store),a=i(),c=s(),u=l(c,null!=a&&a.length?n(a[0]):void 0),d=o(a),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:a,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}}(),{isGroupable:c,isUngroupable:d}=a,f=c||d;return(0,s.createElement)(Hp,{fillProps:{...t,selectedBlocks:o,selectedClientIds:l}},(e=>{if((null==e?void 0:e.length)>0||f)return(0,s.createElement)(p.MenuGroup,null,e,(0,s.createElement)(zp,i({},a,{onClose:null==t?void 0:t.onClose})))}))};var Up=Gp;const Wp={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function $p(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n);return(0,s.createElement)(p.MenuItem,{ref:o},(0,g.__)("Copy"))}var jp=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...r}=e;const l=(0,u.castArray)(t),a=l.length,c=l[0],{onlyBlock:d}=(0,m.useSelect)((e=>{const{getBlockCount:t}=e(zn);return{onlyBlock:1===t()}}),[c]),f=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(lc.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),h=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),v=Vd(c,25),b=(0,g.sprintf)(
|
56 |
/* translators: %s: block name */
|
57 |
+
(0,g.__)("Remove %s"),v),k=1===a?b:(0,g.__)("Remove blocks");return(0,s.createElement)(Rp,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:l,canMove:m,canRemove:v,onDuplicate:b,onInsertAfter:_,onInsertBefore:y,onRemove:E,onCopy:C,onMoveTo:S,blocks:w}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:xp,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Wp,noIcons:!0},r),(e=>{let{onClose:r}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(Fp.Slot,{fillProps:{onClose:r}}),1===a&&(0,s.createElement)(Ap,{clientId:c}),(0,s.createElement)($p,{blocks:w,onCopy:C}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,b,h),shortcut:f.duplicate},(0,g.__)("Duplicate")),l&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,y),shortcut:f.insertBefore},(0,g.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,_),shortcut:f.insertAfter},(0,g.__)("Insert after"))),m&&!d&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,S)},(0,g.__)("Move to")),1===a&&(0,s.createElement)(Lp,{clientId:c,onToggle:r})),(0,s.createElement)(Up.Slot,{fillProps:{onClose:r},clientIds:t}),"function"==typeof o?o({onClose:r}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:r}))),v&&(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,E,h),shortcut:f.remove},k)))}))}))},Kp=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(jp,i({clientIds:t,toggleProps:e},n)))))};function qp(e){let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:f,isVisual:g}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(zn),a=o(),c=a[0],u=i(c),d=s();return{blockClientIds:a,blockClientId:c,blockType:c&&(0,r.getBlockType)(t(c)),hasFixedToolbar:d.hasFixedToolbar,hasReducedUI:d.hasReducedUI,rootClientId:u,isValid:a.every((e=>l(e))),isVisual:a.every((e=>"visual"===n(e)))}}),[]),{toggleBlockHighlight:h}=(0,m.useDispatch)(zn),v=(0,s.useRef)(),{showMovers:b,gestures:k}=ip({ref:v,onChange(e){e&&u||h(o,e)}}),_=(0,d.useViewportMatch)("medium","<")||a;if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const y=_||b;if(0===n.length)return null;const E=f&&g,C=n.length>1,S=c()("block-editor-block-toolbar",y&&"is-showing-movers");return(0,s.createElement)("div",{className:S},!C&&!_&&(0,s.createElement)(sp,{clientIds:n}),(0,s.createElement)("div",i({ref:v},k),(E||C)&&(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,s.createElement)(Bp,{clientIds:n}),(0,s.createElement)(tp,{clientIds:n,hideDragHandle:t||u}))),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Yn.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Yn.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Yn.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Yn.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Yn.Slot,{group:"other",className:"block-editor-block-toolbar__slot"})),(0,s.createElement)(Kp,{clientIds:n}))}var Yp=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:l,hasParents:a,showParentSelector:u}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o}=e(zn),{getBlockType:l}=e(r.store),i=o(),s=i[0],a=n(s),c=l(t(a[a.length-1]));return{blockType:s&&l(t(s)),hasParents:a.length,showParentSelector:(0,r.hasBlockSupport)(c,"__experimentalParentSelector",!0)&&i.length<=1}}),[]);if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const d=c()("block-editor-block-contextual-toolbar",{"has-parent":a&&u,"is-fixed":n});return(0,s.createElement)($d,i({focusOnMount:t,className:d
|
58 |
+
/* translators: accessibility text for the block toolbar */,"aria-label":(0,g.__)("Block tools")},o),(0,s.createElement)(qp,{hideDragHandle:n}))};function Xp(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:l,getSettings:i,getLastMultiSelectedBlockClientId:s}=e(zn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:l(),hasMultiSelection:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:s()}}function Qp(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:g,isCaretWithinFormattedText:h,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:k}=(0,m.useSelect)(Xp,[]),_=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(zn);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),y=(0,d.useViewportMatch)("medium"),[E,C]=(0,s.useState)(!1),[S,w]=(0,s.useState)(!1),{stopTyping:B}=(0,m.useDispatch)(zn),x=!g&&!u&&r&&o,I=u,T=!u&&!b&&y&&!x&&!f&&(!g||h),P=!(u||T||b||r);(0,lc.useShortcut)("core/block-editor/focus-toolbar",(()=>{C(!0),B(!0)}),{isDisabled:!P}),(0,s.useEffect)((()=>{T||C(!1)}),[T]);const N=(0,s.useRef)(),M=Ra(t),R=Ra(k),L=Ra(l),A=Md(a);if(!(I||T||E||x))return null;let D=M;if(!D)return null;l&&(D=L);let O=D;if(v){if(!R)return null;O={top:D,bottom:R}}const F=x?"top left right":"top right left",{ownerDocument:z}=D,V=x?void 0:z.defaultView.frameElement||(0,ar.getScrollContainer)(D)||z.body;return(0,s.createElement)(p.Popover,{ref:A,noArrow:!0,animate:!1,position:F,focusOnMount:!1,anchorRef:O,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":_}),__unstableStickyBoundaryElement:V,__unstableSlotName:i||null,__unstableBoundaryParent:!0,__unstableObserveElement:D,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==a?void 0:a.current},(T||E)&&(0,s.createElement)("div",{onFocus:function(){w(!0)},onBlur:function(){w(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":S})},(0,s.createElement)(Bd,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,s.createElement)(Yp,{focusOnMount:E,__experimentalInitialIndex:N.current,__experimentalOnIndexChange:e=>{N.current=e},key:t}),I&&(0,s.createElement)(Ud,{clientId:t,rootClientId:n,blockElement:D}),x&&(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(Bd,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function Zp(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(zn),a=t()||n();if(!a)return;const{name:c,attributes:d={},isValid:p}=l(a)||{},m=i(a),f=s(m),g=(0,u.find)(m,(e=>{var t;return null===(t=f[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isValid:p,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function Jp(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(Zp,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,s.createElement)(Qp,{clientId:r,rootClientId:l,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function em(e){let{children:t}=e;const n=(0,s.useContext)(Rd),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(Rt()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Ad,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Jp,{__unstablePopoverSlot:"block-toolbar"}),t))}var tm=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Un();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),nm=tm((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Pd,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),om=(0,d.compose)([tm,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(zn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(xd,{rootClientId:t})})),rm=window.wp.isShallowEqual,lm=n.n(rm);const im=new WeakMap;function sm(e,t){const n=(0,m.useSelect)((e=>e(zn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(zn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(zn),d=function(e,t,n,o,l,i,s){return a=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){s();const n=p.map((e=>(0,r.cloneBlock)(e)));i(n,t,e,!0,null)}if("block"===d){const r=n(u[0]);if(c===e&&r===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;l(u,c,e,i&&r<t?t-s:t)}}}(e,t,l,i,a,s,u),p=function(e,t,n,o,l,i){return s=>{if(!n)return;const a=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(t=>"files"===t.type&&l(t.blockName,e)&&t.isMatch(s)));if(a){const n=a.transform(s,o);i(n,t,e)}}}(e,t,n,c,o,s),f=function(e,t,n){return o=>{const l=(0,r.pasteHandler)({HTML:o,mode:"BLOCKS"});l.length&&n(l,t,e)}}(e,t,s);return e=>{const t=(0,ar.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function am(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,s=o?l:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i<c?a:c,Math.sqrt((i-d)**2+(s-u)**2)}function cm(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=am(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function um(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,g.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=cm(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function dm(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(zn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(zn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(zn),a=sm(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=um(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=r(e))||void 0===i?void 0:i.orientation);n(void 0===s?0:s),null!==s&&l(e,s)}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:a,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function pm(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(zn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(zn).getBlockRootClientId(e);return{blockListSettings:t(zn).getBlockListSettings(e),parentLock:t(zn).getTemplateLock(n)}}),[e]),p=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=xo(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),lm()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(zn),{replaceInnerBlocks:i}=(0,m.useDispatch)(zn),a=(0,m.useSelect)((t=>t(zn).getBlocks(e)),[e]),c=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{if((0===a.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(n,a)||i(e,n,0===a.length&&o&&0!==n.length,l())}}),[a,t,n,e])}(t,i,a,d);const k=(0,m.useSelect)((e=>{const n=e(zn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){im.has(t)||im.set(t,new WeakMap);const n=im.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,s.createElement)(ur,{value:k},(0,s.createElement)(Em,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function mm(e){return qa(e),(0,s.createElement)(pm,e)}const fm=(0,s.forwardRef)(((e,t)=>{const n=gm({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function gm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Un(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:s}=e(zn),a=t(n),c=s()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,dm({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?mm:pm;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(f,i({},p,{clientId:n})):(0,s.createElement)(Em,t)}}gm.save=r.__unstableGetInnerBlocksProps,fm.DefaultBlockAppender=om,fm.ButtonBlockAppender=nm,fm.Content=()=>gm.save().children;var hm=fm;const vm=(0,s.createContext)(),bm=(0,s.createContext)();function km(e){let{className:t,...n}=e;const[o,r]=(0,s.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(zn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=gm({ref:(0,d.useMergeRefs)([Qa(),Dd(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":u})},n);return(0,s.createElement)(vm.Provider,{value:o},(0,s.createElement)("div",p))}function _m(e){return function(){const e=(0,m.useSelect)((e=>e(zn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(zn).__experimentalGetParsedPattern(e[n].name),t=Od(o))};return t=Od(o),()=>Fd(t)}),[e])}(),(0,s.createElement)(em,null,(0,s.createElement)(Gn,{value:Vn},(0,s.createElement)(km,e)))}function ym(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=Io}=e;const[i,a]=(0,s.useState)(new Set),c=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{a((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[a]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(zn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(Po,{value:l},(0,s.createElement)(bm.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Va,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(Nd,{tagName:r,rootClientId:n,renderAppender:o}))}function Em(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(ym,e))}_m.__unstableElementContext=vm;const Cm=["colors","disableCustomColors","gradients","disableCustomGradients"];function Sm(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,S]=(0,s.useState)(v?"gradient":!!y&&"color");return y||E?(0,s.createElement)(p.BaseControl,{className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",null,(0,s.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,s.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:S,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:h,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,s.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function wm(e){const t={};return t.colors=mo("color.palette"),t.gradients=mo("color.gradients"),t.disableCustomColors=!mo("color.custom"),t.disableCustomGradients=!mo("color.customGradient"),(0,s.createElement)(Sm,i({},t,e))}var Bm=function(e){return(0,u.every)(Cm,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Sm,e):(0,s.createElement)(wm,e)};function xm(e){let t,{colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d,settings:m}=e;return u&&(t="bottom left"),(0,s.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,className:"block-editor-panel-color-gradient-settings__item-group"},m.map(((e,m)=>e&&(0,s.createElement)(p.Dropdown,{key:m,position:t,className:"block-editor-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:t=>{var n;let{isOpen:o,onToggle:r}=t;return(0,s.createElement)(p.__experimentalItem,{onClick:r,className:c()("block-editor-panel-color-gradient-settings__item",{"is-open":o})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:null!==(n=e.gradientValue)&&void 0!==n?n:e.colorValue}),(0,s.createElement)(p.FlexItem,null,e.label)))},renderContent:()=>(0,s.createElement)(Bm,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function Im(){return{disableCustomColors:!mo("color.custom"),disableCustomGradients:!mo("color.customGradient")}}function Tm(){const e=Im(),t=mo("color.palette.custom"),n=mo("color.palette.theme"),o=mo("color.palette.default"),r=mo("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,g._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=mo("color.gradients.custom"),i=mo("color.gradients.theme"),a=mo("color.gradients.default"),c=mo("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,g._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}zc([Vc,Uc]);const Pm=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Nm=(e,t)=>(0,u.find)(e,{color:t});function Mm(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const Rm=[];function Lm(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Tm(),l=r.colors.reduce(((e,t)=>e.concat(t.colors)),[]),{color:a}=(null==n?void 0:n.border)||{},[c,u]=(0,s.useState)((()=>{var e;return null===(e=Pm(l,t,a))||void 0===e?void 0:e.color}));(0,s.useEffect)((()=>{var e;u(null===(e=Pm(l,t,a))||void 0===e?void 0:e.color)}),[t,a,l]);const d=[{label:(0,g.__)("Color"),onColorChange:e=>{u(e);const t=Nm(l,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},i=null!=t&&t.slug?t.slug:void 0;o({style:qo(r),borderColor:i})},colorValue:c,clearable:!1}];return(0,s.createElement)(xm,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function Am(e,t,n){var o;if(!sf(t,"color")||af(t))return e;const{borderColor:r,style:l}=n,i=Mm("border-color",r),s=c()(e.className,{"has-border-color":r||(null==l||null===(o=l.border)||void 0===o?void 0:o.color),[i]:!!i});return e.className=s||void 0,e}const Dm=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:a}=l,c=mo("color.palette")||Rm;if(!sf(r,"color")||af(r))return(0,s.createElement)(e,t);const u={borderColor:a?null===(n=Pm(c,a))||void 0===n?void 0:n.color:void 0};let d=t.wrapperProps;return d={...t.wrapperProps,style:{...u,...null===(o=t.wrapperProps)||void 0===o?void 0:o.style}},(0,s.createElement)(e,i({},t,{wrapperProps:d}))}));function Om(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Fm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=Om(o),i=0===r||r?`${r}${l}`:void 0;return i}function zm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Fm(e),n=isNaN(parseFloat(t));return n}function Vm(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Hm(e){let{onChange:t,values:n,...o}=e;const r=Fm(n),l=Vm(n)&&zm(n),a=l?(0,g.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return sf(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Am),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!sf(e,"color")||af(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Am(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Dm);const Gm={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function Um(e){let{onChange:t,values:n,...o}=e;const r="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(Gm).map((e=>{let[n,l]=e;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{key:n,"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}));var a})))}var Wm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),$m=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function jm(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("Link Radii");return(0,s.createElement)(p.Tooltip,{text:o},(0,s.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?Wm:$m,iconSize:16,"aria-label":o})))}const Km={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},qm={px:100,em:20,rem:20};function Ym(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Vm(n)||!zm(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t||"px"}return Om(Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t})))||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(Fm(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,g.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Hm,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,unit:i,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:qm[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(Um,{min:0,onChange:t,values:n||Km,units:l}),(0,s.createElement)(jm,{onClick:()=>r(!o),isLinked:o})))}function Xm(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Ym,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=qo(t)),o({style:t})}})}var Qm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{d:"M5 11.25h14v1.5H5z"})),Zm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"})),Jm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"}));const ef=[{label:(0,g.__)("Solid"),icon:Qm,value:"solid"},{label:(0,g.__)("Dashed"),icon:Zm,value:"dashed"},{label:(0,g.__)("Dotted"),icon:Jm,value:"dotted"}];function tf(e){let{onChange:t,value:n}=e;return(0,s.createElement)("fieldset",{className:"components-border-style-control"},(0,s.createElement)("legend",null,(0,g.__)("Style")),(0,s.createElement)("div",{className:"components-border-style-control__buttons"},ef.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===n,onClick:()=>t(e.value===n?void 0:e.value),"aria-label":e.label})))))}const nf=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(tf,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:qo(t)})}})},of=e=>{const{attributes:{borderColor:t,style:n},setAttributes:o}=e,{width:r,color:l,style:i}=(null==n?void 0:n.border)||{},[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),[m,f]=(0,s.useState)(),h=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"]});return(0,s.createElement)(p.__experimentalUnitControl,{value:r,label:(0,g.__)("Width"),min:0,onChange:e=>{let s={...n,border:{...null==n?void 0:n.border,width:e}},p=t;const g=0===parseFloat(e),h=0===parseFloat(r);g&&!h&&(d(t),f(l),c(i),p=void 0,s.border.color=void 0,s.border.style="none"),!g&&h&&("none"===i&&(s.border.style=a),void 0===t&&(p=u,s.border.color=m)),void 0!==e&&""!==e||(s=qo(s)),o({borderColor:p,style:s})},units:h})},rf="__experimentalBorder";function lf(e){const{clientId:t}=e,n=mo("border.color")&&sf(e.name,"color"),o=mo("border.radius")&&sf(e.name,"radius"),l=mo("border.style")&&sf(e.name,"style"),i=mo("border.width")&&sf(e.name,"width");if([!n,!o,!l,!i].every(Boolean))return null;const a=(0,r.getBlockSupport)(e.name,[rf,"__experimentalDefaultControls"]),c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var o;return{...n,...t,style:{...n.style,border:{...null===(o=n.style)||void 0===o?void 0:o.border,[e]:void 0}}}}};return(0,s.createElement)(nr,{__experimentalGroup:"border"},i&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.width)}(e),label:(0,g.__)("Width"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cf(o,"width")})}(e),isShownByDefault:null==a?void 0:a.width,resetAllFilter:c("width"),panelId:t},(0,s.createElement)(of,e)),l&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.style)}(e),label:(0,g.__)("Style"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cf(o,"style")})}(e),isShownByDefault:null==a?void 0:a.style,resetAllFilter:c("style"),panelId:t},(0,s.createElement)(nf,e)),n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{attributes:{borderColor:n,style:o}}=e;return!!n||!(null==o||null===(t=o.border)||void 0===t||!t.color)}(e),label:(0,g.__)("Color"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({borderColor:void 0,style:cf(o,"color")})}(e),isShownByDefault:null==a?void 0:a.color,resetAllFilter:c("color",{borderColor:void 0}),panelId:t},(0,s.createElement)(Lm,e)),o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:cf(o,"radius")})}(e),isShownByDefault:null==a?void 0:a.radius,resetAllFilter:c("radius"),panelId:t},(0,s.createElement)(Xm,e)))}function sf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==s.Platform.OS)return!1;const n=(0,r.getBlockSupport)(e,rf);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function af(e){const t=(0,r.getBlockSupport)(e,rf);return null==t?void 0:t.__experimentalSkipSerialization}function cf(e,t){return qo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function uf(e){if(e)return`has-${e}-gradient-background`}function df(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function pf(e,t){return(0,u.find)(e,["gradient",t])}function mf(e,t){const n=pf(e,t);return n&&n.slug}function ff(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Un(),o=mo("color.gradients.custom"),r=mo("color.gradients.theme"),l=mo("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(zn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(zn),d=(0,s.useCallback)((o=>{const r=mf(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=uf(a);let f;return f=a?df(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}zc([Vc,Uc]);var gf=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const m=a||o,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=Oc(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of h){if(!e.color)continue;const t=Oc(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
59 |
+
(0,g.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
60 |
+
(0,g.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,g.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,g.__)("Transparent text may be hard for people to read."),E=(0,g.__)("Transparent text may be hard for people to read."))}return y?((0,Pt.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function hf(e){var t;let{settings:n,enableAlpha:o,...r}=e;const l={...Tm(),clearable:!1,enableAlpha:o,label:n.label,onColorChange:n.onColorChange,onGradientChange:n.onGradientChange,colorValue:n.colorValue,gradientValue:n.gradientValue},a=null!==(t=n.gradientValue)&&void 0!==t?t:n.colorValue;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:n.hasValue,label:n.label,onDeselect:n.onDeselect,isShownByDefault:n.isShownByDefault,resetAllFilter:n.resetAllFilter},r,{className:"block-editor-tools-panel-color-gradient-settings__item"}),(0,s.createElement)(p.Dropdown,{className:"block-editor-tools-panel-color-dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:e=>{let{isOpen:t,onToggle:o}=e;return(0,s.createElement)(p.Button,{onClick:o,"aria-expanded":t,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":t})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:a}),(0,s.createElement)(p.FlexItem,null,n.label)))},renderContent:()=>(0,s.createElement)(Bm,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function vf(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function bf(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),p=Ma(o);return(0,s.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(vf(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(vf(t).color);let n=p.current,o=vf(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=vf(n).backgroundColor;i(o)})),(0,s.createElement)(nr,{__experimentalGroup:"color"},n.map(((e,n)=>(0,s.createElement)(hf,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,s.createElement)(gf,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:u}))}const kf="color",_f=e=>{const t=(0,r.getBlockSupport)(e,kf);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},yf=e=>{const t=(0,r.getBlockSupport)(e,kf);return null==t?void 0:t.__experimentalSkipSerialization},Ef=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,kf);return(0,u.isObject)(t)&&!!t.link},Cf=e=>{const t=(0,r.getBlockSupport)(e,kf);return(0,u.isObject)(t)&&!!t.gradients},Sf=e=>{const t=(0,r.getBlockSupport)(e,kf);return t&&!1!==t.background},wf=e=>{const t=(0,r.getBlockSupport)(e,kf);return t&&!1!==t.text},Bf=e=>t=>{var n,o,r,l,i,s,a,c,u,d;return"background"===e?!!(t.attributes.backgroundColor||null!==(r=t.attributes.style)&&void 0!==r&&null!==(l=r.color)&&void 0!==l&&l.background||t.attributes.gradient||null!==(i=t.attributes.style)&&void 0!==i&&null!==(s=i.color)&&void 0!==s&&s.gradient):"link"===e?!(null===(a=t.attributes.style)||void 0===a||null===(c=a.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text):!!t.attributes[`${e}Color`]||!(null===(n=t.attributes.style)||void 0===n||null===(o=n.color)||void 0===o||!o[e])},xf=(e,t)=>qo(Yo(t,e,void 0)),If=e=>({textColor:void 0,style:xf(["color","text"],e.style)}),Tf=e=>({style:xf(["elements","link","color","text"],e.style)}),Pf=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function Nf(e,t,n){var o,r,l,i,s,a;if(!_f(t)||yf(t))return e;const u=Cf(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=Mm("background-color",d),h=uf(m),v=Mm("color",p),b=c()(e.className,v,h,{[g]:!(u&&null!=f&&null!==(o=f.color)&&void 0!==o&&o.gradient||!g),"has-text-color":p||(null==f||null===(r=f.color)||void 0===r?void 0:r.text),"has-background":d||(null==f||null===(l=f.color)||void 0===l?void 0:l.background)||u&&(m||(null==f||null===(i=f.color)||void 0===i?void 0:i.gradient)),"has-link-color":null==f||null===(s=f.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color});return e.className=b||void 0,e}const Mf=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Pm(e,n[1]).color:t};function Rf(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,f=mo("color.palette.custom"),h=mo("color.palette.theme"),v=mo("color.palette.default"),b=(0,s.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=mo("color.gradients.custom"),_=mo("color.gradients.theme"),y=mo("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=mo("color.custom"),S=mo("color.customGradient"),w=mo("color.background"),B=mo("color.link"),x=mo("color.text"),I=C||!h||(null==h?void 0:h.length)>0,T=S||!_||(null==_?void 0:_.length)>0,P=(0,s.useRef)(m);if((0,s.useEffect)((()=>{P.current=m}),[m]),!_f(p))return null;const N=Ef(p)&&B&&I,M=wf(p)&&x&&I,R=Sf(p)&&w&&I,L=Cf(p)&&T;if(!(N||M||R||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=df(E,F);else if(L){var V;z=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=Nm(b,n),i=t+"Color",s={...P.current.style,color:{...null===(o=P.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},a=null!=l&&l.slug?l.slug:void 0,c={style:qo(s),[i]:a};e.setAttributes(c),P.current={...P.current,...c}},G=!("web"!==s.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[kf,"__experimentalDefaultControls"]);return(0,s.createElement)(bf,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:Pm(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>Bf("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:xf(["color","text"],t.style)})})(e),resetAllFilter:If}]:[],...R||L?[{label:(0,g.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:Pm(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=mf(E,t);let o;if(n){var r,l,i;const e={...null===(r=P.current)||void 0===r?void 0:r.style,color:{...null===(l=P.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:qo(e),gradient:n}}else{var s,a,c;const e={...null===(s=P.current)||void 0===s?void 0:s.style,color:{...null===(a=P.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:qo(e),gradient:void 0}}e.setAttributes(o),P.current={...P.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>Bf("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(Pf(t))})(e),resetAllFilter:Pf}]:[],...N?[{label:(0,g.__)("Link"),onColorChange:t=>{const n=Nm(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=qo(Yo(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:Mf(b,null==A||null===(l=A.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==U?void 0:U.link,hasValue:()=>Bf("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:xf(["elements","link","color","text"],t.style)})})(e),resetAllFilter:Tf}]:[]]})}const Lf=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=mo("color.palette.custom")||[],u=mo("color.palette.theme")||[],d=mo("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!_f(o)||yf(o))return(0,s.createElement)(e,t);const m={};var f,g;a&&(m.color=null===(f=Pm(p,a))||void 0===f?void 0:f.color),l&&(m.backgroundColor=null===(g=Pm(p,l))||void 0===g?void 0:g.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:h}))})),Af={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return _f(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Cf(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Nf),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!_f(e)||yf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Nf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Lf),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Xo({linkColor:Ef(r),textColor:wf(r),backgroundColor:Sf(r),gradient:Cf(r)},Af,e,t,n,o)}));const Df=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],Of=[{name:(0,g._x)("Thin","font weight"),value:"100"},{name:(0,g._x)("Extra Light","font weight"),value:"200"},{name:(0,g._x)("Light","font weight"),value:"300"},{name:(0,g._x)("Regular","font weight"),value:"400"},{name:(0,g._x)("Medium","font weight"),value:"500"},{name:(0,g._x)("Semi Bold","font weight"),value:"600"},{name:(0,g._x)("Bold","font weight"),value:"700"},{name:(0,g._x)("Extra Bold","font weight"),value:"800"},{name:(0,g._x)("Black","font weight"),value:"900"}],Ff=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function zf(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Ff(n,o),c={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return Df.forEach((t=>{let{name:n,value:o}=t;Of.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,g.sprintf)(
|
61 |
/* translators: 1: Font weight name. 2: Font style name. */
|
62 |
(0,g.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return Df.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[c];return Of.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||u[0];return i&&(0,s.createElement)(p.CustomSelectControl,{className:"components-font-appearance-control",label:a,describedBy:d?n?o?(0,g.sprintf)(// translators: %s: Currently selected font appearance.
|
63 |
(0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
|
64 |
(0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
|
65 |
+
(0,g.__)("Currently selected font weight: %s"),d.name):(0,g.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}function Vf(e){let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||Rt()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const a=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:a},(0,s.createElement)(p.__experimentalNumberControl,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType);return e.value=((e,t)=>{if(l)return e;switch(e){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o),e},onChange:n,label:(0,g.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))}const Hf="typography.lineHeight";function Gf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Vf,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:qo(t)})}})}function Uf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Hf)||t}const Wf="typography.__experimentalFontStyle",$f="typography.__experimentalFontWeight";function jf(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Kf(e),i=!qf(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,c=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,s.createElement)(zf,{onChange:e=>{r({style:qo({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function Kf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Wf),n=mo("typography.fontStyle");return!t||!n}function qf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,$f),n=mo("typography.fontWeight");return!t||!n}function Yf(e){const t=Kf(e),n=qf(e);return t&&n}function Xf(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=mo("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,g.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(p.SelectControl,i({label:(0,g.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Qf="typography.__experimentalFontFamily";function Zf(e,t,n){if(!(0,r.hasBlockSupport)(t,Qf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(mp())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function Jf(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=mo("typography.fontFamilies"),l=null===(t=(0,u.find)(r,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(Xf,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,u.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})}})}function eg(e){let{name:t}=e;const n=mo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Qf)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Qf)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Zf),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Qf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Zf(o,e,n)},e}));const tg=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function ng(e,t){return(0,u.find)(e,{size:t})||{size:t}}function og(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var rg=function(e){const t=mo("typography.fontSizes"),n=!mo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const lg="typography.fontSize";function ig(e,t,n){if(!(0,r.hasBlockSupport)(t,lg))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(mp())(e.className);o.add(og(n.fontSize));const l=o.value;return e.className=l||void 0,e}function sg(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=mo("typography.fontSizes"),a=tg(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),c=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(rg,{onChange:e=>{const t=ng(i,e).slug;l({style:qo({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function ag(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=mo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,lg)||!n}const cg=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=mo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,lg)||(0,r.hasBlockSupport)(i,"typography.__experimentalSkipSerialization")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=tg(l,a,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,s.createElement)(e,p)}),"withFontSizeInlineStyles"),ug={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,lg)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",ig),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,lg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ig(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",cg),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Xo({fontSize:(0,r.hasBlockSupport)(l,lg)},ug,e,t,n,o)}));var dg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),pg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const mg=[{name:(0,g.__)("Underline"),value:"underline",icon:dg},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:pg}];function fg(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,g.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},mg.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name})))))}const gg="typography.__experimentalTextDecoration";function hg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(fg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function vg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,gg),n=mo("typography.textDecoration");return t||!n}var bg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})),kg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})),_g=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const yg=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:bg},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:kg},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:_g}];function Eg(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,g.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},yg.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)})))))}const Cg="typography.__experimentalTextTransform";function Sg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Eg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function wg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Cg),n=mo("typography.textTransform");return t||!n}function Bg(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const xg="typography.__experimentalLetterSpacing";function Ig(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Bg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Tg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,xg),n=mo("typography.letterSpacing");return t||!n}const Pg="typography",Ng=[Hf,lg,Wf,$f,Qf,gg,Cg,xg];function Mg(e){const{clientId:t}=e,n=eg(e),o=ag(e),l=Yf(e),i=Uf(e),a=vg(e),c=wg(e),u=Tg(e),d=!Kf(e),m=!qf(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Yf(e),ag(e),Uf(e),eg(e),vg(e),wg(e),Tg(e)];return t.filter(Boolean).length===t.length}(e),h=Rg(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[Pg,"__experimentalDefaultControls"]),b=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,s.createElement)(nr,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,g.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,s.createElement)(Jf,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e),label:(0,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:qo({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,s.createElement)(sg,e)),!l&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:Ff(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,s.createElement)(jf,e)),!i&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,g.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.lineHeight,resetAllFilter:b("lineHeight"),panelId:t},(0,s.createElement)(Gf,e)),!a&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,g.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textDecoration,resetAllFilter:b("textDecoration"),panelId:t},(0,s.createElement)(hg,e)),!c&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textTransform,resetAllFilter:b("textTransform"),panelId:t},(0,s.createElement)(Sg,e)),!u&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,g.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==v?void 0:v.letterSpacing,resetAllFilter:b("letterSpacing"),panelId:t},(0,s.createElement)(Ig,e)))}const Rg=e=>Ng.some((t=>(0,r.hasBlockSupport)(e,t)));function Lg(e){const t=(0,r.getBlockSupport)(e,Ug);return!!(!0===t||null!=t&&t.blockGap)}function Ag(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.blockGap");return!Lg(e)||t}function Dg(e){var t;const{clientId:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=Ma(n);return Ag(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:e}};r({style:qo(n)});const l=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;i.current&&l&&(null===(s=i.current.parentNode)||void 0===s||s.replaceChild(i.current,i.current))},units:l,value:null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap})),native:null})}function Og(e){const t=(0,r.getBlockSupport)(e,Ug);return!!(!0===t||null!=t&&t.margin)}function Fg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.margin"),n=!Yg(e,"margin");return!Og(e)||t||n}function zg(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=qg(n,"margin"),a=i&&i.some((e=>$g.includes(e)));return Fg(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:qo(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Vg(e){const t=(0,r.getBlockSupport)(e,Ug);return!!(!0===t||null!=t&&t.padding)}function Hg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.padding"),n=!Yg(e,"padding");return!Vg(e)||t||n}function Gg(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=qg(n,"padding"),a=i&&i.some((e=>$g.includes(e)));return Hg(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:qo(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const Ug="spacing",Wg=["top","right","bottom","left"],$g=["vertical","horizontal"];function jg(e){const t=Ag(e),n=Hg(e),o=Fg(e),l=Kg(e),i=(a=e.name,"web"===s.Platform.OS&&(Lg(a)||Vg(a)||Og(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Ug,"__experimentalDefaultControls"]),u=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,s.createElement)(nr,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(Gg,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(zg,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,g.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(Dg,e)))}const Kg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ag(e),n=Hg(e),o=Fg(e);return t&&n&&o};function qg(e,t){const n=(0,r.getBlockSupport)(e,Ug);if(n&&"boolean"!=typeof n[t])return n[t]}function Yg(e,t){const n=qg(e,t);return!(n&&n.some((e=>Wg.includes(e)))&&n.some((e=>$g.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}const Xg=[...Ng,rf,kf,Ug],Qg=e=>Xg.some((t=>(0,r.hasBlockSupport)(e,t))),Zg="var:";function Jg(e){return(0,u.startsWith)(e,Zg)?`var(--wp--${e.slice(Zg.length).split("|").join("--")})`:e}function eh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(0,u.first)(l)){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&!(0,u.isString)(s)?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=Jg(r))})):t.includes(l.join("."))||(n[o]=Jg((0,u.get)(e,l))))}}));const o=sr(e,{selector:"self"});return o.forEach((e=>{if("self"!==e.selector)throw"This style can't be added as inline style";n[e.key]=e.value})),n}const th={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[kf],"typography.__experimentalSkipSerialization":[Pg],[`${Ug}.__experimentalSkipSerialization`]:["spacing"]},nh={...th,[`${Ug}`]:["spacing.blockGap"]};function oh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:nh;if(!Qg(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{(0,r.getBlockSupport)(t,n)&&(l=(0,u.omit)(l,e))})),e.style={...eh(l),...e.style},e}const rh=(0,d.createHigherOrderComponent)((e=>t=>{const n=Wn();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Rf,t),(0,s.createElement)(Mg,t),(0,s.createElement)(lf,t),(0,s.createElement)(jg,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),lh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=null===(n=t.attributes.style)||void 0===n?void 0:n.elements,a=`wp-elements-${(0,d.useInstanceId)(e)}`,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=eh(t);return(0,u.isEmpty)(o)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(a,null===(o=t.attributes.style)||void 0===o?void 0:o.elements),m=(0,s.useContext)(_m.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,l&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:l?c()(t.className,a):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Qg(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",oh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Qg(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),oh(o,e,n,th)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",rh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",lh);var ih=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==Ca.DOWN||(e.preventDefault(),n())},label:(0,g.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,g.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const sh=[];function ah(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Oc(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function ch(e){let{selector:t,id:n,values:o}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:n},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"})))),(0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:r}}))}function uh(e){let{presetSetting:t,defaultSetting:n}=e;const o=!mo(n),r=mo(`${t}.custom`)||sh,l=mo(`${t}.theme`)||sh,i=mo(`${t}.default`)||sh;return(0,s.useMemo)((()=>[...r,...l,...o?sh:i]),[o,r,l,i])}function dh(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,l=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=uh({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=uh({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!mo("color.custom"),u=!mo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(ih,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:c,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}zc([Vc]);const ph=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(dh,t))}),"withDuotoneControls"),mh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),f=c()(null==t?void 0:t.className,p),g=(0,s.useContext)(_m.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(ch,{selector:m,id:p,values:ah(u)}),g),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",ph),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",mh);const fh="__experimentalLayout";function gh(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=mo("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,fh,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:h}=c;if(!d)return null;const v=l||h||{},{inherit:b=!1,type:k="default"}=v;if("default"===k&&!a)return null;const _=xo(k),y=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(nr,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},f&&!!i&&(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!b,onChange:()=>t({layout:{inherit:!b}})}),!b&&u&&(0,s.createElement)(hh,{type:k,onChange:e=>t({layout:{type:e}})}),!b&&_&&(0,s.createElement)(_.inspectorControls,{layout:v,onChange:y,layoutBlockSupport:c}))),!b&&_&&(0,s.createElement)(_.toolBarControls,{layout:v,onChange:y,layoutBlockSupport:c}))}function hh(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Bo.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const vh=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,fh)&&(0,s.createElement)(gh,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),bh=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,fh),a=(0,d.useInstanceId)(e),u=mo("layout")||{},p=(0,s.useContext)(_m.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,fh)||{},g=null!=m&&m.inherit?u:m||f||{},h=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(Mo,{selector:`.wp-container-${a}`,layout:g,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:h})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,fh)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",bh),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",vh);const kh=[];function _h(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=Mm("border-color",n);return{className:c()({[l]:!!l,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:eh({border:r})}}function yh(e){const t=mo("color.palette")||kh,n=_h(e);if(e.borderColor){const o=Pm(t,e.borderColor);n.style.borderColor=o.color}return n}function Eh(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Mm("background-color",s),m=Mm("color",a),f=uf(u),g=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!g&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:eh({color:(null==d?void 0:d.color)||{}})}}const Ch={};function Sh(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=mo("color.palette.custom")||[],l=mo("color.palette.theme")||[],i=mo("color.palette.default")||[],a=mo("color.gradients")||Ch,c=(0,s.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,s.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=Eh(e);if(t){const e=Pm(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=df(u,o)),n){const e=Pm(c,n);d.style.color=e.color}return d}function wh(e){const{style:t}=e;return{style:eh({spacing:(null==t?void 0:t.spacing)||{}})}}function Bh(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const xh=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),Ih=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette.custom"),o=mo("color.palette.theme"),r=mo("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function Th(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Oc(t);return(0,u.maxBy)(e,(e=>{let{color:t}=e;return n.contrast(t)})).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Nm(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=Pm(r,o[l],o[`custom${(0,u.upperFirst)(l)}`]),s=t[l];return(null==s?void 0:s.color)===i.color&&s?e[l]=s:e[l]={...i,class:Mm(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Ph(e){return function(){const t=xh(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(Th(o,t),"withCustomColors")}}function Nh(){const e=Ih();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(Th(n,e),"withColors")}const Mh=[];var Rh=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=(0,u.reduce)(t,((e,t)=>(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("typography.fontSizes")||Mh;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(o,((e,t,n)=>(e[`set${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=tg(r,l,n[t]);return e[o]={...i,class:og(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Lh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),Ah=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),Dh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const Oh=[{icon:Lh,title:(0,g.__)("Align text left"),align:"left"},{icon:Ah,title:(0,g.__)("Align text center"),align:"center"},{icon:Dh,title:(0,g.__)("Align text right"),align:"right"}],Fh={position:"bottom right",isAlternate:!0};var zh=function(e){let{value:t,onChange:n,alignmentControls:o=Oh,label:r=(0,g.__)("Align"),describedBy:l=(0,g.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,h=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,g.isRTL)()?Dh:Lh,label:r,toggleProps:{describedBy:l},popoverProps:Fh,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},h))};function Vh(e){return(0,s.createElement)(zh,i({},e,{isToolbar:!1}))}function Hh(e){return(0,s.createElement)(zh,i({},e,{isToolbar:!0}))}var Gh={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(zn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Nu(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?td(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]);return[(0,s.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ja,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}},Uh=window.wp.apiFetch,Wh=n.n(Uh),$h=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),jh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),Kh={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await Wh()({path:(0,ud.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wo,{key:"icon",icon:"page"===e.subtype?$h:jh}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)};const qh=[];function Yh(e){let{completers:t=qh}=e;const{name:n}=Un();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Gh,Kh])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Xh=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Yh(e)}))},Qh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),Zh=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:Qh,label:n,onClick:()=>o(!t),disabled:r})},Jh=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",a=`${i}__popover`;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:a,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==Ca.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},ev=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),tv=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(zn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(zn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,g.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(wo,{icon:ev,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,s.createElement)(Hd,{clientId:e,maximumLength:35})),(0,s.createElement)(wo,{icon:ev,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Hd,{clientId:r,maximumLength:35})))};function nv(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,a]=(0,s.useState)(!0),[u,d]=(0,s.useState)(!1),{isParentSelected:p,hasChildSelected:f,isDraggingBlocks:g,isParentHighlighted:h}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l}=e(zn);return{isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),v=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":h,"is-dragging-blocks":g});return(0,s.useEffect)((()=>{p||f||l||a(!0),p&&!u&&l&&a(!1),f&&l&&a(!1)}),[p,f,l,u]),(0,s.createElement)(n,i({},o,{className:v,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l?()=>a(!1):void 0}),null==o?void 0:o.children)}const ov=()=>(0,s.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),rv=e=>{let{style:t,className:n}=e;return(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,s.createElement)(ov,null)))},lv=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,g.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==Ca.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(rv,null)))}))}};var iv=e=>{let{children:t,...n}=e;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:lv(n),renderContent:()=>t})},sv=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const av=ia(p.__experimentalTreeGridRow);function cv(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=ca({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(av,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function uv(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(wo,{icon:ev}))}var dv=(0,s.forwardRef)((function e(t,n){let{className:o,block:{clientId:r},isSelected:l,onClick:i,onToggleExpanded:a,position:u,siblingBlockCount:m,level:f,tabIndex:h,onFocus:v,onDragStart:b,onDragEnd:k,draggable:_,isExpanded:y}=t;const E=zd(r),C=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,S=((e,t,n)=>(0,g.sprintf)(
|
66 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
67 |
+
(0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,m,f);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",o),onClick:i,onKeyDown:function(e){e.keyCode!==Ca.ENTER&&e.keyCode!==Ca.SPACE||i(e)},"aria-describedby":C,ref:n,tabIndex:h,onFocus:v,onDragStart:e=>{e.dataTransfer.clearData(),b(e)},onDragEnd:k,draggable:_,href:`#block-${r}`,"aria-expanded":y},(0,s.createElement)(uv,{onClick:a}),(0,s.createElement)(ja,{icon:null==E?void 0:E.icon,showColors:!0}),(0,s.createElement)(Hd,{clientId:r,maximumLength:35}),(null==E?void 0:E.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},E.anchor),l&&(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("(selected block)"))),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:C},S))})),pv=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:f,...g}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(zn);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=f.includes(h)?f:[h];return(0,s.createElement)(Gd,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,s.createElement)(dv,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f,isExpanded:p},g))}))}));const mv=(0,s.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),fv=()=>(0,s.useContext)(mv);var gv=(0,s.memo)((function(e){let{block:t,isDragged:n,isSelected:o,isBranchSelected:r,selectBlock:l,position:i,level:a,rowCount:u,siblingBlockCount:d,showBlockMovers:f,path:h,isExpanded:v,selectedClientIds:b}=e;const k=(0,s.useRef)(null),[_,y]=(0,s.useState)(!1),{clientId:E}=t,{toggleBlockHighlight:C}=(0,m.useDispatch)(zn),{__experimentalFeatures:S,__experimentalPersistentListViewFeatures:w,__experimentalHideContainerBlockActions:B,isTreeGridMounted:x,expand:I,collapse:T}=fv(),P=f&&d>0,N=c()("block-editor-list-view-block__mover-cell",{"is-visible":_||o}),M=c()("block-editor-list-view-block__menu-cell",{"is-visible":_||o});(0,s.useEffect)((()=>{w&&!x&&o&&k.current.focus()}),[]);const R=w?C:()=>{},L=(0,s.useCallback)((()=>{y(!0),R(E,!0)}),[E,y,R]),A=(0,s.useCallback)((()=>{y(!1),R(E,!1)}),[E,y,R]),D=(0,s.useCallback)((e=>{l(e,E)}),[E,l]),O=(0,s.useCallback)((e=>{l(void 0,e)}),[l]),F=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===v?T(E):!1===v&&I(E)}),[E,I,T,v]),z=S&&(!B||B&&a>1),V=S&&!z;let H;P?H=2:V&&(H=3);const G=c()({"is-selected":o,"is-branch-selected":w&&r,"is-dragging":n,"has-single-cell":V}),U=zd(E),W=U?(0,g.sprintf)(// translators: %s: The title of the block.
|
68 |
+
(0,g.__)("Options for %s block"),U.title):(0,g.__)("Options"),$=b.includes(E)?b:[E];return(0,s.createElement)(cv,{className:G,onMouseEnter:L,onMouseLeave:A,onFocus:L,onBlur:A,level:a,position:i,rowCount:u,path:h,id:`list-view-block-${E}`,"data-block":E,isExpanded:v},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:H,ref:k},(e=>{let{ref:n,tabIndex:r,onFocus:l}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(pv,{block:t,onClick:D,onToggleExpanded:F,isSelected:o,position:i,siblingBlockCount:d,level:a,ref:n,tabIndex:r,onFocus:l,isExpanded:v,selectedClientIds:b}))})),P&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:N,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Jd,{orientation:"vertical",clientIds:[E],ref:t,tabIndex:n,onFocus:o})})),(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(ep,{orientation:"vertical",clientIds:[E],ref:t,tabIndex:n,onFocus:o})})))),z&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:M},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(jp,{clientIds:$,icon:xp,label:W,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:O})})))}));function hv(e,t,n){var o;return(null==n?void 0:n.includes(e.clientId))?0:null===(o=t[e.clientId])||void 0===o||o?1+e.innerBlocks.reduce(vv(t,n),0):1}const vv=(e,t)=>(n,o)=>{var r;return(null==t?void 0:t.includes(o.clientId))?n:(null===(r=e[o.clientId])||void 0===r||r)&&o.innerBlocks.length>0?n+hv(o,e,t):n+1};function bv(e){const{blocks:t,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:c=!1,listPosition:d=0,fixedListWindow:p}=e,{expandedState:f,draggedClientIds:g,__experimentalPersistentListViewFeatures:h}=fv(),v=(0,u.compact)(t),b=v.length;let k=d;return(0,s.createElement)(s.Fragment,null,v.map(((e,t)=>{var d;const{clientId:_,innerBlocks:y}=e;t>0&&(k+=hv(v[t-1],f,g));const E=h,{itemInView:C}=p,S=!E||C(k),w=t+1,B=a.length>0?`${a}_${w}`:`${w}`,x=r&&!!y&&!!y.length,I=x?null===(d=f[_])||void 0===d||d:void 0,T=!(null==g||!g.includes(_)),P=T||S,N=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(_,l),M=c||N&&x;return(0,s.createElement)(m.AsyncModeProvider,{key:_,value:!N},P&&(0,s.createElement)(gv,{block:e,selectBlock:n,isSelected:N,isBranchSelected:M,isDragged:T,level:i,position:w,rowCount:b,siblingBlockCount:b,showBlockMovers:o,path:B,isExpanded:I,listPosition:k,selectedClientIds:l}),!P&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),x&&I&&!T&&(0,s.createElement)(bv,{blocks:y,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:i+1,path:B,listPosition:k+1,fixedListWindow:p,isBranchSelected:M,selectedClientIds:l}))})))}bv.defaultProps={selectBlock:()=>{}};var kv=(0,s.memo)(bv);function _v(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,s.useMemo)((()=>t.current?[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]:[]),[o,r]),c=a||i,u=(0,s.useCallback)((()=>{if(!i)return 0;const e=c.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,c]),d=(0,s.useMemo)((()=>{if(!c)return{};const e=u();return{width:c.offsetWidth-e}}),[u,c]),m=(0,s.useCallback)((()=>{if(!c)return{};const e=c.ownerDocument,t=c.getBoundingClientRect(),n=u(),o={left:t.left+n,right:t.right,width:0,height:t.height,ownerDocument:e};return"top"===l?{...o,top:t.top,bottom:t.top}:"bottom"===l||"inside"===l?{...o,top:t.bottom,bottom:t.bottom}:{}}),[c,l,u]);return c?(0,s.createElement)(p.Popover,{noArrow:!0,animate:!1,getAnchorRect:m,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},(0,s.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function yv(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const Ev=["top","bottom"];const Cv=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var Sv=(0,s.forwardRef)((function(e,t){let{blocks:n,__experimentalFeatures:o,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,showNestedBlocks:c,showBlockMovers:f,...h}=e;const{clientIdsTree:v,draggedClientIds:b,selectedClientIds:k}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(zn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(n),{visibleBlockCount:_}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(zn),o=(null==b?void 0:b.length)>0?n(b).length+1:0;return{visibleBlockCount:t()-o}}),[b]),{updateBlockSelection:y}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(zn),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:a,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(zn),{getBlockType:f}=(0,m.useSelect)(r.store);return{updateBlockSelection:(0,s.useCallback)((async(r,s,a)=>{if(null==r||!r.shiftKey)return await e(),void n(s);r.preventDefault();const m="keydown"===r.type&&(r.keyCode===Ca.UP||r.keyCode===Ca.DOWN);if(!m&&!p()&&!d())return void n(s,null);const h=c(),v=[...l(s),s];m&&!h.some((e=>v.includes(e)))&&await e();let b=i(),k=s;m&&(p()||d()||(b=s),a&&(k=a));const _=l(b),y=l(k),{start:E,end:C}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(b,k,_,y);await t(E,C,null);const S=c(),w=(0,u.difference)(h,S);let B;if(1===w.length){var x;const e=null===(x=f(o(w[0])))||void 0===x?void 0:x.title;e&&(B=(0,g.sprintf)(
|
69 |
/* translators: %s: block name */
|
70 |
(0,g.__)("%s deselected."),e))}else w.length>1&&(B=(0,g.sprintf)(
|
71 |
/* translators: %s: number of deselected blocks */
|
|