Version Description
Download this release
Release Info
Developer | gutenbergplugin |
Plugin | Gutenberg |
Version | 12.5.0 |
Comparing to | |
See all releases |
Code changes from version 12.4.1 to 12.5.0
- build/api-fetch/index.js +33 -19
- build/api-fetch/index.min.asset.php +1 -1
- build/api-fetch/index.min.js +1 -1
- build/block-editor/index.js +259 -113
- build/block-editor/index.min.asset.php +1 -1
- build/block-editor/index.min.js +40 -40
- build/block-editor/style-rtl.css +0 -1
build/api-fetch/index.js
CHANGED
@@ -169,30 +169,44 @@ function createPreloadingMiddleware(preloadedData) {
|
|
169 |
}
|
170 |
}
|
171 |
|
172 |
-
if (typeof rawPath
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
return Promise.resolve(parse ? cacheData.body : cacheData);
|
190 |
-
}
|
191 |
}
|
192 |
|
193 |
return next(options);
|
194 |
};
|
195 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
|
197 |
/* harmony default export */ var preloading = (createPreloadingMiddleware);
|
198 |
//# sourceMappingURL=preloading.js.map
|
169 |
}
|
170 |
}
|
171 |
|
172 |
+
if (typeof rawPath !== 'string') {
|
173 |
+
return next(options);
|
174 |
+
}
|
175 |
+
|
176 |
+
const method = options.method || 'GET';
|
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);
|
|
|
|
|
189 |
}
|
190 |
|
191 |
return next(options);
|
192 |
};
|
193 |
}
|
194 |
+
/**
|
195 |
+
* This is a helper function that sends a success response.
|
196 |
+
*
|
197 |
+
* @param {Record<string, any>} responseData
|
198 |
+
* @param {boolean} parse
|
199 |
+
* @return {Promise<any>} Promise with the response.
|
200 |
+
*/
|
201 |
+
|
202 |
+
|
203 |
+
function prepareResponse(responseData, parse) {
|
204 |
+
return Promise.resolve(parse ? responseData.body : new window.Response(JSON.stringify(responseData.body), {
|
205 |
+
status: 200,
|
206 |
+
statusText: 'OK',
|
207 |
+
headers: responseData.headers
|
208 |
+
}));
|
209 |
+
}
|
210 |
|
211 |
/* harmony default export */ var preloading = (createPreloadingMiddleware);
|
212 |
//# sourceMappingURL=preloading.js.map
|
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' => '72c0a03c7ad9642b09c5dd55cc0e07d5');
|
build/api-fetch/index.min.js
CHANGED
@@ -1 +1 @@
|
|
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
|
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 O}});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 O({...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 O({...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 v(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(v.nonceEndpoint).then(_).then((e=>e.text())).then((t=>(v.nonceMiddleware.nonce=t,v(e))))))}v.use=function(e){y.unshift(e)},v.setFetchHandler=function(e){P=e},v.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},v.createPreloadingMiddleware=function(e){const t=Object.keys(e).reduce(((t,r)=>(t[(0,o.normalizePath)(r)]=e[r],t)),{});return(e,r)=>{const{parse:n=!0}=e;let s=e.path;if(!s&&e.url){const t=(0,o.getQueryArg)(e.url,"rest_route");"string"==typeof t&&(s=t)}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)}},v.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})})),v.fetchAllMiddleware=d,v.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 O=v;(window.wp=window.wp||{}).apiFetch=t.default}();
|
build/block-editor/index.js
CHANGED
@@ -6459,10 +6459,15 @@ const __experimentalGetAllowedBlocks = rememo(function (state) {
|
|
6459 |
/**
|
6460 |
* Returns the block to be directly inserted by the block appender.
|
6461 |
*
|
6462 |
-
* @param
|
6463 |
-
* @param
|
6464 |
*
|
6465 |
-
* @return {?
|
|
|
|
|
|
|
|
|
|
|
6466 |
*/
|
6467 |
|
6468 |
const __experimentalGetDirectInsertBlock = rememo(function (state) {
|
@@ -10022,6 +10027,7 @@ const cleanEmptyObject = object => {
|
|
10022 |
*/
|
10023 |
|
10024 |
|
|
|
10025 |
/**
|
10026 |
* Internal dependencies
|
10027 |
*/
|
@@ -10034,55 +10040,24 @@ function BlockSupportToolsPanel(_ref) {
|
|
10034 |
group,
|
10035 |
label
|
10036 |
} = _ref;
|
10037 |
-
const {
|
10038 |
-
attributes,
|
10039 |
-
clientIds,
|
10040 |
-
panelId
|
10041 |
-
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
10042 |
-
const {
|
10043 |
-
getBlockAttributes,
|
10044 |
-
getMultiSelectedBlockClientIds,
|
10045 |
-
getSelectedBlockClientId,
|
10046 |
-
hasMultiSelection
|
10047 |
-
} = select(store); // When we currently have a multi-selection, the value returned from
|
10048 |
-
// `getSelectedBlockClientId()` is `null`. When a `null` value is used
|
10049 |
-
// for the `panelId`, a `ToolsPanel` will still allow panel items to
|
10050 |
-
// register themselves despite their panelIds not matching.
|
10051 |
-
|
10052 |
-
const selectedBlockClientId = getSelectedBlockClientId();
|
10053 |
-
|
10054 |
-
if (hasMultiSelection()) {
|
10055 |
-
const selectedBlockClientIds = getMultiSelectedBlockClientIds();
|
10056 |
-
const selectedBlockAttributes = selectedBlockClientIds.reduce((blockAttributes, blockId) => {
|
10057 |
-
blockAttributes[blockId] = getBlockAttributes(blockId);
|
10058 |
-
return blockAttributes;
|
10059 |
-
}, {});
|
10060 |
-
return {
|
10061 |
-
panelId: selectedBlockClientId,
|
10062 |
-
clientIds: selectedBlockClientIds,
|
10063 |
-
attributes: selectedBlockAttributes
|
10064 |
-
};
|
10065 |
-
}
|
10066 |
-
|
10067 |
-
return {
|
10068 |
-
panelId: selectedBlockClientId,
|
10069 |
-
clientIds: [selectedBlockClientId],
|
10070 |
-
attributes: {
|
10071 |
-
[selectedBlockClientId]: getBlockAttributes(selectedBlockClientId)
|
10072 |
-
}
|
10073 |
-
};
|
10074 |
-
}, []);
|
10075 |
const {
|
10076 |
updateBlockAttributes
|
10077 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
10078 |
-
|
10079 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
10080 |
let resetFilters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
10081 |
const newAttributes = {};
|
|
|
10082 |
clientIds.forEach(clientId => {
|
10083 |
const {
|
10084 |
style
|
10085 |
-
} =
|
10086 |
let newBlockAttributes = {
|
10087 |
style
|
10088 |
};
|
@@ -10098,8 +10073,7 @@ function BlockSupportToolsPanel(_ref) {
|
|
10098 |
newAttributes[clientId] = newBlockAttributes;
|
10099 |
});
|
10100 |
updateBlockAttributes(clientIds, newAttributes, true);
|
10101 |
-
};
|
10102 |
-
|
10103 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
|
10104 |
className: `${group}-block-support-panel`,
|
10105 |
label: label,
|
@@ -10603,6 +10577,15 @@ const Edit = props => {
|
|
10603 |
|
10604 |
|
10605 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10606 |
|
10607 |
function BlockEdit(props) {
|
10608 |
const {
|
@@ -15900,7 +15883,10 @@ function useScrollIntoView(clientId) {
|
|
15900 |
* WordPress dependencies
|
15901 |
*/
|
15902 |
|
15903 |
-
const BlockRefs = (0,external_wp_element_namespaceObject.createContext)(
|
|
|
|
|
|
|
15904 |
function BlockRefsProvider(_ref) {
|
15905 |
let {
|
15906 |
children
|
@@ -18100,10 +18086,8 @@ function styleSheetsCompat(doc) {
|
|
18100 |
});
|
18101 |
|
18102 |
if (isMatch && !doc.getElementById(ownerNode.id)) {
|
18103 |
-
//
|
18104 |
-
|
18105 |
-
For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
|
18106 |
-
For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles).`, ownerNode.outerHTML);
|
18107 |
doc.head.appendChild(ownerNode.cloneNode(true)); // Add inline styles belonging to the stylesheet.
|
18108 |
|
18109 |
const inlineCssId = ownerNode.id.replace('-css', '-inline-css');
|
@@ -19814,6 +19798,7 @@ function EditorStyles(_ref) {
|
|
19814 |
|
19815 |
|
19816 |
|
|
|
19817 |
/**
|
19818 |
* Internal dependencies
|
19819 |
*/
|
@@ -19824,6 +19809,7 @@ function EditorStyles(_ref) {
|
|
19824 |
// This is used to avoid rendering the block list if the sizes change.
|
19825 |
|
19826 |
let MemoizedBlockList;
|
|
|
19827 |
|
19828 |
function AutoBlockPreview(_ref) {
|
19829 |
let {
|
@@ -19845,7 +19831,18 @@ function AutoBlockPreview(_ref) {
|
|
19845 |
styles: settings.styles,
|
19846 |
assets: settings.__unstableResolvedAssets
|
19847 |
};
|
19848 |
-
}, []); //
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19849 |
|
19850 |
MemoizedBlockList = MemoizedBlockList || (0,external_wp_compose_namespaceObject.pure)(BlockList);
|
19851 |
const scale = containerWidth / viewportWidth;
|
@@ -19855,11 +19852,12 @@ function AutoBlockPreview(_ref) {
|
|
19855 |
className: "block-editor-block-preview__content",
|
19856 |
style: {
|
19857 |
transform: `scale(${scale})`,
|
19858 |
-
height: contentHeight * scale
|
|
|
19859 |
}
|
19860 |
}, (0,external_wp_element_namespaceObject.createElement)(iframe, {
|
19861 |
head: (0,external_wp_element_namespaceObject.createElement)(EditorStyles, {
|
19862 |
-
styles:
|
19863 |
}),
|
19864 |
assets: assets,
|
19865 |
contentRef: (0,external_wp_compose_namespaceObject.useRefEffect)(bodyElement => {
|
@@ -19879,7 +19877,10 @@ function AutoBlockPreview(_ref) {
|
|
19879 |
position: 'absolute',
|
19880 |
width: viewportWidth,
|
19881 |
height: contentHeight,
|
19882 |
-
pointerEvents: 'none'
|
|
|
|
|
|
|
19883 |
}
|
19884 |
}, contentResizeListener, (0,external_wp_element_namespaceObject.createElement)(MemoizedBlockList, {
|
19885 |
renderAppender: false
|
@@ -22344,7 +22345,7 @@ class Inserter extends external_wp_element_namespaceObject.Component {
|
|
22344 |
onSelectOrClose
|
22345 |
} = this.props;
|
22346 |
|
22347 |
-
if (hasSingleBlockType || directInsertBlock
|
22348 |
return this.renderToggle({
|
22349 |
onToggle: insertOnlyAllowedBlock
|
22350 |
});
|
@@ -22418,10 +22419,56 @@ class Inserter extends external_wp_element_namespaceObject.Component {
|
|
22418 |
onSelectOrClose
|
22419 |
} = ownProps;
|
22420 |
|
22421 |
-
if (!hasSingleBlockType && !
|
22422 |
return;
|
22423 |
}
|
22424 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22425 |
function getInsertionIndex() {
|
22426 |
const {
|
22427 |
getBlockIndex,
|
@@ -22448,7 +22495,19 @@ class Inserter extends external_wp_element_namespaceObject.Component {
|
|
22448 |
const {
|
22449 |
insertBlock
|
22450 |
} = dispatch(store);
|
22451 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22452 |
insertBlock(blockToInsert, getInsertionIndex(), rootClientId);
|
22453 |
|
22454 |
if (onSelectOrClose) {
|
@@ -23891,7 +23950,11 @@ function BlockSelectionButton(_ref) {
|
|
23891 |
let nextTabbable;
|
23892 |
|
23893 |
if (navigateDown) {
|
23894 |
-
nextTabbable =
|
|
|
|
|
|
|
|
|
23895 |
|
23896 |
if (!nextTabbable) {
|
23897 |
nextTabbable = blockElement.ownerDocument.defaultView.frameElement;
|
@@ -27328,6 +27391,8 @@ var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(exte
|
|
27328 |
|
27329 |
|
27330 |
|
|
|
|
|
27331 |
/**
|
27332 |
* This hook is a side effect which updates the block-editor store when changes
|
27333 |
* happen to inner block settings. The given props are transformed into a
|
@@ -27335,20 +27400,20 @@ var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(exte
|
|
27335 |
* the block-editor store, then the store is updated with the new settings which
|
27336 |
* came from props.
|
27337 |
*
|
27338 |
-
* @param {string}
|
27339 |
-
* @param {string[]}
|
27340 |
-
*
|
27341 |
-
* @param {?
|
27342 |
-
* @param {?Function|boolean}
|
27343 |
-
*
|
27344 |
-
* @param {string}
|
27345 |
-
*
|
27346 |
-
* @param {boolean}
|
27347 |
-
*
|
27348 |
-
*
|
27349 |
-
* @param {string}
|
27350 |
-
*
|
27351 |
-
* @param {Object}
|
27352 |
*/
|
27353 |
|
27354 |
function useNestedSettingsUpdate(clientId, allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, layout) {
|
@@ -28401,7 +28466,7 @@ function ColorGradientSettingsDropdown(_ref) {
|
|
28401 |
isBordered: true,
|
28402 |
isSeparated: true,
|
28403 |
className: "block-editor-panel-color-gradient-settings__item-group"
|
28404 |
-
}, settings.map((setting, index) => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
|
28405 |
key: index,
|
28406 |
position: dropdownPosition,
|
28407 |
className: "block-editor-panel-color-gradient-settings__dropdown",
|
@@ -30110,15 +30175,24 @@ function ContrastCheckerMessage(_ref) {
|
|
30110 |
colordBackgroundColor,
|
30111 |
colordTextColor,
|
30112 |
backgroundColor,
|
30113 |
-
textColor
|
|
|
30114 |
} = _ref;
|
30115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
30116 |
// prop, but the contrast checker requires granular control over when the
|
30117 |
// announcements are made. Notably, the message will be re-announced if a
|
30118 |
// new color combination is selected and the contrast is still insufficient.
|
30119 |
|
|
|
30120 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
30121 |
-
(0,
|
|
|
30122 |
}, [backgroundColor, textColor]);
|
30123 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
30124 |
className: "block-editor-contrast-checker"
|
@@ -30137,7 +30211,8 @@ function ContrastChecker(_ref2) {
|
|
30137 |
fontSize,
|
30138 |
// font size value in pixels
|
30139 |
isLargeText,
|
30140 |
-
textColor
|
|
|
30141 |
} = _ref2;
|
30142 |
|
30143 |
if (!(backgroundColor || fallbackBackgroundColor) || !(textColor || fallbackTextColor)) {
|
@@ -30146,20 +30221,35 @@ function ContrastChecker(_ref2) {
|
|
30146 |
|
30147 |
const colordBackgroundColor = w(backgroundColor || fallbackBackgroundColor);
|
30148 |
const colordTextColor = w(textColor || fallbackTextColor);
|
30149 |
-
const
|
30150 |
-
|
30151 |
-
|
|
|
30152 |
level: 'AA',
|
30153 |
size: isLargeText || isLargeText !== false && fontSize >= 24 ? 'large' : 'small'
|
30154 |
-
})
|
|
|
|
|
|
|
30155 |
return null;
|
30156 |
}
|
30157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30158 |
return (0,external_wp_element_namespaceObject.createElement)(ContrastCheckerMessage, {
|
30159 |
backgroundColor: backgroundColor,
|
30160 |
textColor: textColor,
|
30161 |
colordBackgroundColor: colordBackgroundColor,
|
30162 |
-
colordTextColor: colordTextColor
|
|
|
|
|
|
|
30163 |
});
|
30164 |
}
|
30165 |
|
@@ -30188,6 +30278,7 @@ function getComputedStyle(node) {
|
|
30188 |
|
30189 |
function ColorPanel(_ref) {
|
30190 |
let {
|
|
|
30191 |
settings,
|
30192 |
clientId,
|
30193 |
enableContrastChecking = true,
|
@@ -30221,11 +30312,13 @@ function ColorPanel(_ref) {
|
|
30221 |
initialOpen: false,
|
30222 |
settings: settings,
|
30223 |
showTitle: showTitle,
|
|
|
30224 |
__experimentalHasMultipleOrigins: true,
|
30225 |
__experimentalIsRenderedInSidebar: true
|
30226 |
}, enableContrastChecking && (0,external_wp_element_namespaceObject.createElement)(contrast_checker, {
|
30227 |
backgroundColor: detectedBackgroundColor,
|
30228 |
-
textColor: detectedColor
|
|
|
30229 |
})));
|
30230 |
}
|
30231 |
//# sourceMappingURL=color-panel.js.map
|
@@ -30554,10 +30647,11 @@ function ColorEdit(props) {
|
|
30554 |
});
|
30555 |
};
|
30556 |
|
|
|
30557 |
return (0,external_wp_element_namespaceObject.createElement)(ColorPanel, {
|
30558 |
-
enableContrastChecking:
|
30559 |
-
external_wp_element_namespaceObject.Platform.OS === 'web' && !gradient && !(style !== null && style !== void 0 && (_style$color6 = style.color) !== null && _style$color6 !== void 0 && _style$color6.gradient),
|
30560 |
clientId: props.clientId,
|
|
|
30561 |
settings: [...(hasTextColor ? [{
|
30562 |
label: (0,external_wp_i18n_namespaceObject.__)('Text'),
|
30563 |
onColorChange: onChangeColor('text'),
|
@@ -30644,38 +30738,38 @@ const withColorPaletteStyles = (0,external_wp_compose_namespaceObject.createHigh
|
|
30644 |
|
30645 |
|
30646 |
const FONT_STYLES = [{
|
30647 |
-
name: (0,external_wp_i18n_namespaceObject.
|
30648 |
value: 'normal'
|
30649 |
}, {
|
30650 |
-
name: (0,external_wp_i18n_namespaceObject.
|
30651 |
value: 'italic'
|
30652 |
}];
|
30653 |
const FONT_WEIGHTS = [{
|
30654 |
-
name: (0,external_wp_i18n_namespaceObject.
|
30655 |
value: '100'
|
30656 |
}, {
|
30657 |
-
name: (0,external_wp_i18n_namespaceObject.
|
30658 |
value: '200'
|
30659 |
}, {
|
30660 |
-
name: (0,external_wp_i18n_namespaceObject.
|
30661 |
value: '300'
|
30662 |
}, {
|
30663 |
-
name: (0,external_wp_i18n_namespaceObject.
|
30664 |
value: '400'
|
30665 |
}, {
|
30666 |
-
name: (0,external_wp_i18n_namespaceObject.
|
30667 |
value: '500'
|
30668 |
}, {
|
30669 |
-
name: (0,external_wp_i18n_namespaceObject.
|
30670 |
value: '600'
|
30671 |
}, {
|
30672 |
-
name: (0,external_wp_i18n_namespaceObject.
|
30673 |
value: '700'
|
30674 |
}, {
|
30675 |
-
name: (0,external_wp_i18n_namespaceObject.
|
30676 |
value: '800'
|
30677 |
}, {
|
30678 |
-
name: (0,external_wp_i18n_namespaceObject.
|
30679 |
value: '900'
|
30680 |
}];
|
30681 |
/**
|
@@ -39848,8 +39942,18 @@ const LinkControlSearchItem = _ref => {
|
|
39848 |
className: "block-editor-link-control__search-item-info"
|
39849 |
}, !isURL && ((0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(suggestion.url)) || ''), isURL && (0,external_wp_i18n_namespaceObject.__)('Press ENTER to add this link'))), shouldShowType && suggestion.type && (0,external_wp_element_namespaceObject.createElement)("span", {
|
39850 |
className: "block-editor-link-control__search-item-type"
|
39851 |
-
}, suggestion
|
39852 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39853 |
/* harmony default export */ var search_item = (LinkControlSearchItem);
|
39854 |
//# sourceMappingURL=search-item.js.map
|
39855 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/link-control/constants.js
|
@@ -39962,7 +40066,8 @@ function LinkControlSearchResults(_ref) {
|
|
39962 |
isSelected: index === selectedSuggestion,
|
39963 |
isURL: directLinkEntryTypes.includes(suggestion.type.toLowerCase()),
|
39964 |
searchTerm: currentInputValue,
|
39965 |
-
shouldShowType: shouldShowSuggestionsTypes
|
|
|
39966 |
});
|
39967 |
})));
|
39968 |
}
|
@@ -40038,16 +40143,27 @@ const handleDirectEntry = val => {
|
|
40038 |
}]);
|
40039 |
};
|
40040 |
|
40041 |
-
const handleEntitySearch = async (val, suggestionsQuery, fetchSearchSuggestions, directEntryHandler, withCreateSuggestion, withURLSuggestion) => {
|
40042 |
const {
|
40043 |
isInitialSuggestions
|
40044 |
} = suggestionsQuery;
|
40045 |
-
let
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40046 |
const couldBeURL = !val.includes(' '); // If it's potentially a URL search then concat on a URL search suggestion
|
40047 |
// just for good measure. That way once the actual results run out we always
|
40048 |
// have a URL option to fallback on.
|
40049 |
|
40050 |
-
if (couldBeURL && withURLSuggestion && !isInitialSuggestions) {
|
40051 |
results = results[0].concat(results[1]);
|
40052 |
} else {
|
40053 |
results = results[0];
|
@@ -40086,12 +40202,14 @@ const handleEntitySearch = async (val, suggestionsQuery, fetchSearchSuggestions,
|
|
40086 |
|
40087 |
function useSearchHandler(suggestionsQuery, allowDirectEntry, withCreateSuggestion, withURLSuggestion) {
|
40088 |
const {
|
40089 |
-
fetchSearchSuggestions
|
|
|
40090 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
40091 |
const {
|
40092 |
getSettings
|
40093 |
} = select(store);
|
40094 |
return {
|
|
|
40095 |
fetchSearchSuggestions: getSettings().__experimentalFetchLinkSuggestions
|
40096 |
};
|
40097 |
}, []);
|
@@ -40104,7 +40222,7 @@ function useSearchHandler(suggestionsQuery, allowDirectEntry, withCreateSuggesti
|
|
40104 |
isInitialSuggestions
|
40105 |
}) : handleEntitySearch(val, { ...suggestionsQuery,
|
40106 |
isInitialSuggestions
|
40107 |
-
}, fetchSearchSuggestions, directEntryHandler, withCreateSuggestion, withURLSuggestion);
|
40108 |
}, [directEntryHandler, fetchSearchSuggestions, withCreateSuggestion]);
|
40109 |
}
|
40110 |
//# sourceMappingURL=use-search-handler.js.map
|
@@ -41014,6 +41132,7 @@ const MediaReplaceFlow = _ref => {
|
|
41014 |
let {
|
41015 |
mediaURL,
|
41016 |
mediaId,
|
|
|
41017 |
allowedTypes,
|
41018 |
accept,
|
41019 |
onSelect,
|
@@ -41023,7 +41142,10 @@ const MediaReplaceFlow = _ref => {
|
|
41023 |
name = (0,external_wp_i18n_namespaceObject.__)('Replace'),
|
41024 |
createNotice,
|
41025 |
removeNotice,
|
41026 |
-
children
|
|
|
|
|
|
|
41027 |
} = _ref;
|
41028 |
const [mediaURLValue, setMediaURLValue] = (0,external_wp_element_namespaceObject.useState)(mediaURL);
|
41029 |
const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
@@ -41055,7 +41177,8 @@ const MediaReplaceFlow = _ref => {
|
|
41055 |
}, 1000);
|
41056 |
};
|
41057 |
|
41058 |
-
const selectMedia = media => {
|
|
|
41059 |
setMediaURLValue(media.url); // Calling `onSelect` after the state update since it might unmount the component.
|
41060 |
|
41061 |
onSelect(media);
|
@@ -41067,13 +41190,19 @@ const MediaReplaceFlow = _ref => {
|
|
41067 |
onSelectURL(newURL);
|
41068 |
};
|
41069 |
|
41070 |
-
const uploadFiles = event => {
|
41071 |
const files = event.target.files;
|
|
|
|
|
|
|
|
|
|
|
|
|
41072 |
onFilesUpload(files);
|
41073 |
|
41074 |
const setMedia = _ref2 => {
|
41075 |
let [media] = _ref2;
|
41076 |
-
selectMedia(media);
|
41077 |
};
|
41078 |
|
41079 |
mediaUpload({
|
@@ -41091,6 +41220,15 @@ const MediaReplaceFlow = _ref => {
|
|
41091 |
}
|
41092 |
};
|
41093 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41094 |
const POPOVER_PROPS = {
|
41095 |
isAlternate: true
|
41096 |
};
|
@@ -41117,8 +41255,11 @@ const MediaReplaceFlow = _ref => {
|
|
41117 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, {
|
41118 |
className: "block-editor-media-replace-flow__media-upload-menu"
|
41119 |
}, (0,external_wp_element_namespaceObject.createElement)(media_upload, {
|
41120 |
-
|
41121 |
-
|
|
|
|
|
|
|
41122 |
allowedTypes: allowedTypes,
|
41123 |
onClose: onCloseModal,
|
41124 |
render: _ref5 => {
|
@@ -41135,6 +41276,7 @@ const MediaReplaceFlow = _ref => {
|
|
41135 |
uploadFiles(event, onClose);
|
41136 |
},
|
41137 |
accept: accept,
|
|
|
41138 |
render: _ref6 => {
|
41139 |
let {
|
41140 |
openFileDialog
|
@@ -41757,12 +41899,16 @@ const PanelColorSettings = _ref => {
|
|
41757 |
colorSettings,
|
41758 |
...props
|
41759 |
} = _ref;
|
41760 |
-
const settings = colorSettings.map(
|
41761 |
-
|
|
|
|
|
|
|
|
|
41762 |
value,
|
41763 |
onChange,
|
41764 |
...otherSettings
|
41765 |
-
} =
|
41766 |
return { ...otherSettings,
|
41767 |
colorValue: value,
|
41768 |
onColorChange: onChange
|
6459 |
/**
|
6460 |
* Returns the block to be directly inserted by the block appender.
|
6461 |
*
|
6462 |
+
* @param {Object} state Editor state.
|
6463 |
+
* @param {?string} rootClientId Optional root client ID of block list.
|
6464 |
*
|
6465 |
+
* @return {?WPDirectInsertBlock} The block type to be directly inserted.
|
6466 |
+
*
|
6467 |
+
* @typedef {Object} WPDirectInsertBlock
|
6468 |
+
* @property {string} name The type of block.
|
6469 |
+
* @property {?Object} attributes Attributes to pass to the newly created block.
|
6470 |
+
* @property {?Array<string>} attributesToCopy Attributes to be copied from adjecent blocks when inserted.
|
6471 |
*/
|
6472 |
|
6473 |
const __experimentalGetDirectInsertBlock = rememo(function (state) {
|
10027 |
*/
|
10028 |
|
10029 |
|
10030 |
+
|
10031 |
/**
|
10032 |
* Internal dependencies
|
10033 |
*/
|
10040 |
group,
|
10041 |
label
|
10042 |
} = _ref;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10043 |
const {
|
10044 |
updateBlockAttributes
|
10045 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
10046 |
+
const {
|
10047 |
+
getBlockAttributes,
|
10048 |
+
getMultiSelectedBlockClientIds,
|
10049 |
+
getSelectedBlockClientId,
|
10050 |
+
hasMultiSelection
|
10051 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
10052 |
+
const panelId = getSelectedBlockClientId();
|
10053 |
+
const resetAll = (0,external_wp_element_namespaceObject.useCallback)(function () {
|
10054 |
let resetFilters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
10055 |
const newAttributes = {};
|
10056 |
+
const clientIds = hasMultiSelection() ? getMultiSelectedBlockClientIds() : [panelId];
|
10057 |
clientIds.forEach(clientId => {
|
10058 |
const {
|
10059 |
style
|
10060 |
+
} = getBlockAttributes(clientId);
|
10061 |
let newBlockAttributes = {
|
10062 |
style
|
10063 |
};
|
10073 |
newAttributes[clientId] = newBlockAttributes;
|
10074 |
});
|
10075 |
updateBlockAttributes(clientIds, newAttributes, true);
|
10076 |
+
}, [cleanEmptyObject, getBlockAttributes, getMultiSelectedBlockClientIds, hasMultiSelection, panelId, updateBlockAttributes]);
|
|
|
10077 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
|
10078 |
className: `${group}-block-support-panel`,
|
10079 |
label: label,
|
10577 |
|
10578 |
|
10579 |
|
10580 |
+
/**
|
10581 |
+
* The `useBlockEditContext` hook provides information about the block this hook is being used in.
|
10582 |
+
* It returns an object with the `name`, `isSelected` state, and the `clientId` of the block.
|
10583 |
+
* It is useful if you want to create custom hooks that need access to the current blocks clientId
|
10584 |
+
* but don't want to rely on the data getting passed in as a parameter.
|
10585 |
+
*
|
10586 |
+
* @return {Object} Block edit context
|
10587 |
+
*/
|
10588 |
+
|
10589 |
|
10590 |
function BlockEdit(props) {
|
10591 |
const {
|
15883 |
* WordPress dependencies
|
15884 |
*/
|
15885 |
|
15886 |
+
const BlockRefs = (0,external_wp_element_namespaceObject.createContext)({
|
15887 |
+
refs: new Map(),
|
15888 |
+
callbacks: new Map()
|
15889 |
+
});
|
15890 |
function BlockRefsProvider(_ref) {
|
15891 |
let {
|
15892 |
children
|
18086 |
});
|
18087 |
|
18088 |
if (isMatch && !doc.getElementById(ownerNode.id)) {
|
18089 |
+
// Display warning once we have a way to add style dependencies to the editor.
|
18090 |
+
// See: https://github.com/WordPress/gutenberg/pull/37466.
|
|
|
|
|
18091 |
doc.head.appendChild(ownerNode.cloneNode(true)); // Add inline styles belonging to the stylesheet.
|
18092 |
|
18093 |
const inlineCssId = ownerNode.id.replace('-css', '-inline-css');
|
19798 |
|
19799 |
|
19800 |
|
19801 |
+
|
19802 |
/**
|
19803 |
* Internal dependencies
|
19804 |
*/
|
19809 |
// This is used to avoid rendering the block list if the sizes change.
|
19810 |
|
19811 |
let MemoizedBlockList;
|
19812 |
+
const MAX_HEIGHT = 2000;
|
19813 |
|
19814 |
function AutoBlockPreview(_ref) {
|
19815 |
let {
|
19831 |
styles: settings.styles,
|
19832 |
assets: settings.__unstableResolvedAssets
|
19833 |
};
|
19834 |
+
}, []); // Avoid scrollbars for pattern previews.
|
19835 |
+
|
19836 |
+
const editorStyles = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
19837 |
+
if (styles) {
|
19838 |
+
return [...styles, {
|
19839 |
+
css: 'body{height:auto;overflow:hidden;}',
|
19840 |
+
__unstableType: 'presets'
|
19841 |
+
}];
|
19842 |
+
}
|
19843 |
+
|
19844 |
+
return styles;
|
19845 |
+
}, [styles]); // Initialize on render instead of module top level, to avoid circular dependency issues.
|
19846 |
|
19847 |
MemoizedBlockList = MemoizedBlockList || (0,external_wp_compose_namespaceObject.pure)(BlockList);
|
19848 |
const scale = containerWidth / viewportWidth;
|
19852 |
className: "block-editor-block-preview__content",
|
19853 |
style: {
|
19854 |
transform: `scale(${scale})`,
|
19855 |
+
height: contentHeight * scale,
|
19856 |
+
maxHeight: contentHeight > MAX_HEIGHT ? MAX_HEIGHT * scale : undefined
|
19857 |
}
|
19858 |
}, (0,external_wp_element_namespaceObject.createElement)(iframe, {
|
19859 |
head: (0,external_wp_element_namespaceObject.createElement)(EditorStyles, {
|
19860 |
+
styles: editorStyles
|
19861 |
}),
|
19862 |
assets: assets,
|
19863 |
contentRef: (0,external_wp_compose_namespaceObject.useRefEffect)(bodyElement => {
|
19877 |
position: 'absolute',
|
19878 |
width: viewportWidth,
|
19879 |
height: contentHeight,
|
19880 |
+
pointerEvents: 'none',
|
19881 |
+
// This is a catch-all max-height for patterns.
|
19882 |
+
// See: https://github.com/WordPress/gutenberg/pull/38175.
|
19883 |
+
maxHeight: MAX_HEIGHT
|
19884 |
}
|
19885 |
}, contentResizeListener, (0,external_wp_element_namespaceObject.createElement)(MemoizedBlockList, {
|
19886 |
renderAppender: false
|
22345 |
onSelectOrClose
|
22346 |
} = this.props;
|
22347 |
|
22348 |
+
if (hasSingleBlockType || directInsertBlock) {
|
22349 |
return this.renderToggle({
|
22350 |
onToggle: insertOnlyAllowedBlock
|
22351 |
});
|
22419 |
onSelectOrClose
|
22420 |
} = ownProps;
|
22421 |
|
22422 |
+
if (!hasSingleBlockType && !directInsertBlock) {
|
22423 |
return;
|
22424 |
}
|
22425 |
|
22426 |
+
function getAdjacentBlockAttributes(attributesToCopy) {
|
22427 |
+
const {
|
22428 |
+
getBlock,
|
22429 |
+
getPreviousBlockClientId
|
22430 |
+
} = select(store);
|
22431 |
+
|
22432 |
+
if (!attributesToCopy || !clientId && !rootClientId) {
|
22433 |
+
return {};
|
22434 |
+
}
|
22435 |
+
|
22436 |
+
const result = {};
|
22437 |
+
let adjacentAttributes = {}; // If there is no clientId, then attempt to get attributes
|
22438 |
+
// from the last block within innerBlocks of the root block.
|
22439 |
+
|
22440 |
+
if (!clientId) {
|
22441 |
+
var _parentBlock$innerBlo;
|
22442 |
+
|
22443 |
+
const parentBlock = getBlock(rootClientId);
|
22444 |
+
|
22445 |
+
if (parentBlock !== null && parentBlock !== void 0 && (_parentBlock$innerBlo = parentBlock.innerBlocks) !== null && _parentBlock$innerBlo !== void 0 && _parentBlock$innerBlo.length) {
|
22446 |
+
const lastInnerBlock = parentBlock.innerBlocks[parentBlock.innerBlocks.length - 1];
|
22447 |
+
|
22448 |
+
if (directInsertBlock && (directInsertBlock === null || directInsertBlock === void 0 ? void 0 : directInsertBlock.name) === lastInnerBlock.name) {
|
22449 |
+
adjacentAttributes = lastInnerBlock.attributes;
|
22450 |
+
}
|
22451 |
+
}
|
22452 |
+
} else {
|
22453 |
+
// Otherwise, attempt to get attributes from the
|
22454 |
+
// previous block relative to the current clientId.
|
22455 |
+
const currentBlock = getBlock(clientId);
|
22456 |
+
const previousBlock = getBlock(getPreviousBlockClientId(clientId));
|
22457 |
+
|
22458 |
+
if ((currentBlock === null || currentBlock === void 0 ? void 0 : currentBlock.name) === (previousBlock === null || previousBlock === void 0 ? void 0 : previousBlock.name)) {
|
22459 |
+
adjacentAttributes = (previousBlock === null || previousBlock === void 0 ? void 0 : previousBlock.attributes) || {};
|
22460 |
+
}
|
22461 |
+
} // Copy over only those attributes flagged to be copied.
|
22462 |
+
|
22463 |
+
|
22464 |
+
attributesToCopy.forEach(attribute => {
|
22465 |
+
if (adjacentAttributes.hasOwnProperty(attribute)) {
|
22466 |
+
result[attribute] = adjacentAttributes[attribute];
|
22467 |
+
}
|
22468 |
+
});
|
22469 |
+
return result;
|
22470 |
+
}
|
22471 |
+
|
22472 |
function getInsertionIndex() {
|
22473 |
const {
|
22474 |
getBlockIndex,
|
22495 |
const {
|
22496 |
insertBlock
|
22497 |
} = dispatch(store);
|
22498 |
+
let blockToInsert; // Attempt to augment the directInsertBlock with attributes from an adjacent block.
|
22499 |
+
// This ensures styling from nearby blocks is preserved in the newly inserted block.
|
22500 |
+
// See: https://github.com/WordPress/gutenberg/issues/37904
|
22501 |
+
|
22502 |
+
if (directInsertBlock) {
|
22503 |
+
const newAttributes = getAdjacentBlockAttributes(directInsertBlock.attributesToCopy);
|
22504 |
+
blockToInsert = (0,external_wp_blocks_namespaceObject.createBlock)(directInsertBlock.name, { ...(directInsertBlock.attributes || {}),
|
22505 |
+
...newAttributes
|
22506 |
+
});
|
22507 |
+
} else {
|
22508 |
+
blockToInsert = (0,external_wp_blocks_namespaceObject.createBlock)(allowedBlockType.name);
|
22509 |
+
}
|
22510 |
+
|
22511 |
insertBlock(blockToInsert, getInsertionIndex(), rootClientId);
|
22512 |
|
22513 |
if (onSelectOrClose) {
|
23950 |
let nextTabbable;
|
23951 |
|
23952 |
if (navigateDown) {
|
23953 |
+
nextTabbable = blockElement;
|
23954 |
+
|
23955 |
+
do {
|
23956 |
+
nextTabbable = external_wp_dom_namespaceObject.focus.tabbable.findNext(nextTabbable);
|
23957 |
+
} while (nextTabbable && blockElement.contains(nextTabbable));
|
23958 |
|
23959 |
if (!nextTabbable) {
|
23960 |
nextTabbable = blockElement.ownerDocument.defaultView.frameElement;
|
27391 |
|
27392 |
|
27393 |
|
27394 |
+
/** @typedef {import('../../selectors').WPDirectInsertBlock } WPDirectInsertBlock */
|
27395 |
+
|
27396 |
/**
|
27397 |
* This hook is a side effect which updates the block-editor store when changes
|
27398 |
* happen to inner block settings. The given props are transformed into a
|
27400 |
* the block-editor store, then the store is updated with the new settings which
|
27401 |
* came from props.
|
27402 |
*
|
27403 |
+
* @param {string} clientId The client ID of the block to update.
|
27404 |
+
* @param {string[]} allowedBlocks An array of block names which are permitted
|
27405 |
+
* in inner blocks.
|
27406 |
+
* @param {?WPDirectInsertBlock} __experimentalDefaultBlock The default block to insert: [ blockName, { blockAttributes } ].
|
27407 |
+
* @param {?Function|boolean} __experimentalDirectInsert If a default block should be inserted directly by the
|
27408 |
+
* appender.
|
27409 |
+
* @param {string} [templateLock] The template lock specified for the inner
|
27410 |
+
* blocks component. (e.g. "all")
|
27411 |
+
* @param {boolean} captureToolbars Whether or children toolbars should be shown
|
27412 |
+
* in the inner blocks component rather than on
|
27413 |
+
* the child block.
|
27414 |
+
* @param {string} orientation The direction in which the block
|
27415 |
+
* should face.
|
27416 |
+
* @param {Object} layout The layout object for the block container.
|
27417 |
*/
|
27418 |
|
27419 |
function useNestedSettingsUpdate(clientId, allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, layout) {
|
28466 |
isBordered: true,
|
28467 |
isSeparated: true,
|
28468 |
className: "block-editor-panel-color-gradient-settings__item-group"
|
28469 |
+
}, settings.map((setting, index) => setting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
|
28470 |
key: index,
|
28471 |
position: dropdownPosition,
|
28472 |
className: "block-editor-panel-color-gradient-settings__dropdown",
|
30175 |
colordBackgroundColor,
|
30176 |
colordTextColor,
|
30177 |
backgroundColor,
|
30178 |
+
textColor,
|
30179 |
+
shouldShowTransparencyWarning
|
30180 |
} = _ref;
|
30181 |
+
let msg = '';
|
30182 |
+
|
30183 |
+
if (shouldShowTransparencyWarning) {
|
30184 |
+
msg = (0,external_wp_i18n_namespaceObject.__)('Transparent text may be hard for people to read.');
|
30185 |
+
} else {
|
30186 |
+
msg = colordBackgroundColor.brightness() < colordTextColor.brightness() ? (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 text color.') : (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 text color.');
|
30187 |
+
} // Note: The `Notice` component can speak messages via its `spokenMessage`
|
30188 |
// prop, but the contrast checker requires granular control over when the
|
30189 |
// announcements are made. Notably, the message will be re-announced if a
|
30190 |
// new color combination is selected and the contrast is still insufficient.
|
30191 |
|
30192 |
+
|
30193 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
30194 |
+
const speakMsg = shouldShowTransparencyWarning ? (0,external_wp_i18n_namespaceObject.__)('Transparent text may be hard for people to read.') : (0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read.');
|
30195 |
+
(0,external_wp_a11y_namespaceObject.speak)(speakMsg);
|
30196 |
}, [backgroundColor, textColor]);
|
30197 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
30198 |
className: "block-editor-contrast-checker"
|
30211 |
fontSize,
|
30212 |
// font size value in pixels
|
30213 |
isLargeText,
|
30214 |
+
textColor,
|
30215 |
+
enableAlphaChecker = false
|
30216 |
} = _ref2;
|
30217 |
|
30218 |
if (!(backgroundColor || fallbackBackgroundColor) || !(textColor || fallbackTextColor)) {
|
30221 |
|
30222 |
const colordBackgroundColor = w(backgroundColor || fallbackBackgroundColor);
|
30223 |
const colordTextColor = w(textColor || fallbackTextColor);
|
30224 |
+
const textColorHasTransparency = colordTextColor.alpha() < 1;
|
30225 |
+
const backgroundColorHasTransparency = colordBackgroundColor.alpha() < 1;
|
30226 |
+
const hasTransparency = textColorHasTransparency || backgroundColorHasTransparency;
|
30227 |
+
const isReadable = colordTextColor.isReadable(colordBackgroundColor, {
|
30228 |
level: 'AA',
|
30229 |
size: isLargeText || isLargeText !== false && fontSize >= 24 ? 'large' : 'small'
|
30230 |
+
}); // Don't show the message if the text is readable AND there's no transparency.
|
30231 |
+
// This is the default.
|
30232 |
+
|
30233 |
+
if (isReadable && !hasTransparency) {
|
30234 |
return null;
|
30235 |
}
|
30236 |
|
30237 |
+
if (hasTransparency) {
|
30238 |
+
if ( // If there's transparency, don't show the message if the alpha checker is disabled.
|
30239 |
+
!enableAlphaChecker || // If the alpha checker is enabled, we only show the warning if the text has transparency.
|
30240 |
+
isReadable && !textColorHasTransparency) {
|
30241 |
+
return null;
|
30242 |
+
}
|
30243 |
+
}
|
30244 |
+
|
30245 |
return (0,external_wp_element_namespaceObject.createElement)(ContrastCheckerMessage, {
|
30246 |
backgroundColor: backgroundColor,
|
30247 |
textColor: textColor,
|
30248 |
colordBackgroundColor: colordBackgroundColor,
|
30249 |
+
colordTextColor: colordTextColor // Flag to warn about transparency only if the text is otherwise readable according to colord
|
30250 |
+
// to ensure the readability warnings take precedence.
|
30251 |
+
,
|
30252 |
+
shouldShowTransparencyWarning: isReadable && textColorHasTransparency
|
30253 |
});
|
30254 |
}
|
30255 |
|
30278 |
|
30279 |
function ColorPanel(_ref) {
|
30280 |
let {
|
30281 |
+
enableAlpha = false,
|
30282 |
settings,
|
30283 |
clientId,
|
30284 |
enableContrastChecking = true,
|
30312 |
initialOpen: false,
|
30313 |
settings: settings,
|
30314 |
showTitle: showTitle,
|
30315 |
+
enableAlpha: enableAlpha,
|
30316 |
__experimentalHasMultipleOrigins: true,
|
30317 |
__experimentalIsRenderedInSidebar: true
|
30318 |
}, enableContrastChecking && (0,external_wp_element_namespaceObject.createElement)(contrast_checker, {
|
30319 |
backgroundColor: detectedBackgroundColor,
|
30320 |
+
textColor: detectedColor,
|
30321 |
+
enableAlphaChecker: enableAlpha
|
30322 |
})));
|
30323 |
}
|
30324 |
//# sourceMappingURL=color-panel.js.map
|
30647 |
});
|
30648 |
};
|
30649 |
|
30650 |
+
const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web' && !gradient && !(style !== null && style !== void 0 && (_style$color6 = style.color) !== null && _style$color6 !== void 0 && _style$color6.gradient);
|
30651 |
return (0,external_wp_element_namespaceObject.createElement)(ColorPanel, {
|
30652 |
+
enableContrastChecking: enableContrastChecking,
|
|
|
30653 |
clientId: props.clientId,
|
30654 |
+
enableAlpha: true,
|
30655 |
settings: [...(hasTextColor ? [{
|
30656 |
label: (0,external_wp_i18n_namespaceObject.__)('Text'),
|
30657 |
onColorChange: onChangeColor('text'),
|
30738 |
|
30739 |
|
30740 |
const FONT_STYLES = [{
|
30741 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Regular', 'font style'),
|
30742 |
value: 'normal'
|
30743 |
}, {
|
30744 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Italic', 'font style'),
|
30745 |
value: 'italic'
|
30746 |
}];
|
30747 |
const FONT_WEIGHTS = [{
|
30748 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Thin', 'font weight'),
|
30749 |
value: '100'
|
30750 |
}, {
|
30751 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Extra Light', 'font weight'),
|
30752 |
value: '200'
|
30753 |
}, {
|
30754 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Light', 'font weight'),
|
30755 |
value: '300'
|
30756 |
}, {
|
30757 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Regular', 'font weight'),
|
30758 |
value: '400'
|
30759 |
}, {
|
30760 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Medium', 'font weight'),
|
30761 |
value: '500'
|
30762 |
}, {
|
30763 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Semi Bold', 'font weight'),
|
30764 |
value: '600'
|
30765 |
}, {
|
30766 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Bold', 'font weight'),
|
30767 |
value: '700'
|
30768 |
}, {
|
30769 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Extra Bold', 'font weight'),
|
30770 |
value: '800'
|
30771 |
}, {
|
30772 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Black', 'font weight'),
|
30773 |
value: '900'
|
30774 |
}];
|
30775 |
/**
|
39942 |
className: "block-editor-link-control__search-item-info"
|
39943 |
}, !isURL && ((0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(suggestion.url)) || ''), isURL && (0,external_wp_i18n_namespaceObject.__)('Press ENTER to add this link'))), shouldShowType && suggestion.type && (0,external_wp_element_namespaceObject.createElement)("span", {
|
39944 |
className: "block-editor-link-control__search-item-type"
|
39945 |
+
}, getVisualTypeName(suggestion)));
|
39946 |
};
|
39947 |
+
|
39948 |
+
function getVisualTypeName(suggestion) {
|
39949 |
+
if (suggestion.isFrontPage) {
|
39950 |
+
return 'front page';
|
39951 |
+
} // Rename 'post_tag' to 'tag'. Ideally, the API would return the localised CPT or taxonomy label.
|
39952 |
+
|
39953 |
+
|
39954 |
+
return suggestion.type === 'post_tag' ? 'tag' : suggestion.type;
|
39955 |
+
}
|
39956 |
+
|
39957 |
/* harmony default export */ var search_item = (LinkControlSearchItem);
|
39958 |
//# sourceMappingURL=search-item.js.map
|
39959 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/link-control/constants.js
|
40066 |
isSelected: index === selectedSuggestion,
|
40067 |
isURL: directLinkEntryTypes.includes(suggestion.type.toLowerCase()),
|
40068 |
searchTerm: currentInputValue,
|
40069 |
+
shouldShowType: shouldShowSuggestionsTypes,
|
40070 |
+
isFrontPage: suggestion === null || suggestion === void 0 ? void 0 : suggestion.isFrontPage
|
40071 |
});
|
40072 |
})));
|
40073 |
}
|
40143 |
}]);
|
40144 |
};
|
40145 |
|
40146 |
+
const handleEntitySearch = async (val, suggestionsQuery, fetchSearchSuggestions, directEntryHandler, withCreateSuggestion, withURLSuggestion, pageOnFront) => {
|
40147 |
const {
|
40148 |
isInitialSuggestions
|
40149 |
} = suggestionsQuery;
|
40150 |
+
let resultsIncludeFrontPage = false;
|
40151 |
+
let results = await Promise.all([fetchSearchSuggestions(val, suggestionsQuery), directEntryHandler(val)]); // Identify front page and update type to match.
|
40152 |
+
|
40153 |
+
results[0] = results[0].map(result => {
|
40154 |
+
if (Number(result.id) === pageOnFront) {
|
40155 |
+
resultsIncludeFrontPage = true;
|
40156 |
+
result.isFrontPage = true;
|
40157 |
+
return result;
|
40158 |
+
}
|
40159 |
+
|
40160 |
+
return result;
|
40161 |
+
});
|
40162 |
const couldBeURL = !val.includes(' '); // If it's potentially a URL search then concat on a URL search suggestion
|
40163 |
// just for good measure. That way once the actual results run out we always
|
40164 |
// have a URL option to fallback on.
|
40165 |
|
40166 |
+
if (!resultsIncludeFrontPage && couldBeURL && withURLSuggestion && !isInitialSuggestions) {
|
40167 |
results = results[0].concat(results[1]);
|
40168 |
} else {
|
40169 |
results = results[0];
|
40202 |
|
40203 |
function useSearchHandler(suggestionsQuery, allowDirectEntry, withCreateSuggestion, withURLSuggestion) {
|
40204 |
const {
|
40205 |
+
fetchSearchSuggestions,
|
40206 |
+
pageOnFront
|
40207 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
40208 |
const {
|
40209 |
getSettings
|
40210 |
} = select(store);
|
40211 |
return {
|
40212 |
+
pageOnFront: getSettings().pageOnFront,
|
40213 |
fetchSearchSuggestions: getSettings().__experimentalFetchLinkSuggestions
|
40214 |
};
|
40215 |
}, []);
|
40222 |
isInitialSuggestions
|
40223 |
}) : handleEntitySearch(val, { ...suggestionsQuery,
|
40224 |
isInitialSuggestions
|
40225 |
+
}, fetchSearchSuggestions, directEntryHandler, withCreateSuggestion, withURLSuggestion, pageOnFront);
|
40226 |
}, [directEntryHandler, fetchSearchSuggestions, withCreateSuggestion]);
|
40227 |
}
|
40228 |
//# sourceMappingURL=use-search-handler.js.map
|
41132 |
let {
|
41133 |
mediaURL,
|
41134 |
mediaId,
|
41135 |
+
mediaIds,
|
41136 |
allowedTypes,
|
41137 |
accept,
|
41138 |
onSelect,
|
41142 |
name = (0,external_wp_i18n_namespaceObject.__)('Replace'),
|
41143 |
createNotice,
|
41144 |
removeNotice,
|
41145 |
+
children,
|
41146 |
+
multiple = false,
|
41147 |
+
addToGallery,
|
41148 |
+
handleUpload = true
|
41149 |
} = _ref;
|
41150 |
const [mediaURLValue, setMediaURLValue] = (0,external_wp_element_namespaceObject.useState)(mediaURL);
|
41151 |
const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
41177 |
}, 1000);
|
41178 |
};
|
41179 |
|
41180 |
+
const selectMedia = (media, closeMenu) => {
|
41181 |
+
closeMenu();
|
41182 |
setMediaURLValue(media.url); // Calling `onSelect` after the state update since it might unmount the component.
|
41183 |
|
41184 |
onSelect(media);
|
41190 |
onSelectURL(newURL);
|
41191 |
};
|
41192 |
|
41193 |
+
const uploadFiles = (event, closeMenu) => {
|
41194 |
const files = event.target.files;
|
41195 |
+
|
41196 |
+
if (!handleUpload) {
|
41197 |
+
closeMenu();
|
41198 |
+
return onSelect(files);
|
41199 |
+
}
|
41200 |
+
|
41201 |
onFilesUpload(files);
|
41202 |
|
41203 |
const setMedia = _ref2 => {
|
41204 |
let [media] = _ref2;
|
41205 |
+
selectMedia(media, closeMenu);
|
41206 |
};
|
41207 |
|
41208 |
mediaUpload({
|
41220 |
}
|
41221 |
};
|
41222 |
|
41223 |
+
const onlyAllowsImages = () => {
|
41224 |
+
if (!allowedTypes || allowedTypes.length === 0) {
|
41225 |
+
return false;
|
41226 |
+
}
|
41227 |
+
|
41228 |
+
return allowedTypes.every(allowedType => allowedType === 'image' || allowedType.startsWith('image/'));
|
41229 |
+
};
|
41230 |
+
|
41231 |
+
const gallery = multiple && onlyAllowsImages();
|
41232 |
const POPOVER_PROPS = {
|
41233 |
isAlternate: true
|
41234 |
};
|
41255 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, {
|
41256 |
className: "block-editor-media-replace-flow__media-upload-menu"
|
41257 |
}, (0,external_wp_element_namespaceObject.createElement)(media_upload, {
|
41258 |
+
gallery: gallery,
|
41259 |
+
addToGallery: addToGallery,
|
41260 |
+
multiple: multiple,
|
41261 |
+
value: multiple ? mediaIds : mediaId,
|
41262 |
+
onSelect: media => selectMedia(media, onClose),
|
41263 |
allowedTypes: allowedTypes,
|
41264 |
onClose: onCloseModal,
|
41265 |
render: _ref5 => {
|
41276 |
uploadFiles(event, onClose);
|
41277 |
},
|
41278 |
accept: accept,
|
41279 |
+
multiple: multiple,
|
41280 |
render: _ref6 => {
|
41281 |
let {
|
41282 |
openFileDialog
|
41899 |
colorSettings,
|
41900 |
...props
|
41901 |
} = _ref;
|
41902 |
+
const settings = colorSettings.map(setting => {
|
41903 |
+
if (!setting) {
|
41904 |
+
return setting;
|
41905 |
+
}
|
41906 |
+
|
41907 |
+
const {
|
41908 |
value,
|
41909 |
onChange,
|
41910 |
...otherSettings
|
41911 |
+
} = setting;
|
41912 |
return { ...otherSettings,
|
41913 |
colorValue: value,
|
41914 |
onColorChange: onChange
|
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' => '8e1785e598c20633265b0411c64a9f99');
|
build/block-editor/index.min.js
CHANGED
@@ -1,33 +1,33 @@
|
|
1 |
-
!function(){var e={9367: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)},4184: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)}()},1934: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()}))]}},5913: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 h=d&&d.newPos+1<a,g=m&&0<=f&&f<c;if(h||g){if(!h||g&&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 h=f();if(h)return h}},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("")}}},7630: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(5913))&&o.__esModule?o:{default:o}).default)},9010:function(e,t,n){"use strict";var o=n(4657);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),h=o.outerHeight(e),g=o.outerWidth(e),v=void 0,b=void 0,_=void 0,k=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+g-(S.left+w)+d,top:f.top+h-(S.top+B)+u},k=S):(v=o.offset(t),b=t.clientHeight,_=t.clientWidth,k={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+g-(v.left+_+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+h-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,k.top+y.top):!1===i?o.scrollTop(t,k.top+E.top):y.top<0?o.scrollTop(t,k.top+y.top):o.scrollTop(t,k.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,k.top+y.top):o.scrollTop(t,k.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,k.left+y.left):!1===s?o.scrollLeft(t,k.left+E.left):y.left<0?o.scrollLeft(t,k.left+y.left):o.scrollLeft(t,k.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,k.left+y.left):o.scrollLeft(t,k.left+E.left)))}},4979:function(e,t,n){"use strict";e.exports=n(9010)},4657: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 h(e){return null!=e&&e==e.window}var g={};function v(e,t,n){if(h(e))return"width"===t?g.viewportWidth(e):g.viewportHeight(e);if(9===e.nodeType)return"width"===t?g.docWidth(e):g.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){g["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],g["viewport"+e](n))},g["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 _(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 k(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)&&k(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);g["outer"+t]=function(t,n){return t&&_(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];g[e]=function(t,o){return void 0===o?t&&_(t,e,-1):t?(c(t),d(t)&&(o+=f(t,["padding","border"],n)),k(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"===k(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(k(e,l))||0,o[l]=r+t[l]-n[l]);k(e,o)}(e,t)},isWindow:h,each:u,css:k,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(h(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(h(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},g)},5717: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}},8303:function(e,t,n){var o=n(1934);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}},2703:function(e,t,n){"use strict";var o=n(414);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}},5697:function(e,t,n){e.exports=n(2703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4857: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(5697),c=n(9367),u=n(8303),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}))}))},4042:function(e,t,n){"use strict";var o=n(4857);t.Z=o.TextareaAutosize},3692: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,h={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){h.isRoot||(h.parent.node[h.key]=e),h.node=e,t&&(f=!1)},delete:function(e){delete h.parent.node[h.key],e&&(f=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.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 h;function g(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=l(h.node)),h.isLeaf=0==h.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){h.circular=i[e];break}}else h.isLeaf=!0,h.keys=null;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot}g();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),f?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),g(),a(h.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var l=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=l.node),l.isLast=r==h.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(h,l),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(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 Pg},AlignmentToolbar:function(){return Mg},Autocomplete:function(){return Dg},BlockAlignmentControl:function(){return zo},BlockAlignmentToolbar:function(){return Vo},BlockBreadcrumb:function(){return Hg},BlockColorsStyleSelector:function(){return jg},BlockContextProvider:function(){return ir},BlockControls:function(){return Yn},BlockEdit:function(){return ur},BlockEditorKeyboardShortcuts:function(){return ak},BlockEditorProvider:function(){return $a},BlockFormatControls:function(){return qn},BlockIcon:function(){return Ua},BlockInspector:function(){return rk},BlockList:function(){return mm},BlockMover:function(){return Yd},BlockNavigationDropdown:function(){return mv},BlockPreview:function(){return pu},BlockSelectionClearer:function(){return qa},BlockSettingsMenu:function(){return Vp},BlockSettingsMenuControls:function(){return Dp},BlockStyles:function(){return vv},BlockTitle:function(){return Ad},BlockToolbar:function(){return Hp},BlockTools:function(){return lk},BlockVerticalAlignmentControl:function(){return Fv},BlockVerticalAlignmentToolbar:function(){return zv},ButtonBlockAppender:function(){return wd},ButtonBlockerAppender:function(){return Sd},ColorPalette:function(){return Hv},ColorPaletteControl:function(){return Uv},ContrastChecker:function(){return bf},CopyHandler:function(){return wp},DefaultBlockAppender:function(){return Ed},FontSizePicker:function(){return Xf},InnerBlocks:function(){return cm},Inserter:function(){return yd},InspectorAdvancedControls:function(){return Jo},InspectorControls:function(){return er},JustifyContentControl:function(){return go},JustifyToolbar:function(){return vo},LineHeightControl:function(){return Rf},MediaPlaceholder:function(){return n_},MediaReplaceFlow:function(){return Xb},MediaUpload:function(){return Yb},MediaUploadCheck:function(){return Zb},MultiSelectScrollIntoView:function(){return ck},NavigableToolbar:function(){return zd},ObserveTyping:function(){return mk},PanelColorSettings:function(){return o_},PlainText:function(){return N_},PreserveScrollInReorder:function(){return fk},RichText:function(){return I_},RichTextShortcut:function(){return R_},RichTextToolbarButton:function(){return L_},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return Q_},ToolSelector:function(){return O_},Typewriter:function(){return bk},URLInput:function(){return Bb},URLInputButton:function(){return H_},URLPopover:function(){return e_},Warning:function(){return pr},WritingFlow:function(){return rc},__experimentalBlockAlignmentMatrixControl:function(){return zg},__experimentalBlockContentOverlay:function(){return Ug},__experimentalBlockFullHeightAligmentControl:function(){return Fg},__experimentalBlockPatternSetup:function(){return Tv},__experimentalBlockVariationPicker:function(){return _v},__experimentalBlockVariationTransforms:function(){return Pv},__experimentalBorderRadiusControl:function(){return Um},__experimentalBorderStyleControl:function(){return qm},__experimentalColorGradientControl:function(){return _m},__experimentalColorGradientSettingsDropdown:function(){return km},__experimentalDuotoneControl:function(){return Qh},__experimentalFontAppearanceControl:function(){return Mf},__experimentalFontFamilyControl:function(){return Gf},__experimentalGetBorderClassesAndStyles:function(){return dg},__experimentalGetColorClassesAndStyles:function(){return mg},__experimentalGetGradientClass:function(){return of},__experimentalGetGradientObjectByGradientValue:function(){return lf},__experimentalGetMatchingVariation:function(){return Nv},__experimentalGetSpacingClassesAndStyles:function(){return gg},__experimentalImageEditingProvider:function(){return ub},__experimentalImageEditor:function(){return kb},__experimentalImageSizeControl:function(){return Eb},__experimentalImageURLInputUI:function(){return Y_},__experimentalLayoutStyle:function(){return Mo},__experimentalLetterSpacingControl:function(){return bh},__experimentalLibrary:function(){return ik},__experimentalLinkControl:function(){return jb},__experimentalLinkControlSearchInput:function(){return Fb},__experimentalLinkControlSearchItem:function(){return Tb},__experimentalLinkControlSearchResults:function(){return Mb},__experimentalListView:function(){return dv},__experimentalPanelColorGradientSettings:function(){return gf},__experimentalPreviewOptions:function(){return Z_},__experimentalResponsiveBlockControl:function(){return M_},__experimentalTextDecorationControl:function(){return ih},__experimentalTextTransformControl:function(){return fh},__experimentalUnitControl:function(){return F_},__experimentalUseBlockPreview:function(){return mu},__experimentalUseBorderProps:function(){return pg},__experimentalUseColorProps:function(){return hg},__experimentalUseCustomSides:function(){return Vh},__experimentalUseGradient:function(){return af},__experimentalUseNoRecursiveRenders:function(){return yk},__experimentalUseResizeCanvas:function(){return X_},__unstableBlockSettingsMenuFirstItem:function(){return Pp},__unstableEditorStyles:function(){return cu},__unstableIframe:function(){return sc},__unstableInserterMenuExtension:function(){return ud},__unstableRichTextInputEvent:function(){return A_},__unstableUseBlockSelectionClearer:function(){return Ka},__unstableUseClipboardHandler:function(){return Sp},__unstableUseMouseMoveTypingReset:function(){return dk},__unstableUseTypewriter:function(){return vk},__unstableUseTypingObserver:function(){return pk},createCustomColorsHOC:function(){return yg},getColorClassName:function(){return wm},getColorObjectByAttributeValues:function(){return Cm},getColorObjectByColorValue:function(){return Sm},getFontSize:function(){return qf},getFontSizeClass:function(){return Zf},getFontSizeObjectByValue:function(){return Yf},getGradientSlugByValue:function(){return sf},getGradientValueBySlug:function(){return rf},getPxFromCssUnit:function(){return Rk},store:function(){return zn},storeConfig:function(){return Fn},transformStyles:function(){return iu},useBlockDisplayInformation:function(){return Ld},useBlockEditContext:function(){return Gn},useBlockProps:function(){return Pa},useCachedTruthy:function(){return vg},useInnerBlocksProps:function(){return am},useSetting:function(){return mo},validateThemeColors:function(){return Ek},validateThemeGradients:function(){return Ck},withColorContext:function(){return Vv},withColors:function(){return Eg},withFontSizes:function(){return Sg}});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 _t},__unstableGetBlockWithoutInnerBlocks:function(){return W},__unstableGetClientIdWithClientIdsTree:function(){return j},__unstableGetClientIdsTree:function(){return K},__unstableIsLastBlockChangeIgnored:function(){return kt},areInnerBlocksControlled:function(){return It},canInsertBlockType:function(){return qe},canInsertBlocks:function(){return Ye},canMoveBlock:function(){return Qe},canMoveBlocks:function(){return Je},canRemoveBlock:function(){return Ze},canRemoveBlocks:function(){return Xe},didAutomaticChange:function(){return wt},getAdjacentBlockClientId:function(){return pe},getBlock:function(){return G},getBlockAttributes:function(){return U},getBlockCount:function(){return Q},getBlockHierarchyRootClientId:function(){return ue},getBlockIndex:function(){return Ie},getBlockInsertionPoint:function(){return He},getBlockListSettings:function(){return ht},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 X},getClientIdsOfDescendants:function(){return q},getClientIdsWithDescendants:function(){return Y},getDraggedBlockClientIds:function(){return Oe},getFirstMultiSelectedBlockClientId:function(){return _e},getGlobalBlockCount:function(){return Z},getInserterItems:function(){return lt},getLastMultiSelectedBlockClientId:function(){return ke},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 ge},getSelectedBlockCount:function(){return oe},getSelectedBlocksInitialCaretPosition:function(){return he},getSelectionEnd:function(){return ee},getSelectionStart:function(){return J},getSettings:function(){return gt},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 Ue},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 Ge},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 Zt},replaceBlocks:function(){return Yt},replaceInnerBlocks:function(){return pn},resetBlocks:function(){return Lt},resetSelection:function(){return Dt},selectBlock:function(){return Vt},selectNextBlock:function(){return Ut},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 gn},startMultiSelect:function(){return Gt},startTyping:function(){return fn},stopDraggingBlocks:function(){return vn},stopMultiSelect:function(){return Wt},stopTyping:function(){return hn},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(4184),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")},h=window.wp.i18n;const g={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,h.__)("Black"),slug:"black",color:"#000000"},{name:(0,h.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,h.__)("White"),slug:"white",color:"#ffffff"},{name:(0,h.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,h.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,h.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,h.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,h.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,h.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,h.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,h.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,h.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,h._x)("Small","font size name"),size:13,slug:"small"},{name:(0,h._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,h._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,h._x)("Large","font size name"),size:36,slug:"large"},{name:(0,h._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,h.__)("Thumbnail")},{slug:"medium",name:(0,h.__)("Medium")},{slug:"large",name:(0,h.__)("Large")},{slug:"full",name:(0,h.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__unstableGalleryWithImageBlocks:!1,gradients:[{name:(0,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,h.__)("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,h.__)("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,h.__)("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,h.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,h.__)("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 _(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 k(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,k(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:k(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=k(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=k(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]:_(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]:_(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]:_(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=k(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||["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]:g,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 U(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function G(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:U(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])),Z=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])),X=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>G(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?G(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?_e(e):ke(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 he(e){return e.initialPosition}const ge=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:ge(e)}const be=D((e=>{const t=ve(e);return t.length?t.map((t=>G(e,t))):z}),(e=>[...ge.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function _e(e){return(0,u.first)(ve(e))||null}function ke(e){return(0,u.last)(ve(e))||null}function ye(e,t){return _e(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 Ue(e){return null!==e.insertionPoint}function Ge(e){return e.template.isValid}function We(e){return e.settings.template}function $e(e,t){if(!t)return e.settings.templateLock;const n=ht(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}=gt(e),s=je(i,t,!0);if(!s)return!1;const a=!!$e(e,o);if(a)return!1;const c=ht(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),h=null===d&&null===f||!0===d||!0===f;return h?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",h,n,o,{getBlock:G.bind(null,e),getBlockParentsByBlockName:ce.bind(null,e)}):h},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 Ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=U(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 Xe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Ze(e,t,n)))}function Qe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=U(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)(X(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(G(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}=gt(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 ht(e,t){return e.blockListSettings[t]}function gt(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])),_t=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 kt(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)},Ut=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Gt(){return{type:"START_MULTI_SELECT"}}function Wt(){return{type:"STOP_MULTI_SELECT"}}const $t=(e,t)=>n=>{let{select:o,dispatch:r}=n;if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t});const l=o.getSelectedBlockCount();(0,Nt.speak)((0,h.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
-
(0,h._n)("%s block selected.","%s blocks selected.",l),l),"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 Zt(e,t){return Yt(e,t)}const Xt=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=Xt("MOVE_BLOCKS_DOWN"),Jt=Xt("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:h,offset:g}=o.getSelectionStart(),v=(f===s?d:m).attributes[h],b=(f===s||f===a)&&void 0!==h&&void 0!==g&&!!v;v||("number"==typeof h?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 h):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const _=(0,r.cloneBlock)(c),k=(0,r.cloneBlock)(p);if(b){const e=f===s?_:k,t=e.attributes[h],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=v,l=(0,Pt.insert)((0,Pt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),"",g,g);e.attributes[h]=(0,Pt.toHTMLString)({value:l,multilineTag:n,preserveWhiteSpace:r})}const y=c.name===p.name?[k]:(0,r.switchToBlockType)(k,c.name);if(!y||!y.length)return;const E=d.merge(_.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 hn(){return{type:"STOP_TYPING"}}function gn(){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}}function En(e,t,n){const o=(0,r.getDefaultBlockName)();if(o)return nn((0,r.createBlock)(o,e),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,h.__)("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,h.__)("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,h.__)("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,__experimentalUseThunks:!0},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:Un}=Hn;function Gn(){return(0,s.useContext)(Hn)}function Wn(){const{isSelected:e,clientId:t,name:n}=Gn();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}=Gn(),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,Zn=(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"})),Xn=(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}=Gn();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 ho=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,h.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:oo,title:(0,h.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ro,title:(0,h.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:lo,title:(0,h.__)("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,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};function go(e){return(0,s.createElement)(ho,i({},e,{isToolbar:!1}))}function vo(e){return(0,s.createElement)(ho,i({},e,{isToolbar:!0}))}const bo={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},_o={left:"flex-start",right:"flex-end",center:"center"},ko=["wrap","nowrap"];var yo={name:"flex",label:(0,h.__)("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=ko.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: ${_o[r.justifyContent]||_o.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)(go,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:no,label:(0,h.__)("Justify items left")},{value:"center",icon:oo,label:(0,h.__)("Justify items center")},{value:"right",icon:ro,label:(0,h.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:lo,label:(0,h.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,h.__)("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,"> *")} {\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,'> [data-align="wide"]')} {\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,'> [data-align="full"]')} {\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,'> [data-align="left"]')} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-right: 2em;\n\t\t\t}\n\n\t\t\t${ao(o,'> [data-align="right"]')} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-left: 2em;\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,h.sprintf)((0,h.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
-
o.wide=(0,h.sprintf)((0,h.__)("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:Zn,title:(0,h.__)("None")},left:{icon:Xn,title:(0,h.__)("Align left")},center:{icon:Qn,title:(0,h.__)("Align center")},right:{icon:Jn,title:(0,h.__)("Align right")},wide:{icon:eo,title:(0,h.__)("Wide width")},full:{icon:to,title:(0,h.__)("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,g={popoverProps:Oo,icon:d?d.icon:m.icon,label:(0,h.__)("Align"),toggleProps:{describedBy:(0,h.__)("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({},g,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"],Uo=["wide","full"];function Go(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,...Uo):t}const Wo=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Ao(Go((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(Go((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 Go((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"),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){let{children:t,group:n,label:o}=e;const{attributes:r,clientIds:l,panelId:i}=(0,m.useSelect)((e=>{const{getBlockAttributes:t,getMultiSelectedBlockClientIds:n,getSelectedBlockClientId:o,hasMultiSelection:r}=e(zn),l=o();if(r()){const e=n(),o=e.reduce(((e,n)=>(e[n]=t(n),e)),{});return{panelId:l,clientIds:e,attributes:o}}return{panelId:l,clientIds:[l],attributes:{[l]:t(l)}}}),[]),{updateBlockAttributes:a}=(0,m.useDispatch)(zn);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={};l.forEach((n=>{const{style:o}=r[n];let l={style:o};e.forEach((e=>{l={...l,...e(l)}})),l={...l,style:qo(l.style)},t[n]=l})),a(l,t,!0)},key:i,panelId:i,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0},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 Xo(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)(Yo,{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 Qo=Ko;Qo.Slot=Xo;const Jo=e=>(0,s.createElement)(Ko,i({},e,{__experimentalGroup:"advanced"}));Jo.Slot=e=>(0,s.createElement)(Xo,i({},e,{__experimentalGroup:"advanced"})),Jo.slotName="InspectorAdvancedControls";var er=Qo;const tr=/[\s#]/g,nr=(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,h.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,h.__)("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,h.__)("https://wordpress.org/support/article/page-jumps/")},(0,h.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,h.__)("Add an anchor"),onChange:e=>{e=e.replace(tr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(er,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(er,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("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",nr),(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 or=(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)(er,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,h.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,h.__)("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",or),(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.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}));var rr=window.wp.dom;const lr=(0,s.createContext)({});function ir(e){let{value:t,children:n}=e;const o=(0,s.useContext)(lr),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(lr.Provider,{value:r,children:n})}var sr=lr;const ar={};var cr=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(sr),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):ar),[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 ur(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Un,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(cr,e))}var dr=(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"})),pr=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:dr,label:(0,h.__)("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)))))))))},mr=n(7630);function fr(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,rr.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 hr=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,mr.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)(fr,{title:(0,h.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,h.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(fr,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const gr=e=>(0,r.rawHandler)({HTML:e.originalContent});var vr=(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,gr(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,h._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,h.__)("Convert to HTML"),onClick:t},{title:(0,h.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(pr,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,h.__)("Attempt Block Recovery"))],secondaryActions:f},(0,h.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
|
10 |
-
(0,h.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(hr,{block:i,onKeep:t,onConvert:n,convertor:gr,convertButtonText:(0,h.__)("Convert to Blocks")})))}));const br=(0,s.createElement)(pr,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed."));var _r=()=>br;class kr 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 yr=kr,Er=n(4042),Cr=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)(Er.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 Sr=zr();const wr=e=>Ar(e,Sr);let Br=zr();wr.write=e=>Ar(e,Br);let Ir=zr();wr.onStart=e=>Ar(e,Ir);let xr=zr();wr.onFrame=e=>Ar(e,xr);let Tr=zr();wr.onFinish=e=>Ar(e,Tr);let Nr=[];wr.setTimeout=(e,t)=>{let n=wr.now()+t,o=()=>{let e=Nr.findIndex((e=>e.cancel==o));~e&&Nr.splice(e,1),Hr.count-=~e?1:0},r={time:n,handler:e,cancel:o};return Nr.splice(Pr(n),0,r),Hr.count+=1,Dr(),r};let Pr=e=>~(~Nr.findIndex((t=>t.time>e))||~Nr.length);wr.cancel=e=>{Sr.delete(e),Br.delete(e)},wr.sync=e=>{Lr=!0,wr.batchedUpdates(e),Lr=!1},wr.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,wr.onStart(n)}return o.handler=e,o.cancel=()=>{Ir.delete(n),t=null},o};let Mr="undefined"!=typeof window?window.requestAnimationFrame:()=>{};wr.use=e=>Mr=e,wr.now="undefined"!=typeof performance?()=>performance.now():Date.now,wr.batchedUpdates=e=>e(),wr.catch=console.error,wr.frameLoop="always",wr.advance=()=>{"demand"!==wr.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Fr()};let Rr=-1,Lr=!1;function Ar(e,t){Lr?(t.delete(e),e(0)):(t.add(e),Dr())}function Dr(){Rr<0&&(Rr=0,"demand"!==wr.frameLoop&&Mr(Or))}function Or(){~Rr&&(Mr(Or),wr.batchedUpdates(Fr))}function Fr(){let e=Rr;Rr=wr.now();let t=Pr(Rr);t&&(Vr(Nr.splice(0,t),(e=>e.handler())),Hr.count-=t),Ir.flush(),Sr.flush(e?Math.min(64,Rr-e):16.667),xr.flush(),Br.flush(),Tr.flush()}function zr(){let e=new Set,t=e;return{add(n){Hr.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Hr.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Hr.count-=t.size,Vr(t,(t=>t(n)&&e.add(t))),Hr.count+=e.size,t=e)}}}function Vr(e,t){e.forEach((e=>{try{t(e)}catch(e){wr.catch(e)}}))}const Hr={count:0,clear(){Rr=-1,Nr=[],Ir=zr(),Sr=zr(),xr=zr(),Br=zr(),Tr=zr(),Hr.count=0}};var Ur=n(9196),Gr=n.n(Ur);function Wr(){}const $r={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 jr(e,t){if($r.arr(e)){if(!$r.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 Kr=(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 Yr=e=>$r.und(e)?[]:$r.arr(e)?e:[e];function Zr(e,t){if(e.size){const n=Array.from(e);e.clear(),Kr(n,t)}}const Xr=(e,...t)=>Zr(e,(e=>e(...t)));let Qr,Jr,el=null,tl=!1,nl=Wr;var ol=Object.freeze({__proto__:null,get createStringInterpolator(){return Qr},get to(){return Jr},get colors(){return el},get skipAnimation(){return tl},get willAdvance(){return nl},assign:e=>{e.to&&(Jr=e.to),e.now&&(wr.now=e.now),void 0!==e.colors&&(el=e.colors),null!=e.skipAnimation&&(tl=e.skipAnimation),e.createStringInterpolator&&(Qr=e.createStringInterpolator),e.requestAnimationFrame&&wr.use(e.requestAnimationFrame),e.batchedUpdates&&(wr.batchedUpdates=e.batchedUpdates),e.willAdvance&&(nl=e.willAdvance),e.frameLoop&&(wr.frameLoop=e.frameLoop)}});const rl=new Set;let ll=[],il=[],sl=0;const al={get idle(){return!rl.size&&!ll.length},start(e){sl>e.priority?(rl.add(e),wr.onStart(cl)):(ul(e),wr(pl))},advance:pl,sort(e){if(sl)wr.onFrame((()=>al.sort(e)));else{const t=ll.indexOf(e);~t&&(ll.splice(t,1),dl(e))}},clear(){ll=[],rl.clear()}};function cl(){rl.forEach(ul),rl.clear(),wr(pl)}function ul(e){ll.includes(e)||dl(e)}function dl(e){ll.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(ll),0,e)}function pl(e){const t=il;for(let n=0;n<ll.length;n++){const o=ll[n];sl=o.priority,o.idle||(nl(o),o.advance(e),o.idle||t.push(o))}return sl=0,il=ll,il.length=0,ll=t,ll.length>0}const ml="[-+]?\\d*\\.?\\d+",fl=ml+"%";function hl(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const gl=new RegExp("rgb"+hl(ml,ml,ml)),vl=new RegExp("rgba"+hl(ml,ml,ml,ml)),bl=new RegExp("hsl"+hl(ml,fl,fl)),_l=new RegExp("hsla"+hl(ml,fl,fl,ml)),kl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,yl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,El=/^#([0-9a-fA-F]{6})$/,Cl=/^#([0-9a-fA-F]{8})$/;function Sl(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 wl(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Sl(r,o,e+1/3),i=Sl(r,o,e),s=Sl(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Bl(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Il(e){return(parseFloat(e)%360+360)%360/360}function xl(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Tl(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Nl(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=El.exec(e))?parseInt(t[1]+"ff",16)>>>0:el&&void 0!==el[e]?el[e]:(t=gl.exec(e))?(Bl(t[1])<<24|Bl(t[2])<<16|Bl(t[3])<<8|255)>>>0:(t=vl.exec(e))?(Bl(t[1])<<24|Bl(t[2])<<16|Bl(t[3])<<8|xl(t[4]))>>>0:(t=kl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Cl.exec(e))?parseInt(t[1],16)>>>0:(t=yl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=bl.exec(e))?(255|wl(Il(t[1]),Tl(t[2]),Tl(t[3])))>>>0:(t=_l.exec(e))?(wl(Il(t[1]),Tl(t[2]),Tl(t[3]))|xl(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 Pl=(e,t,n)=>{if($r.fun(e))return e;if($r.arr(e))return Pl({range:e,output:t,extrapolate:n});if($r.str(e.output[0]))return Qr(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 Ml(){return(Ml=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 Rl=Symbol.for("FluidValue.get"),Ll=Symbol.for("FluidValue.observers"),Al=e=>Boolean(e&&e[Rl]),Dl=e=>e&&e[Rl]?e[Rl]():e,Ol=e=>e[Ll]||null;function Fl(e,t){let n=e[Ll];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class zl{constructor(e){if(this[Rl]=void 0,this[Ll]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Vl(this,e)}}const Vl=(e,t)=>Gl(e,Rl,t);function Hl(e,t){if(e[Rl]){let n=e[Ll];n||Gl(e,Ll,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Ul(e,t){let n=e[Ll];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Ll]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Gl=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Wl=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,$l=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let jl;const Kl=/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})`,Yl=e=>{jl||(jl=el?new RegExp(`(${Object.keys(el).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Dl(e).replace($l,Nl).replace(jl,Nl))),n=t.map((e=>e.match(Wl).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=>Pl(Ml({},e,{output:t}))));return e=>{let n=0;return t[0].replace(Wl,(()=>String(o[n++](e)))).replace(Kl,ql)}},Zl="react-spring: ",Xl=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Zl}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Ql=Xl(console.warn),Jl=Xl(console.warn);function ei(e){return $r.str(e)&&("#"==e[0]||/\d/.test(e)||e in(el||{}))}const ti=e=>(0,Ur.useEffect)(e,ni),ni=[];function oi(){const e=(0,Ur.useState)()[1],t=(0,Ur.useState)(ri)[0];return ti(t.unmount),()=>{t.current&&e({})}}function ri(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function li(e){const t=(0,Ur.useRef)();return(0,Ur.useEffect)((()=>{t.current=e})),t.current}const ii="undefined"!=typeof window&&window.document&&window.document.createElement?Ur.useLayoutEffect:Ur.useEffect,si=Symbol.for("Animated:node"),ai=e=>e&&e[si],ci=(e,t)=>{return n=e,o=si,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},ui=e=>e&&e[si]&&e[si].getPayload();class di{constructor(){this.payload=void 0,ci(this,this)}getPayload(){return this.payload||[]}}class pi extends di{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,$r.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new pi(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return $r.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,$r.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class mi extends pi{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Pl({output:[e,e]})}static create(e){return new mi(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if($r.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=Pl({output:[this.getValue(),e]})),this._value=0,super.reset()}}const fi={dependencies:null};class hi extends di{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return qr(this.source,((n,o)=>{var r;(r=n)&&r[si]===r?t[o]=n.getValue(e):Al(n)?t[o]=Dl(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Kr(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return qr(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){fi.dependencies&&Al(e)&&fi.dependencies.add(e);const t=ui(e);t&&Kr(t,(e=>this.add(e)))}}class gi extends hi{constructor(e){super(e)}static create(e){return new gi(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(vi)),!0)}}function vi(e){return(ei(e)?mi:pi).create(e)}function bi(e){const t=ai(e);return t?t.constructor:$r.arr(e)?gi:ei(e)?mi:pi}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)}const ki=(e,t)=>{const n=!$r.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Ur.forwardRef)(((o,r)=>{const l=(0,Ur.useRef)(null),i=n&&(0,Ur.useCallback)((e=>{l.current=function(e,t){return e&&($r.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return fi.dependencies=n,e.style&&(e=_i({},e,{style:t.createAnimatedStyle(e.style)})),e=new hi(e),fi.dependencies=null,[e,n]}(o,t),c=oi(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new yi(u,a),p=(0,Ur.useRef)();ii((()=>{const e=p.current;p.current=d,Kr(a,(e=>Hl(e,d))),e&&(Kr(e.deps,(t=>Ul(t,e))),wr.cancel(e.update))})),(0,Ur.useEffect)(u,[]),ti((()=>()=>{const e=p.current;Kr(e.deps,(t=>Ul(t,e)))}));const m=t.getComponentProps(s.getValue());return Ur.createElement(e,_i({},m,{ref:i}))}))};class yi{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&wr.write(this.update)}}const Ei=Symbol.for("AnimatedComponent"),Ci=e=>$r.str(e)?e:e&&$r.str(e.displayName)?e.displayName:$r.fun(e)&&e.name||null;function Si(){return(Si=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 wi(e,...t){return $r.fun(e)?e(...t):e}const Bi=(e,t)=>!0===e||!!(t&&e&&($r.fun(e)?e(t):Yr(e).includes(t))),Ii=(e,t)=>$r.obj(e)?t&&e[t]:e,xi=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ti=e=>e,Ni=(e,t=Ti)=>{let n=Pi;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);$r.und(n)||(o[r]=n)}return o},Pi=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Mi={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 Ri(e){const t=function(e){const t={};let n=0;if(qr(e,((e,o)=>{Mi[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 Si({},e)}function Li(e){return e=Dl(e),$r.arr(e)?e.map(Li):ei(e)?ol.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Ai(e){for(const t in e)return!0;return!1}function Di(e){return $r.fun(e)||$r.arr(e)&&$r.obj(e[0])}function Oi(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Fi(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const zi=Si({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Vi{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,zi)}}function Hi(e,t){if($r.und(t.decay)){const n=!$r.und(t.tension)||!$r.und(t.friction);!n&&$r.und(t.frequency)&&$r.und(t.damping)&&$r.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Ui=[];class Gi{constructor(){this.changed=!1,this.values=Ui,this.toValues=null,this.fromValues=Ui,this.to=void 0,this.from=void 0,this.config=new Vi,this.immediate=!1}}function Wi(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Bi(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{$r.und(n.pause)||(r.paused=Bi(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Bi(e,t)),c=wi(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-wr.now()}function m(){c>0?(u=wr.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(Si({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const $i=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?qi(e.get()):t.every((e=>e.noop))?ji(e.get()):Ki(e.get(),t.every((e=>e.finished))),ji=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Ki=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),qi=e=>({value:e,cancelled:!0,finished:!1});function Yi(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=Ni(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&&Ki(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new Xi,i=new Qi;return(async()=>{if(ol.skipAnimation)throw Zi(n),i.result=Ki(o,!1),d(i),i;m(l);const s=$r.obj(e)?Si({},e):Si({},t,{to:e});s.parentId=r,qr(c,((e,t)=>{$r.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 h;if(ol.skipAnimation)return Zi(n),Ki(o,!1);try{let t;t=$r.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]),h=Ki(o.get(),!0,!1)}catch(e){if(e instanceof Xi)h=e.result;else{if(!(e instanceof Qi))throw e;h=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return $r.fun(i)&&wr.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function Zi(e,t){Zr(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Xi 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 Qi extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Ji=e=>e instanceof ts;let es=1;class ts extends zl{constructor(...e){super(...e),this.id=es++,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=ai(this);return e&&e.getValue()}to(...e){return ol.to(this,e)}interpolate(...e){return Ql(`${Zl}The "interpolate" function is deprecated in v9 (use "to" instead)`),ol.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){Fl(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||al.sort(this),Fl(this,{type:"priority",parent:this,priority:e})}}const ns=Symbol.for("SpringPhase"),os=e=>(1&e[ns])>0,rs=e=>(2&e[ns])>0,ls=e=>(4&e[ns])>0,is=(e,t)=>t?e[ns]|=3:e[ns]&=-3,ss=(e,t)=>t?e[ns]|=4:e[ns]&=-5;class as extends ts{constructor(e,t){if(super(),this.key=void 0,this.animation=new Gi,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,!$r.und(e)||!$r.und(t)){const n=$r.obj(e)?Si({},e):Si({},t,{from:e});$r.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(rs(this)||this._state.asyncTo)||ls(this)}get goal(){return Dl(this.animation.to)}get velocity(){const e=ai(this);return e instanceof pi?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return os(this)}get isAnimating(){return rs(this)}get isPaused(){return ls(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=ui(o.to);!i&&Al(o.to)&&(l=Yr(Dl(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==mi?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=$r.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if($r.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=!$r.und(a),m=n==c?s.v0>0:n<c;let f,h=!1;const g=1,v=Math.ceil(e/g);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(h=d==c||d>c==m,h&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*g,d+=i*g}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=ai(this),a=s.getValue();if(t){const e=Dl(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 wr.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(rs(this)){const{to:e,config:t}=this.animation;wr.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 $r.und(e)?(n=this.queue||[],this.queue=[]):n=[$r.obj(e)?e:Si({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>$i(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Zi(this._state,e&&this._lastCallId),wr.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=$r.obj(n)?n[t]:n,(null==n||Di(n))&&(n=void 0),o=$r.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return os(this)||(e.reverse&&([n,o]=[o,n]),o=Dl(o),$r.und(o)?ai(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Si({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Ni(n,((e,t)=>/^on/.test(t)?Ii(e,o):e))),hs(this,n,"onProps"),gs(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 Wi(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ls(this)||(ss(this,!0),Xr(i.pauseQueue),gs(this,"onPause",Ki(this,cs(this,this.animation.to)),this))},resume:()=>{ls(this)&&(ss(this,!1),rs(this)&&this._resume(),Xr(i.resumeQueue),gs(this,"onResume",Ki(this,cs(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=us(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=!$r.und(e.to),r=!$r.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&&!$r.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!jr(d,c);p&&(s.from=d),d=Dl(d);const m=!jr(u,a);m&&this._focus(u);const f=Di(t.to),{config:h}=s,{decay:g,velocity:v}=h;(o||r)&&(h.velocity=0),t.config&&!f&&function(e,t,n){n&&(Hi(n=Si({},n),t),t=Si({},n,t)),Hi(e,t),Object.assign(e,t);for(const t in zi)null==e[t]&&(e[t]=zi[t]);let{mass:o,frequency:r,damping:l}=e;$r.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)}(h,wi(t.config,l),t.config!==i.config?wi(i.config,l):void 0);let b=ai(this);if(!b||$r.und(u))return n(Ki(this,!0));const _=$r.und(t.reset)?r&&!t.default:!$r.und(d)&&Bi(t.reset,l),k=_?d:this.get(),y=Li(u),E=$r.num(y)||$r.arr(y)||ei(y),C=!f&&(!E||Bi(i.immediate||t.immediate,l));if(m){const e=bi(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=Al(u),B=!1;if(!w){const e=_||!os(this)&&p;(m||e)&&(B=jr(Li(k),y),w=!B),(jr(s.immediate,C)||C)&&jr(h.decay,g)&&jr(h.velocity,v)||(w=!0)}if(B&&rs(this)&&(s.changed&&!_?w=!0:w||this._stop(a)),!f&&((w||Al(a))&&(s.values=b.getPayload(),s.toValues=Al(u)?null:S==mi?[1]:Yr(y)),s.immediate!=C&&(s.immediate=C,C||_||this._set(a)),w)){const{onRest:e}=s;Kr(fs,(e=>hs(this,t,e)));const o=Ki(this,cs(this,a));Xr(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&wr.batchedUpdates((()=>{s.changed=!_,null==e||e(o,this),_?wi(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}_&&this._set(k),f?n(Yi(t.to,t,this._state,this)):w?this._start():rs(this)&&!m?this._pendingCalls.add(n):n(ji(k))}_focus(e){const t=this.animation;e!==t.to&&(Ol(this)&&this._detach(),t.to=e,Ol(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Al(t)&&(Hl(t,this),Ji(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Al(e)&&Ul(e,this)}_set(e,t=!0){const n=Dl(e);if(!$r.und(n)){const e=ai(this);if(!e||!jr(n,e.getValue())){const o=bi(n);e&&e.constructor==o?e.setValue(n):ci(this,o.create(n)),e&&wr.batchedUpdates((()=>{this._onChange(n,t)}))}}return ai(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,gs(this,"onStart",Ki(this,cs(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),wi(this.animation.onChange,e,this)),wi(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;ai(this).reset(Dl(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),rs(this)||(is(this,!0),ls(this)||this._resume())}_resume(){ol.skipAnimation?this.finish():al.start(this)}_stop(e,t){if(rs(this)){is(this,!1);const n=this.animation;Kr(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Fl(this,{type:"idle",parent:this});const o=t?qi(this.get()):Ki(this.get(),cs(this,null!=e?e:n.to));Xr(this._pendingCalls,o),n.changed&&(n.changed=!1,gs(this,"onRest",o,this))}}}function cs(e,t){const n=Li(t);return jr(Li(e.get()),n)}function us(e,t=e.loop,n=e.to){let o=wi(t);if(o){const r=!0!==o&&Ri(o),l=(r||e).reverse,i=!r||r.reset;return ds(Si({},e,{loop:t,default:!1,pause:void 0,to:!l||Di(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function ds(e){const{to:t,from:n}=e=Ri(e),o=new Set;return $r.obj(t)&&ms(t,o),$r.obj(n)&&ms(n,o),e.keys=o.size?Array.from(o):null,e}function ps(e){const t=ds(e);return $r.und(t.default)&&(t.default=Ni(t)),t}function ms(e,t){qr(e,((e,n)=>null!=e&&t.add(n)))}const fs=["onStart","onRest","onChange","onPause","onResume"];function hs(e,t,n){e.animation[n]=t[n]!==xi(t,n)?Ii(t[n],e.key):void 0}function gs(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 vs=["onStart","onChange","onRest"];let bs=1;class _s{constructor(e,t){this.id=bs++,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(Si({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];$r.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(ds(e)),this}start(e){let{queue:t}=this;return e?t=Yr(e).map(ds):this.queue=[],this._flush?this._flush(this,t):(Bs(this,t),ks(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Kr(Yr(t),(t=>n[t].stop(!!e)))}else Zi(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if($r.und(e))this.start({pause:!0});else{const t=this.springs;Kr(Yr(e),(e=>t[e].pause()))}return this}resume(e){if($r.und(e))this.start({pause:!1});else{const t=this.springs;Kr(Yr(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,Zr(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&&Zr(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Zr(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)}wr.onFrame(this._onFrame)}}function ks(e,t){return Promise.all(t.map((t=>ys(e,t)))).then((t=>$i(e,t)))}async function ys(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=$r.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=$r.arr(r)||$r.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Kr(vs,(n=>{const o=t[n];if($r.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,Xr(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===xi(t,"cancel");(u||m&&d.asyncId)&&p.push(Wi(++e._lastAsyncId,{props:t,state:d,actions:{pause:Wr,resume:Wr,start(t,n){m?(Zi(d,e._lastAsyncId),n(qi(e))):(t.onRest=s,n(Yi(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=$i(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=us(t,i,r);if(n)return Bs(e,[n]),ys(e,n,!0)}return a&&wr.batchedUpdates((()=>a(f,e,e.item))),f}function Es(e,t){const n=Si({},e.springs);return t&&Kr(Yr(t),(e=>{$r.und(e.keys)&&(e=ds(e)),$r.obj(e.to)||(e=Si({},e,{to:void 0})),ws(n,e,(e=>Ss(e)))})),Cs(e,n),n}function Cs(e,t){qr(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Hl(t,e))}))}function Ss(e,t){const n=new as;return n.key=e,t&&Hl(n,t),n}function ws(e,t,n){t.keys&&Kr(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Bs(e,t){Kr(t,(t=>{ws(e.springs,t,(t=>Ss(t,e)))}))}const Is=["children"],xs=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,Is);const o=(0,Ur.useContext)(Ts),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Ur.useState)((()=>({inputs:t,result:e()}))),o=(0,Ur.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,Ur.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Ts;return Ur.createElement(i,{value:n},t)},Ts=(Ns=xs,Ps={},Object.assign(Ns,Ur.createContext(Ps)),Ns.Provider._context=Ns,Ns.Consumer._context=Ns,Ns);var Ns,Ps;xs.Provider=Ts.Provider,xs.Consumer=Ts.Consumer;const Ms=()=>{const e=[],t=function(t){Jl(`${Zl}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 Kr(e,((e,r)=>{if($r.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 Kr(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Kr(e,(e=>e.resume(...arguments))),this},t.set=function(t){Kr(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Kr(e,((e,o)=>{if($r.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 Kr(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Kr(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return $r.fun(e)?e(n,t):e};return t._getProps=n,t};function Rs(e,t,n){const o=$r.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Ur.useMemo)((()=>o||3==arguments.length?Ms():void 0),[]),l=(0,Ur.useRef)(0),i=oi(),s=(0,Ur.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Es(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?ks(e,t):new Promise((o=>{Cs(e,n),s.queue.push((()=>{o(ks(e,t))})),i()}))}})),[]),a=(0,Ur.useRef)([...s.ctrls]),c=[],u=li(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new _s(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=ps(n))}}(0,Ur.useMemo)((()=>{Kr(a.current.slice(e,u),(e=>{Oi(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Ur.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Es(e,c[t]))),m=(0,Ur.useContext)(xs),f=li(m),h=m!==f&&Ai(m);ii((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Kr(e,(e=>e()))),Kr(a.current,((e,t)=>{null==r||r.add(e),h&&e.start({default:m});const n=c[t];n&&(Fi(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),ti((()=>()=>{Kr(s.ctrls,(e=>e.stop(!0)))}));const g=p.map((e=>Si({},e)));return r?[g,r]:g}let Ls;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Ls||(Ls={}));class As extends ts{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Pl(...t);const n=this._get(),o=bi(n);ci(this,o.create(n))}advance(e){const t=this._get();jr(t,this.get())||(ai(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Os(this._active)&&Fs(this)}_get(){const e=$r.arr(this.source)?this.source.map(Dl):Yr(Dl(this.source));return this.calc(...e)}_start(){this.idle&&!Os(this._active)&&(this.idle=!1,Kr(ui(this),(e=>{e.done=!1})),ol.skipAnimation?(wr.batchedUpdates((()=>this.advance())),Fs(this)):al.start(this))}_attach(){let e=1;Kr(Yr(this.source),(t=>{Al(t)&&Hl(t,this),Ji(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Kr(Yr(this.source),(e=>{Al(e)&&Ul(e,this)})),this._active.clear(),Fs(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=Yr(this.source).reduce(((e,t)=>Math.max(e,(Ji(t)?t.priority:0)+1)),0))}}function Ds(e){return!1!==e.idle}function Os(e){return!e.size||Array.from(e).every(Ds)}function Fs(e){e.idle||(e.idle=!0,Kr(ui(e),(e=>{e.done=!0})),Fl(e,{type:"idle",parent:e}))}ol.assign({createStringInterpolator:Yl,to:(e,t)=>new As(e,t)}),al.advance;var zs=window.ReactDOM;function Vs(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 Hs=["style","children","scrollTop","scrollLeft"],Us=/^--/;function Gs(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Us.test(e)||$s.hasOwnProperty(e)&&$s[e]?(""+t).trim():t+"px"}const Ws={};let $s={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 js=["Webkit","Ms","Moz","O"];$s=Object.keys($s).reduce(((e,t)=>(js.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),$s);const Ks=["x","y","z"],qs=/^(matrix|translate|scale|rotate|skew)/,Ys=/^(translate)/,Zs=/^(rotate|skew)/,Xs=(e,t)=>$r.num(e)&&0!==e?e+t:e,Qs=(e,t)=>$r.arr(e)?e.every((e=>Qs(e,t))):$r.num(e)?e===t:parseFloat(e)===t;class Js extends hi{constructor(e){let{x:t,y:n,z:o}=e,r=Vs(e,Ks);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Xs(e,"px"))).join(",")})`,Qs(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],$r.und(e))return;const n=Ys.test(t)?"px":Zs.test(t)?"deg":"";l.push(Yr(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Xs(r,n)})`,Qs(r,0)]:e=>[`${t}(${e.map((e=>Xs(e,n))).join(",")})`,Qs(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new ea(l,i)),super(r)}}class ea extends zl{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 Kr(this.inputs,((n,o)=>{const r=Dl(n[0]),[l,i]=this.transforms[o]($r.arr(r)?r:n.map(Dl));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Kr(this.inputs,(e=>Kr(e,(e=>Al(e)&&Hl(e,this)))))}observerRemoved(e){0==e&&Kr(this.inputs,(e=>Kr(e,(e=>Al(e)&&Ul(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Fl(this,e)}}const ta=["scrollTop","scrollLeft"];ol.assign({batchedUpdates:zs.unstable_batchedUpdates,createStringInterpolator:Yl,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 na=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new hi(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Ci(e)||"Anonymous";return(e=$r.str(e)?l[e]||(l[e]=ki(e,r)):e[Ei]||(e[Ei]=ki(e,r))).displayName=`Animated(${t})`,e};return qr(e,((t,n)=>{$r.arr(e)&&(n=Ci(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=Vs(o,Hs),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Ws[t]||(Ws[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=Gs(t,r[t]);Us.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 Js(e),getComponentProps:e=>Vs(e,ta)}).animated,oa=e=>e+1,ra=e=>({top:e.offsetTop,left:e.offsetLeft});var la=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)(oa,0),[u,p]=(0,s.useReducer)(oa,0),[m,f]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>l.current?ra(l.current):null),[r]),g=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,rr.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",g()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void g();l.current.style.transform="";const e=ra(l.current);c(),f({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=$r.fun(e),[[o],r]=Rs(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 ia=".block-editor-block-list__block",sa=".block-list-appender";function aa(e,t){return t.closest([ia,sa].join(","))===e}function ca(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=rr.focus.tabbable.find(t.current).filter((e=>(0,rr.isTextField)(e))),r=-1===n,l=(r?u.last:u.first)(o)||t.current;aa(t.current,l)?(0,rr.placeCaretAtHorizontalEdge)(l,r):t.current.focus()}),[n]),t}function ua(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function da(){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",ua),t.addEventListener("mouseover",ua),()=>{t.removeEventListener("mouseout",ua),t.removeEventListener("mouseover",ua),t.classList.remove("is-hovered")}}),[e])}function pa(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(),h=n(e),g=l(e),v=s(e),b=u(e,!0),_=p(m);return c()({"is-selected":g,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":h,"has-child-selected":b,"has-active-entity":_,"is-active-entity":_===e,"remove-outline":g&&f&&d()})}),[e])}function ma(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 fa(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 ha(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 ga(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):aa(r,l.target)&&n(e)}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var va=window.wp.keycodes;function ba(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!==va.ENTER&&s!==va.BACKSPACE&&s!==va.DELETE||a!==i||(0,rr.isTextField)(a)||(t.preventDefault(),s===va.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function _a(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 ka=n(4979),ya=n.n(ka);function Ea(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,rr.getScrollContainer)(e)||e.ownerDocument.defaultView;o&&ya()(e,o,{onlyScrollIfNeeded:!0})}),[n]),t}const Ca=(0,s.createContext)();function Sa(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(Ca.Provider,{value:n},t)}function wa(e){const{refs:t,callbacks:n}=(0,s.useContext)(Ca),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 Ba(e){const{refs:t}=(0,s.useContext)(Ca),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 Ia(e){const{callbacks:t}=(0,s.useContext)(Ca),n=Ba(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 xa(e,t){Array.from(e.closest(".is-root-container").querySelectorAll(".rich-text")).forEach((e=>{t?e.setAttribute("contenteditable",!0):e.removeAttribute("contenteditable")}))}function Ta(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 h(t){let{isSelectionEnd:n}=t;const l=p.getSelection();if(!l.rangeCount||l.isCollapsed)return void xa(u,!0);const i=function(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(ia);return t?t.id.slice("block-".length):void 0}(l.focusNode);if(e===i){if(r(e),n&&(xa(u,!0),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 g(){d.removeEventListener("selectionchange",h),p.removeEventListener("mouseup",g),f=p.requestAnimationFrame((()=>{h({isSelectionEnd:!0}),n()}))}function v(n){let{buttons:o}=n;1===o&&l()&&i(e)&&(m=d.activeElement,t(),d.addEventListener("selectionchange",h),p.addEventListener("mouseup",g),xa(u,!1))}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&&(xa(u,!1),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",h),p.removeEventListener("mouseup",g),p.cancelAnimationFrame(f)}}),[e,t,n,o,r,l,i,s])}function Na(){const e=(0,s.useContext)(dm);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Pa(){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)(Ma),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:g,isPartOfSelection:v,adjustScrolling:b,enableAnimation:_}=(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),h=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==h?void 0:h.apiVersion)||1,blockTitle:null==h?void 0:h.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),k=(0,h.sprintf)((0,h.__)("Block: %s"),g),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,ca(n),Ea(n),wa(n),ga(n),Ta(n),ba(n),_a(n),da(),Na(),la({isSelected:v,adjustScrolling:b,enableAnimation:_,triggerAnimationOnChange:a})]),C=Gn();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":k,"data-block":n,"data-type":p,"data-title":g,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,pa(n),ma(n),fa(n),ha(n)),style:{...l.style,...e.style}}}Pa.save=r.__unstableGetBlockProps;const Ma=(0,s.createContext)();function Ra(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Pa(o,{__unstableIsHtml:n}),t)}const La=(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),h=u(n,o),{name:g,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:h,block:d,name:g,attributes:v,isValid:b,isSelected:p}})),Aa=(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 Da=(0,d.compose)(d.pure,La,Aa,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){let{mode:t,isLocked:n,canRemove:o,clientId:l,isSelected:i,isSelectionEnabled:a,className:d,name:p,isValid:f,attributes:h,wrapperProps:g,setAttributes:v,onReplace:b,onInsertBlocksAfter:_,onMerge:k,toggleSelection:y}=e;const{removeBlock:E}=(0,m.useDispatch)(zn),C=(0,s.useCallback)((()=>E(l)),[l]);let S=(0,s.createElement)(ur,{name:p,isSelected:i,attributes:h,setAttributes:v,insertBlocksAfter:n?void 0:_,onReplace:o?b:void 0,onRemove:o?C:void 0,mergeBlocks:o?k:void 0,clientId:l,isSelectionEnabled:a,toggleSelection:y});const w=(0,r.getBlockType)(p);null!=w&&w.getEditWrapperProps&&(g=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}(g,w.getEditWrapperProps(h)));const B=g&&!!g["data-align"];let I;if(B&&(S=(0,s.createElement)("div",{className:"wp-block","data-align":g["data-align"]},S)),f)I="html"===t?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},S),(0,s.createElement)(Ra,{isHtml:!0},(0,s.createElement)(Cr,{clientId:l}))):(null==w?void 0:w.apiVersion)>1?S:(0,s.createElement)(Ra,g,S);else{const e=(0,r.getSaveContent)(w,h);I=(0,s.createElement)(Ra,{className:"has-warning"},(0,s.createElement)(vr,{clientId:l}),(0,s.createElement)(s.RawHTML,null,(0,rr.safeHTML)(e)))}const x={clientId:l,className:d,wrapperProps:(0,u.omit)(g,["data-align"]),isAligned:B},T=(0,s.useMemo)((()=>x),Object.values(x));return(0,s.createElement)(Ma.Provider,{value:T},(0,s.createElement)(yr,{fallback:(0,s.createElement)(Ra,{className:"has-warning"},(0,s.createElement)(_r,null))},I))})),Oa=window.wp.htmlEntities,Fa=(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 za=[(0,s.createInterpolateElement)((0,h.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,h.__)("Drag files into the editor to automatically insert media blocks."),(0,h.__)("Change a block's type by pressing the block icon on the toolbar.")];var Va=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*za.length));return(0,s.createElement)(p.Tip,null,za[e])},Ha=(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"})),Ua=(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:Ha});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)})),Ga=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)(Ua,{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 Wa(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:h}=a.dispatch(zn),{getBlockName:g,getBlocks:v}=a.select(zn),b=(0,m.useSelect)((e=>!t||e(zn).areInnerBlocksControlled(t)),[t]),_=(0,s.useRef)({incoming:null,outgoing:[]}),k=(0,s.useRef)(!1),y=()=>{n&&(h(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));k.current&&(_.current.incoming=e),h(),p(t,e)})):(k.current&&(_.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)((()=>{_.current.outgoing.includes(n)?(0,u.last)(_.current.outgoing)===n&&(_.current.outgoing=[]):v(t)!==n&&(_.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{b||(_.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;k.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===g(t))return;if(t&&!i(t))return;const a=r(),d=v(t),p=d!==s;if(s=d,p&&(_.current.incoming||l()))return _.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,_.current.outgoing.push(s),(c?C.current:E.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}var $a=(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]),Wa(e),(0,s.createElement)(Sa,null,t)}));function ja(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)(mm,null)))}function Ka(){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:Ka()},e))}function Ya(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 Za(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r}=e(zn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r()}}function Xa(){const{isMultiSelecting:e,multiSelectedBlockClientIds:t,hasMultiSelection:n,selectedBlockClientId:o}=(0,m.useSelect)(Za,[]),r=Ba(o),l=Ba((0,u.first)(t)),i=Ba((0,u.last)(t));return(0,d.useRefEffect)((s=>{const{ownerDocument:a}=s,{defaultView:c}=a;if(!n||e){if(!o||e)return;const t=c.getSelection();if(t.rangeCount&&!t.isCollapsed){const e=r.current,{startContainer:n,endContainer:o}=t.getRangeAt(0);!e||e.contains(n)&&e.contains(o)||t.removeAllRanges()}return}const{length:u}=t;if(u<2)return;if(!l.current||!i.current)return;s.focus();const d=c.getSelection(),p=a.createRange(),m=Ya(l.current,"start"),f=Ya(i.current,"end");var h;h=s,Array.from(h.querySelectorAll(".rich-text:not( .editor-post-title__input )")).forEach((e=>{e.removeAttribute("contenteditable")})),p.setStartBefore(m),p.setEndAfter(f),d.removeAllRanges(),d.addRange(p)}),[n,e,t,o])}function Qa(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}function Ja(e,t,n,o){let r,l=rr.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(!rr.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 ec(){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 h(e){const t=l(),n=i(),o=e?t:n;o&&u(o)}function g(t){const{keyCode:l,target:i}=t,c=l===va.UP,u=l===va.DOWN,m=l===va.LEFT,g=l===va.RIGHT,v=c||m,b=m||g,_=c||u,k=b||_,y=t.shiftKey,E=y||t.ctrlKey||t.altKey||t.metaKey,C=_?rr.isVerticalEdge:rr.isHorizontalEdge,{ownerDocument:S}=d,{defaultView:w}=S;if(a())return void(k&&((y?f:h)(v),t.preventDefault()));if(_?p||(p=(0,rr.computeCaretRect)(w)):p=null,t.defaultPrevented)return;if(!k)return;if(!function(e,t,n){if((t===va.UP||t===va.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(i,l,E))return;const B=(0,rr.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=Ja(e,t,d);return!n||!function(e,t){return e.closest(ia)===t.closest(ia)}(e,n)}(i,v)&&C(i,v)&&(f(v),t.preventDefault())}else if(_&&(0,rr.isVerticalEdge)(i,v)&&!I){const e=Ja(i,v,d,!0);e&&((0,rr.placeCaretAtVerticalEdge)(e,v,p),t.preventDefault())}else if(b&&w.getSelection().isCollapsed&&(0,rr.isHorizontalEdge)(i,B)&&!I){const e=Ja(i,B,d);(0,rr.placeCaretAtHorizontalEdge)(e,v),t.preventDefault()}}return d.addEventListener("mousedown",m),d.addEventListener("keydown",g),()=>{d.removeEventListener("mousedown",m),d.removeEventListener("keydown",g)}}),[])}var tc=window.wp.keyboardShortcuts;function nc(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(zn),{multiSelect:o}=(0,m.useDispatch)(zn),r=(0,tc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;if(!(0,rr.isEntirelySelected)(l.target))return;const i=t(),[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 oc(){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";rr.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),g=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===va.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==va.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(Qa(e.target)&&Qa(rr.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!==va.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=rr.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,g]),h]}(),o=(0,m.useSelect)((e=>e(zn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,Xa(),nc(),ec(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,o)return e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var rc=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=oc();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 lc="editor-styles-wrapper";function ic(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var sc=(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,g]=(0,s.useState)(),[v,b]=(0,s.useState)([]),_=ic(null==a?void 0:a.styles),k=ic(null==a?void 0:a.scripts),y=Ka(),[E,C,S]=oc(),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),g(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=>{k.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(`.${lc}`)||t.includes(".wp-block"))}))&&!e.getElementById(n.id)){console.warn(`Stylesheet ${n.id} was not properly added.\nFor blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).\nFor themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles).`,n.outerHTML),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}"),_.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,h.__)("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()(lc,...v)},(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),ac={grad:.9,turn:360,rad:360/(2*Math.PI)},cc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},uc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},dc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},pc=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},mc=function(e){return{r:dc(e.r,0,255),g:dc(e.g,0,255),b:dc(e.b,0,255),a:dc(e.a)}},fc=function(e){return{r:uc(e.r),g:uc(e.g),b:uc(e.b),a:uc(e.a,3)}},hc=/^#([0-9a-f]{3,8})$/i,gc=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},vc=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}},bc=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}},_c=function(e){return{h:pc(e.h),s:dc(e.s,0,100),l:dc(e.l,0,100),a:dc(e.a)}},kc=function(e){return{h:uc(e.h),s:uc(e.s),l:uc(e.l),a:uc(e.a,3)}},yc=function(e){return bc((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},Ec=function(e){return{h:(t=vc(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},Cc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Sc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Bc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ic={string:[[function(e){var t=hc.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?uc(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?uc(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=wc.exec(e)||Bc.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:mc({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=Cc.exec(e)||Sc.exec(e);if(!t)return null;var n,o,r=_c({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(ac[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return yc(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 cc(t)&&cc(n)&&cc(o)?mc({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(!cc(t)||!cc(n)||!cc(o))return null;var i=_c({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return yc(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!cc(t)||!cc(n)||!cc(o))return null;var i=function(e){return{h:pc(e.h),s:dc(e.s,0,100),v:dc(e.v,0,100),a:dc(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return bc(i)},"hsv"]]},xc=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]},Tc=function(e,t){var n=Ec(e);return{h:n.h,s:dc(n.s+100*t,0,100),l:n.l,a:n.a}},Nc=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Pc=function(e,t){var n=Ec(e);return{h:n.h,s:n.s,l:dc(n.l+100*t,0,100),a:n.a}},Mc=function(){function e(e){this.parsed=function(e){return"string"==typeof e?xc(e.trim(),Ic.string):"object"==typeof e&&null!==e?xc(e,Ic.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 uc(Nc(this.rgba),2)},e.prototype.isDark=function(){return Nc(this.rgba)<.5},e.prototype.isLight=function(){return Nc(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=fc(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?gc(uc(255*r)):"","#"+gc(t)+gc(n)+gc(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return fc(this.rgba)},e.prototype.toRgbString=function(){return t=(e=fc(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 kc(Ec(this.rgba))},e.prototype.toHslString=function(){return t=(e=kc(Ec(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=vc(this.rgba),{h:uc(e.h),s:uc(e.s),v:uc(e.v),a:uc(e.a,3)};var e},e.prototype.invert=function(){return Rc({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),Rc(Tc(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Rc(Tc(this.rgba,-e))},e.prototype.grayscale=function(){return Rc(Tc(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Rc(Pc(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Rc(Pc(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?Rc({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):uc(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ec(this.rgba);return"number"==typeof e?Rc({h:e,s:t.s,l:t.l,a:t.a}):uc(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Rc(e).toHex()},e}(),Rc=function(e){return e instanceof Mc?e:new Mc(e)},Lc=[],Ac=function(e){e.forEach((function(e){Lc.indexOf(e)<0&&(e(Mc,Ic),Lc.push(e))}))};function Dc(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 Oc=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Fc=function(e){return.2126*Oc(e.r)+.7152*Oc(e.g)+.0722*Oc(e.b)};function zc(e){e.prototype.luminance=function(){return e=Fc(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=Fc(l))>(a=Fc(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 Vc=n(3692),Hc=n.n(Vc);const Uc=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Gc(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=h();)!1!==t&&e.push(t);return e}function h(){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 g(){const e=p(/^([^{]+)/);if(e)return Wc(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=Wc(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Uc,""),value:n?Wc(n[0]).replace(Uc,""):""});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 _(){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 k=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=_();)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=Wc(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:Wc(t[1]),media:Wc(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Wc(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 '}'")}()||k()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Wc(t[1]),o=Wc(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=g()||[];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=g();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return $c(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Wc(e){return e?e.replace(/^\s+|\s+$/g,""):""}function $c(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){$c(e,o)})):n&&"object"==typeof n&&$c(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var jc=n(5717),Kc=n.n(jc),qc=Yc;function Yc(e){this.options=e||{}}Yc.prototype.emit=function(e){return e},Yc.prototype.visit=function(e){return this[e.type](e)},Yc.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 Zc=Xc;function Xc(e){qc.call(this,e)}Kc()(Xc,qc),Xc.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Xc.prototype.comment=function(e){return this.emit("",e.position)},Xc.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Xc.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xc.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("}")},Xc.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Xc.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Xc.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xc.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Xc.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Xc.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("}")},Xc.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Xc.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xc.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Xc.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("}"):""},Xc.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var Qc=Jc;function Jc(e){e=e||{},qc.call(this,e),this.indentation=e.indent}Kc()(Jc,qc),Jc.prototype.compile=function(e){return this.stylesheet(e)},Jc.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Jc.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Jc.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Jc.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}")},Jc.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}")},Jc.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Jc.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Jc.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}")},Jc.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)+"}")},Jc.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")},Jc.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}")},Jc.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}")},Jc.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}")},Jc.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Jc.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()+"}"):""},Jc.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Jc.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var eu=function(e,t){try{const r=Gc(e);return n=Hc().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new Zc(o):new Qc(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function tu(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 nu(e,t){return new URL(e,t).toString()}var ou=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]};tu(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+nu(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 ru=/^(body|html|:root).*$/;var lu=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(ru)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},iu=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(lu(t)),o&&r.push(ou(o)),r.length?eu(n,(0,d.compose)(r)):n}))};const su=".editor-styles-wrapper";function au(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(su);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=Rc(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function cu(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>iu(t,su)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:au(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let uu;Ac([Dc,zc]);var du=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}}),[]);uu=uu||(0,d.pure)(mm);const u=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(${u})`,height:i*u}},(0,s.createElement)(sc,{head:(0,s.createElement)(cu,{styles:a}),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"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none"}},l,(0,s.createElement)(uu,{renderAppender:!1}))))},pu=(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)($a,{value:c,settings:a},r?(0,s.createElement)(ja,{onClick:l}):(0,s.createElement)(du,{viewportWidth:o,__experimentalPadding:n})):null}));function mu(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)($a,{value:p,settings:a},(0,s.createElement)(hm,{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 fu=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)(pu,{__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,h.__)("No Preview Available."))),!p&&(0,s.createElement)(Ga,{title:i,icon:a,description:c}))},hu=(0,s.createContext)(),gu=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(hu);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)}))})),vu=(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 bu(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)(Ua,{icon:n}):(0,h.sprintf)(
|
11 |
/* translators: %d: Number of blocks. */
|
12 |
-
(0,h._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(
|
13 |
/* translators: %s: block pattern title. */
|
14 |
-
(0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function
|
15 |
-
(0,h._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Nt.speak)(s),i&&i()}),[l,c,f,g,d,p,i,a]),
|
16 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
17 |
-
(0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var
|
18 |
/* translators: %d: number of results. */
|
19 |
-
(0,h._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)(
|
20 |
/* translators: %d: number of results. */
|
21 |
-
(0,h._n)("%d result found.","%d results found.",e),e);b(n)}),[t,b]);const T=(0,d.useAsyncList)(I,{step:9}),N=(0,d.useAsyncList)(T.length===I.length?x:
|
22 |
/* translators: Blocks tab title in the block inserter. */
|
23 |
-
title:(0,h.__)("Blocks")},
|
24 |
/* translators: Patterns tab title in the block inserter. */
|
25 |
-
title:(0,h.__)("Patterns")},
|
26 |
/* translators: Reusable blocks tab title in the block inserter. */
|
27 |
-
title:(0,h.__)("Reusable")};var
|
28 |
-
(0,h._x)("Add %s","directly add the only allowed block"),l):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:u,...d}=c;return(0,s.createElement)(p.Button,i({icon:Fa,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
|
29 |
-
(0,h.__)("%s block added"),a.title);(0,Nt.speak)(
|
30 |
-
(0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const f=!m;let g=(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:Fa}));return(f||m)&&(g=(0,s.createElement)(p.Tooltip,{text:n},g)),g},isAppender:!0})}const Sd=(0,s.forwardRef)(((e,t)=>(Rt()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Cd(e,t))));var wd=(0,s.forwardRef)(Cd),Bd=(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)(Ed,{rootClientId:n}):(0,s.createElement)(wd,{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 Id(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 xd=(0,s.createContext)();function Td(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(zn),l=(0,s.useContext)(xd),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:g,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=Ia(u),_=Ia(f),k="vertical"===a,y=(0,s.useMemo)((()=>{if(!b&&!_)return{};const e=b?b.getBoundingClientRect():null,t=_?_.getBoundingClientRect():null;if(k)return{width:b?b.offsetWidth:_.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,h.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:b?b.offsetHeight:_.offsetHeight}}),[b,_]),E=(0,s.useCallback)((()=>{if(!b&&!_)return{};const{ownerDocument:e}=b||_,t=b?b.getBoundingClientRect():null,n=_?_.getBoundingClientRect():null;return k?(0,h.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,h.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,_]),C=Id(n),S=(0,d.useReducedMotion)(),w=c()("block-editor-block-list__insertion-point","is-"+a),B=b&&_&&v,I={start:{...k?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...k?{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:{...k?{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+"--"+g},(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)(yd,{position:"bottom center",clientId:f,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Nd(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(zn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(xd.Provider,{value:(0,s.useRef)(!1)},r&&(0,s.createElement)(Td,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function Pd(){const e=(0,s.useContext)(xd),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(),h=t.clientY-f.top,g=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>h||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>g));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 _=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>_.bottom||t.clientY<_.top)||"vertical"===m&&(t.clientX>_.right||t.clientX<_.left))return void(l()&&p());const k=r(b);0!==k?u(d,k,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,a])}const Md="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Rd="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Ld(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 Ad(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=Ld(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 Dd=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,h,g]=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,rr.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 _={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:_,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:h,onDragEnd:()=>{b(),d.current=!1,g(),i&&i()},__experimentalDragComponent:(0,s.createElement)(bu,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Od=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=Ld(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:g,orientation:v}=a,{setNavigationMode:b,removeBlock:_}=(0,m.useDispatch)(zn),k=(0,s.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,s.useEffect)((()=>{k.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":!!g}),O=(0,h.__)("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)(Ua,{icon:null==l?void 0:l.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Dd,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:vu,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:k,onClick:()=>b(!1),onKeyDown:function(e){const{keyCode:n}=e,r=n===va.UP,l=n===va.DOWN,i=n===va.LEFT,s=n===va.RIGHT,a=n===va.TAB,c=n===va.ESCAPE,u=n===va.ENTER,d=n===va.SPACE,p=e.shiftKey;if(n===va.BACKSPACE||n===va.DELETE)return _(t),void e.preventDefault();const m=I(),f=x(),h=T(f||m),g=N(f||m),v=a&&p||r,b=a&&!p||l,k=i,y=s;let E;if(v)E=h;else if(b)E=g;else if(k){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||k||y)if(E)e.preventDefault(),M(E);else if(a&&m){let t;b?(t=rr.focus.tabbable.findNext(o),t||(t=o.ownerDocument.defaultView.frameElement,t=rr.focus.tabbable.findNext(t))):t=rr.focus.tabbable.findPrevious(o),t&&(e.preventDefault(),t.focus(),R())}},label:E,className:"block-selection-button_select-button"},(0,s.createElement)(Ad,{clientId:t})))))};function Fd(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var zd=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=!rr.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]=rr.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,tc.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=Fd(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=Fd(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)},Vd=(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"})),Hd=(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"})),Ud=(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"})),Gd=(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 Wd=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?Vd:Hd:Ud:"down"===e?"horizontal"===t?(0,h.isRTL)()?Hd:Vd:Gd:null,$d=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move right"):(0,h.__)("Move left"):(0,h.__)("Move up"):"down"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move left"):(0,h.__)("Move right"):(0,h.__)("Move down"):null,jd=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(jd),g=(0,u.castArray)(n).length,{blockType:v,isDisabled:b,rootClientId:_,isFirst:k,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),h=t((0,u.last)(d)),g=s(m),v=a(p),b=0===f,_=h===g.length-1,{orientation:k}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:_,rootClientId:m,firstIndex:f,isFirst:b,isLast:_,orientation:l||k}}),[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:Wd(o,C),label:$d(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,_),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,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,h.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,h.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,h.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
31 |
(0,h._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,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
32 |
(0,h._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,h.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
|
33 |
(0,h.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
@@ -42,52 +42,52 @@ title:(0,h.__)("Reusable")};var gd=function(e){let{children:t,showPatterns:n=!1,
|
|
42 |
(0,h.__)("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,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
43 |
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
44 |
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
45 |
-
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(g,v&&v.title,E,
|
46 |
/* translators: %s: Name of the block's parent. */
|
47 |
-
(0,h.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(
|
48 |
/* translators: %s: block title. */
|
49 |
(0,h.__)("%s: Change block type or style"),f):(0,h.sprintf)(
|
50 |
/* translators: %d: number of blocks. */
|
51 |
-
(0,h._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||_
|
52 |
(0,h.__)('Copied "%s" to clipboard.'),s):(0,h.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
53 |
(0,h.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,h.sprintf)(// Translators: %d: Number of blocks being copied.
|
54 |
(0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,h.sprintf)(// Translators: %d: Number of blocks being cut.
|
55 |
-
(0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function
|
56 |
/* translators: %s: block name */
|
57 |
-
(0,h.__)("Remove %s"),g),
|
58 |
-
/* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(Hp,{hideDragHandle:n}))};function Gp(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 Wp(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:h,isCaretWithinFormattedText:g,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:_}=(0,m.useSelect)(Gp,[]),k=(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=!h&&!u&&r&&o,x=u,T=!u&&!b&&y&&!I&&!f&&(!h||g),N=!(u||T||b||r);(0,tc.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=Ia(t),R=Ia(_),L=Ia(l),A=Id(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,rr.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":k}),__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)(yd,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,s.createElement)(Up,{focusOnMount:E,__experimentalInitialIndex:P.current,__experimentalOnIndexChange:e=>{P.current=e},key:t}),x&&(0,s.createElement)(Od,{clientId:t,rootClientId:n,blockElement:D}),I&&(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(yd,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function $p(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),h=(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:h}}function jp(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)($p,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,s.createElement)(Wp,{clientId:r,rootClientId:l,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Kp(e){let{children:t}=e;const n=(0,s.useContext)(xd),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)(Nd,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(jp,{__unstablePopoverSlot:"block-toolbar"}),t))}var qp=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Gn();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Yp=qp((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(wd,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Zp=(0,d.compose)([qp,(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)(Ed,{rootClientId:t})})),Xp=window.wp.isShallowEqual,Qp=n.n(Xp);const Jp=new WeakMap;function em(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,rr.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function tm(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 nm(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=tm(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function om(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,h.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=nm(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function rm(){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=em(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=om(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 lm(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:h,orientation:g,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),Qp()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,g,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 _=(0,m.useSelect)((e=>{const n=e(zn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){Jp.has(t)||Jp.set(t,new WeakMap);const n=Jp.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)(ir,{value:_},(0,s.createElement)(hm,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function im(e){return Wa(e),(0,s.createElement)(lm,e)}const sm=(0,s.forwardRef)(((e,t)=>{const n=am({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function am(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Gn(),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,rm({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?im:lm;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)(hm,t)}}am.save=r.__unstableGetInnerBlocksProps,sm.DefaultBlockAppender=Zp,sm.ButtonBlockAppender=Yp,sm.Content=()=>am.save().children;var cm=sm;const um=(0,s.createContext)(),dm=(0,s.createContext)();function pm(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=am({ref:(0,d.useMergeRefs)([Ka(),Pd(),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)(um.Provider,{value:o},(0,s.createElement)("div",p))}function mm(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=Md(o))};return t=Md(o),()=>Rd(t)}),[e])}(),(0,s.createElement)(Kp,null,(0,s.createElement)(Un,{value:Vn},(0,s.createElement)(pm,e)))}function fm(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)(dm.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Da,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(Bd,{tagName:r,rootClientId:n,renderAppender:o}))}function hm(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(fm,e))}mm.__unstableElementContext=um;const gm=["colors","disableCustomColors","gradients","disableCustomGradients"];function vm(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:g,gradientValue:v,clearable:b,showTitle:_=!0,enableAlpha:k}=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},_&&(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,h.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,h.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,h.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:g,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:k}),("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 bm(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)(vm,i({},t,e))}var _m=function(e){return(0,u.every)(gm,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(vm,e):(0,s.createElement)(bm,e)};function km(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)=>(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)(_m,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function ym(){return{disableCustomColors:!mo("color.custom"),disableCustomGradients:!mo("color.customGradient")}}function Em(){const e=ym(),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,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,h._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,h._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}Ac([Dc,zc]);const Cm=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Sm=(e,t)=>(0,u.find)(e,{color:t});function wm(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const Bm=[];function Im(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Em(),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=Cm(l,t,a))||void 0===e?void 0:e.color}));(0,s.useEffect)((()=>{var e;u(null===(e=Cm(l,t,a))||void 0===e?void 0:e.color)}),[t,a,l]);const d=[{label:(0,h.__)("Color"),onColorChange:e=>{u(e);const t=Sm(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)(km,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function xm(e,t,n){var o;if(!Jm(t,"color")||ef(t))return e;const{borderColor:r,style:l}=n,i=wm("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 Tm=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:a}=l,c=mo("color.palette")||Bm;if(!Jm(r,"color")||ef(r))return(0,s.createElement)(e,t);const u={borderColor:a?null===(n=Cm(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 Nm(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Pm(){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=Nm(o),i=0===r||r?`${r}${l}`:null;return i}function Mm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Pm(e),n=isNaN(parseFloat(t));return n}function Rm(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Lm(e){let{onChange:t,values:n,...o}=e;const r=Pm(n),l=Rm(n)&&Mm(n),a=l?(0,h.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,h.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Jm(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",xm),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Jm(e,"color")||ef(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),xm(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Tm);const Am={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function Dm(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(Am).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 Om=(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"})),Fm=(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 zm(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink Radii"):(0,h.__)("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?Om:Fm,iconSize:16,"aria-label":o})))}const Vm={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Hm={px:100,em:20,rem:20};function Um(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Rm(n)||!Mm(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 Nm(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)(Pm(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Lm,{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:Hm[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(Dm,{min:0,onChange:t,values:n||Vm,units:l}),(0,s.createElement)(zm,{onClick:()=>r(!o),isLinked:o})))}function Gm(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Um,{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 Wm=(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"})),$m=(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 Km=[{label:(0,h.__)("Solid"),icon:Wm,value:"solid"},{label:(0,h.__)("Dashed"),icon:$m,value:"dashed"},{label:(0,h.__)("Dotted"),icon:jm,value:"dotted"}];function qm(e){let{onChange:t,value:n}=e;return(0,s.createElement)("fieldset",{className:"components-border-style-control"},(0,s.createElement)("legend",null,(0,h.__)("Style")),(0,s.createElement)("div",{className:"components-border-style-control__buttons"},Km.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 Ym=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(qm,{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)})}})},Zm=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)(),g=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"]});return(0,s.createElement)(p.__experimentalUnitControl,{value:r,label:(0,h.__)("Width"),min:0,onChange:e=>{let s={...n,border:{...null==n?void 0:n.border,width:e}},p=t;const h=0===parseFloat(e),g=0===parseFloat(r);h&&!g&&(d(t),f(l),c(i),p=void 0,s.border.color=void 0,s.border.style="none"),!h&&g&&("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:g})},Xm="__experimentalBorder";function Qm(e){const{clientId:t}=e,n=tf(e),o=Jm(e.name),l=mo("border.color")&&Jm(e.name,"color"),i=mo("border.radius")&&Jm(e.name,"radius"),a=mo("border.style")&&Jm(e.name,"style"),c=mo("border.width")&&Jm(e.name,"width");if(n||!o)return null;const u=(0,r.getBlockSupport)(e.name,[Xm,"__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)(er,{__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,h.__)("Width"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:nf(o,"width")})}(e),isShownByDefault:null==u?void 0:u.width,resetAllFilter:d("width"),panelId:t},(0,s.createElement)(Zm,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,h.__)("Style"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:nf(o,"style")})}(e),isShownByDefault:null==u?void 0:u.style,resetAllFilter:d("style"),panelId:t},(0,s.createElement)(Ym,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,h.__)("Color"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({borderColor:void 0,style:nf(o,"color")})}(e),isShownByDefault:null==u?void 0:u.color,resetAllFilter:d("color",{borderColor:void 0}),panelId:t},(0,s.createElement)(Im,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,h.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:nf(o,"radius")})}(e),isShownByDefault:null==u?void 0:u.radius,resetAllFilter:d("radius"),panelId:t},(0,s.createElement)(Gm,e)))}function Jm(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,Xm);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 ef(e){const t=(0,r.getBlockSupport)(e,Xm);return null==t?void 0:t.__experimentalSkipSerialization}const tf=()=>[!mo("border.color"),!mo("border.radius"),!mo("border.style"),!mo("border.width")].every(Boolean);function nf(e,t){return qo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function of(e){if(e)return`has-${e}-gradient-background`}function rf(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function lf(e,t){return(0,u.find)(e,["gradient",t])}function sf(e,t){const n=lf(e,t);return n&&n.slug}function af(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Gn(),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=sf(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=of(a);let f;return f=a?rf(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}
|
59 |
// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
|
60 |
-
const
|
61 |
-
var
|
62 |
/* translators: 1: Font weight name. 2: Font style name. */
|
63 |
-
(0,h.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return
|
64 |
(0,h.__)("Currently selected font appearance: %s"),d.name):(0,h.sprintf)(// translators: %s: Currently selected font style.
|
65 |
(0,h.__)("Currently selected font style: %s"),d.name):(0,h.sprintf)(// translators: %s: Currently selected font weight.
|
66 |
-
(0,h.__)("Currently selected font weight: %s"),d.name):(0,h.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}function Rf(e){let{value:t,onChange:n}=e;const o=function(e){return void 0!==e&&""!==e}(t),r=o?t:"";return(0,s.createElement)("div",{className:"block-editor-line-height-control"},(0,s.createElement)(p.TextControl,{autoComplete:"off",onKeyDown:e=>{const{keyCode:t}=e;t!==va.ZERO||o||(e.preventDefault(),n("0"))},onChange:e=>{if(o)return void n(e);let t=e;switch(e){case"0.1":t=1.6;break;case"0":t=1.4}n(t)},label:(0,h.__)("Line height"),placeholder:1.5,step:.1,type:"number",value:r,min:0}))}const Lf="typography.lineHeight";function Af(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Rf,{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 Df(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Lf)||t}const Of="typography.__experimentalFontStyle",Ff="typography.__experimentalFontWeight";function zf(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Vf(e),i=!Hf(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)(Mf,{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 Vf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Of),n=mo("typography.fontStyle");return!t||!n}function Hf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Ff),n=mo("typography.fontWeight");return!t||!n}function Uf(e){const t=Vf(e),n=Hf(e);return t&&n}function Gf(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,h.__)("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,h.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Wf="typography.__experimentalFontFamily";function $f(e,t,n){if(!(0,r.hasBlockSupport)(t,Wf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(sp())(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)(Gf,{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 Kf(e){let{name:t}=e;const n=mo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Wf)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Wf)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",$f),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Wf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),$f(o,e,n)},e}));const qf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Yf(e,t){return(0,u.find)(e,{size:t})||{size:t}}function Zf(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var Xf=function(e){const t=mo("typography.fontSizes"),n=!mo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Qf="typography.fontSize";function Jf(e,t,n){if(!(0,r.hasBlockSupport)(t,Qf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(sp())(e.className);o.add(Zf(n.fontSize));const l=o.value;return e.className=l||void 0,e}function eh(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=mo("typography.fontSizes"),a=qf(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)(Xf,{onChange:e=>{const t=Yf(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 th(){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,Qf)||!n}const nh=(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,Qf)||(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=qf(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");(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Qf)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Jf),(0,l.addFilter)("blocks.registerBlockType","core/font/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)),Jf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",nh);var oh=(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"})),rh=(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 lh=[{name:(0,h.__)("Underline"),value:"underline",icon:oh},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:rh}];function ih(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,h.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},lh.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 sh="typography.__experimentalTextDecoration";function ah(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(ih,{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 ch(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,sh),n=mo("typography.textDecoration");return t||!n}var uh=(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"})),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 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"})),ph=(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 mh=[{name:(0,h.__)("Uppercase"),value:"uppercase",icon:uh},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:dh},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:ph}];function fh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,h.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},mh.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 hh="typography.__experimentalTextTransform";function gh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(fh,{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 vh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,hh),n=mo("typography.textTransform");return t||!n}function bh(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,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const _h="typography.__experimentalLetterSpacing";function kh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(bh,{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 yh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,_h),n=mo("typography.letterSpacing");return t||!n}const Eh="typography",Ch=[Lf,Qf,Of,Ff,Wf,sh,hh,_h];function Sh(e){const{clientId:t}=e,n=Kf(e),o=th(e),l=Uf(e),i=Df(e),a=ch(e),c=vh(e),u=yh(e),d=!Vf(e),m=!Hf(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Uf(e),th(e),Df(e),Kf(e),ch(e),vh(e),yh(e)];return t.filter(Boolean).length===t.length}(e),g=wh(e.name);if(f||!g)return null;const v=(0,r.getBlockSupport)(e.name,[Eh,"__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)(er,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,h.__)("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,h.__)("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)(eh,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:Pf(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)(zf,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,h.__)("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)(Af,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,h.__)("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)(ah,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,h.__)("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)(gh,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,h.__)("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)(kh,e)))}const wh=e=>Ch.some((t=>(0,r.hasBlockSupport)(e,t)));function Bh(e){const t=(0,r.getBlockSupport)(e,Ah);return!!(!0===t||null!=t&&t.blockGap)}function Ih(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.blockGap");return!Bh(e)||t}function xh(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=Ba(n);return Ih(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("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 Th(e){const t=(0,r.getBlockSupport)(e,Ah);return!!(!0===t||null!=t&&t.margin)}function Nh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.margin"),n=!Hh(e,"margin");return!Th(e)||t||n}function Ph(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=Vh(n,"margin"),a=i&&i.some((e=>Oh.includes(e)));return Nh(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,h.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Mh(e){const t=(0,r.getBlockSupport)(e,Ah);return!!(!0===t||null!=t&&t.padding)}function Rh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.padding"),n=!Hh(e,"padding");return!Mh(e)||t||n}function Lh(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=Vh(n,"padding"),a=i&&i.some((e=>Oh.includes(e)));return Rh(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,h.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const Ah="spacing",Dh=["top","right","bottom","left"],Oh=["vertical","horizontal"];function Fh(e){const t=Ih(e),n=Rh(e),o=Nh(e),l=zh(e),i=(a=e.name,"web"===s.Platform.OS&&(Bh(a)||Mh(a)||Th(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Ah,"__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)(er,{__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,h.__)("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)(Lh,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,h.__)("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)(Ph,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,h.__)("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)(xh,e)))}const zh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ih(e),n=Rh(e),o=Nh(e);return t&&n&&o};function Vh(e,t){const n=(0,r.getBlockSupport)(e,Ah);if(n&&"boolean"!=typeof n[t])return n[t]}function Hh(e,t){const n=Vh(e,t);return!(n&&n.some((e=>Dh.includes(e)))&&n.some((e=>Oh.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}const Uh=[...Ch,Xm,yf,Ah],Gh=e=>Uh.some((t=>(0,r.hasBlockSupport)(e,t))),Wh="var:";function $h(e){return(0,u.startsWith)(e,Wh)?`var(--wp--${e.slice(Wh.length).split("|").join("--")})`:e}function jh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};return 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 r=(0,u.get)(e,l);i&&!(0,u.isString)(r)?Object.entries(i).forEach((e=>{const[t,o]=e,l=(0,u.get)(r,[o]);l&&(n[t]=$h(l))})):t.includes(l.join("."))||(n[o]=$h((0,u.get)(e,l)))}})),n}const Kh={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[yf],"typography.__experimentalSkipSerialization":[Eh],[`${Ah}.__experimentalSkipSerialization`]:["spacing"]},qh={...Kh,[`${Ah}`]:["spacing.blockGap"]};function Yh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:qh;if(!Gh(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={...jh(l),...e.style},e}const Zh=(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)(If,t),(0,s.createElement)(Sh,t),(0,s.createElement)(Qm,t),(0,s.createElement)(Fh,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Xh=(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=jh(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)(mm.__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 Gh(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Yh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Gh(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Yh(o,e,n,Kh)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Zh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Xh);var Qh=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,h.__)("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!==va.DOWN||(e.preventDefault(),n())},label:(0,h.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,h.__)("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 Jh=[];function eg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Rc(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 tg(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 ng(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")||Jh,a=mo("color.palette")||Jh,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)(Qh,{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})}}))}Ac([Dc]);const og=(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)(ng,t))}),"withDuotoneControls"),rg=(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),h=(0,s.useContext)(mm.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(tg,{selector:m,id:p,values:eg(u)}),h),(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",og),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",rg);const lg="__experimentalLayout";function ig(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,lg,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:g}=c;if(!d)return null;const v=l||g||{},{inherit:b=!1,type:_="default"}=v;if("default"===_&&!a)return null;const k=Io(_),y=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(er,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Layout")},f&&!!i&&(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Inherit default layout"),checked:!!b,onChange:()=>t({layout:{inherit:!b}})}),!b&&u&&(0,s.createElement)(sg,{type:_,onChange:e=>t({layout:{type:e}})}),!b&&k&&(0,s.createElement)(k.inspectorControls,{layout:v,onChange:y,layoutBlockSupport:c}))),!b&&k&&(0,s.createElement)(k.toolBarControls,{layout:v,onChange:y,layoutBlockSupport:c}))}function sg(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 ag=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,lg)&&(0,s.createElement)(ig,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),cg=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,lg),a=(0,d.useInstanceId)(e),u=mo("layout")||{},p=(0,s.useContext)(mm.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,lg)||{},h=null!=m&&m.inherit?u:m||f||{},g=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:h,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:g})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,lg)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",cg),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",ag);const ug=[];function dg(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=wm("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:jh({border:r})}}function pg(e){const t=mo("color.palette")||ug,n=dg(e);if(e.borderColor){const o=Cm(t,e.borderColor);n.style.borderColor=o.color}return n}function mg(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=wm("background-color",s),m=wm("color",a),f=of(u),h=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!h&&!!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:jh({color:(null==d?void 0:d.color)||{}})}}const fg={};function hg(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")||fg,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=mg(e);if(t){const e=Cm(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=rf(u,o)),n){const e=Cm(c,n);d.style.color=e.color}return d}function gg(e){const{style:t}=e;return{style:jh({spacing:(null==t?void 0:t.spacing)||{}})}}function vg(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const bg=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),_g=()=>(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 kg(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=Rc(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=Sm(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=Cm(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:wm(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function yg(e){return function(){const t=bg(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(kg(o,t),"withCustomColors")}}function Eg(){const e=_g();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(kg(n,e),"withColors")}const Cg=[];var Sg=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")||Cg;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=qf(r,l,n[t]);return e[o]={...i,class:Zf(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},wg=(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"})),Bg=(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"})),Ig=(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 xg=[{icon:wg,title:(0,h.__)("Align text left"),align:"left"},{icon:Bg,title:(0,h.__)("Align text center"),align:"center"},{icon:Ig,title:(0,h.__)("Align text right"),align:"right"}],Tg={position:"bottom right",isAlternate:!0};var Ng=function(e){let{value:t,onChange:n,alignmentControls:o=xg,label:r=(0,h.__)("Align"),describedBy:l=(0,h.__)("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,g=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,h.isRTL)()?Ig:wg,label:r,toggleProps:{describedBy:l},popoverProps:Tg,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},g))};function Pg(e){return(0,s.createElement)(Ng,i({},e,{isToolbar:!1}))}function Mg(e){return(0,s.createElement)(Ng,i({},e,{isToolbar:!0}))}var Rg={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]=Bu(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?Zu(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)(Ua,{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 Lg=[];function Ag(e){let{completers:t=Lg}=e;const{name:n}=Gn();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Rg])),(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 Dg=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Ag(e)}))},Og=(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"})),Fg=function(e){let{isActive:t,label:n=(0,h.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:Og,label:n,onClick:()=>o(!t),disabled:r})},zg=function(e){const{label:t=(0,h.__)("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!==va.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},Vg=(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"})),Hg=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,h.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,h.__)("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:Vg,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)(Ad,{clientId:e})),(0,s.createElement)(wo,{icon:Vg,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Ad,{clientId:r})))};function Ug(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:h,isParentHighlighted:g}=(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":g,"is-dragging-blocks":h});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 Gg=()=>(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"})),Wg=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)(Gg,null)))},$g=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,h.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==va.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(Wg,null)))}))}};var jg=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:$g(n),renderContent:()=>t})},Kg=(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 qg=na(p.__experimentalTreeGridRow);function Yg(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=la({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(qg,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function Zg(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:Vg}))}var Xg=(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:g,onFocus:v,onDragStart:b,onDragEnd:_,draggable:k}=t;const y=Ld(r),E=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,C=((e,t,n)=>(0,h.sprintf)(
|
67 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
68 |
-
(0,h.__)("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!==va.ENTER&&e.keyCode!==va.SPACE||(e.preventDefault(),i(e))},"aria-describedby":E,ref:n,tabIndex:g,onFocus:v,onDragStart:e=>{e.dataTransfer.clearData(),b(e)},onDragEnd:
|
69 |
-
(0,h.__)("Options for %s block"),H.title);return(0,s.createElement)(
|
70 |
-
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var mv=(0,s.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(zn).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(pv,i({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:l}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,h.__)("List view")),(0,s.createElement)(dv,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function fv(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=ap(o,r,n),i=(0,s.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,s.createElement)(fu,{item:i,isStylePreview:!0})}function hv(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}function gv(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:f}=up({clientId:t,onSwitch:n}),[h,g]=(0,s.useState)(null),[v,b]=(0,s.useState)(0),_=(0,d.useViewportMatch)("medium","<");if((0,s.useLayoutEffect)((()=>{const e=document.querySelector(".interface-interface-skeleton__content"),t=(null==e?void 0:e.scrollTop)||0;b(t+16)}),[h]),!i||0===i.length)return null;const k=(0,u.debounce)(g,250),y=e=>{l(e),o(null),g(null),k.cancel()},E=e=>{var t;h!==e?(k(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):k.cancel()};return(0,s.createElement)("div",{className:"block-editor-block-styles"},(0,s.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":a.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>E(e),onFocus:()=>E(e),onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:t=>{va.ENTER!==t.keyCode&&va.SPACE!==t.keyCode||(t.preventDefault(),y(e))},onClick:()=>y(e),role:"button",tabIndex:"0"},(0,s.createElement)(p.__experimentalText,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),h&&!_&&(0,s.createElement)(hv,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>E(null)},(0,s.createElement)(fv,{activeStyle:a,className:f,genericPreviewBlock:m,style:h})))}gv.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var vv=gv,bv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),_v=function(e){let{icon:t=bv,label:n=(0,h.__)("Choose variation"),instructions:o=(0,h.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,s.createElement)(p.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,h.__)("Block variations")},r.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(p.Button,{variant:"link",onClick:()=>l()},(0,h.__)("Skip"))))},kv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const yv="carousel",Ev="grid",Cv=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{onClick:t},(0,h.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:n},(0,h.__)("Choose")))},Sv=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(p.Button,{icon:Hd,label:(0,h.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:Vd,label:(0,h.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var wv=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===yv,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:to,label:(0,h.__)("Carousel view"),onClick:()=>n(yv),isPressed:u}),(0,s.createElement)(p.Button,{icon:kv,label:(0,h.__)("Grid view"),onClick:()=>n(Ev),isPressed:t===Ev}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(Sv,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(Cv,{onBlockPatternSelect:a,onStartBlank:c}))};const Bv=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r}=e;const l=(0,p.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===yv){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:a},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(xv,{className:e.get(n)||"",key:t.name,pattern:t})))))}return(0,s.createElement)(p.__unstableComposite,i({},l,{role:"listbox",className:a,"aria-label":(0,h.__)("Patterns list")}),o.map((e=>(0,s.createElement)(Iv,{key:e.name,pattern:e,onSelect:r,composite:l}))))};function Iv(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,title:a,description:c,viewportWidth:u=700}=t,m=(0,d.useInstanceId)(Iv,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?m:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(pu,{blocks:l,viewportWidth:u}),(0,s.createElement)("div",{className:`${r}__item-title`},a)),!!c&&(0,s.createElement)(p.VisuallyHidden,{id:m},c))}function xv(e){let{className:t,pattern:n}=e;const{blocks:o,title:r,description:l}=n,i=(0,d.useInstanceId)(xv,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":r,"aria-describedby":l?i:void 0},(0,s.createElement)(pu,{blocks:o,__experimentalLive:!0}),!!l&&(0,s.createElement)(p.VisuallyHidden,{id:i},l))}var Tv=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(yv),[u,d]=(0,s.useState)(0),[p,f]=(0,s.useState)(!1),{replaceBlock:h}=(0,m.useDispatch)(zn),g=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(zn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o);if(null==g||!g.length||p)return l;const v=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));h(t,n)});return(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,s.createElement)(wv,{viewMode:a,setViewMode:c,activeSlide:u,totalSlides:g.length,handleNext:()=>{d((e=>e+1))},handlePrevious:()=>{d((e=>e-1))},onBlockPatternSelect:()=>{v(g[u].blocks)},onStartBlank:()=>{f(!0)}}),(0,s.createElement)(Bv,{viewMode:a,activeSlide:u,patterns:g,onBlockPatternSelect:v}))};const Nv=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&(0,u.isMatch)(e,n)}));return 1===n.length?n[0]:void 0};var Pv=function(e){let{blockClientId:t}=e;const[n,o]=(0,s.useState)(),{updateBlockAttributes:l}=(0,m.useDispatch)(zn),{variations:i,blockAttributes:a}=(0,m.useSelect)((e=>{const{getBlockVariations:n}=e(r.store),{getBlockName:o,getBlockAttributes:l}=e(zn),i=t&&o(t);return{variations:i&&n(i,"transform"),blockAttributes:l(t)}}),[t]);if((0,s.useEffect)((()=>{var e;o(null===(e=Nv(a,i))||void 0===e?void 0:e.name)}),[a,i]),null==i||!i.length)return null;const c=i.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}})),u=e=>{l(t,{...i.find((t=>{let{name:n}=t;return n===e})).attributes})},d="block-editor-block-variation-transforms";return(0,s.createElement)(p.DropdownMenu,{className:d,label:(0,h.__)("Transform to variation"),text:(0,h.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${d}__popover`},icon:Gd,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${d}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:c,value:n,onSelect:u})))))};const Mv=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Rv=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Lv={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,h._x)("Align top","Block vertical alignment setting")},center:{icon:Rv,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Mv,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},Av=["top","center","bottom"],Dv={isAlternate:!0};var Ov=function(e){let{value:t,onChange:n,controls:o=Av,isCollapsed:r=!0,isToolbar:l}=e;const a=Lv[t],c=Lv.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:Dv,icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Lv[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};function Fv(e){return(0,s.createElement)(Ov,i({},e,{isToolbar:!1}))}function zv(e){return(0,s.createElement)(Ov,i({},e,{isToolbar:!0}))}var Vv=(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette"),o=!mo("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,u.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),Hv=Vv(p.ColorPalette);function Uv(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(_m,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var Gv=function(e,t){return(Gv=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])})(e,t)},Wv=function(){return(Wv=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}).apply(this,arguments)};function $v(e,t,n,o){void 0===o&&(o=0);var r=nb(e,t,o),l=r.width,i=r.height;return e>=t*n&&l>t*n?{width:t*n,height:t}:l>t*n?{width:e,height:e/n}:l>i*n?{width:i*n,height:i}:{width:l,height:l/n}}function jv(e,t,n,o,r){void 0===r&&(r=0);var l=nb(t.width,t.height,r),i=l.width,s=l.height;return{x:Kv(e.x,i,n.width,o),y:Kv(e.y,s,n.height,o)}}function Kv(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function qv(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Yv(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Zv(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?Xv:Qv,a={x:s(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:s(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:s(100,n.width/t.width*100/r),height:s(100,n.height/t.height*100/r)},c=Math.round(s(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(s(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:a,croppedAreaPixels:Wv(Wv({},d),{x:Math.round(s(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(s(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function Xv(e,t){return Math.min(e,Math.max(0,t))}function Qv(e,t){return t}function Jv(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function eb(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function tb(e,t,n,o,r){var l=Math.cos,i=Math.sin,s=r*Math.PI/180;return[(e-n)*l(s)-(t-o)*i(s)+n,(e-n)*i(s)+(t-o)*l(s)+o]}function nb(e,t,n){var o=e/2,r=t/2,l=[tb(0,0,o,r,n),tb(e,0,o,r,n),tb(e,t,o,r,n),tb(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),s=Math.max.apply(Math,l.map((function(e){return e[0]}))),a=Math.min.apply(Math,l.map((function(e){return e[1]})));return{width:s-i,height:Math.max.apply(Math,l.map((function(e){return e[1]})))-a}}function ob(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var rb=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=Jv(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l=n.imageRef||n.videoRef;if(l){n.mediaSize={width:l.offsetWidth,height:l.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var i=n.props.cropSize?n.props.cropSize:$v(l.offsetWidth,l.offsetHeight,n.props.aspect,n.props.rotation);n.setState({cropSize:i},n.recomputeCropPosition)}n.containerRef&&(n.containerRect=n.containerRef.getBoundingClientRect())},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){e.preventDefault(),document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=Wv({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?jv(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=n.props.zoom-e.deltaY*n.props.zoomSpeed/200;n.setNewZoom(r,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},s=n.props.restrictPosition?jv(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.emitCropData=function(){if(n.state.cropSize){var e=Zv(n.props.restrictPosition?jv(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition),t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?jv(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function __(){this.constructor=e}Gv(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&this.styleRef.remove(),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():e.cropSize!==this.props.cropSize&&this.computeSizes(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=qv(n,o),this.lastPinchRotation=Yv(n,o),this.onDragStart(eb(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=eb(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=qv(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=Yv(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.crop,i=l.x,s=l.y,a=t.rotation,c=t.zoom,u=t.cropShape,d=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,h=p.mediaStyle,g=t.classes,v=g.containerClassName,b=g.cropAreaClassName,_=g.mediaClassName;return Gr().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:ob("reactEasyCrop_Container",v)},n?Gr().createElement("img",Wv({alt:"",className:ob("reactEasyCrop_Image",_)},r,{src:n,ref:function(t){return e.imageRef=t},style:Wv(Wv({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&Gr().createElement("video",Wv({autoPlay:!0,loop:!0,muted:!0,className:ob("reactEasyCrop_Video",_)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:Wv(Wv({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&Gr().createElement("div",{style:Wv(Wv({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:ob("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",b)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(Gr().Component);const lb={position:"bottom right",isAlternate:!0};var ib=window.wp.apiFetch,sb=n.n(ib);const ab=(0,s.createContext)({}),cb=()=>(0,s.useContext)(ab);function ub(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:i,onFinishEditing:a,onSaveImage:c,children:u}=e;const d=function(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)({x:0,y:0}),[p,m]=(0,s.useState)(),[f,h]=(0,s.useState)(),[g,v]=(0,s.useState)(),[b,_]=(0,s.useState)(),k=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),h(0),v(n/o),_(n/o)}),[n,o,d,m,h,v,_]),y=(0,s.useCallback)((()=>{const e=(f+90)%360;let r=n/o;if(f%180==90&&(r=o/n),0===e)return i(),h(e),v(1/g),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),h(e),v(1/g),d({x:-u.y*r,y:u.x*r})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof a&&(s.crossOrigin=a)}),[f,n,o,i,h,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:h,rotateClockwise:y,aspect:g,setAspect:v,defaultAspect:b,initializeTransformValues:k})),[r,i,a,c,u,d,p,m,f,h,y,g,v,b,k])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:n,naturalWidth:o,naturalHeight:r},i),p=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:d}=(0,m.useDispatch)(Pu.store),[p,f]=(0,s.useState)(!1),g=(0,s.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,s.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,sb()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,h.sprintf)(
|
71 |
/* translators: 1. Error message */
|
72 |
-
(0,h.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{f(!1),u()}))}),[f,t,n,o,r,l,i,c,d,f,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:g})),[p,v,g])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),f=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(ab.Provider,{value:f},u)}function db(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:a,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:h,setCrop:g,setZoom:v,rotation:b}=cb();let _=o||r*l/i;return b%180==90&&(_=r*i/l),(0,s.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":a}),style:{width:n||r,height:_}},(0,s.createElement)(rb,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:h,onCropComplete:e=>{g(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var pb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function mb(){const{isInProgress:e,zoom:t,setZoom:n}=cb();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:lb,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:pb,label:(0,h.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,h.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var fb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function hb(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,s.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,s.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?lp:void 0},t)})))}function gb(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=cb();return(0,s.createElement)(p.DropdownMenu,{icon:fb,label:(0,h.__)("Aspect Ratio"),popoverProps:lb,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(hb,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("Original"),aspect:l},{title:(0,h.__)("Square"),aspect:1}]}),(0,s.createElement)(hb,{label:(0,h.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("16:10"),aspect:1.6},{title:(0,h.__)("16:9"),aspect:16/9},{title:(0,h.__)("4:3"),aspect:4/3},{title:(0,h.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(hb,{label:(0,h.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("10:16"),aspect:.625},{title:(0,h.__)("9:16"),aspect:9/16},{title:(0,h.__)("3:4"),aspect:3/4},{title:(0,h.__)("2:3"),aspect:2/3}]}))}))}var vb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function bb(){const{isInProgress:e,rotateClockwise:t}=cb();return(0,s.createElement)(p.ToolbarButton,{icon:vb,label:(0,h.__)("Rotate"),onClick:t,disabled:e})}function _b(){const{isInProgress:e,apply:t,cancel:n}=cb();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,h.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,h.__)("Cancel")))}function kb(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(db,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(Yn,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(mb,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(gb,{toggleProps:e}))),(0,s.createElement)(bb,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(_b,null))))}const yb=[25,50,75,100];function Eb(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:g,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,c);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(o)&&(0,s.createElement)(p.SelectControl,{label:(0,h.__)("Image size"),value:l,options:o,onChange:d}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,h.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,h.__)("Width"),value:f,min:1,onChange:e=>g("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,h.__)("Height"),value:m,min:1,onChange:e=>g("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,h.__)("Image size presets")},yb.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,s.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,h.__)("Reset")))))}var Cb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(O.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),Sb=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Currently selected link settings")),l)};class wb extends s.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,s.createRef)(),this.inputRef=(0,s.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,ya()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!r&&(t.length<2||!o&&(0,ld.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(t,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,h.sprintf)(
|
73 |
/* translators: %s: number of results. */
|
74 |
-
(0,h._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,h.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===l&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=l}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case va.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case va.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case va.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case va.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case va.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case va.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,h.__)("Link selected.")));break;case va.ENTER:null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:o,disableSuggestions:r,__experimentalShowInitialSuggestions:l=!1}=e,{showSuggestions:i}=t,s=i;const a=n&&n.length;return l||a||(s=!1),!0===r&&(s=!1),{showSuggestions:s,suggestionsListboxId:`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${o}`}}render(){return(0,s.createElement)(s.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,h.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:a,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:f}=this.state,g={id:`url-input-control-${o}`,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},v={value:i,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:r,onKeyDown:this.onKeyDown,role:"combobox","aria-label":(0,h.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(g,v,a):(0,s.createElement)(p.BaseControl,g,(0,s.createElement)("input",v),a&&(0,s.createElement)(p.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:l,selectedSuggestion:a,suggestionsListboxId:d,suggestionOptionIdPrefix:m,loading:f}=this.state,h={id:d,ref:this.autocompleteRef,role:"listbox"},g=(e,t)=>({role:"option",tabIndex:"-1",id:`${m}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===a});return(0,u.isFunction)(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:a,suggestionsListProps:h,buildSuggestionItemProps:g,isLoading:f,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!(0,u.isFunction)(t)&&r&&l.length?(0,s.createElement)(p.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},(0,s.createElement)("div",i({},h,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,s.createElement)(p.Button,i({},g(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===a}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var
|
75 |
/* translators: %s: search term. */
|
76 |
-
(0,h.__)("Create: <mark>%s</mark>"),n),{mark:(0,s.createElement)("mark",null)}),(0,s.createElement)(p.Button,i({},r,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,s.createElement)(wo,{className:"block-editor-link-control__search-item-icon",icon:Fa}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null},
|
77 |
/* translators: %s: search term. */
|
78 |
-
(0,h.__)('Search results for "%s"'),o),w=(0,s.createElement)(f?s.Fragment:p.VisuallyHidden,{},(0,s.createElement)("span",{className:"block-editor-link-control__search-results-label",id:C},S));return(0,s.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},w,(0,s.createElement)("div",i({},l,{className:b,"aria-labelledby":C}),u.map(((e,t)=>y&&Nb===e.type?(0,s.createElement)(Ib,{searchTerm:o,buttonText:g,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===d}):Nb===e.type?null:(0,s.createElement)(Tb,{key:`${e.id}-${e.type}`,itemProps:a(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:_.includes(e.type.toLowerCase()),searchTerm:o,shouldShowType:E})))))}function Rb(e){const t=(0,u.startsWith)(e,"#");return(0,ld.isURL)(e)||e&&e.includes("www.")||t}const Lb=()=>Promise.resolve([]),Ab=e=>{let t="URL";const n=(0,ld.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,ld.prependHTTP)(e):e,type:t}])};const Db=()=>Promise.resolve([]),Ob=(0,s.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:a=!1,onCreateSuggestion:p=u.noop,onChange:f=u.noop,onSelect:g=u.noop,showSuggestions:v=!0,renderSuggestions:b=(e=>(0,s.createElement)(Mb,e)),fetchSuggestions:_=null,allowDirectEntry:k=!0,showInitialSuggestions:y=!1,suggestionsQuery:E={},withURLSuggestion:C=!0,createSuggestionButtonText:S,useLabel:w=!1}=e;const B=function(e,t,n,o){const{fetchSearchSuggestions:r}=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return{fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),l=t?Ab:Lb;return(0,s.useCallback)(((t,i)=>{let{isInitialSuggestions:s}=i;return Rb(t)?l(t,{isInitialSuggestions:s}):(async(e,t,n,o,r,l)=>{const{isInitialSuggestions:i}=t;let s=await Promise.all([n(e,t),o(e)]);return s=e.includes(" ")||!l||i?s[0]:s[0].concat(s[1]),i||Rb(e)||!r?s:s.concat({title:e,url:e,type:Nb})})(t,{...e,isInitialSuggestions:s},r,l,n,o)}),[l,r,n])}(E,k,a,C),I=v?_||B:Db,x=(0,d.useInstanceId)(Ob),[T,N]=(0,s.useState)(),P=async e=>{let t=e;if(Nb!==e.type)(k||t&&Object.keys(t).length>=1)&&g({...(0,u.omit)(r,"id","url"),...t},t);else try{var n;t=await p(e.title),null!==(n=t)&&void 0!==n&&n.url&&g(t)}catch(e){}},M=c()(l,{"has-no-label":!w});return(0,s.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,s.createElement)(Bb,{label:w?"URL":void 0,className:M,value:n,onChange:(e,t)=>{f(e),N(t)},placeholder:null!=i?i:(0,h.__)("Search or type url"),__experimentalRenderSuggestions:v?e=>b({...e,instanceId:x,withCreateSuggestion:a,currentInputValue:n,createSuggestionButtonText:S,suggestionsQuery:E,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),P(t)}}):null,__experimentalFetchLinkSuggestions:I,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:y,onSubmit:(e,t)=>{var o;const r=e||T;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?P(r||{url:n}):t.preventDefault()},ref:t}),o)}));var Fb=Ob,zb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),Vb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));const{Slot:Hb,Fill:Ub}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function Gb(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function Wb(e){let{value:t,onEditClick:n,hasRichPreviews:o=!1,hasUnlinkControl:r=!1,onRemove:l}=e;const i=o?null==t?void 0:t.url:null,{richData:a,isFetching:u}=function(e){const[t,n]=(0,s.useReducer)(Gb,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,s.useEffect)((()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t}(i),d=a&&Object.keys(a).length,f=t&&(0,ld.filterURLForDisplay)((0,ld.safeDecodeURI)(t.url),16)||"",g=(null==a?void 0:a.title)||(null==t?void 0:t.title)||f,v=!t.url.length;let b;return b=null!=a&&a.icon?(0,s.createElement)("img",{src:null==a?void 0:a.icon,alt:""}):v?(0,s.createElement)(wo,{icon:zb,size:32}):(0,s.createElement)(wo,{icon:xb}),(0,s.createElement)("div",{"aria-label":(0,h.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":d,"is-fetching":!!u,"is-preview":!0,"is-error":v})},(0,s.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:c()("block-editor-link-control__search-item-icon",{"is-image":null==a?void 0:a.icon})},b),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-details"},v?(0,s.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,h.__)("Link is empty")):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ExternalLink,{className:"block-editor-link-control__search-item-title",href:t.url},(0,rr.__unstableStripHTML)(g)),(null==t?void 0:t.url)&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},f)))),(0,s.createElement)(p.Button,{icon:Vb,label:(0,h.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:n,iconSize:24}),r&&(0,s.createElement)(p.Button,{icon:Fm,label:(0,h.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:l,iconSize:24}),(0,s.createElement)(Hb,{fillProps:t})),(d&&((null==a?void 0:a.image)||(null==a?void 0:a.description))||u)&&(0,s.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==a?void 0:a.image)||u)&&(0,s.createElement)("div",{"aria-hidden":!(null!=a&&a.image),className:c()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=a&&a.image)})},(null==a?void 0:a.image)&&(0,s.createElement)("img",{src:null==a?void 0:a.image,alt:""})),((null==a?void 0:a.description)||u)&&(0,s.createElement)("div",{"aria-hidden":!(null!=a&&a.description),className:c()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=a&&a.description)})},(null==a?void 0:a.description)&&(0,s.createElement)(p.__experimentalText,{truncate:!0,numberOfLines:"2"},a.description))))}function $b(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=Pb,onChange:a=u.noop,onRemove:d,noDirectEntry:m=!1,showSuggestions:f=!0,showInitialSuggestions:g,forceIsEditingLink:v,createSuggestion:b,withCreateSuggestion:_,inputValue:k="",suggestionsQuery:y={},noURLSuggestion:E=!1,createSuggestionButtonText:C,hasRichPreviews:S=!1,hasTextControl:w=!1,renderControlBottom:B=null}=e;void 0===_&&b&&(_=!0);const I=(0,s.useRef)(!0),x=(0,s.useRef)(),T=(0,s.useRef)(),[N,P]=(0,s.useState)((null==l?void 0:l.url)||""),[M,R]=(0,s.useState)((null==l?void 0:l.title)||""),L=k||N,[A,D]=(0,s.useState)(void 0!==v?v:!l||!l.url),O=(0,s.useRef)(!1),F=!(null!=L&&null!==(t=L.trim())&&void 0!==t&&t.length);function z(){var e;O.current=!(null===(e=x.current)||void 0===e||!e.contains(x.current.ownerDocument.activeElement)),D(!1)}(0,s.useEffect)((()=>{void 0!==v&&v!==A&&D(v)}),[v]),(0,s.useEffect)((()=>{if(I.current)return void(I.current=!1);const e=null!=T&&T.current?1:0;(rr.focus.focusable.find(x.current)[e]||x.current).focus(),O.current=!1}),[A]),(0,s.useEffect)((()=>{null!=l&&l.title&&l.title!==M&&R(l.title),null!=l&&l.url&&P(l.url)}),[l]);const{createPage:V,isCreatingPage:H,errorMessage:U}=function(e){const t=(0,s.useRef)(),[n,o]=(0,s.useState)(!1),[r,l]=(0,s.useState)(null);return(0,s.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=(e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,h.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(b),G=()=>{L===(null==l?void 0:l.url)&&M===(null==l?void 0:l.title)||a({url:L,title:M}),z()},W=d&&l&&!A&&!H,$=!(null==i||!i.length),j=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&w;return(0,s.createElement)("div",{tabIndex:-1,ref:x,className:"block-editor-link-control"},H&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(p.Spinner,null)," ",(0,h.__)("Creating"),"…"),(A||!l)&&!H&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:c()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":j})},j&&(0,s.createElement)(p.TextControl,{ref:T,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:M,onChange:R,onKeyDown:e=>{const{keyCode:t}=e;t!==va.ENTER||F||(e.preventDefault(),G())}}),(0,s.createElement)(Fb,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:L,withCreateSuggestion:_,onCreateSuggestion:V,onChange:P,onSelect:e=>{a({...e,title:M||(null==e?void 0:e.title)}),z()},showInitialSuggestions:g,allowDirectEntry:!m,showSuggestions:f,suggestionsQuery:y,withURLSuggestion:!E,createSuggestionButtonText:C,useLabel:j},(0,s.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,s.createElement)(p.Button,{onClick:G,label:(0,h.__)("Submit"),icon:Cb,className:"block-editor-link-control__search-submit",disabled:F})))),U&&(0,s.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},U)),l&&!A&&!H&&(0,s.createElement)(Wb,{key:null==l?void 0:l.url,value:l,onEditClick:()=>D(!0),hasRichPreviews:S,hasUnlinkControl:W,onRemove:d}),$&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},(0,s.createElement)(Sb,{value:l,settings:i,onChange:a})),B&&B())}$b.ViewerFill=Ub;var jb=$b,Kb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})),qb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),Yb=(0,p.withFilters)("editor.MediaUpload")((()=>null)),Zb=function(e){let{fallback:t=null,children:n}=e;return(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return!!t().mediaUpload}),[])?n:t},Xb=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Pu.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,allowedTypes:o,accept:r,onSelect:l,onSelectURL:i,onFilesUpload:a=u.noop,onCloseModal:c=u.noop,name:d=(0,h.__)("Replace"),createNotice:f,removeNotice:g,children:v}=e;const[b,_]=(0,s.useState)(t),k=(0,m.useSelect)((e=>e(zn).getSettings().mediaUpload),[]),y=(0,s.createRef)(),E=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),C=e=>{const t=document.createElement("div");t.innerHTML=(0,s.renderToString)(e);const n=t.textContent||t.innerText||"";setTimeout((()=>{f("error",n,{speak:!0,id:E,isDismissible:!0})}),1e3)},S=e=>{_(e.url),l(e),(0,Nt.speak)((0,h.__)("The media file has been replaced")),g(E)},w=e=>{e.keyCode===va.DOWN&&(e.preventDefault(),e.target.click())};return(0,s.createElement)(p.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{ref:y,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:w},d)},renderContent:e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,s.createElement)(Yb,{value:n,onSelect:e=>S(e),allowedTypes:o,onClose:c,render:e=>{let{open:t}=e;return(0,s.createElement)(p.MenuItem,{icon:Kb,onClick:t},(0,h.__)("Open Media Library"))}}),(0,s.createElement)(Zb,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{(e=>{const t=e.target.files;a(t),k({allowedTypes:o,filesList:t,onFileChange:e=>{let[t]=e;S(t)},onError:C})})(e)},accept:r,render:e=>{let{openFileDialog:t}=e;return(0,s.createElement)(p.MenuItem,{icon:qb,onClick:()=>{t()}},(0,h.__)("Upload"))}})),v),i&&(0,s.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,s.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,h.__)("Current media URL:")),(0,s.createElement)(jb,{value:{url:b},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;_(t),i(t),y.current.focus()}})))}})}));function Qb(e){let{url:t,urlLabel:n,className:o}=e;const r=c()(o,"block-editor-url-popover__link-viewer-url");return t?(0,s.createElement)(p.ExternalLink,{className:r,href:t},n||(0,ld.filterURLForDisplay)((0,ld.safeDecodeURI)(t))):(0,s.createElement)("span",{className:r})}function Jb(e){let{additionalControls:t,children:n,renderSettings:o,position:r="bottom center",focusOnMount:l="firstElement",...a}=e;const[c,u]=(0,s.useState)(!1),d=!!o&&c;return(0,s.createElement)(p.Popover,i({className:"block-editor-url-popover",focusOnMount:l,position:r},a),(0,s.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,s.createElement)("div",{className:"block-editor-url-popover__row"},n,!!o&&(0,s.createElement)(p.Button,{className:"block-editor-url-popover__settings-toggle",icon:Gd,label:(0,h.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c})),d&&(0,s.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),t&&!d&&(0,s.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}Jb.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,s.createElement)("form",i({className:c()("block-editor-url-popover__link-editor",n)},l),(0,s.createElement)(Bb,{value:r,onChange:o,autocompleteRef:t}),(0,s.createElement)(p.Button,{icon:Cb,label:(0,h.__)("Apply"),type:"submit"}))},Jb.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:l,...a}=e;return(0,s.createElement)("div",i({className:c()("block-editor-url-popover__link-viewer",t)},a),(0,s.createElement)(Qb,{url:r,urlLabel:l,className:n}),o&&(0,s.createElement)(p.Button,{icon:Vb,label:(0,h.__)("Edit"),onClick:o}))};var e_=Jb;const t_=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,s.createElement)(e_,{onClose:r},(0,s.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},(0,s.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,h.__)("URL"),placeholder:(0,h.__)("Paste or type URL"),onChange:n,value:t}),(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:Cb,label:(0,h.__)("Apply"),type:"submit"})))};var n_=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:a,isAppender:d,accept:f,addToGallery:g,multiple:v=!1,handleUpload:b=!0,dropZoneUIOnly:_,disableDropZone:k,disableMediaButtons:y,onError:E,onSelect:C,onCancel:S,onSelectURL:w,onDoubleClick:B,onFilesPreUpload:I=u.noop,onHTMLDrop:x=u.noop,onClose:T=u.noop,children:N,mediaLibraryButton:P,placeholder:M,style:R}=e;const L=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return t().mediaUpload}),[]),[A,D]=(0,s.useState)(""),[O,F]=(0,s.useState)(!1);(0,s.useEffect)((()=>{var e;D(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const z=e=>{D(e.target.value)},V=()=>{F(!0)},H=()=>{F(!1)},U=e=>{e.preventDefault(),A&&w&&(w(A),H())},G=e=>{if(!b)return C(e);let o;if(I(e),v)if(g){let e=[];o=n=>{const o=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));C(o.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=C;else o=e=>{let[t]=e;return C(t)};L({allowedTypes:n,filesList:e,onFileChange:o,onError:E})},W=e=>{G(e.target.files)},$=null!=M?M:e=>{let{instructions:t,title:u}=l;if(L||w||(t=(0,h.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===u){const e=null!=n?n:[],[o]=e,r=1===e.length,l=r&&"audio"===o,i=r&&"image"===o,s=r&&"video"===o;void 0===t&&L&&(t=(0,h.__)("Upload a media file or pick one from your media library."),l?t=(0,h.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,h.__)("Upload an image file, pick one from your media library, or add one with a URL."):s&&(t=(0,h.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=(0,h.__)("Media"),l?u=(0,h.__)("Audio"):i?u=(0,h.__)("Image"):s&&(u=(0,h.__)("Video")))}const m=c()("block-editor-media-placeholder",o,{"is-appender":d});return(0,s.createElement)(p.Placeholder,{icon:r,label:u,instructions:t,className:m,notices:a,onDoubleClick:B,preview:i,style:R},e,N)},j=()=>k?null:(0,s.createElement)(p.DropZone,{onFilesDrop:G,onHTMLDrop:x}),K=()=>S&&(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,h.__)("Cancel"),variant:"link",onClick:S},(0,h.__)("Cancel")),q=()=>w&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:V,isPressed:O,variant:"tertiary"},(0,h.__)("Insert from URL")),O&&(0,s.createElement)(t_,{src:A,onChange:z,onSubmit:U,onClose:H}));return _||y?(_&&Rt()("wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop",{since:"5.4",alternative:"disableMediaButtons"}),(0,s.createElement)(Zb,null,j())):(0,s.createElement)(Zb,{fallback:$(q())},(()=>{const e=null!=P?P:e=>{let{open:t}=e;return(0,s.createElement)(p.Button,{variant:"tertiary",onClick:()=>{t()}},(0,h.__)("Media Library"))},o=(0,s.createElement)(Yb,{addToGallery:g,gallery:v&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:v,onSelect:C,onClose:T,allowedTypes:n,value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(L&&d)return(0,s.createElement)(s.Fragment,null,j(),(0,s.createElement)(p.FormFileUpload,{onChange:W,accept:f,multiple:v,render:e=>{let{openFileDialog:t}=e;const n=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,h.__)("Upload")),o,q(),K());return $(n)}}));if(L){const e=(0,s.createElement)(s.Fragment,null,j(),(0,s.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:W,accept:f,multiple:v},(0,h.__)("Upload")),o,q(),K());return $(e)}return $(o)})())})),o_=e=>{let{colorSettings:t,...n}=e;const o=t.map((e=>{let{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,s.createElement)(gf,i({settings:o,gradients:[],disableCustomGradients:!0},n))};const r_={position:"bottom right",isAlternate:!0};var l_=()=>(0,s.createElement)(s.Fragment,null,["bold","italic","link"].map((e=>(0,s.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,s.createElement)(p.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,s.createElement)(p.ToolbarItem,null,(n=>(0,s.createElement)(p.DropdownMenu,{icon:Gd
|
79 |
-
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("More"),toggleProps:{...n,className:c()(n.className,{"is-pressed":t}),describedBy:(0,h.__)("Displays more block tools")},controls:(0,u.orderBy)(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:r_})))}))),i_=e=>{let{inline:t,anchorRef:n}=e;return t?(0,s.createElement)(p.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:n,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,s.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(l_,null)))):(0,s.createElement)(Yn,{group:"inline"},(0,s.createElement)(l_,null))};function s_(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(zn);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==va.DELETE&&o!==va.BACKSPACE&&o!==va.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function a_(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>`<img src="${(0,Ep.createBlobURL)(e)}">`)).join("")}var c_=window.wp.shortcode;function u_(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function d_(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function p_(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?p_.EMPTY_ARRAY:t||n?t||(Rt()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats"}),n.map((e=>`core/${e}`))):void 0}function m_(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const s=[],[a,c]=(0,Pt.split)(t),u=n.length>0;let d=-1;const p=(0,Pt.isEmpty)(a)&&!(0,Pt.isEmpty)(c);u&&(0,Pt.isEmpty)(a)||(s.push(r((0,Pt.toHTMLString)({value:a,multilineTag:i}),!p)),d+=1),u?(s.push(...n),d+=n.length):l&&s.push(l()),(u||l)&&(0,Pt.isEmpty)(c)||s.push(r((0,Pt.toHTMLString)({value:c,multilineTag:i}),p)),o(s,u?d:1,u?-1:0)}function f_(e,t){return t?(0,Pt.replace)(e,/\n+/g,Pt.__UNSTABLE_LINE_SEPARATOR):(0,Pt.replace)(e,new RegExp(Pt.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function h_(e){const t=(0,s.useRef)(e);return t.current=e,(0,d.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:l,value:i,formatTypes:s,tagName:a,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:f,pastePlainText:h}=t.current;if(!n)return void e.preventDefault();const{clipboardData:g}=e;let v="",b="";try{v=g.getData("text/plain"),b=g.getData("text/html")}catch(e){try{b=g.getData("Text")}catch(e){return}}if(b=function(e){return e.replace(/.*<!--StartFragment-->/s,"").replace(/<!--EndFragment-->.*/s,"")}(b),b=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(t.length):e}(b),e.preventDefault(),window.console.log("Received HTML:\n\n",b),window.console.log("Received plain text:\n\n",v),o)return void l((0,Pt.insert)(i,v));const _=s.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:b,plainText:v})),e}),i);if(_!==i)return void l(_);const k=[...(0,rr.getFilesFromDataTransfer)(g)];if("true"===g.getData("rich-text")){const e=g.getData("rich-text-multi-line-tag")||void 0;let t=(0,Pt.create)({html:b,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:f});return t=f_(t,!!m),u_(t,i.activeFormats),void l((0,Pt.insert)(i,t))}if(h)return void l((0,Pt.insert)(i,(0,Pt.create)({text:v})));if(k&&k.length&&!b){const e=(0,r.pasteHandler)({HTML:a_(k),mode:"BLOCKS",tagName:a,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",k),void(c&&(0,Pt.isEmpty)(i)?c(e):m_({value:i,pastedBlocks:e,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,Pt.isEmpty)(i)&&(E=v,(0,c_.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,Pt.isEmpty)(i)&&(0,ld.isURL)(v.trim())&&(y="BLOCKS");const C=(0,r.pasteHandler)({HTML:b,plainText:v,mode:y,tagName:a,preserveWhiteSpace:f});if("string"==typeof C){let e=(0,Pt.create)({html:C});e=f_(e,!!m),u_(e,i.activeFormats),l((0,Pt.insert)(i,e))}else C.length>0&&(c&&(0,Pt.isEmpty)(i)?c(C,C.length-1,-1):m_({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function g_(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(zn),o=(0,s.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function l(){const{value:e,onReplace:t}=o.current;if(!t)return;const{start:l,text:i}=e;if(" "!==i.slice(l-1,l))return;const s=i.slice(0,l).trim(),a=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),c=(0,r.findTransform)(a,(e=>{let{prefix:t}=e;return s===t}));if(!c)return;const u=(0,Pt.toHTMLString)({value:(0,Pt.slice)(e,l,i.length)});t([c.transform(u)]),n()}function i(e){const{inputType:r,type:i}=e,{value:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==r&&"compositionend"!==i)return;c&&l&&l();const d=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<t.length||o.slice(n-t.length,n).toLowerCase()!==t?e:(0,Pt.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(s));d!==s&&(t(),a({...d,activeFormats:s.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function v_(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(zn),n=(0,s.useRef)(e);return n.current=e,(0,d.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:l,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;if(e.keyCode!==va.ENTER)return;e.preventDefault();const m={...l};m.formats=o(l);const f=i&&s;if(i){const e=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,r.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(i([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,Pt.insert)(m,"\n")):f&&(0,Pt.__unstableIsEmptyLine)(m)?m_({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c}):u((0,Pt.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!f&&!r?d||u((0,Pt.insert)(m,"\n")):!f&&r?p():f&&m_({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function b_(e){return e(Pt.store).getFormatTypes()}p_.EMPTY_ARRAY=[];const k_=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function y_(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function E_(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function C_(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:l}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const a=(0,Pt.getActiveFormat)(r,t);let c=void 0!==a;const d=(0,Pt.getActiveObject)(r),p=void 0!==d&&d.type===t;if("core/link"===t&&!(0,Pt.isCollapsed)(r)){const e=r.formats,t=(0,u.find)(e[r.start],{type:"core/link"}),n=(0,u.find)(e[r.end-1],{type:"core/link"});t&&n&&t===n||(c=!1)}return(0,s.createElement)(i,{key:t,isActive:c,activeAttributes:c&&a.attributes||{},isObjectActive:p,activeObjectAttributes:p&&d.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const S_=(0,s.createContext)(),w_=(0,s.createContext)(),B_=(0,s.forwardRef)((function e(t,n){let{children:o,tagName:l="div",value:a="",onChange:f,isSelected:h,multiline:g,inlineToolbar:v,wrapperClassName:b,autocompleters:_,onReplace:k,placeholder:y,allowedFormats:E,formattingControls:C,withoutInteractiveFormatting:S,onRemove:w,onMerge:B,onSplit:I,__unstableOnSplitAtEnd:x,__unstableOnSplitMiddle:T,identifier:N,preserveWhiteSpace:P,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:R,__unstableDisableFormats:L,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:O,...F}=t;const z=(0,d.useInstanceId)(e);N=N||z,F=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(F);const V=(0,s.useRef)(),{clientId:H}=Gn(),{selectionStart:U,selectionEnd:G,isSelected:W,disabled:$}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n,isMultiSelecting:o,hasMultiSelection:r}=e(zn),l=t(),i=n();let s;return void 0===h?s=l.clientId===H&&l.attributeKey===N:h&&(s=l.clientId===H),{selectionStart:s?l.offset:void 0,selectionEnd:s?i.offset:void 0,isSelected:s,disabled:o()||r()}})),{selectionChange:j}=(0,m.useDispatch)(zn),K=d_(g),q=p_({allowedFormats:E,formattingControls:C,disableFormats:L}),Y=!q||q.length>0;let Z=a,X=f;Array.isArray(a)&&(Z=r.children.toHTML(a),X=e=>f(r.children.fromDOM((0,Pt.__unstableCreateElement)(document,e).childNodes)));const Q=(0,s.useCallback)(((e,t)=>{j(H,N,e,t)}),[H,N]),{formatTypes:J,prepareHandlers:ee,valueHandlers:te,changeHandlers:ne,dependencies:oe}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,m.useSelect)(b_,[]),i=(0,s.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&k_.has(n))}))),[l,r,k_]),a=(0,m.useSelect)((e=>i.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o)),{})),[i,t,n]),c=(0,m.useDispatch)(),u=[],d=[],p=[],f=[];return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=a[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)f.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:n,blockClientId:t})),p.push(e.__experimentalCreateOnChangeEditableValue({...a[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:f}}({clientId:H,identifier:N,withoutInteractiveFormatting:S,allowedFormats:q});function re(e){return J.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,Pt.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:le,onChange:ie,ref:se}=(0,Pt.__unstableUseRichText)({value:Z,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;X(e),Object.values(ne).forEach((e=>{e(n,o)}))},selectionStart:U,selectionEnd:G,onSelectionChange:Q,placeholder:y,__unstableIsSelected:W,__unstableMultilineTag:K,__unstableDisableFormats:L,preserveWhiteSpace:P,__unstableDependencies:[...oe,l],__unstableAfterParse:function(e){return te.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:re,__unstableAddInvisibleFormats:function(e){return ee.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ae=function(e){return(0,p.__unstableUseAutocompleteProps)({...e,completers:Ag(e)})}({onReplace:k,completers:_,record:le,onChange:ie});!function(e){let{value:t}=e;const n=t.activeFormats&&!!t.activeFormats.length,{isCaretWithinFormattedText:o}=(0,m.useSelect)(zn),{enterFormattedText:r,exitFormattedText:l}=(0,m.useDispatch)(zn);(0,s.useEffect)((()=>{n?o()||r():o()&&l()}),[n])}({value:le}),function(e){let{html:t,value:n}=e;const o=(0,s.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,m.useDispatch)(zn);(0,s.useLayoutEffect)((()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}l()}else o.current=n.text}),[t,r])}({html:Z,value:le});const ce=(0,s.useRef)(new Set),ue=(0,s.useRef)(new Set);function de(){V.current.focus()}const pe=l,me=(0,s.createElement)(s.Fragment,null,W&&(0,s.createElement)(S_.Provider,{value:ce},(0,s.createElement)(w_.Provider,{value:ue},(0,s.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:le,onChange:ie,onFocus:de}),(0,s.createElement)(C_,{value:le,onChange:ie,onFocus:de,formatTypes:J,forwardedRef:V})))),W&&Y&&(0,s.createElement)(i_,{inline:v,anchorRef:V.current}),(0,s.createElement)(pe,i({role:"textbox","aria-multiline":!0,"aria-label":y},F,ae,{ref:(0,d.useMergeRefs)([ae.ref,F.ref,se,g_({value:le,onChange:ie,__unstableAllowPrefixTransformations:O,formatTypes:J,onReplace:k}),(0,d.useRefEffect)((e=>{function t(e){(va.isKeyboardEvent.primary(e,"z")||va.isKeyboardEvent.primary(e,"y")||va.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),y_(ce),E_(ue),s_(),h_({isSelected:W,disableFormats:L,onChange:ie,value:le,formatTypes:J,tagName:l,onReplace:k,onSplit:I,onSplitMiddle:T,__unstableEmbedURLOnPaste:R,multilineTag:K,preserveWhiteSpace:P,pastePlainText:M}),v_({removeEditorOnlyFormats:re,value:le,onReplace:k,onSplit:I,onSplitMiddle:T,multilineTag:K,onChange:ie,disableLineBreaks:A,onSplitAtEnd:x}),V,n]),contentEditable:!$||void 0,suppressContentEditableWarning:!$,className:c()("block-editor-rich-text__editable",F.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===va.DELETE||t===va.BACKSPACE)){const{start:n,end:o,text:r}=le,l=t===va.BACKSPACE,i=le.activeFormats&&!!le.activeFormats.length;if(!(0,Pt.isCollapsed)(le)||i||l&&0!==n||!l&&o!==r.length)return;B&&B(!l),w&&(0,Pt.isEmpty)(le)&&l&&w(!l),e.preventDefault()}}})));if(!b)return me;Rt()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div"});const fe=c()("block-editor-rich-text",b);return(0,s.createElement)("div",{className:fe},me)}));B_.Content=e=>{let{value:t,tagName:n,multiline:o,...l}=e;Array.isArray(t)&&(t=r.children.toHTML(t));const i=d_(o);!t&&i&&(t=`<${i}></${i}>`);const a=(0,s.createElement)(s.RawHTML,null,t);return n?(0,s.createElement)(n,(0,u.omit)(l,["format"]),a):a},B_.isEmpty=e=>!e||0===e.length;var I_=B_;const x_=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(I_,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));x_.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,s.createElement)(n,o,t)};var T_=x_,N_=(0,s.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,s.createElement)(T_,i({ref:t},o));const{className:r,onChange:l,...a}=o;return(0,s.createElement)(Er.Z,i({ref:t,className:c()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},a))}));function P_(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(P_),l=o||(0,h.sprintf)(
|
80 |
/* translators: 1: property name. 2: viewport name. */
|
81 |
-
(0,h._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{"aria-describedby":`rbc-desc-${r}`},n.label),(0,s.createElement)(p.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}var
|
82 |
/* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
|
83 |
label:(0,h.__)("All")},viewports:d=[{id:"small",label:(0,h.__)("Small screens")},{id:"medium",label:(0,h.__)("Medium screens")},{id:"large",label:(0,h.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const m=o||(0,h.sprintf)(
|
84 |
/* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */
|
85 |
-
(0,h.__)("Use the same %s on all screensizes."),n),f=(0,h.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),g=l((0,s.createElement)(
|
86 |
-
/* translators: 'Help text for the responsive mode toggle control.' */return(0,s.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,s.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,s.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,s.createElement)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,checked:!a,onChange:r,help:f}),(0,s.createElement)("div",{className:c()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&g,a&&(i?i(d):d.map((e=>(0,s.createElement)(s.Fragment,{key:e.id},l((0,s.createElement)(
|
87 |
-
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("Tools")}))},position:"bottom right",renderContent:()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{role:"menu","aria-label":(0,h.__)("Tools")},(0,s.createElement)(p.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wo,{icon:
|
88 |
/* translators: button label text should, if possible, be under 16 characters. */
|
89 |
-
children:(0,h.__)("Preview")};return(0,s.createElement)(p.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:i,toggleProps:a,icon:null},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&
|
90 |
/* translators: %d: number of blocks */
|
91 |
(0,h._n)("%d block","%d blocks",t.length),t.length)),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,h.sprintf)(
|
92 |
/* translators: %d: number of words */
|
93 |
-
(0,h._n)("%d word","%d words",n),n))))}));function tk(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:l}=(0,m.useSelect)((e=>{var n,o;const l=e(zn).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==l||null===(n=l.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==l?void 0:l.onChange)&&void 0!==o?o:null,styles:e(r.store).getBlockStyles(t)}}),[t]),i=(0,s.useMemo)((()=>[{label:(0,h.__)("Not set"),value:""},...l.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[l]),a=(0,s.useMemo)((()=>{var e;return null===(e=cp(l))||void 0===e?void 0:e.name}),[l]),c=(0,s.useCallback)((e=>{o(t,e)}),[t,o]);return n&&n!==a?o&&(0,s.createElement)("div",{className:"default-style-picker__default-switcher"},(0,s.createElement)(p.SelectControl,{options:i,value:n||"",label:(0,h.__)("Default Style"),onChange:c})):null}const nk=e=>{let{clientId:t,blockName:n,hasBlockStyles:o}=e;const l=Ld(t);return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(Ga,l),(0,s.createElement)(Pv,{blockClientId:t}),o&&(0,s.createElement)("div",null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Styles")},(0,s.createElement)(vv,{scope:"core/block-inspector",clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,s.createElement)(tk,{blockName:n}))),(0,s.createElement)(er.Slot,null),(0,s.createElement)(er.Slot,{__experimentalGroup:"typography",label:(0,h.__)("Typography")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"dimensions",label:(0,h.__)("Dimensions")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}),(0,s.createElement)("div",null,(0,s.createElement)(ok,null)),(0,s.createElement)(Q_,{key:"back"}))},ok=()=>{const e=(0,p.__experimentalUseSlot)(Jo.slotName);return Boolean(e.fills&&e.fills.length)?(0,s.createElement)(p.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,h.__)("Advanced"),initialOpen:!1},(0,s.createElement)(er.Slot,{__experimentalGroup:"advanced"})):null};var rk=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,hasBlockStyles:o,selectedBlockName:l,selectedBlockClientId:i,blockType:a}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(zn),{getBlockStyles:l}=e(r.store),i=t(),s=i&&o(i),a=s&&(0,r.getBlockType)(s),c=s&&l(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:a,hasBlockStyles:c&&c.length>0}}),[]);if(n>1)return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(ek,null),(0,s.createElement)(er.Slot,null),(0,s.createElement)(er.Slot,{__experimentalGroup:"typography",label:(0,h.__)("Typography")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"dimensions",label:(0,h.__)("Dimensions")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}));const c=l===(0,r.getUnregisteredTypeHandlerName)();return a&&i&&!c?(0,s.createElement)(nk,{clientId:i,blockName:a.name,hasBlockStyles:o}):t?(0,s.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,h.__)("No block selected.")):null};function lk(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,d.useViewportMatch)("medium"),l=(0,m.useSelect)((e=>e(zn).getSettings().hasFixedToolbar),[]),a=(0,tc.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:c,getBlockRootClientId:f}=(0,m.useSelect)(zn),{duplicateBlocks:h,removeBlocks:g,insertAfterBlock:v,insertBeforeBlock:b,clearSelectedBlock:_,moveBlocksUp:k,moveBlocksDown:y}=(0,m.useDispatch)(zn);return(0,s.createElement)("div",i({},o,{onKeyDown:function(e){if(a("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));k(t,n)}}else if(a("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));y(t,n)}}else if(a("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),h(t))}else if(a("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),g(t))}else if(a("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),v((0,u.last)(t)))}else if(a("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),b((0,u.first)(t)))}else if(a("core/block-editor/delete-multi-selection",e)){if(["INPUT","TEXTAREA"].includes(e.target.nodeName)||e.defaultPrevented)return;const t=c();t.length>1&&(e.preventDefault(),g(t))}else a("core/block-editor/unselect",e)&&c().length>1&&(e.preventDefault(),_(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}),(0,s.createElement)(Nd,{__unstableContentRef:n},(l||!r)&&(0,s.createElement)(Up,{isFixed:!0}),(0,s.createElement)(jp,{__unstableContentRef:n}),(0,s.createElement)(p.Popover.Slot,{name:"block-toolbar",ref:Id(n)}),t,(0,s.createElement)(p.Popover.Slot,{name:"__unstable-block-tools-after",ref:Id(n)})))}var ik=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:a,__experimentalFilterValue:c,onSelect:d=u.noop,shouldFocusBlock:p=!1}=e;const f=(0,m.useSelect)((e=>{const{getBlockRootClientId:t}=e(zn);return n||t(o)||void 0}),[o,n]);return(0,s.createElement)(vd,{onSelect:d,rootClientId:f,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:a,__experimentalFilterValue:c,shouldFocusBlock:p,ref:t})}));function sk(){return null}sk.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(tc.store);return(0,s.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,h.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,h.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,h.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,h.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,h.__)("Remove multiple selected blocks."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,h.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,h.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,h.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,h.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,h.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var ak=sk;function ck(){return Rt()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const uk=new Set([va.UP,va.RIGHT,va.DOWN,va.LEFT,va.ENTER,va.BACKSPACE]);function dk(){const e=(0,m.useSelect)((e=>e(zn).isTyping()),[]),{stopTyping:t}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function pk(){const e=(0,m.useSelect)((e=>e(zn).isTyping())),{startTyping:t,stopTyping:n}=(0,m.useDispatch)(zn),o=dk(),r=(0,d.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:l}=r;if(e){let e;function t(t){const{target:o}=t;e=l.setTimeout((()=>{(0,rr.isTextField)(o)||n()}))}function i(e){const{keyCode:t}=e;t!==va.ESCAPE&&t!==va.TAB||n()}function s(){const e=l.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",t),o.addEventListener("keydown",i),r.addEventListener("selectionchange",s),()=>{l.clearTimeout(e),o.removeEventListener("focus",t),o.removeEventListener("keydown",i),r.removeEventListener("selectionchange",s)}}function i(e){const{type:n,target:r}=e;(0,rr.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&uk.has(t)}(e))&&t()}return o.addEventListener("keypress",i),o.addEventListener("keydown",i),()=>{o.removeEventListener("keypress",i),o.removeEventListener("keydown",i)}}),[e,t,n]);return(0,d.useMergeRefs)([o,r])}var mk=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:pk()},t)};function fk(){return Rt()("PreserveScrollInReorder component",{since:"5.4",hint:"This behavior is now built-in the block list"}),null}const hk=-1!==window.navigator.userAgent.indexOf("Trident"),gk=new Set([va.UP,va.DOWN,va.LEFT,va.RIGHT]);function vk(){const e=(0,m.useSelect)((e=>e(zn).hasSelectedBlock()),[]);return(0,d.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function s(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c(e){let{keyCode:r}=e;if(!m())return;const l=(0,rr.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(gk.has(r))return void(i=l);const s=l.top-i.top;if(0===s)return;const a=(0,rr.getScrollContainer)(t);if(!a)return;const c=a===n.body,u=c?o.scrollY:a.scrollTop,d=c?0:a.getBoundingClientRect().top,p=c?i.top/o.innerHeight:(i.top-d)/(o.innerHeight-d);if(0===u&&p<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=l);const f=c?o.innerHeight:a.clientHeight;i.top+i.height>d+f||i.top<d?i=l:c?o.scrollBy(0,s):a.scrollTop+=s}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,rr.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",s,!0),o.addEventListener("resize",s,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",s,!0),o.removeEventListener("resize",s,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}var bk=hk?e=>e.children:function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:vk(),className:"block-editor__typewriter"},t)};const _k=(0,s.createContext)({});function kk(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function yk(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,s.useContext)(_k),{name:r}=Gn();n=n||r;const l=Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e)),i=(0,s.useMemo)((()=>kk(o,n,e)),[o,n,e]),a=(0,s.useCallback)((e=>{let{children:t}=e;return(0,s.createElement)(_k.Provider,{value:i},t)}),[i]);return[l,a]}function Ek(e){if(void 0===e)e=v.colors;else{const t=e.filter((e=>e.color));0===t.length?e=v.colors:t.length<e.length&&(e=t)}return e}function Ck(e){if(void 0===e)e=v.gradients;else{const t=e.filter((e=>e.gradient));0===t.length?e=v.gradients:t.length<e.length&&(e=t)}return e}function Sk(e){const t=null==e?void 0:e.trim().match(/^(0?[-.]?\d*\.?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function wk(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>Sk(Nk(e,t)).value)).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]<o[0]?o[0]+"px":o[1]>o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function Bk(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=wk(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return Sk(e)}function Ik(e){for(let t=0;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}function xk(e){let t=!1;const n=e.split(/[+-/*/]/g).filter(Boolean);for(const o of n){const n=Sk(Nk(o));if(!parseFloat(n.value)){t=!0;break}e=e.replace(o,n.value)}return t?null:(o=e,Function(`'use strict'; return (${o})`)()).toFixed(0)+"px";var o}function Tk(e,t){const n=.01,o=Object.assign({},{fontSize:16,lineHeight:16,width:375,height:812,type:"font"},t),r={em:o.fontSize,rem:o.fontSize,vh:o.height*n,vw:o.width*n,vmin:(o.width<o.height?o.width:o.height)*n,vmax:(o.width>o.height?o.width:o.height)*n,"%":("font"===o.type?o.fontSize:o.width)*n,ch:8,ex:7.15625,lh:o.lineHeight},l={in:96,cm:37.79527559055118,mm:3.7795275590551185,pt:1.3333333333333333,pc:16,px:1,Q:.9448818897637794};return r[e.unit]?(r[e.unit]*e.value).toFixed(0)+"px":l[e.unit]?(l[e.unit]*e.value).toFixed(0)+"px":null}function Nk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=Sk(e);return n.unit||(n=Bk(e)),Ik(e)&&!n.unit?xk(e):Tk(n,t)}const Pk={};function Mk(e){let t="";return e.hasOwnProperty("fontSize")&&(t=":"+e.width),e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight),e.hasOwnProperty("width")&&(t=":"+e.width),e.hasOwnProperty("height")&&(t=":"+e.height),e.hasOwnProperty("type")&&(t=":"+e.type),t}var Rk=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+Mk(t);return Pk[n]||(Pk[n]=Nk(e,t)),Pk[n]}}(),(window.wp=window.wp||{}).blockEditor=o}();
|
1 |
+
!function(){var e={9367: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)},4184: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)}()},1934: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()}))]}},5913: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 h=d&&d.newPos+1<a,g=m&&0<=f&&f<c;if(h||g){if(!h||g&&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 h=f();if(h)return h}},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("")}}},7630: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(5913))&&o.__esModule?o:{default:o}).default)},9010:function(e,t,n){"use strict";var o=n(4657);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),h=o.outerHeight(e),g=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+g-(S.left+w)+d,top:f.top+h-(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+g-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+h-(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)))}},4979:function(e,t,n){"use strict";e.exports=n(9010)},4657: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 h(e){return null!=e&&e==e.window}var g={};function v(e,t,n){if(h(e))return"width"===t?g.viewportWidth(e):g.viewportHeight(e);if(9===e.nodeType)return"width"===t?g.docWidth(e):g.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){g["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],g["viewport"+e](n))},g["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);g["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];g[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:h,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(h(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(h(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},g)},5717: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}},8303:function(e,t,n){var o=n(1934);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}},2703:function(e,t,n){"use strict";var o=n(414);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}},5697:function(e,t,n){e.exports=n(2703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4857: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(5697),c=n(9367),u=n(8303),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}))}))},4042:function(e,t,n){"use strict";var o=n(4857);t.Z=o.TextareaAutosize},3692: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,h={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){h.isRoot||(h.parent.node[h.key]=e),h.node=e,t&&(f=!1)},delete:function(e){delete h.parent.node[h.key],e&&(f=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.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 h;function g(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=l(h.node)),h.isLeaf=0==h.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){h.circular=i[e];break}}else h.isLeaf=!0,h.keys=null;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot}g();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),f?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),g(),a(h.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var l=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=l.node),l.isLast=r==h.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(h,l),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(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 Mg},AlignmentToolbar:function(){return Rg},Autocomplete:function(){return Og},BlockAlignmentControl:function(){return zo},BlockAlignmentToolbar:function(){return Vo},BlockBreadcrumb:function(){return Gg},BlockColorsStyleSelector:function(){return Kg},BlockContextProvider:function(){return ir},BlockControls:function(){return Yn},BlockEdit:function(){return ur},BlockEditorKeyboardShortcuts:function(){return a_},BlockEditorProvider:function(){return $a},BlockFormatControls:function(){return qn},BlockIcon:function(){return Ga},BlockInspector:function(){return r_},BlockList:function(){return fm},BlockMover:function(){return Zd},BlockNavigationDropdown:function(){return fv},BlockPreview:function(){return mu},BlockSelectionClearer:function(){return qa},BlockSettingsMenu:function(){return Hp},BlockSettingsMenuControls:function(){return Op},BlockStyles:function(){return bv},BlockTitle:function(){return Dd},BlockToolbar:function(){return Gp},BlockTools:function(){return l_},BlockVerticalAlignmentControl:function(){return zv},BlockVerticalAlignmentToolbar:function(){return Vv},ButtonBlockAppender:function(){return Bd},ButtonBlockerAppender:function(){return wd},ColorPalette:function(){return Gv},ColorPaletteControl:function(){return Uv},ContrastChecker:function(){return kf},CopyHandler:function(){return Bp},DefaultBlockAppender:function(){return Cd},FontSizePicker:function(){return Qf},InnerBlocks:function(){return um},Inserter:function(){return Ed},InspectorAdvancedControls:function(){return Jo},InspectorControls:function(){return er},JustifyContentControl:function(){return go},JustifyToolbar:function(){return vo},LineHeightControl:function(){return Lf},MediaPlaceholder:function(){return ok},MediaReplaceFlow:function(){return Qb},MediaUpload:function(){return Zb},MediaUploadCheck:function(){return Xb},MultiSelectScrollIntoView:function(){return c_},NavigableToolbar:function(){return Vd},ObserveTyping:function(){return m_},PanelColorSettings:function(){return rk},PlainText:function(){return Nk},PreserveScrollInReorder:function(){return f_},RichText:function(){return Ik},RichTextShortcut:function(){return Rk},RichTextToolbarButton:function(){return Lk},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return Qk},ToolSelector:function(){return Ok},Typewriter:function(){return b_},URLInput:function(){return Ib},URLInputButton:function(){return Hk},URLPopover:function(){return tk},Warning:function(){return pr},WritingFlow:function(){return rc},__experimentalBlockAlignmentMatrixControl:function(){return Vg},__experimentalBlockContentOverlay:function(){return Ug},__experimentalBlockFullHeightAligmentControl:function(){return zg},__experimentalBlockPatternSetup:function(){return Nv},__experimentalBlockVariationPicker:function(){return _v},__experimentalBlockVariationTransforms:function(){return Mv},__experimentalBorderRadiusControl:function(){return Um},__experimentalBorderStyleControl:function(){return Ym},__experimentalColorGradientControl:function(){return _m},__experimentalColorGradientSettingsDropdown:function(){return ym},__experimentalDuotoneControl:function(){return Jh},__experimentalFontAppearanceControl:function(){return Rf},__experimentalFontFamilyControl:function(){return Wf},__experimentalGetBorderClassesAndStyles:function(){return pg},__experimentalGetColorClassesAndStyles:function(){return fg},__experimentalGetGradientClass:function(){return rf},__experimentalGetGradientObjectByGradientValue:function(){return sf},__experimentalGetMatchingVariation:function(){return Pv},__experimentalGetSpacingClassesAndStyles:function(){return vg},__experimentalImageEditingProvider:function(){return db},__experimentalImageEditor:function(){return yb},__experimentalImageSizeControl:function(){return Cb},__experimentalImageURLInputUI:function(){return Yk},__experimentalLayoutStyle:function(){return Mo},__experimentalLetterSpacingControl:function(){return kh},__experimentalLibrary:function(){return i_},__experimentalLinkControl:function(){return Kb},__experimentalLinkControlSearchInput:function(){return zb},__experimentalLinkControlSearchItem:function(){return Nb},__experimentalLinkControlSearchResults:function(){return Rb},__experimentalListView:function(){return pv},__experimentalPanelColorGradientSettings:function(){return vf},__experimentalPreviewOptions:function(){return Zk},__experimentalResponsiveBlockControl:function(){return Mk},__experimentalTextDecorationControl:function(){return sh},__experimentalTextTransformControl:function(){return hh},__experimentalUnitControl:function(){return Fk},__experimentalUseBlockPreview:function(){return fu},__experimentalUseBorderProps:function(){return mg},__experimentalUseColorProps:function(){return gg},__experimentalUseCustomSides:function(){return Hh},__experimentalUseGradient:function(){return cf},__experimentalUseNoRecursiveRenders:function(){return E_},__experimentalUseResizeCanvas:function(){return Xk},__unstableBlockSettingsMenuFirstItem:function(){return Mp},__unstableEditorStyles:function(){return cu},__unstableIframe:function(){return sc},__unstableInserterMenuExtension:function(){return dd},__unstableRichTextInputEvent:function(){return Ak},__unstableUseBlockSelectionClearer:function(){return Ka},__unstableUseClipboardHandler:function(){return wp},__unstableUseMouseMoveTypingReset:function(){return d_},__unstableUseTypewriter:function(){return v_},__unstableUseTypingObserver:function(){return p_},createCustomColorsHOC:function(){return Eg},getColorClassName:function(){return Bm},getColorObjectByAttributeValues:function(){return Sm},getColorObjectByColorValue:function(){return wm},getFontSize:function(){return Yf},getFontSizeClass:function(){return Xf},getFontSizeObjectByValue:function(){return Zf},getGradientSlugByValue:function(){return af},getGradientValueBySlug:function(){return lf},getPxFromCssUnit:function(){return L_},store:function(){return zn},storeConfig:function(){return Fn},transformStyles:function(){return iu},useBlockDisplayInformation:function(){return Ad},useBlockEditContext:function(){return Un},useBlockProps:function(){return Pa},useCachedTruthy:function(){return bg},useInnerBlocksProps:function(){return cm},useSetting:function(){return mo},validateThemeColors:function(){return C_},validateThemeGradients:function(){return S_},withColorContext:function(){return Hv},withColors:function(){return Cg},withFontSizes:function(){return wg}});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 Ze},canRemoveBlocks:function(){return Xe},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 ht},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 X},getClientIdsOfDescendants:function(){return q},getClientIdsWithDescendants:function(){return Y},getDraggedBlockClientIds:function(){return Oe},getFirstMultiSelectedBlockClientId:function(){return ke},getGlobalBlockCount:function(){return Z},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 ge},getSelectedBlockCount:function(){return oe},getSelectedBlocksInitialCaretPosition:function(){return he},getSelectionEnd:function(){return ee},getSelectionStart:function(){return J},getSettings:function(){return gt},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 Zt},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 gn},startMultiSelect:function(){return Ut},startTyping:function(){return fn},stopDraggingBlocks:function(){return vn},stopMultiSelect:function(){return Wt},stopTyping:function(){return hn},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(4184),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")},h=window.wp.i18n;const g={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,h.__)("Black"),slug:"black",color:"#000000"},{name:(0,h.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,h.__)("White"),slug:"white",color:"#ffffff"},{name:(0,h.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,h.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,h.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,h.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,h.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,h.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,h.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,h.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,h.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,h._x)("Small","font size name"),size:13,slug:"small"},{name:(0,h._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,h._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,h._x)("Large","font size name"),size:36,slug:"large"},{name:(0,h._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,h.__)("Thumbnail")},{slug:"medium",name:(0,h.__)("Medium")},{slug:"large",name:(0,h.__)("Large")},{slug:"full",name:(0,h.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__unstableGalleryWithImageBlocks:!1,gradients:[{name:(0,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,h.__)("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,h.__)("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,h.__)("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,h.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,h.__)("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||["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]:g,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])),Z=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])),X=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 he(e){return e.initialPosition}const ge=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:ge(e)}const be=D((e=>{const t=ve(e);return t.length?t.map((t=>U(e,t))):z}),(e=>[...ge.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=ht(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}=gt(e),s=je(i,t,!0);if(!s)return!1;const a=!!$e(e,o);if(a)return!1;const c=ht(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),h=null===d&&null===f||!0===d||!0===f;return h?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",h,n,o,{getBlock:U.bind(null,e),getBlockParentsByBlockName:ce.bind(null,e)}):h},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 Ze(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 Xe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Ze(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)(X(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}=gt(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 ht(e,t){return e.blockListSettings[t]}function gt(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=(e,t)=>n=>{let{select:o,dispatch:r}=n;if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t});const l=o.getSelectedBlockCount();(0,Nt.speak)((0,h.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
+
(0,h._n)("%s block selected.","%s blocks selected.",l),l),"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 Zt(e,t){return Yt(e,t)}const Xt=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=Xt("MOVE_BLOCKS_DOWN"),Jt=Xt("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:h,offset:g}=o.getSelectionStart(),v=(f===s?d:m).attributes[h],b=(f===s||f===a)&&void 0!==h&&void 0!==g&&!!v;v||("number"==typeof h?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 h):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[h],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=v,l=(0,Pt.insert)((0,Pt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),"",g,g);e.attributes[h]=(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 hn(){return{type:"STOP_TYPING"}}function gn(){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}}function En(e,t,n){const o=(0,r.getDefaultBlockName)();if(o)return nn((0,r.createBlock)(o,e),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,h.__)("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,h.__)("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,h.__)("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,__experimentalUseThunks:!0},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,Zn=(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"})),Xn=(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 ho=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,h.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:oo,title:(0,h.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ro,title:(0,h.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:lo,title:(0,h.__)("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,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};function go(e){return(0,s.createElement)(ho,i({},e,{isToolbar:!1}))}function vo(e){return(0,s.createElement)(ho,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,h.__)("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)(go,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:no,label:(0,h.__)("Justify items left")},{value:"center",icon:oo,label:(0,h.__)("Justify items center")},{value:"right",icon:ro,label:(0,h.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:lo,label:(0,h.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,h.__)("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,"> *")} {\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,'> [data-align="wide"]')} {\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,'> [data-align="full"]')} {\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,'> [data-align="left"]')} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-right: 2em;\n\t\t\t}\n\n\t\t\t${ao(o,'> [data-align="right"]')} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-left: 2em;\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,h.sprintf)((0,h.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
+
o.wide=(0,h.sprintf)((0,h.__)("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:Zn,title:(0,h.__)("None")},left:{icon:Xn,title:(0,h.__)("Align left")},center:{icon:Qn,title:(0,h.__)("Align center")},right:{icon:Jn,title:(0,h.__)("Align right")},wide:{icon:eo,title:(0,h.__)("Wide width")},full:{icon:to,title:(0,h.__)("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,g={popoverProps:Oo,icon:d?d.icon:m.icon,label:(0,h.__)("Align"),toggleProps:{describedBy:(0,h.__)("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({},g,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"),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){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},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 Xo(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)(Yo,{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 Qo=Ko;Qo.Slot=Xo;const Jo=e=>(0,s.createElement)(Ko,i({},e,{__experimentalGroup:"advanced"}));Jo.Slot=e=>(0,s.createElement)(Xo,i({},e,{__experimentalGroup:"advanced"})),Jo.slotName="InspectorAdvancedControls";var er=Qo;const tr=/[\s#]/g,nr=(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,h.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,h.__)("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,h.__)("https://wordpress.org/support/article/page-jumps/")},(0,h.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,h.__)("Add an anchor"),onChange:e=>{e=e.replace(tr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(er,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(er,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("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",nr),(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 or=(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)(er,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,h.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,h.__)("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",or),(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.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}));var rr=window.wp.dom;const lr=(0,s.createContext)({});function ir(e){let{value:t,children:n}=e;const o=(0,s.useContext)(lr),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(lr.Provider,{value:r,children:n})}var sr=lr;const ar={};var cr=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(sr),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):ar),[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 ur(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)(cr,e))}var dr=(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"})),pr=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:dr,label:(0,h.__)("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)))))))))},mr=n(7630);function fr(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,rr.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 hr=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,mr.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)(fr,{title:(0,h.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,h.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(fr,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const gr=e=>(0,r.rawHandler)({HTML:e.originalContent});var vr=(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,gr(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,h._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,h.__)("Convert to HTML"),onClick:t},{title:(0,h.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(pr,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,h.__)("Attempt Block Recovery"))],secondaryActions:f},(0,h.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
|
10 |
+
(0,h.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(hr,{block:i,onKeep:t,onConvert:n,convertor:gr,convertButtonText:(0,h.__)("Convert to Blocks")})))}));const br=(0,s.createElement)(pr,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed."));var kr=()=>br;class _r 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 yr=_r,Er=n(4042),Cr=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)(Er.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 Sr=zr();const wr=e=>Ar(e,Sr);let Br=zr();wr.write=e=>Ar(e,Br);let Ir=zr();wr.onStart=e=>Ar(e,Ir);let xr=zr();wr.onFrame=e=>Ar(e,xr);let Tr=zr();wr.onFinish=e=>Ar(e,Tr);let Nr=[];wr.setTimeout=(e,t)=>{let n=wr.now()+t,o=()=>{let e=Nr.findIndex((e=>e.cancel==o));~e&&Nr.splice(e,1),Hr.count-=~e?1:0},r={time:n,handler:e,cancel:o};return Nr.splice(Pr(n),0,r),Hr.count+=1,Dr(),r};let Pr=e=>~(~Nr.findIndex((t=>t.time>e))||~Nr.length);wr.cancel=e=>{Sr.delete(e),Br.delete(e)},wr.sync=e=>{Lr=!0,wr.batchedUpdates(e),Lr=!1},wr.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,wr.onStart(n)}return o.handler=e,o.cancel=()=>{Ir.delete(n),t=null},o};let Mr="undefined"!=typeof window?window.requestAnimationFrame:()=>{};wr.use=e=>Mr=e,wr.now="undefined"!=typeof performance?()=>performance.now():Date.now,wr.batchedUpdates=e=>e(),wr.catch=console.error,wr.frameLoop="always",wr.advance=()=>{"demand"!==wr.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Fr()};let Rr=-1,Lr=!1;function Ar(e,t){Lr?(t.delete(e),e(0)):(t.add(e),Dr())}function Dr(){Rr<0&&(Rr=0,"demand"!==wr.frameLoop&&Mr(Or))}function Or(){~Rr&&(Mr(Or),wr.batchedUpdates(Fr))}function Fr(){let e=Rr;Rr=wr.now();let t=Pr(Rr);t&&(Vr(Nr.splice(0,t),(e=>e.handler())),Hr.count-=t),Ir.flush(),Sr.flush(e?Math.min(64,Rr-e):16.667),xr.flush(),Br.flush(),Tr.flush()}function zr(){let e=new Set,t=e;return{add(n){Hr.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Hr.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Hr.count-=t.size,Vr(t,(t=>t(n)&&e.add(t))),Hr.count+=e.size,t=e)}}}function Vr(e,t){e.forEach((e=>{try{t(e)}catch(e){wr.catch(e)}}))}const Hr={count:0,clear(){Rr=-1,Nr=[],Ir=zr(),Sr=zr(),xr=zr(),Br=zr(),Tr=zr(),Hr.count=0}};var Gr=n(9196),Ur=n.n(Gr);function Wr(){}const $r={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 jr(e,t){if($r.arr(e)){if(!$r.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 Kr=(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 Yr=e=>$r.und(e)?[]:$r.arr(e)?e:[e];function Zr(e,t){if(e.size){const n=Array.from(e);e.clear(),Kr(n,t)}}const Xr=(e,...t)=>Zr(e,(e=>e(...t)));let Qr,Jr,el=null,tl=!1,nl=Wr;var ol=Object.freeze({__proto__:null,get createStringInterpolator(){return Qr},get to(){return Jr},get colors(){return el},get skipAnimation(){return tl},get willAdvance(){return nl},assign:e=>{e.to&&(Jr=e.to),e.now&&(wr.now=e.now),void 0!==e.colors&&(el=e.colors),null!=e.skipAnimation&&(tl=e.skipAnimation),e.createStringInterpolator&&(Qr=e.createStringInterpolator),e.requestAnimationFrame&&wr.use(e.requestAnimationFrame),e.batchedUpdates&&(wr.batchedUpdates=e.batchedUpdates),e.willAdvance&&(nl=e.willAdvance),e.frameLoop&&(wr.frameLoop=e.frameLoop)}});const rl=new Set;let ll=[],il=[],sl=0;const al={get idle(){return!rl.size&&!ll.length},start(e){sl>e.priority?(rl.add(e),wr.onStart(cl)):(ul(e),wr(pl))},advance:pl,sort(e){if(sl)wr.onFrame((()=>al.sort(e)));else{const t=ll.indexOf(e);~t&&(ll.splice(t,1),dl(e))}},clear(){ll=[],rl.clear()}};function cl(){rl.forEach(ul),rl.clear(),wr(pl)}function ul(e){ll.includes(e)||dl(e)}function dl(e){ll.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(ll),0,e)}function pl(e){const t=il;for(let n=0;n<ll.length;n++){const o=ll[n];sl=o.priority,o.idle||(nl(o),o.advance(e),o.idle||t.push(o))}return sl=0,il=ll,il.length=0,ll=t,ll.length>0}const ml="[-+]?\\d*\\.?\\d+",fl=ml+"%";function hl(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const gl=new RegExp("rgb"+hl(ml,ml,ml)),vl=new RegExp("rgba"+hl(ml,ml,ml,ml)),bl=new RegExp("hsl"+hl(ml,fl,fl)),kl=new RegExp("hsla"+hl(ml,fl,fl,ml)),_l=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,yl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,El=/^#([0-9a-fA-F]{6})$/,Cl=/^#([0-9a-fA-F]{8})$/;function Sl(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 wl(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Sl(r,o,e+1/3),i=Sl(r,o,e),s=Sl(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Bl(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Il(e){return(parseFloat(e)%360+360)%360/360}function xl(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Tl(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Nl(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=El.exec(e))?parseInt(t[1]+"ff",16)>>>0:el&&void 0!==el[e]?el[e]:(t=gl.exec(e))?(Bl(t[1])<<24|Bl(t[2])<<16|Bl(t[3])<<8|255)>>>0:(t=vl.exec(e))?(Bl(t[1])<<24|Bl(t[2])<<16|Bl(t[3])<<8|xl(t[4]))>>>0:(t=_l.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Cl.exec(e))?parseInt(t[1],16)>>>0:(t=yl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=bl.exec(e))?(255|wl(Il(t[1]),Tl(t[2]),Tl(t[3])))>>>0:(t=kl.exec(e))?(wl(Il(t[1]),Tl(t[2]),Tl(t[3]))|xl(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 Pl=(e,t,n)=>{if($r.fun(e))return e;if($r.arr(e))return Pl({range:e,output:t,extrapolate:n});if($r.str(e.output[0]))return Qr(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 Ml(){return(Ml=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 Rl=Symbol.for("FluidValue.get"),Ll=Symbol.for("FluidValue.observers"),Al=e=>Boolean(e&&e[Rl]),Dl=e=>e&&e[Rl]?e[Rl]():e,Ol=e=>e[Ll]||null;function Fl(e,t){let n=e[Ll];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class zl{constructor(e){if(this[Rl]=void 0,this[Ll]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Vl(this,e)}}const Vl=(e,t)=>Ul(e,Rl,t);function Hl(e,t){if(e[Rl]){let n=e[Ll];n||Ul(e,Ll,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Gl(e,t){let n=e[Ll];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Ll]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Ul=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Wl=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,$l=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let jl;const Kl=/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})`,Yl=e=>{jl||(jl=el?new RegExp(`(${Object.keys(el).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Dl(e).replace($l,Nl).replace(jl,Nl))),n=t.map((e=>e.match(Wl).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=>Pl(Ml({},e,{output:t}))));return e=>{let n=0;return t[0].replace(Wl,(()=>String(o[n++](e)))).replace(Kl,ql)}},Zl="react-spring: ",Xl=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Zl}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Ql=Xl(console.warn),Jl=Xl(console.warn);function ei(e){return $r.str(e)&&("#"==e[0]||/\d/.test(e)||e in(el||{}))}const ti=e=>(0,Gr.useEffect)(e,ni),ni=[];function oi(){const e=(0,Gr.useState)()[1],t=(0,Gr.useState)(ri)[0];return ti(t.unmount),()=>{t.current&&e({})}}function ri(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function li(e){const t=(0,Gr.useRef)();return(0,Gr.useEffect)((()=>{t.current=e})),t.current}const ii="undefined"!=typeof window&&window.document&&window.document.createElement?Gr.useLayoutEffect:Gr.useEffect,si=Symbol.for("Animated:node"),ai=e=>e&&e[si],ci=(e,t)=>{return n=e,o=si,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},ui=e=>e&&e[si]&&e[si].getPayload();class di{constructor(){this.payload=void 0,ci(this,this)}getPayload(){return this.payload||[]}}class pi extends di{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,$r.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new pi(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return $r.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,$r.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class mi extends pi{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Pl({output:[e,e]})}static create(e){return new mi(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if($r.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=Pl({output:[this.getValue(),e]})),this._value=0,super.reset()}}const fi={dependencies:null};class hi extends di{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return qr(this.source,((n,o)=>{var r;(r=n)&&r[si]===r?t[o]=n.getValue(e):Al(n)?t[o]=Dl(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Kr(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return qr(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){fi.dependencies&&Al(e)&&fi.dependencies.add(e);const t=ui(e);t&&Kr(t,(e=>this.add(e)))}}class gi extends hi{constructor(e){super(e)}static create(e){return new gi(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(vi)),!0)}}function vi(e){return(ei(e)?mi:pi).create(e)}function bi(e){const t=ai(e);return t?t.constructor:$r.arr(e)?gi:ei(e)?mi:pi}function ki(){return(ki=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 _i=(e,t)=>{const n=!$r.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Gr.forwardRef)(((o,r)=>{const l=(0,Gr.useRef)(null),i=n&&(0,Gr.useCallback)((e=>{l.current=function(e,t){return e&&($r.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return fi.dependencies=n,e.style&&(e=ki({},e,{style:t.createAnimatedStyle(e.style)})),e=new hi(e),fi.dependencies=null,[e,n]}(o,t),c=oi(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new yi(u,a),p=(0,Gr.useRef)();ii((()=>{const e=p.current;p.current=d,Kr(a,(e=>Hl(e,d))),e&&(Kr(e.deps,(t=>Gl(t,e))),wr.cancel(e.update))})),(0,Gr.useEffect)(u,[]),ti((()=>()=>{const e=p.current;Kr(e.deps,(t=>Gl(t,e)))}));const m=t.getComponentProps(s.getValue());return Gr.createElement(e,ki({},m,{ref:i}))}))};class yi{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&wr.write(this.update)}}const Ei=Symbol.for("AnimatedComponent"),Ci=e=>$r.str(e)?e:e&&$r.str(e.displayName)?e.displayName:$r.fun(e)&&e.name||null;function Si(){return(Si=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 wi(e,...t){return $r.fun(e)?e(...t):e}const Bi=(e,t)=>!0===e||!!(t&&e&&($r.fun(e)?e(t):Yr(e).includes(t))),Ii=(e,t)=>$r.obj(e)?t&&e[t]:e,xi=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ti=e=>e,Ni=(e,t=Ti)=>{let n=Pi;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);$r.und(n)||(o[r]=n)}return o},Pi=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Mi={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 Ri(e){const t=function(e){const t={};let n=0;if(qr(e,((e,o)=>{Mi[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 Si({},e)}function Li(e){return e=Dl(e),$r.arr(e)?e.map(Li):ei(e)?ol.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Ai(e){for(const t in e)return!0;return!1}function Di(e){return $r.fun(e)||$r.arr(e)&&$r.obj(e[0])}function Oi(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Fi(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const zi=Si({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Vi{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,zi)}}function Hi(e,t){if($r.und(t.decay)){const n=!$r.und(t.tension)||!$r.und(t.friction);!n&&$r.und(t.frequency)&&$r.und(t.damping)&&$r.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Gi=[];class Ui{constructor(){this.changed=!1,this.values=Gi,this.toValues=null,this.fromValues=Gi,this.to=void 0,this.from=void 0,this.config=new Vi,this.immediate=!1}}function Wi(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Bi(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{$r.und(n.pause)||(r.paused=Bi(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Bi(e,t)),c=wi(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-wr.now()}function m(){c>0?(u=wr.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(Si({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const $i=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?qi(e.get()):t.every((e=>e.noop))?ji(e.get()):Ki(e.get(),t.every((e=>e.finished))),ji=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Ki=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),qi=e=>({value:e,cancelled:!0,finished:!1});function Yi(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=Ni(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&&Ki(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new Xi,i=new Qi;return(async()=>{if(ol.skipAnimation)throw Zi(n),i.result=Ki(o,!1),d(i),i;m(l);const s=$r.obj(e)?Si({},e):Si({},t,{to:e});s.parentId=r,qr(c,((e,t)=>{$r.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 h;if(ol.skipAnimation)return Zi(n),Ki(o,!1);try{let t;t=$r.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]),h=Ki(o.get(),!0,!1)}catch(e){if(e instanceof Xi)h=e.result;else{if(!(e instanceof Qi))throw e;h=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return $r.fun(i)&&wr.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function Zi(e,t){Zr(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Xi 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 Qi extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Ji=e=>e instanceof ts;let es=1;class ts extends zl{constructor(...e){super(...e),this.id=es++,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=ai(this);return e&&e.getValue()}to(...e){return ol.to(this,e)}interpolate(...e){return Ql(`${Zl}The "interpolate" function is deprecated in v9 (use "to" instead)`),ol.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){Fl(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||al.sort(this),Fl(this,{type:"priority",parent:this,priority:e})}}const ns=Symbol.for("SpringPhase"),os=e=>(1&e[ns])>0,rs=e=>(2&e[ns])>0,ls=e=>(4&e[ns])>0,is=(e,t)=>t?e[ns]|=3:e[ns]&=-3,ss=(e,t)=>t?e[ns]|=4:e[ns]&=-5;class as extends ts{constructor(e,t){if(super(),this.key=void 0,this.animation=new Ui,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,!$r.und(e)||!$r.und(t)){const n=$r.obj(e)?Si({},e):Si({},t,{from:e});$r.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(rs(this)||this._state.asyncTo)||ls(this)}get goal(){return Dl(this.animation.to)}get velocity(){const e=ai(this);return e instanceof pi?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return os(this)}get isAnimating(){return rs(this)}get isPaused(){return ls(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=ui(o.to);!i&&Al(o.to)&&(l=Yr(Dl(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==mi?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=$r.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if($r.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=!$r.und(a),m=n==c?s.v0>0:n<c;let f,h=!1;const g=1,v=Math.ceil(e/g);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(h=d==c||d>c==m,h&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*g,d+=i*g}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=ai(this),a=s.getValue();if(t){const e=Dl(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 wr.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(rs(this)){const{to:e,config:t}=this.animation;wr.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 $r.und(e)?(n=this.queue||[],this.queue=[]):n=[$r.obj(e)?e:Si({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>$i(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Zi(this._state,e&&this._lastCallId),wr.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=$r.obj(n)?n[t]:n,(null==n||Di(n))&&(n=void 0),o=$r.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return os(this)||(e.reverse&&([n,o]=[o,n]),o=Dl(o),$r.und(o)?ai(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Si({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Ni(n,((e,t)=>/^on/.test(t)?Ii(e,o):e))),hs(this,n,"onProps"),gs(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 Wi(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ls(this)||(ss(this,!0),Xr(i.pauseQueue),gs(this,"onPause",Ki(this,cs(this,this.animation.to)),this))},resume:()=>{ls(this)&&(ss(this,!1),rs(this)&&this._resume(),Xr(i.resumeQueue),gs(this,"onResume",Ki(this,cs(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=us(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=!$r.und(e.to),r=!$r.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&&!$r.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!jr(d,c);p&&(s.from=d),d=Dl(d);const m=!jr(u,a);m&&this._focus(u);const f=Di(t.to),{config:h}=s,{decay:g,velocity:v}=h;(o||r)&&(h.velocity=0),t.config&&!f&&function(e,t,n){n&&(Hi(n=Si({},n),t),t=Si({},n,t)),Hi(e,t),Object.assign(e,t);for(const t in zi)null==e[t]&&(e[t]=zi[t]);let{mass:o,frequency:r,damping:l}=e;$r.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)}(h,wi(t.config,l),t.config!==i.config?wi(i.config,l):void 0);let b=ai(this);if(!b||$r.und(u))return n(Ki(this,!0));const k=$r.und(t.reset)?r&&!t.default:!$r.und(d)&&Bi(t.reset,l),_=k?d:this.get(),y=Li(u),E=$r.num(y)||$r.arr(y)||ei(y),C=!f&&(!E||Bi(i.immediate||t.immediate,l));if(m){const e=bi(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=Al(u),B=!1;if(!w){const e=k||!os(this)&&p;(m||e)&&(B=jr(Li(_),y),w=!B),(jr(s.immediate,C)||C)&&jr(h.decay,g)&&jr(h.velocity,v)||(w=!0)}if(B&&rs(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||Al(a))&&(s.values=b.getPayload(),s.toValues=Al(u)?null:S==mi?[1]:Yr(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Kr(fs,(e=>hs(this,t,e)));const o=Ki(this,cs(this,a));Xr(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&wr.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?wi(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(Yi(t.to,t,this._state,this)):w?this._start():rs(this)&&!m?this._pendingCalls.add(n):n(ji(_))}_focus(e){const t=this.animation;e!==t.to&&(Ol(this)&&this._detach(),t.to=e,Ol(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Al(t)&&(Hl(t,this),Ji(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Al(e)&&Gl(e,this)}_set(e,t=!0){const n=Dl(e);if(!$r.und(n)){const e=ai(this);if(!e||!jr(n,e.getValue())){const o=bi(n);e&&e.constructor==o?e.setValue(n):ci(this,o.create(n)),e&&wr.batchedUpdates((()=>{this._onChange(n,t)}))}}return ai(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,gs(this,"onStart",Ki(this,cs(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),wi(this.animation.onChange,e,this)),wi(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;ai(this).reset(Dl(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),rs(this)||(is(this,!0),ls(this)||this._resume())}_resume(){ol.skipAnimation?this.finish():al.start(this)}_stop(e,t){if(rs(this)){is(this,!1);const n=this.animation;Kr(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Fl(this,{type:"idle",parent:this});const o=t?qi(this.get()):Ki(this.get(),cs(this,null!=e?e:n.to));Xr(this._pendingCalls,o),n.changed&&(n.changed=!1,gs(this,"onRest",o,this))}}}function cs(e,t){const n=Li(t);return jr(Li(e.get()),n)}function us(e,t=e.loop,n=e.to){let o=wi(t);if(o){const r=!0!==o&&Ri(o),l=(r||e).reverse,i=!r||r.reset;return ds(Si({},e,{loop:t,default:!1,pause:void 0,to:!l||Di(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function ds(e){const{to:t,from:n}=e=Ri(e),o=new Set;return $r.obj(t)&&ms(t,o),$r.obj(n)&&ms(n,o),e.keys=o.size?Array.from(o):null,e}function ps(e){const t=ds(e);return $r.und(t.default)&&(t.default=Ni(t)),t}function ms(e,t){qr(e,((e,n)=>null!=e&&t.add(n)))}const fs=["onStart","onRest","onChange","onPause","onResume"];function hs(e,t,n){e.animation[n]=t[n]!==xi(t,n)?Ii(t[n],e.key):void 0}function gs(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 vs=["onStart","onChange","onRest"];let bs=1;class ks{constructor(e,t){this.id=bs++,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(Si({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];$r.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(ds(e)),this}start(e){let{queue:t}=this;return e?t=Yr(e).map(ds):this.queue=[],this._flush?this._flush(this,t):(Bs(this,t),_s(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Kr(Yr(t),(t=>n[t].stop(!!e)))}else Zi(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if($r.und(e))this.start({pause:!0});else{const t=this.springs;Kr(Yr(e),(e=>t[e].pause()))}return this}resume(e){if($r.und(e))this.start({pause:!1});else{const t=this.springs;Kr(Yr(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,Zr(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&&Zr(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Zr(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)}wr.onFrame(this._onFrame)}}function _s(e,t){return Promise.all(t.map((t=>ys(e,t)))).then((t=>$i(e,t)))}async function ys(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=$r.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=$r.arr(r)||$r.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Kr(vs,(n=>{const o=t[n];if($r.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,Xr(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===xi(t,"cancel");(u||m&&d.asyncId)&&p.push(Wi(++e._lastAsyncId,{props:t,state:d,actions:{pause:Wr,resume:Wr,start(t,n){m?(Zi(d,e._lastAsyncId),n(qi(e))):(t.onRest=s,n(Yi(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=$i(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=us(t,i,r);if(n)return Bs(e,[n]),ys(e,n,!0)}return a&&wr.batchedUpdates((()=>a(f,e,e.item))),f}function Es(e,t){const n=Si({},e.springs);return t&&Kr(Yr(t),(e=>{$r.und(e.keys)&&(e=ds(e)),$r.obj(e.to)||(e=Si({},e,{to:void 0})),ws(n,e,(e=>Ss(e)))})),Cs(e,n),n}function Cs(e,t){qr(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Hl(t,e))}))}function Ss(e,t){const n=new as;return n.key=e,t&&Hl(n,t),n}function ws(e,t,n){t.keys&&Kr(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Bs(e,t){Kr(t,(t=>{ws(e.springs,t,(t=>Ss(t,e)))}))}const Is=["children"],xs=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,Is);const o=(0,Gr.useContext)(Ts),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Gr.useState)((()=>({inputs:t,result:e()}))),o=(0,Gr.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,Gr.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Ts;return Gr.createElement(i,{value:n},t)},Ts=(Ns=xs,Ps={},Object.assign(Ns,Gr.createContext(Ps)),Ns.Provider._context=Ns,Ns.Consumer._context=Ns,Ns);var Ns,Ps;xs.Provider=Ts.Provider,xs.Consumer=Ts.Consumer;const Ms=()=>{const e=[],t=function(t){Jl(`${Zl}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 Kr(e,((e,r)=>{if($r.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 Kr(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Kr(e,(e=>e.resume(...arguments))),this},t.set=function(t){Kr(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Kr(e,((e,o)=>{if($r.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 Kr(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Kr(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return $r.fun(e)?e(n,t):e};return t._getProps=n,t};function Rs(e,t,n){const o=$r.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Gr.useMemo)((()=>o||3==arguments.length?Ms():void 0),[]),l=(0,Gr.useRef)(0),i=oi(),s=(0,Gr.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Es(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?_s(e,t):new Promise((o=>{Cs(e,n),s.queue.push((()=>{o(_s(e,t))})),i()}))}})),[]),a=(0,Gr.useRef)([...s.ctrls]),c=[],u=li(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new ks(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=ps(n))}}(0,Gr.useMemo)((()=>{Kr(a.current.slice(e,u),(e=>{Oi(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Gr.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Es(e,c[t]))),m=(0,Gr.useContext)(xs),f=li(m),h=m!==f&&Ai(m);ii((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Kr(e,(e=>e()))),Kr(a.current,((e,t)=>{null==r||r.add(e),h&&e.start({default:m});const n=c[t];n&&(Fi(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),ti((()=>()=>{Kr(s.ctrls,(e=>e.stop(!0)))}));const g=p.map((e=>Si({},e)));return r?[g,r]:g}let Ls;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Ls||(Ls={}));class As extends ts{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Pl(...t);const n=this._get(),o=bi(n);ci(this,o.create(n))}advance(e){const t=this._get();jr(t,this.get())||(ai(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Os(this._active)&&Fs(this)}_get(){const e=$r.arr(this.source)?this.source.map(Dl):Yr(Dl(this.source));return this.calc(...e)}_start(){this.idle&&!Os(this._active)&&(this.idle=!1,Kr(ui(this),(e=>{e.done=!1})),ol.skipAnimation?(wr.batchedUpdates((()=>this.advance())),Fs(this)):al.start(this))}_attach(){let e=1;Kr(Yr(this.source),(t=>{Al(t)&&Hl(t,this),Ji(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Kr(Yr(this.source),(e=>{Al(e)&&Gl(e,this)})),this._active.clear(),Fs(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=Yr(this.source).reduce(((e,t)=>Math.max(e,(Ji(t)?t.priority:0)+1)),0))}}function Ds(e){return!1!==e.idle}function Os(e){return!e.size||Array.from(e).every(Ds)}function Fs(e){e.idle||(e.idle=!0,Kr(ui(e),(e=>{e.done=!0})),Fl(e,{type:"idle",parent:e}))}ol.assign({createStringInterpolator:Yl,to:(e,t)=>new As(e,t)}),al.advance;var zs=window.ReactDOM;function Vs(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 Hs=["style","children","scrollTop","scrollLeft"],Gs=/^--/;function Us(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Gs.test(e)||$s.hasOwnProperty(e)&&$s[e]?(""+t).trim():t+"px"}const Ws={};let $s={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 js=["Webkit","Ms","Moz","O"];$s=Object.keys($s).reduce(((e,t)=>(js.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),$s);const Ks=["x","y","z"],qs=/^(matrix|translate|scale|rotate|skew)/,Ys=/^(translate)/,Zs=/^(rotate|skew)/,Xs=(e,t)=>$r.num(e)&&0!==e?e+t:e,Qs=(e,t)=>$r.arr(e)?e.every((e=>Qs(e,t))):$r.num(e)?e===t:parseFloat(e)===t;class Js extends hi{constructor(e){let{x:t,y:n,z:o}=e,r=Vs(e,Ks);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Xs(e,"px"))).join(",")})`,Qs(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],$r.und(e))return;const n=Ys.test(t)?"px":Zs.test(t)?"deg":"";l.push(Yr(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Xs(r,n)})`,Qs(r,0)]:e=>[`${t}(${e.map((e=>Xs(e,n))).join(",")})`,Qs(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new ea(l,i)),super(r)}}class ea extends zl{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 Kr(this.inputs,((n,o)=>{const r=Dl(n[0]),[l,i]=this.transforms[o]($r.arr(r)?r:n.map(Dl));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Kr(this.inputs,(e=>Kr(e,(e=>Al(e)&&Hl(e,this)))))}observerRemoved(e){0==e&&Kr(this.inputs,(e=>Kr(e,(e=>Al(e)&&Gl(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Fl(this,e)}}const ta=["scrollTop","scrollLeft"];ol.assign({batchedUpdates:zs.unstable_batchedUpdates,createStringInterpolator:Yl,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 na=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new hi(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Ci(e)||"Anonymous";return(e=$r.str(e)?l[e]||(l[e]=_i(e,r)):e[Ei]||(e[Ei]=_i(e,r))).displayName=`Animated(${t})`,e};return qr(e,((t,n)=>{$r.arr(e)&&(n=Ci(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=Vs(o,Hs),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Ws[t]||(Ws[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=Us(t,r[t]);Gs.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 Js(e),getComponentProps:e=>Vs(e,ta)}).animated,oa=e=>e+1,ra=e=>({top:e.offsetTop,left:e.offsetLeft});var la=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)(oa,0),[u,p]=(0,s.useReducer)(oa,0),[m,f]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>l.current?ra(l.current):null),[r]),g=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,rr.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",g()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void g();l.current.style.transform="";const e=ra(l.current);c(),f({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=$r.fun(e),[[o],r]=Rs(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 ia=".block-editor-block-list__block",sa=".block-list-appender";function aa(e,t){return t.closest([ia,sa].join(","))===e}function ca(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=rr.focus.tabbable.find(t.current).filter((e=>(0,rr.isTextField)(e))),r=-1===n,l=(r?u.last:u.first)(o)||t.current;aa(t.current,l)?(0,rr.placeCaretAtHorizontalEdge)(l,r):t.current.focus()}),[n]),t}function ua(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function da(){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",ua),t.addEventListener("mouseover",ua),()=>{t.removeEventListener("mouseout",ua),t.removeEventListener("mouseover",ua),t.classList.remove("is-hovered")}}),[e])}function pa(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(),h=n(e),g=l(e),v=s(e),b=u(e,!0),k=p(m);return c()({"is-selected":g,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":h,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":g&&f&&d()})}),[e])}function ma(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 fa(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 ha(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 ga(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):aa(r,l.target)&&n(e)}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var va=window.wp.keycodes;function ba(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!==va.ENTER&&s!==va.BACKSPACE&&s!==va.DELETE||a!==i||(0,rr.isTextField)(a)||(t.preventDefault(),s===va.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function ka(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 _a=n(4979),ya=n.n(_a);function Ea(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,rr.getScrollContainer)(e)||e.ownerDocument.defaultView;o&&ya()(e,o,{onlyScrollIfNeeded:!0})}),[n]),t}const Ca=(0,s.createContext)({refs:new Map,callbacks:new Map});function Sa(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(Ca.Provider,{value:n},t)}function wa(e){const{refs:t,callbacks:n}=(0,s.useContext)(Ca),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 Ba(e){const{refs:t}=(0,s.useContext)(Ca),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 Ia(e){const{callbacks:t}=(0,s.useContext)(Ca),n=Ba(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 xa(e,t){Array.from(e.closest(".is-root-container").querySelectorAll(".rich-text")).forEach((e=>{t?e.setAttribute("contenteditable",!0):e.removeAttribute("contenteditable")}))}function Ta(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 h(t){let{isSelectionEnd:n}=t;const l=p.getSelection();if(!l.rangeCount||l.isCollapsed)return void xa(u,!0);const i=function(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(ia);return t?t.id.slice("block-".length):void 0}(l.focusNode);if(e===i){if(r(e),n&&(xa(u,!0),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 g(){d.removeEventListener("selectionchange",h),p.removeEventListener("mouseup",g),f=p.requestAnimationFrame((()=>{h({isSelectionEnd:!0}),n()}))}function v(n){let{buttons:o}=n;1===o&&l()&&i(e)&&(m=d.activeElement,t(),d.addEventListener("selectionchange",h),p.addEventListener("mouseup",g),xa(u,!1))}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&&(xa(u,!1),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",h),p.removeEventListener("mouseup",g),p.cancelAnimationFrame(f)}}),[e,t,n,o,r,l,i,s])}function Na(){const e=(0,s.useContext)(pm);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Pa(){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)(Ma),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:g,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),h=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==h?void 0:h.apiVersion)||1,blockTitle:null==h?void 0:h.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),_=(0,h.sprintf)((0,h.__)("Block: %s"),g),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,ca(n),Ea(n),wa(n),ga(n),Ta(n),ba(n),ka(n),da(),Na(),la({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":g,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,pa(n),ma(n),fa(n),ha(n)),style:{...l.style,...e.style}}}Pa.save=r.__unstableGetBlockProps;const Ma=(0,s.createContext)();function Ra(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Pa(o,{__unstableIsHtml:n}),t)}const La=(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),h=u(n,o),{name:g,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:h,block:d,name:g,attributes:v,isValid:b,isSelected:p}})),Aa=(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 Da=(0,d.compose)(d.pure,La,Aa,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){let{mode:t,isLocked:n,canRemove:o,clientId:l,isSelected:i,isSelectionEnabled:a,className:d,name:p,isValid:f,attributes:h,wrapperProps:g,setAttributes:v,onReplace:b,onInsertBlocksAfter:k,onMerge:_,toggleSelection:y}=e;const{removeBlock:E}=(0,m.useDispatch)(zn),C=(0,s.useCallback)((()=>E(l)),[l]);let S=(0,s.createElement)(ur,{name:p,isSelected:i,attributes:h,setAttributes:v,insertBlocksAfter:n?void 0:k,onReplace:o?b:void 0,onRemove:o?C:void 0,mergeBlocks:o?_:void 0,clientId:l,isSelectionEnabled:a,toggleSelection:y});const w=(0,r.getBlockType)(p);null!=w&&w.getEditWrapperProps&&(g=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}(g,w.getEditWrapperProps(h)));const B=g&&!!g["data-align"];let I;if(B&&(S=(0,s.createElement)("div",{className:"wp-block","data-align":g["data-align"]},S)),f)I="html"===t?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},S),(0,s.createElement)(Ra,{isHtml:!0},(0,s.createElement)(Cr,{clientId:l}))):(null==w?void 0:w.apiVersion)>1?S:(0,s.createElement)(Ra,g,S);else{const e=(0,r.getSaveContent)(w,h);I=(0,s.createElement)(Ra,{className:"has-warning"},(0,s.createElement)(vr,{clientId:l}),(0,s.createElement)(s.RawHTML,null,(0,rr.safeHTML)(e)))}const x={clientId:l,className:d,wrapperProps:(0,u.omit)(g,["data-align"]),isAligned:B},T=(0,s.useMemo)((()=>x),Object.values(x));return(0,s.createElement)(Ma.Provider,{value:T},(0,s.createElement)(yr,{fallback:(0,s.createElement)(Ra,{className:"has-warning"},(0,s.createElement)(kr,null))},I))})),Oa=window.wp.htmlEntities,Fa=(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 za=[(0,s.createInterpolateElement)((0,h.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,h.__)("Drag files into the editor to automatically insert media blocks."),(0,h.__)("Change a block's type by pressing the block icon on the toolbar.")];var Va=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*za.length));return(0,s.createElement)(p.Tip,null,za[e])},Ha=(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"})),Ga=(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:Ha});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)})),Ua=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)(Ga,{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 Wa(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:h}=a.dispatch(zn),{getBlockName:g,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&&(h(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),h(),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===g(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 $a=(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]),Wa(e),(0,s.createElement)(Sa,null,t)}));function ja(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)(fm,null)))}function Ka(){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:Ka()},e))}function Ya(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 Za(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r}=e(zn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r()}}function Xa(){const{isMultiSelecting:e,multiSelectedBlockClientIds:t,hasMultiSelection:n,selectedBlockClientId:o}=(0,m.useSelect)(Za,[]),r=Ba(o),l=Ba((0,u.first)(t)),i=Ba((0,u.last)(t));return(0,d.useRefEffect)((s=>{const{ownerDocument:a}=s,{defaultView:c}=a;if(!n||e){if(!o||e)return;const t=c.getSelection();if(t.rangeCount&&!t.isCollapsed){const e=r.current,{startContainer:n,endContainer:o}=t.getRangeAt(0);!e||e.contains(n)&&e.contains(o)||t.removeAllRanges()}return}const{length:u}=t;if(u<2)return;if(!l.current||!i.current)return;s.focus();const d=c.getSelection(),p=a.createRange(),m=Ya(l.current,"start"),f=Ya(i.current,"end");var h;h=s,Array.from(h.querySelectorAll(".rich-text:not( .editor-post-title__input )")).forEach((e=>{e.removeAttribute("contenteditable")})),p.setStartBefore(m),p.setEndAfter(f),d.removeAllRanges(),d.addRange(p)}),[n,e,t,o])}function Qa(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}function Ja(e,t,n,o){let r,l=rr.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(!rr.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 ec(){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 h(e){const t=l(),n=i(),o=e?t:n;o&&u(o)}function g(t){const{keyCode:l,target:i}=t,c=l===va.UP,u=l===va.DOWN,m=l===va.LEFT,g=l===va.RIGHT,v=c||m,b=m||g,k=c||u,_=b||k,y=t.shiftKey,E=y||t.ctrlKey||t.altKey||t.metaKey,C=k?rr.isVerticalEdge:rr.isHorizontalEdge,{ownerDocument:S}=d,{defaultView:w}=S;if(a())return void(_&&((y?f:h)(v),t.preventDefault()));if(k?p||(p=(0,rr.computeCaretRect)(w)):p=null,t.defaultPrevented)return;if(!_)return;if(!function(e,t,n){if((t===va.UP||t===va.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(i,l,E))return;const B=(0,rr.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=Ja(e,t,d);return!n||!function(e,t){return e.closest(ia)===t.closest(ia)}(e,n)}(i,v)&&C(i,v)&&(f(v),t.preventDefault())}else if(k&&(0,rr.isVerticalEdge)(i,v)&&!I){const e=Ja(i,v,d,!0);e&&((0,rr.placeCaretAtVerticalEdge)(e,v,p),t.preventDefault())}else if(b&&w.getSelection().isCollapsed&&(0,rr.isHorizontalEdge)(i,B)&&!I){const e=Ja(i,B,d);(0,rr.placeCaretAtHorizontalEdge)(e,v),t.preventDefault()}}return d.addEventListener("mousedown",m),d.addEventListener("keydown",g),()=>{d.removeEventListener("mousedown",m),d.removeEventListener("keydown",g)}}),[])}var tc=window.wp.keyboardShortcuts;function nc(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(zn),{multiSelect:o}=(0,m.useDispatch)(zn),r=(0,tc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;if(!(0,rr.isEntirelySelected)(l.target))return;const i=t(),[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 oc(){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";rr.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),g=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===va.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==va.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(Qa(e.target)&&Qa(rr.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!==va.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=rr.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,g]),h]}(),o=(0,m.useSelect)((e=>e(zn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,Xa(),nc(),ec(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,o)return e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var rc=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=oc();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 lc="editor-styles-wrapper";function ic(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var sc=(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,g]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=ic(null==a?void 0:a.styles),_=ic(null==a?void 0:a.scripts),y=Ka(),[E,C,S]=oc(),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),g(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(`.${lc}`)||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,h.__)("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()(lc,...v)},(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),ac={grad:.9,turn:360,rad:360/(2*Math.PI)},cc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},uc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},dc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},pc=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},mc=function(e){return{r:dc(e.r,0,255),g:dc(e.g,0,255),b:dc(e.b,0,255),a:dc(e.a)}},fc=function(e){return{r:uc(e.r),g:uc(e.g),b:uc(e.b),a:uc(e.a,3)}},hc=/^#([0-9a-f]{3,8})$/i,gc=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},vc=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}},bc=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}},kc=function(e){return{h:pc(e.h),s:dc(e.s,0,100),l:dc(e.l,0,100),a:dc(e.a)}},_c=function(e){return{h:uc(e.h),s:uc(e.s),l:uc(e.l),a:uc(e.a,3)}},yc=function(e){return bc((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},Ec=function(e){return{h:(t=vc(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},Cc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Sc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Bc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ic={string:[[function(e){var t=hc.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?uc(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?uc(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=wc.exec(e)||Bc.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:mc({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=Cc.exec(e)||Sc.exec(e);if(!t)return null;var n,o,r=kc({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(ac[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return yc(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 cc(t)&&cc(n)&&cc(o)?mc({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(!cc(t)||!cc(n)||!cc(o))return null;var i=kc({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return yc(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!cc(t)||!cc(n)||!cc(o))return null;var i=function(e){return{h:pc(e.h),s:dc(e.s,0,100),v:dc(e.v,0,100),a:dc(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return bc(i)},"hsv"]]},xc=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]},Tc=function(e,t){var n=Ec(e);return{h:n.h,s:dc(n.s+100*t,0,100),l:n.l,a:n.a}},Nc=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Pc=function(e,t){var n=Ec(e);return{h:n.h,s:n.s,l:dc(n.l+100*t,0,100),a:n.a}},Mc=function(){function e(e){this.parsed=function(e){return"string"==typeof e?xc(e.trim(),Ic.string):"object"==typeof e&&null!==e?xc(e,Ic.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 uc(Nc(this.rgba),2)},e.prototype.isDark=function(){return Nc(this.rgba)<.5},e.prototype.isLight=function(){return Nc(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=fc(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?gc(uc(255*r)):"","#"+gc(t)+gc(n)+gc(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return fc(this.rgba)},e.prototype.toRgbString=function(){return t=(e=fc(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 _c(Ec(this.rgba))},e.prototype.toHslString=function(){return t=(e=_c(Ec(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=vc(this.rgba),{h:uc(e.h),s:uc(e.s),v:uc(e.v),a:uc(e.a,3)};var e},e.prototype.invert=function(){return Rc({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),Rc(Tc(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Rc(Tc(this.rgba,-e))},e.prototype.grayscale=function(){return Rc(Tc(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Rc(Pc(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Rc(Pc(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?Rc({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):uc(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ec(this.rgba);return"number"==typeof e?Rc({h:e,s:t.s,l:t.l,a:t.a}):uc(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Rc(e).toHex()},e}(),Rc=function(e){return e instanceof Mc?e:new Mc(e)},Lc=[],Ac=function(e){e.forEach((function(e){Lc.indexOf(e)<0&&(e(Mc,Ic),Lc.push(e))}))};function Dc(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 Oc=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Fc=function(e){return.2126*Oc(e.r)+.7152*Oc(e.g)+.0722*Oc(e.b)};function zc(e){e.prototype.luminance=function(){return e=Fc(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=Fc(l))>(a=Fc(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 Vc=n(3692),Hc=n.n(Vc);const Gc=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Uc(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=h();)!1!==t&&e.push(t);return e}function h(){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 g(){const e=p(/^([^{]+)/);if(e)return Wc(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=Wc(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Gc,""),value:n?Wc(n[0]).replace(Gc,""):""});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=Wc(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:Wc(t[1]),media:Wc(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Wc(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=Wc(t[1]),o=Wc(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=g()||[];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=g();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return $c(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Wc(e){return e?e.replace(/^\s+|\s+$/g,""):""}function $c(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){$c(e,o)})):n&&"object"==typeof n&&$c(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var jc=n(5717),Kc=n.n(jc),qc=Yc;function Yc(e){this.options=e||{}}Yc.prototype.emit=function(e){return e},Yc.prototype.visit=function(e){return this[e.type](e)},Yc.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 Zc=Xc;function Xc(e){qc.call(this,e)}Kc()(Xc,qc),Xc.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Xc.prototype.comment=function(e){return this.emit("",e.position)},Xc.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Xc.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xc.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("}")},Xc.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Xc.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Xc.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xc.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Xc.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Xc.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("}")},Xc.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Xc.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xc.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Xc.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("}"):""},Xc.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var Qc=Jc;function Jc(e){e=e||{},qc.call(this,e),this.indentation=e.indent}Kc()(Jc,qc),Jc.prototype.compile=function(e){return this.stylesheet(e)},Jc.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Jc.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Jc.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Jc.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}")},Jc.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}")},Jc.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Jc.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Jc.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}")},Jc.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)+"}")},Jc.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")},Jc.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}")},Jc.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}")},Jc.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}")},Jc.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Jc.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()+"}"):""},Jc.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Jc.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var eu=function(e,t){try{const r=Uc(e);return n=Hc().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new Zc(o):new Qc(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function tu(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 nu(e,t){return new URL(e,t).toString()}var ou=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]};tu(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+nu(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 ru=/^(body|html|:root).*$/;var lu=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(ru)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},iu=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(lu(t)),o&&r.push(ou(o)),r.length?eu(n,(0,d.compose)(r)):n}))};const su=".editor-styles-wrapper";function au(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(su);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=Rc(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function cu(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>iu(t,su)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:au(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let uu;Ac([Dc,zc]);const du=2e3;var pu=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]);uu=uu||(0,d.pure)(fm);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>du?du*f:void 0}},(0,s.createElement)(sc,{head:(0,s.createElement)(cu,{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"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:du}},l,(0,s.createElement)(uu,{renderAppender:!1}))))},mu=(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)($a,{value:c,settings:a},r?(0,s.createElement)(ja,{onClick:l}):(0,s.createElement)(pu,{viewportWidth:o,__experimentalPadding:n})):null}));function fu(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)($a,{value:p,settings:a},(0,s.createElement)(gm,{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 hu=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)(mu,{__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,h.__)("No Preview Available."))),!p&&(0,s.createElement)(Ua,{title:i,icon:a,description:c}))},gu=(0,s.createContext)(),vu=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(gu);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)}))})),bu=(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 ku(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)(Ga,{icon:n}):(0,h.sprintf)(
|
11 |
/* translators: %d: Number of blocks. */
|
12 |
+
(0,h._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Ga,{icon:bu})))))}var _u=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)(ku,{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 yu(){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 Eu=(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)(_u,{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)(vu,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,yu()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===va.ENTER&&(e.preventDefault(),l(o,yu()?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)(Ga,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))})),Cu=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Nt.speak)((0,h.__)("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))})),Su=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(gu);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),wu=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(Cu,{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)(Su,{key:t},e.map(((e,l)=>(0,s.createElement)(Eu,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)},Bu=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))},Iu=(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])]},xu=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(gu.Provider,{value:n},t)};const Tu=[];var Nu=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=Iu(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]),g=(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:Tu);return(0,s.createElement)(xu,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(Bu,{title:(0,h._x)("Most used","blocks")},(0,s.createElement)(wu,{items:p,onSelect:c,onHover:o,label:(0,h._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=f[e.slug];return t&&t.length?(0,s.createElement)(Bu,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(wu,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(Bu,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,h.__)("Uncategorized")},(0,s.createElement)(wu,{items:m,onSelect:c,onHover:o,label:(0,h.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=g[t];return r&&r.length?(0,s.createElement)(Bu,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(wu,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},Pu=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,h.__)("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,h.__)("Explore all patterns"),onClick:()=>r()},(0,h._x)("Explore","Label for showing all block patterns"))))},Mu=window.wp.notices,Ru=(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)(Mu.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,h.sprintf)(
|
13 |
/* translators: %s: block pattern title. */
|
14 |
+
(0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function Lu(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)(Lu)}`;return(0,s.createElement)(_u,{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)(mu,{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 Au(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Du=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,h.__)("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)(Lu,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(Au,{key:e.name}))))};function Ou(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 Fu(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,h.__)("Search for patterns"),placeholder:(0,h.__)("Search")}))}var zu=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)(Fu,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(Ou,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},Vu=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(wo,{className:"block-editor-inserter__no-results-icon",icon:Ha}),(0,s.createElement)("p",null,(0,h.__)("No results found.")))},Hu=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:g,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):g(e,p,d,!0,a||n?0:null,t);const s=(0,h.sprintf)(// translators: %d: the name of the block that has been added
|
15 |
+
(0,h._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Nt.speak)(s),i&&i()}),[l,c,f,g,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const Gu=e=>e.name||"",Uu=e=>e.title,Wu=e=>e.description||"",$u=e=>e.keywords||[],ju=e=>e.category,Ku=()=>null;function qu(){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 Yu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(qu(e))},Zu=(e,t)=>(0,u.differenceWith)(e,Yu(t),((e,t)=>t.includes(e))),Xu=(e,t,n,o)=>0===Yu(o).length?e:Qu(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}}),Qu=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=Yu(t);if(0===o.length)return e;const r=e.map((e=>[e,Ju(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 Ju(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Gu,getTitle:r=Uu,getDescription:l=Wu,getKeywords:i=$u,getCategory:s=ju,getCollection:a=Ku}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=s(e),h=a(e),g=qu(t),v=qu(d);let b=0;if(g===v)b+=30;else if(v.startsWith(g))b+=20;else{const e=[c,d,p,...m,f,h].join(" "),t=(0,u.words)(g);0===Zu(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&b++,b}function ed(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,h.sprintf)(
|
16 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
17 |
+
(0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var td=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Nt.speak,500),[l,i]=Hu({shouldFocusBlock:!0}),[a,,c]=Ru(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?Qu(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,h.sprintf)(
|
18 |
/* translators: %d: number of results. */
|
19 |
+
(0,h._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)(ed,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(xu,null,!f&&(0,s.createElement)(Vu,null),f&&(0,s.createElement)(Du,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function nd(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)(zu,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(td,{filterValue:o,selectedCategory:l,patternCategories:n}))}var od=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,h.__)("Patterns"),closeLabel:(0,h.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(nd,n))};function rd(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=Ru(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)(Du,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var ld=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=Ru(),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,h._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,!l&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Pu,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),(0,s.createElement)(rd,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d})),l&&(0,s.createElement)(od,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},id=window.wp.url;function sd(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Iu(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(Vu,null):(0,s.createElement)(Bu,{title:(0,h.__)("Reusable blocks")},(0,s.createElement)(wu,{items:i,onSelect:l,onHover:t,label:(0,h.__)("Reusable blocks")}))}var ad=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(sd,{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,id.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,h.__)("Manage Reusable blocks"))))};const{Fill:cd,Slot:ud}=(0,p.createSlotFill)("__unstableInserterMenuExtension");cd.Slot=ud;var dd=cd;const pd=[];var md=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:g=!0,shouldFocusBlock:v=!0}=e;const b=(0,d.useDebounce)(Nt.speak,500),[k,_]=Hu({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[y,E,C,S]=Iu(k,_),[w,,B]=Ru(_,k),I=(0,s.useMemo)((()=>{const e=Xu((0,u.orderBy)(y,["frecency"],["desc"]),E,C,t);return void 0!==m?e.slice(0,m):e}),[t,y,E,C,m]),x=(0,s.useMemo)((()=>{const e=Qu(w,t);return void 0!==c?e.slice(0,c):e}),[t,w,c]);(0,s.useEffect)((()=>{if(!t)return;const e=I.length+x.length,n=(0,h.sprintf)(
|
20 |
/* translators: %d: number of results. */
|
21 |
+
(0,h._n)("%d result found.","%d results found.",e),e);b(n)}),[t,b]);const T=(0,d.useAsyncList)(I,{step:9}),N=(0,d.useAsyncList)(T.length===I.length?x:pd),P=!(0,u.isEmpty)(I)||!(0,u.isEmpty)(x);return(0,s.createElement)(xu,null,!f&&!P&&(0,s.createElement)(Vu,null),!!I.length&&(0,s.createElement)(Bu,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Blocks"))},(0,s.createElement)(wu,{items:T,onSelect:S,onHover:o,label:(0,h.__)("Blocks"),isDraggable:g})),!!I.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),!!x.length&&(0,s.createElement)(Bu,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(Du,{shownPatterns:N,blockPatterns:x,onClickPattern:B,isDraggable:g}))),f&&(0,s.createElement)(dd.Slot,{fillProps:{onSelect:S,onHover:o,filterValue:t,hasItems:P,rootClientId:k}},(e=>e.length?e:P?null:(0,s.createElement)(Vu,null))))};const fd={name:"blocks",
|
22 |
/* translators: Blocks tab title in the block inserter. */
|
23 |
+
title:(0,h.__)("Blocks")},hd={name:"patterns",
|
24 |
/* translators: Patterns tab title in the block inserter. */
|
25 |
+
title:(0,h.__)("Patterns")},gd={name:"reusable",
|
26 |
/* translators: Reusable blocks tab title in the block inserter. */
|
27 |
+
title:(0,h.__)("Reusable")};var vd=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[fd];return n&&e.push(hd),o&&e.push(gd),e}),[fd,n,hd,o,gd]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},bd=(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,g]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=Hu({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]),I=(0,s.useCallback)(((e,t)=>{E(e,{patternName:t}),i()}),[E,i]),x=(0,s.useCallback)((e=>{C(!!e),b(e)}),[C,b]),T=(0,s.useCallback)((e=>{_(e)}),[_]),N=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(Nu,{rootClientId:y,onInsert:B,onHover:x,showMostUsedBlocks:c})),a&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(p.VisuallyHidden,{as:"h2"},(0,h.__)("A tip for using the block editor")),(0,s.createElement)(Va,null)))),[y,B,x,f,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(ld,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:k})),[y,I,T,k]),M=(0,s.useMemo)((()=>(0,s.createElement)(ad,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),R=(0,s.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:M),[N,P,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),g(e)},value:f,label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search"),ref:L}),!!f&&(0,s.createElement)(md,{filterValue:f,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!f&&(S||w)&&(0,s.createElement)(vd,{showPatterns:S,showReusableBlocks:w},R),!f&&!S&&!w&&N)),a&&v&&(0,s.createElement)(hu,{item:v}))}));function kd(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r}=e;const[l,i]=(0,s.useState)(""),[a,u]=Hu({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[d]=Iu(a,u),[f]=Ru(u,a),g=f.length&&!!l,v=g&&f.length>6||d.length>6,{setInserterIsOpened:b,insertionIndex:k}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(zn),l=n(o);return{setInserterIsOpened:t().__experimentalSetIsInserterOpened,insertionIndex:-1===l?r():l}}),[o,n]);return(0,s.useEffect)((()=>{b&&b(!1)}),[b]),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":v,"has-expand":b})},v&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:l,onChange:e=>{i(e)},label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(md,{filterValue:l,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:g?2:0,maxBlockTypes:6,isDraggable:!1})),b&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{b({rootClientId:n,insertionIndex:k,filterValue:l})},"aria-label":(0,h.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,h.__)("Browse all")))}const _d=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={}}=e;t=a?(0,h.sprintf)(// translators: %s: the name of the block when there is only one
|
28 |
+
(0,h._x)("Add %s","directly add the only allowed block"),l):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:u,...d}=c;return(0,s.createElement)(p.Button,i({icon:Fa,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 yd 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=_d}=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)(kd,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r}):(0,s.createElement)(bd,{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,h.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var Ed=(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,h.sprintf)(// translators: %s: the name of the block that has been added
|
29 |
+
(0,h.__)("%s block added"),a.title);(0,Nt.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(yd),Cd=(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,Oa.decodeEntities)(r)||(0,h.__)("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,h.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{va.ENTER!==e.keyCode&&va.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(Ed,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Sd(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(Ed,{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,h.sprintf)(// translators: %s: the name of the block when there is only one
|
30 |
+
(0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const f=!m;let g=(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:Fa}));return(f||m)&&(g=(0,s.createElement)(p.Tooltip,{text:n},g)),g},isAppender:!0})}const wd=(0,s.forwardRef)(((e,t)=>(Rt()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Sd(e,t))));var Bd=(0,s.forwardRef)(Sd),Id=(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)(Cd,{rootClientId:n}):(0,s.createElement)(Bd,{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 xd(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 Td=(0,s.createContext)();function Nd(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(zn),l=(0,s.useContext)(Td),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:g,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=Ia(u),k=Ia(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,h.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,h.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,h.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=xd(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+"--"+g},(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)(Ed,{position:"bottom center",clientId:f,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Pd(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(zn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(Td.Provider,{value:(0,s.useRef)(!1)},r&&(0,s.createElement)(Nd,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function Md(){const e=(0,s.useContext)(Td),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(),h=t.clientY-f.top,g=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>h||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>g));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 Rd="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Ld="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Ad(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 Dd(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=Ad(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 Od=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,h,g]=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,rr.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:h,onDragEnd:()=>{b(),d.current=!1,g(),i&&i()},__experimentalDragComponent:(0,s.createElement)(ku,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Fd=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=Ad(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:g,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":!!g}),O=(0,h.__)("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)(Ga,{icon:null==l?void 0:l.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Od,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:bu,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===va.UP,l=n===va.DOWN,i=n===va.LEFT,s=n===va.RIGHT,a=n===va.TAB,c=n===va.ESCAPE,u=n===va.ENTER,d=n===va.SPACE,p=e.shiftKey;if(n===va.BACKSPACE||n===va.DELETE)return k(t),void e.preventDefault();const m=I(),f=x(),h=T(f||m),g=N(f||m),v=a&&p||r,b=a&&!p||l,_=i,y=s;let E;if(v)E=h;else if(b)E=g;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=rr.focus.tabbable.findNext(t)}while(t&&o.contains(t));t||(t=o.ownerDocument.defaultView.frameElement,t=rr.focus.tabbable.findNext(t))}else t=rr.focus.tabbable.findPrevious(o);t&&(e.preventDefault(),t.focus(),R())}},label:E,className:"block-selection-button_select-button"},(0,s.createElement)(Dd,{clientId:t})))))};function zd(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var Vd=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=!rr.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]=rr.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,tc.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=zd(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=zd(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)},Hd=(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"})),Gd=(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"})),Ud=(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"})),Wd=(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 $d=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?Hd:Gd:Ud:"down"===e?"horizontal"===t?(0,h.isRTL)()?Gd:Hd:Wd:null,jd=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move right"):(0,h.__)("Move left"):(0,h.__)("Move up"):"down"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move left"):(0,h.__)("Move right"):(0,h.__)("Move down"):null,Kd=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(Kd),g=(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),h=t((0,u.last)(d)),g=s(m),v=a(p),b=0===f,k=h===g.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:$d(o,C),label:jd(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,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,h.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,h.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,h.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
31 |
(0,h._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,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
32 |
(0,h._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,h.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
|
33 |
(0,h.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
42 |
(0,h.__)("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,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
43 |
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
44 |
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
45 |
+
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(g,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),qd=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Kd,i({direction:"up",ref:t},e)))),Yd=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Kd,i({direction:"down",ref:t},e))));var Zd=(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),h=d((0,u.first)(p)),g=i(m),v=0===g,b=i((0,u.last)(p))===c(h).length-1;return{blockType:f?(0,r.getBlockType)(f.name):null,canMove:a(o,h),rootClientId:h,firstIndex:g,isFirst:v,isLast:b,orientation:null===(n=s(h))||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),g=()=>f(!0),v=()=>f(!1);if(!r||t&&n&&!a)return null;const b=(0,h.__)("Drag");return(0,s.createElement)("div",{className:c()("block-editor-block-mover",{"is-visible":m||!l,"is-horizontal":"horizontal"===u})},!d&&(0,s.createElement)(Od,{clientIds:o,cloneClassname:"block-editor-block-mover__drag-clone"},(e=>(0,s.createElement)(p.Button,i({icon:bu,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:g,onBlur:v},(e=>(0,s.createElement)(qd,i({clientIds:o},e)))),(0,s.createElement)(p.ToolbarItem,{onFocus:g,onBlur:v},(e=>(0,s.createElement)(Yd,i({clientIds:o},e))))))}));const{clearTimeout:Xd,setTimeout:Qd}=window,Jd=200;function ep(e){let{ref:t,isFocused:n,debounceTimeout:o=Jd,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&&Xd&&Xd(e)};return(0,s.useEffect)((()=>()=>d()),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=Qd((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function tp(e){let{ref:t,debounceTimeout:n=Jd,onChange:o=u.noop}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=ep({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 np(){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=Ad(n),c=(0,s.useRef)(),{gestures:u}=tp({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,h.sprintf)(
|
46 |
/* translators: %s: Name of the block's parent. */
|
47 |
+
(0,h.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(Ga,{icon:a.icon})}))}var op=(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 rp(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,h.__)("Preview")),(0,s.createElement)(mu,{viewportWidth:500,blocks:t})))))}var lp=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,h.__)("Transform to"),className:t},i&&(0,s.createElement)(rp,{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)(Ga,{icon:n,showColors:!0}),l)})))},ip=(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"})),sp=window.wp.tokenList,ap=n.n(sp);function cp(e,t,n){const o=new(ap())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function up(e){return(0,u.find)(e,"isDefault")}function dp(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?up(e)?e:[{name:"default",label:(0,h._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(ap())(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=cp(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:f,className:a}}function pp(e){let{clientId:t,onSwitch:n=u.noop}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=dp({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?ip:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function mp(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(pp,{clientId:o,onSwitch:n}))}const fp=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=fp(e,t,n);if(o)return o}}},hp=(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 gp(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,h.__)("Preview")),(0,s.createElement)(vp,{patterns:t,onSelect:n})))))}function vp(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,h.__)("Patterns list")}),t.map((e=>(0,s.createElement)(bp,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function bp(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(bp,`${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)(mu,{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 kp=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=fp(r,t.name,o);if(n){e=!0,o.add(n.clientId),hp(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)(gp,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:Hd},(0,h.__)("Patterns"))):null};const _p=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(zn),l=Ad(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:f,patterns:g}=(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,h=1===n.length,g=h&&c(f);let v;var b;h?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:op;return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==g||!g.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==g||!g.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)(Ga,{icon:d,showColors:!0})}));const y=f,E=1===n.length?(0,h.sprintf)(
|
48 |
/* translators: %s: block title. */
|
49 |
(0,h.__)("%s: Change block type or style"),f):(0,h.sprintf)(
|
50 |
/* translators: %d: number of blocks. */
|
51 |
+
(0,h._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)(Ga,{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)(Dd,{clientId:t}))),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)(kp,{blocks:n,patterns:g,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(lp,{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)(mp,{hoveredBlock:n[0],onSwitch:l}))})))))};var yp=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)(_p,{clientIds:t,blocks:n})},Ep=(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"})),Cp=window.wp.blob;function Sp(){const{getBlockName:e}=(0,m.useSelect)(zn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(Mu.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,h.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
|
52 |
(0,h.__)('Copied "%s" to clipboard.'),s):(0,h.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
53 |
(0,h.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,h.sprintf)(// Translators: %d: Number of blocks being copied.
|
54 |
(0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,h.sprintf)(// Translators: %d: Number of blocks being cut.
|
55 |
+
(0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function wp(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o}=(0,m.useSelect)(zn),{flashBlock:l,removeBlocks:i,replaceBlocks:s}=(0,m.useDispatch)(zn),a=Sp();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,rr.documentHasUncollapsedSelection)(t):(0,rr.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,rr.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!o&&(o=r.map((e=>`<img src="${(0,Cp.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 Bp=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:wp()},t)};function Ip(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),h=i(t[0]),g=(0,u.every)(f,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,h))),v=l(d(),h),b=a(t,h),k=c(t,h),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(zn),T=Sp();return n({canDuplicate:g,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:h,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(){I(!0),x(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 xp=(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,h.__)("Edit as HTML"):(0,h.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),Tp=(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,h.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)}));const{Fill:Np,Slot:Pp}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Np.Slot=Pp;var Mp=Np;function Rp(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,h._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,h._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}const{Fill:Lp,Slot:Ap}=(0,p.createSlotFill)("BlockSettingsMenuControls");function Dp(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(Lp,t))}Dp.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&&!p,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)(Ap,{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)(Rp,i({},a,{onClose:null==t?void 0:t.onClose})))}))};var Op=Dp;const Fp={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function zp(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,h.__)("Copy"))}var Vp=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const a=(0,u.castArray)(t),c=a.length,d=a[0],{onlyBlock:f,title:g}=(0,m.useSelect)((e=>{var t;const{getBlockCount:n,getBlockName:o}=e(zn),{getBlockType:l}=e(r.store);return{onlyBlock:1===n(),title:null===(t=l(o(d)))||void 0===t?void 0:t.title}}),[d]),v=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(tc.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")}}),[]),b=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),k=(0,h.sprintf)(
|
56 |
/* translators: %s: block name */
|
57 |
+
(0,h.__)("Remove %s"),g),_=1===c?k:(0,h.__)("Remove blocks");return(0,s.createElement)(Ip,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:a,canRemove:m,onDuplicate:g,onInsertAfter:k,onInsertBefore:y,onRemove:E,onCopy:C,onMoveTo:S,blocks:w}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:Ep,label:(0,h.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Fp,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(Mp.Slot,{fillProps:{onClose:l}}),1===c&&(0,s.createElement)(Tp,{clientId:d}),(0,s.createElement)(zp,{blocks:w,onCopy:C}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,g,b),shortcut:v.duplicate},(0,h.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,y),shortcut:v.insertBefore},(0,h.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:v.insertAfter},(0,h.__)("Insert after"))),a&&!f&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,S)},(0,h.__)("Move to")),1===c&&(0,s.createElement)(xp,{clientId:d,onToggle:l})),(0,s.createElement)(Op.Slot,{fillProps:{onClose:l},clientIds:t}),"function"==typeof o?o({onClose:l}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:l}))),m&&(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,E,b),shortcut:v.remove},_)))}))}))},Hp=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Vp,i({clientIds:t,toggleProps:e},n)))))};function Gp(e){let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:f,isVisual:h}=(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:g}=(0,m.useDispatch)(zn),v=(0,s.useRef)(),{showMovers:b,gestures:k}=tp({ref:v,onChange(e){e&&u||g(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&&h,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)(np,{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)(yp,{clientIds:n}),(0,s.createElement)(Zd,{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)(Hp,{clientIds:n}))}var Up=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)(Vd,i({focusOnMount:t,className:d
|
58 |
+
/* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(Gp,{hideDragHandle:n}))};function Wp(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 $p(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:h,isCaretWithinFormattedText:g,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:k}=(0,m.useSelect)(Wp,[]),_=(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=!h&&!u&&r&&o,x=u,T=!u&&!b&&y&&!I&&!f&&(!h||g),N=!(u||T||b||r);(0,tc.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=Ia(t),R=Ia(k),L=Ia(l),A=xd(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,rr.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)(Ed,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,s.createElement)(Up,{focusOnMount:E,__experimentalInitialIndex:P.current,__experimentalOnIndexChange:e=>{P.current=e},key:t}),x&&(0,s.createElement)(Fd,{clientId:t,rootClientId:n,blockElement:D}),I&&(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(Ed,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function jp(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),h=(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:h}}function Kp(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(jp,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,s.createElement)($p,{clientId:r,rootClientId:l,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function qp(e){let{children:t}=e;const n=(0,s.useContext)(Td),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)(Pd,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Kp,{__unstablePopoverSlot:"block-toolbar"}),t))}var Yp=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Un();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Zp=Yp((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Bd,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Xp=(0,d.compose)([Yp,(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)(Cd,{rootClientId:t})})),Qp=window.wp.isShallowEqual,Jp=n.n(Qp);const em=new WeakMap;function tm(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,rr.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function nm(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 om(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=nm(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function rm(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,h.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=om(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function lm(){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=tm(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=rm(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 im(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:h,orientation:g,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),Jp()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,g,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){em.has(t)||em.set(t,new WeakMap);const n=em.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)(ir,{value:k},(0,s.createElement)(gm,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function sm(e){return Wa(e),(0,s.createElement)(im,e)}const am=(0,s.forwardRef)(((e,t)=>{const n=cm({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function cm(){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,lm({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?sm:im;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)(gm,t)}}cm.save=r.__unstableGetInnerBlocksProps,am.DefaultBlockAppender=Xp,am.ButtonBlockAppender=Zp,am.Content=()=>cm.save().children;var um=am;const dm=(0,s.createContext)(),pm=(0,s.createContext)();function mm(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=cm({ref:(0,d.useMergeRefs)([Ka(),Md(),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)(dm.Provider,{value:o},(0,s.createElement)("div",p))}function fm(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=Rd(o))};return t=Rd(o),()=>Ld(t)}),[e])}(),(0,s.createElement)(qp,null,(0,s.createElement)(Gn,{value:Vn},(0,s.createElement)(mm,e)))}function hm(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)(pm.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Da,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(Id,{tagName:r,rootClientId:n,renderAppender:o}))}function gm(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(hm,e))}fm.__unstableElementContext=dm;const vm=["colors","disableCustomColors","gradients","disableCustomGradients"];function bm(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:g,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,h.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,h.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,h.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:g,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 km(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)(bm,i({},t,e))}var _m=function(e){return(0,u.every)(vm,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(bm,e):(0,s.createElement)(km,e)};function ym(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)(_m,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function Em(){return{disableCustomColors:!mo("color.custom"),disableCustomGradients:!mo("color.customGradient")}}function Cm(){const e=Em(),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,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,h._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,h._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}Ac([Dc,zc]);const Sm=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},wm=(e,t)=>(0,u.find)(e,{color:t});function Bm(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const Im=[];function xm(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Cm(),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=Sm(l,t,a))||void 0===e?void 0:e.color}));(0,s.useEffect)((()=>{var e;u(null===(e=Sm(l,t,a))||void 0===e?void 0:e.color)}),[t,a,l]);const d=[{label:(0,h.__)("Color"),onColorChange:e=>{u(e);const t=wm(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)(ym,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function Tm(e,t,n){var o;if(!ef(t,"color")||tf(t))return e;const{borderColor:r,style:l}=n,i=Bm("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 Nm=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:a}=l,c=mo("color.palette")||Im;if(!ef(r,"color")||tf(r))return(0,s.createElement)(e,t);const u={borderColor:a?null===(n=Sm(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 Pm(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Mm(){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=Pm(o),i=0===r||r?`${r}${l}`:null;return i}function Rm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Mm(e),n=isNaN(parseFloat(t));return n}function Lm(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Am(e){let{onChange:t,values:n,...o}=e;const r=Mm(n),l=Lm(n)&&Rm(n),a=l?(0,h.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,h.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return ef(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Tm),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!ef(e,"color")||tf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Tm(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Nm);const Dm={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function Om(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(Dm).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 Fm=(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"})),zm=(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 Vm(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink Radii"):(0,h.__)("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?Fm:zm,iconSize:16,"aria-label":o})))}const Hm={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Gm={px:100,em:20,rem:20};function Um(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Lm(n)||!Rm(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 Pm(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)(Mm(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Am,{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:Gm[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(Om,{min:0,onChange:t,values:n||Hm,units:l}),(0,s.createElement)(Vm,{onClick:()=>r(!o),isLinked:o})))}function Wm(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Um,{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 $m=(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"})),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 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"})),Km=(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 qm=[{label:(0,h.__)("Solid"),icon:$m,value:"solid"},{label:(0,h.__)("Dashed"),icon:jm,value:"dashed"},{label:(0,h.__)("Dotted"),icon:Km,value:"dotted"}];function Ym(e){let{onChange:t,value:n}=e;return(0,s.createElement)("fieldset",{className:"components-border-style-control"},(0,s.createElement)("legend",null,(0,h.__)("Style")),(0,s.createElement)("div",{className:"components-border-style-control__buttons"},qm.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 Zm=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Ym,{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)})}})},Xm=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)(),g=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"]});return(0,s.createElement)(p.__experimentalUnitControl,{value:r,label:(0,h.__)("Width"),min:0,onChange:e=>{let s={...n,border:{...null==n?void 0:n.border,width:e}},p=t;const h=0===parseFloat(e),g=0===parseFloat(r);h&&!g&&(d(t),f(l),c(i),p=void 0,s.border.color=void 0,s.border.style="none"),!h&&g&&("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:g})},Qm="__experimentalBorder";function Jm(e){const{clientId:t}=e,n=nf(e),o=ef(e.name),l=mo("border.color")&&ef(e.name,"color"),i=mo("border.radius")&&ef(e.name,"radius"),a=mo("border.style")&&ef(e.name,"style"),c=mo("border.width")&&ef(e.name,"width");if(n||!o)return null;const u=(0,r.getBlockSupport)(e.name,[Qm,"__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)(er,{__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,h.__)("Width"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:of(o,"width")})}(e),isShownByDefault:null==u?void 0:u.width,resetAllFilter:d("width"),panelId:t},(0,s.createElement)(Xm,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,h.__)("Style"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:of(o,"style")})}(e),isShownByDefault:null==u?void 0:u.style,resetAllFilter:d("style"),panelId:t},(0,s.createElement)(Zm,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,h.__)("Color"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({borderColor:void 0,style:of(o,"color")})}(e),isShownByDefault:null==u?void 0:u.color,resetAllFilter:d("color",{borderColor:void 0}),panelId:t},(0,s.createElement)(xm,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,h.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:of(o,"radius")})}(e),isShownByDefault:null==u?void 0:u.radius,resetAllFilter:d("radius"),panelId:t},(0,s.createElement)(Wm,e)))}function ef(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,Qm);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 tf(e){const t=(0,r.getBlockSupport)(e,Qm);return null==t?void 0:t.__experimentalSkipSerialization}const nf=()=>[!mo("border.color"),!mo("border.radius"),!mo("border.style"),!mo("border.width")].every(Boolean);function of(e,t){return qo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function rf(e){if(e)return`has-${e}-gradient-background`}function lf(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function sf(e,t){return(0,u.find)(e,["gradient",t])}function af(e,t){const n=sf(e,t);return n&&n.slug}function cf(){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=af(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=rf(a);let f;return f=a?lf(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}
|
59 |
// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
|
60 |
+
const uf=(0,h.__)("(%s: color %s)"),df=(0,h.__)("(%s: gradient %s)"),pf=["colors","disableCustomColors","gradients","disableCustomGradients"],mf=e=>{let{colors:t,gradients:n,settings:o}=e;return o.map(((e,o)=>{let r,{colorValue:l,gradientValue:i,label:a,colors:c,gradients:u}=e;if(!l&&!i)return null;if(l){const e=wm(c||t,l);r=(0,h.sprintf)(uf,a.toLowerCase(),e&&e.name||l)}else{const e=sf(u||n,l);r=(0,h.sprintf)(df,a.toLowerCase(),e&&e.name||i)}return(0,s.createElement)(p.ColorIndicator,{key:o,colorValue:l||i,"aria-label":r})}))},ff=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:a,settings:d,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:v,...b}=e;if((0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(d,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients))))return null;const k=(0,s.createElement)("span",{className:"block-editor-panel-color-gradient-settings__panel-title"},m,(0,s.createElement)(mf,{colors:n,gradients:o,settings:d}));return(0,s.createElement)(p.PanelBody,i({className:c()("block-editor-panel-color-gradient-settings",t),title:f?k:void 0},b),(0,s.createElement)(ym,{settings:d,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:v}),!!a&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalSpacer,{marginY:4})," ",a))},hf=e=>{const t=Em();return t.colors=mo("color.palette"),t.gradients=mo("color.gradients"),(0,s.createElement)(ff,i({},t,e))},gf=e=>{const t=Cm();return(0,s.createElement)(ff,i({},t,e))};// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
|
61 |
+
var vf=e=>(0,u.every)(pf,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(ff,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(gf,e):(0,s.createElement)(hf,e);function bf(e){let{colordBackgroundColor:t,colordTextColor:n,backgroundColor:o,textColor:r,shouldShowTransparencyWarning:l}=e,i="";return i=l?(0,h.__)("Transparent text may be hard for people to read."):t.brightness()<n.brightness()?(0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter text color."):(0,h.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color."),(0,s.useEffect)((()=>{const e=l?(0,h.__)("Transparent text may be hard for people to read."):(0,h.__)("This color combination may be hard for people to read.");(0,Nt.speak)(e)}),[o,r]),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},i))}Ac([Dc,zc]);var kf=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fontSize:r,isLargeText:l,textColor:i,enableAlphaChecker:a=!1}=e;if(!t&&!n||!i&&!o)return null;const c=Rc(t||n),u=Rc(i||o),d=u.alpha()<1,p=c.alpha()<1,m=d||p,f=u.isReadable(c,{level:"AA",size:l||!1!==l&&r>=24?"large":"small"});return f&&!m||m&&(!a||f&&!d)?null:(0,s.createElement)(bf,{backgroundColor:t,textColor:i,colordBackgroundColor:c,colordTextColor:u,shouldShowTransparencyWarning:f&&d})};function _f(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function yf(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0,showTitle:l=!0}=e;const[i,a]=(0,s.useState)(),[c,u]=(0,s.useState)(),d=Ba(o);return(0,s.useEffect)((()=>{if(!r)return;if(!d.current)return;u(_f(d.current).color);let e=d.current,t=_f(e).backgroundColor;for(;"rgba(0, 0, 0, 0)"===t&&e.parentNode&&e.parentNode.nodeType===e.parentNode.ELEMENT_NODE;)e=e.parentNode,t=_f(e).backgroundColor;a(t)})),(0,s.createElement)(er,null,(0,s.createElement)(vf,{title:(0,h.__)("Color"),initialOpen:!1,settings:n,showTitle:l,enableAlpha:t,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},r&&(0,s.createElement)(kf,{backgroundColor:i,textColor:c,enableAlphaChecker:t})))}const Ef="color",Cf=e=>{const t=(0,r.getBlockSupport)(e,Ef);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Sf=e=>{const t=(0,r.getBlockSupport)(e,Ef);return null==t?void 0:t.__experimentalSkipSerialization},wf=e=>{const t=(0,r.getBlockSupport)(e,Ef);return(0,u.isObject)(t)&&!!t.gradients};function Bf(e,t,n){var o,r,l,i,s,a;if(!Cf(t)||Sf(t))return e;const u=wf(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,h=Bm("background-color",d),g=rf(m),v=Bm("color",p),b=c()(e.className,v,g,{[h]:!(u&&null!=f&&null!==(o=f.color)&&void 0!==o&&o.gradient||!h),"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 If=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Sm(e,n[1]).color:t};function xf(e){var t,n,o,l,i,a,c,d,p;const{name:m,attributes:f}=e,g=mo("color.palette.custom"),v=mo("color.palette.theme"),b=mo("color.palette.default"),k=(0,s.useMemo)((()=>[...g||[],...v||[],...b||[]]),[g,v,b]),_=mo("color.gradients.custom"),y=mo("color.gradients.theme"),E=mo("color.gradients.default"),C=(0,s.useMemo)((()=>[..._||[],...y||[],...E||[]]),[_,y,E]),S=mo("color.custom"),w=mo("color.customGradient"),B=mo("color.background"),I=mo("color.link"),x=mo("color.text"),T=S||!v||(null==v?void 0:v.length)>0,N=w||!y||(null==y?void 0:y.length)>0,P=(0,s.useRef)(f);if((0,s.useEffect)((()=>{P.current=f}),[f]),!Cf(m))return null;const M=(e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,Ef);return(0,u.isObject)(t)&&!!t.link})(m)&&I&&T,R=(e=>{const t=(0,r.getBlockSupport)(e,Ef);return t&&!1!==t.text})(m)&&x&&T,L=(e=>{const t=(0,r.getBlockSupport)(e,Ef);return t&&!1!==t.background})(m)&&B&&T,A=wf(m)&&N;if(!(M||R||L||A))return null;const{style:D,textColor:O,backgroundColor:F,gradient:z}=f;let V;if(A&&z)V=lf(C,z);else if(A){var H;V=null==D||null===(H=D.color)||void 0===H?void 0:H.gradient}const G=t=>n=>{var o,r;const l=wm(k,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}},U=!("web"!==s.Platform.OS||z||null!=D&&null!==(t=D.color)&&void 0!==t&&t.gradient);return(0,s.createElement)(yf,{enableContrastChecking:U,clientId:e.clientId,enableAlpha:!0,settings:[...R?[{label:(0,h.__)("Text"),onColorChange:G("text"),colorValue:Sm(k,O,null==D||null===(n=D.color)||void 0===n?void 0:n.text).color}]:[],...L||A?[{label:(0,h.__)("Background"),onColorChange:L?G("background"):void 0,colorValue:Sm(k,F,null==D||null===(o=D.color)||void 0===o?void 0:o.background).color,gradientValue:V,onGradientChange:A?t=>{const n=af(C,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}]:[],...M?[{label:(0,h.__)("Link"),onColorChange:t=>{const n=wm(k,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=qo(function(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},["elements","link","color","text"],n,u.clone)}(D,0,o));e.setAttributes({style:r})},colorValue:If(k,null==D||null===(l=D.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==D||null===(c=D.elements)||void 0===c||null===(d=c.link)||void 0===d||null===(p=d.color)||void 0===p||!p.text)}]:[]]})}const Tf=(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(!Cf(o)||Sf(o))return(0,s.createElement)(e,t);const m={};var f,h;a&&(m.color=null===(f=Sm(p,a))||void 0===f?void 0:f.color),l&&(m.backgroundColor=null===(h=Sm(p,l))||void 0===h?void 0:h.color);let g=t.wrapperProps;return g={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:g}))}));(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return Cf(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),wf(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Bf),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Cf(e)||Sf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Bf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Tf);const Nf=[{name:(0,h._x)("Regular","font style"),value:"normal"},{name:(0,h._x)("Italic","font style"),value:"italic"}],Pf=[{name:(0,h._x)("Thin","font weight"),value:"100"},{name:(0,h._x)("Extra Light","font weight"),value:"200"},{name:(0,h._x)("Light","font weight"),value:"300"},{name:(0,h._x)("Regular","font weight"),value:"400"},{name:(0,h._x)("Medium","font weight"),value:"500"},{name:(0,h._x)("Semi Bold","font weight"),value:"600"},{name:(0,h._x)("Bold","font weight"),value:"700"},{name:(0,h._x)("Extra Bold","font weight"),value:"800"},{name:(0,h._x)("Black","font weight"),value:"900"}],Mf=(e,t)=>e?t?(0,h.__)("Appearance"):(0,h.__)("Font style"):(0,h.__)("Font weight");function Rf(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Mf(n,o),c={key:"default",name:(0,h.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return Nf.forEach((t=>{let{name:n,value:o}=t;Pf.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,h.sprintf)(
|
62 |
/* translators: 1: Font weight name. 2: Font style name. */
|
63 |
+
(0,h.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return Nf.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 Pf.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,h.sprintf)(// translators: %s: Currently selected font appearance.
|
64 |
(0,h.__)("Currently selected font appearance: %s"),d.name):(0,h.sprintf)(// translators: %s: Currently selected font style.
|
65 |
(0,h.__)("Currently selected font style: %s"),d.name):(0,h.sprintf)(// translators: %s: Currently selected font weight.
|
66 |
+
(0,h.__)("Currently selected font weight: %s"),d.name):(0,h.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}function Lf(e){let{value:t,onChange:n}=e;const o=function(e){return void 0!==e&&""!==e}(t),r=o?t:"";return(0,s.createElement)("div",{className:"block-editor-line-height-control"},(0,s.createElement)(p.TextControl,{autoComplete:"off",onKeyDown:e=>{const{keyCode:t}=e;t!==va.ZERO||o||(e.preventDefault(),n("0"))},onChange:e=>{if(o)return void n(e);let t=e;switch(e){case"0.1":t=1.6;break;case"0":t=1.4}n(t)},label:(0,h.__)("Line height"),placeholder:1.5,step:.1,type:"number",value:r,min:0}))}const Af="typography.lineHeight";function Df(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Lf,{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 Of(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Af)||t}const Ff="typography.__experimentalFontStyle",zf="typography.__experimentalFontWeight";function Vf(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Hf(e),i=!Gf(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)(Rf,{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 Hf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Ff),n=mo("typography.fontStyle");return!t||!n}function Gf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,zf),n=mo("typography.fontWeight");return!t||!n}function Uf(e){const t=Hf(e),n=Gf(e);return t&&n}function Wf(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,h.__)("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,h.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const $f="typography.__experimentalFontFamily";function jf(e,t,n){if(!(0,r.hasBlockSupport)(t,$f))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(ap())(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 Kf(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)(Wf,{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 qf(e){let{name:t}=e;const n=mo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,$f)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,$f)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",jf),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,$f))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),jf(o,e,n)},e}));const Yf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Zf(e,t){return(0,u.find)(e,{size:t})||{size:t}}function Xf(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var Qf=function(e){const t=mo("typography.fontSizes"),n=!mo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Jf="typography.fontSize";function eh(e,t,n){if(!(0,r.hasBlockSupport)(t,Jf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(ap())(e.className);o.add(Xf(n.fontSize));const l=o.value;return e.className=l||void 0,e}function th(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=mo("typography.fontSizes"),a=Yf(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)(Qf,{onChange:e=>{const t=Zf(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 nh(){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,Jf)||!n}const oh=(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,Jf)||(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=Yf(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");(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Jf)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",eh),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Jf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),eh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",oh);var rh=(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"})),lh=(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 ih=[{name:(0,h.__)("Underline"),value:"underline",icon:rh},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:lh}];function sh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,h.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},ih.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 ah="typography.__experimentalTextDecoration";function ch(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(sh,{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 uh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,ah),n=mo("typography.textDecoration");return t||!n}var dh=(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"})),ph=(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"})),mh=(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 fh=[{name:(0,h.__)("Uppercase"),value:"uppercase",icon:dh},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:ph},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:mh}];function hh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,h.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},fh.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 gh="typography.__experimentalTextTransform";function vh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(hh,{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 bh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,gh),n=mo("typography.textTransform");return t||!n}function kh(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,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const _h="typography.__experimentalLetterSpacing";function yh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(kh,{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 Eh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,_h),n=mo("typography.letterSpacing");return t||!n}const Ch="typography",Sh=[Af,Jf,Ff,zf,$f,ah,gh,_h];function wh(e){const{clientId:t}=e,n=qf(e),o=nh(e),l=Uf(e),i=Of(e),a=uh(e),c=bh(e),u=Eh(e),d=!Hf(e),m=!Gf(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Uf(e),nh(e),Of(e),qf(e),uh(e),bh(e),Eh(e)];return t.filter(Boolean).length===t.length}(e),g=Bh(e.name);if(f||!g)return null;const v=(0,r.getBlockSupport)(e.name,[Ch,"__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)(er,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,h.__)("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)(Kf,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,h.__)("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)(th,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:Mf(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)(Vf,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,h.__)("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)(Df,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,h.__)("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)(ch,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,h.__)("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)(vh,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,h.__)("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)(yh,e)))}const Bh=e=>Sh.some((t=>(0,r.hasBlockSupport)(e,t)));function Ih(e){const t=(0,r.getBlockSupport)(e,Dh);return!!(!0===t||null!=t&&t.blockGap)}function xh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.blockGap");return!Ih(e)||t}function Th(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=Ba(n);return xh(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("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 Nh(e){const t=(0,r.getBlockSupport)(e,Dh);return!!(!0===t||null!=t&&t.margin)}function Ph(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.margin"),n=!Gh(e,"margin");return!Nh(e)||t||n}function Mh(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=Hh(n,"margin"),a=i&&i.some((e=>Fh.includes(e)));return Ph(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,h.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Rh(e){const t=(0,r.getBlockSupport)(e,Dh);return!!(!0===t||null!=t&&t.padding)}function Lh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.padding"),n=!Gh(e,"padding");return!Rh(e)||t||n}function Ah(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=Hh(n,"padding"),a=i&&i.some((e=>Fh.includes(e)));return Lh(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,h.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const Dh="spacing",Oh=["top","right","bottom","left"],Fh=["vertical","horizontal"];function zh(e){const t=xh(e),n=Lh(e),o=Ph(e),l=Vh(e),i=(a=e.name,"web"===s.Platform.OS&&(Ih(a)||Rh(a)||Nh(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Dh,"__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)(er,{__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,h.__)("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)(Ah,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,h.__)("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)(Mh,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,h.__)("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)(Th,e)))}const Vh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=xh(e),n=Lh(e),o=Ph(e);return t&&n&&o};function Hh(e,t){const n=(0,r.getBlockSupport)(e,Dh);if(n&&"boolean"!=typeof n[t])return n[t]}function Gh(e,t){const n=Hh(e,t);return!(n&&n.some((e=>Oh.includes(e)))&&n.some((e=>Fh.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}const Uh=[...Sh,Qm,Ef,Dh],Wh=e=>Uh.some((t=>(0,r.hasBlockSupport)(e,t))),$h="var:";function jh(e){return(0,u.startsWith)(e,$h)?`var(--wp--${e.slice($h.length).split("|").join("--")})`:e}function Kh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};return 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 r=(0,u.get)(e,l);i&&!(0,u.isString)(r)?Object.entries(i).forEach((e=>{const[t,o]=e,l=(0,u.get)(r,[o]);l&&(n[t]=jh(l))})):t.includes(l.join("."))||(n[o]=jh((0,u.get)(e,l)))}})),n}const qh={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[Ef],"typography.__experimentalSkipSerialization":[Ch],[`${Dh}.__experimentalSkipSerialization`]:["spacing"]},Yh={...qh,[`${Dh}`]:["spacing.blockGap"]};function Zh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Yh;if(!Wh(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={...Kh(l),...e.style},e}const Xh=(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)(xf,t),(0,s.createElement)(wh,t),(0,s.createElement)(Jm,t),(0,s.createElement)(zh,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Qh=(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=Kh(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)(fm.__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 Wh(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Zh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Wh(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Zh(o,e,n,qh)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Xh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Qh);var Jh=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,h.__)("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!==va.DOWN||(e.preventDefault(),n())},label:(0,h.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,h.__)("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 eg=[];function tg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Rc(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 ng(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 og(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")||eg,a=mo("color.palette")||eg,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)(Jh,{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})}}))}Ac([Dc]);const rg=(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)(og,t))}),"withDuotoneControls"),lg=(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),h=(0,s.useContext)(fm.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(ng,{selector:m,id:p,values:tg(u)}),h),(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",rg),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",lg);const ig="__experimentalLayout";function sg(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,ig,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:g}=c;if(!d)return null;const v=l||g||{},{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)(er,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Layout")},f&&!!i&&(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Inherit default layout"),checked:!!b,onChange:()=>t({layout:{inherit:!b}})}),!b&&u&&(0,s.createElement)(ag,{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 ag(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 cg=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,ig)&&(0,s.createElement)(sg,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),ug=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,ig),a=(0,d.useInstanceId)(e),u=mo("layout")||{},p=(0,s.useContext)(fm.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,ig)||{},h=null!=m&&m.inherit?u:m||f||{},g=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:h,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:g})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,ig)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",ug),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",cg);const dg=[];function pg(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=Bm("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:Kh({border:r})}}function mg(e){const t=mo("color.palette")||dg,n=pg(e);if(e.borderColor){const o=Sm(t,e.borderColor);n.style.borderColor=o.color}return n}function fg(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Bm("background-color",s),m=Bm("color",a),f=rf(u),h=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!h&&!!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:Kh({color:(null==d?void 0:d.color)||{}})}}const hg={};function gg(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")||hg,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=fg(e);if(t){const e=Sm(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=lf(u,o)),n){const e=Sm(c,n);d.style.color=e.color}return d}function vg(e){const{style:t}=e;return{style:Kh({spacing:(null==t?void 0:t.spacing)||{}})}}function bg(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const kg=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),_g=()=>(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 yg(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=Rc(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=wm(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=Sm(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:Bm(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Eg(e){return function(){const t=kg(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(yg(o,t),"withCustomColors")}}function Cg(){const e=_g();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(yg(n,e),"withColors")}const Sg=[];var wg=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")||Sg;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=Yf(r,l,n[t]);return e[o]={...i,class:Xf(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Bg=(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"})),Ig=(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"})),xg=(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 Tg=[{icon:Bg,title:(0,h.__)("Align text left"),align:"left"},{icon:Ig,title:(0,h.__)("Align text center"),align:"center"},{icon:xg,title:(0,h.__)("Align text right"),align:"right"}],Ng={position:"bottom right",isAlternate:!0};var Pg=function(e){let{value:t,onChange:n,alignmentControls:o=Tg,label:r=(0,h.__)("Align"),describedBy:l=(0,h.__)("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,g=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,h.isRTL)()?xg:Bg,label:r,toggleProps:{describedBy:l},popoverProps:Ng,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},g))};function Mg(e){return(0,s.createElement)(Pg,i({},e,{isToolbar:!1}))}function Rg(e){return(0,s.createElement)(Pg,i({},e,{isToolbar:!0}))}var Lg={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]=Iu(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?Xu(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)(Ga,{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 Ag=[];function Dg(e){let{completers:t=Ag}=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([Lg])),(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 Og=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Dg(e)}))},Fg=(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"})),zg=function(e){let{isActive:t,label:n=(0,h.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:Fg,label:n,onClick:()=>o(!t),disabled:r})},Vg=function(e){const{label:t=(0,h.__)("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!==va.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},Hg=(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"})),Gg=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,h.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,h.__)("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:Hg,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)(Dd,{clientId:e})),(0,s.createElement)(wo,{icon:Hg,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Dd,{clientId:r})))};function Ug(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:h,isParentHighlighted:g}=(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":g,"is-dragging-blocks":h});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 Wg=()=>(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"})),$g=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)(Wg,null)))},jg=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,h.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==va.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)($g,null)))}))}};var Kg=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:jg(n),renderContent:()=>t})},qg=(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 Yg=na(p.__experimentalTreeGridRow);function Zg(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=la({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(Yg,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function Xg(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:Hg}))}var Qg=(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:g,onFocus:v,onDragStart:b,onDragEnd:k,draggable:_}=t;const y=Ad(r),E=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,C=((e,t,n)=>(0,h.sprintf)(
|
67 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
68 |
+
(0,h.__)("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!==va.ENTER&&e.keyCode!==va.SPACE||(e.preventDefault(),i(e))},"aria-describedby":E,ref:n,tabIndex:g,onFocus:v,onDragStart:e=>{e.dataTransfer.clearData(),b(e)},onDragEnd:k,draggable:_,href:`#block-${r}`},(0,s.createElement)(Xg,{onClick:a}),(0,s.createElement)(Ga,{icon:null==y?void 0:y.icon,showColors:!0}),(0,s.createElement)(Dd,{clientId:r}),(null==y?void 0:y.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},y.anchor),l&&(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("(selected block)"))),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:E},C))})),Jg=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,...p}=e;const{clientId:f}=r,{blockMovingClientId:h,selectedBlockInBlockEditor:g}=(0,m.useSelect)((e=>{const{getBlockRootClientId:t,hasBlockMovingClientId:n,getSelectedBlockClientId:o}=e(zn);return{rootClientId:t(f)||"",blockMovingClientId:n(),selectedBlockInBlockEditor:o()}}),[f]),v=h&&g===f,b=c()("block-editor-list-view-block-contents",{"is-dropping-before":v});return(0,s.createElement)(Od,{clientIds:[r.clientId]},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,s.createElement)(Qg,i({ref:t,className:b,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f},p))}))}));const ev=(0,s.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),tv=()=>(0,s.useContext)(ev);var nv=(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:g,isExpanded:v}=e;const b=(0,s.useRef)(null),[k,_]=(0,s.useState)(!1),{clientId:y}=t,{toggleBlockHighlight:E}=(0,m.useDispatch)(zn),{__experimentalFeatures:C,__experimentalPersistentListViewFeatures:S,__experimentalHideContainerBlockActions:w,isTreeGridMounted:B,expand:I,collapse:x}=tv(),T=f&&d>0,N=c()("block-editor-list-view-block__mover-cell",{"is-visible":k||o}),P=c()("block-editor-list-view-block__menu-cell",{"is-visible":k||o});(0,s.useEffect)((()=>{S&&!B&&o&&b.current.focus()}),[]);const M=S?E:()=>{},R=(0,s.useCallback)((()=>{_(!0),M(y,!0)}),[y,_,M]),L=(0,s.useCallback)((()=>{_(!1),M(y,!1)}),[y,_,M]),A=(0,s.useCallback)((e=>{e.stopPropagation(),l(y)}),[y,l]),D=(0,s.useCallback)((e=>{e.stopPropagation(),!0===v?x(y):!1===v&&I(y)}),[y,I,x,v]),O=C&&(!w||w&&a>1),F=C&&!O;let z;T?z=2:F&&(z=3);const V=c()({"is-selected":o,"is-branch-selected":S&&r,"is-dragging":n,"has-single-cell":F}),H=Ad(y),G=(0,h.sprintf)(// translators: %s: The title of the block.
|
69 |
+
(0,h.__)("Options for %s block"),H.title);return(0,s.createElement)(Zg,{className:V,onMouseEnter:R,onMouseLeave:L,onFocus:R,onBlur:L,level:a,position:i,rowCount:u,path:g,id:`list-view-block-${y}`,"data-block":y,isExpanded:v},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:z,ref:b},(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)(Jg,{block:t,onClick:A,onToggleExpanded:D,isSelected:o,position:i,siblingBlockCount:d,level:a,ref:n,tabIndex:r,onFocus:l}))})),T&&(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)(qd,{orientation:"vertical",clientIds:[y],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)(Yd,{orientation:"vertical",clientIds:[y],ref:t,tabIndex:n,onFocus:o})})))),O&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:P},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Vp,{clientIds:[y],icon:Ep,label:G,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:A})})))}));function ov(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(rv(t,n),0):1}const rv=(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+ov(o,e,t):n+1};function lv(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:h,__experimentalPersistentListViewFeatures:g}=tv(),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+=ov(v[t-1],f,h));const E=g,{itemInView:C}=p,S=!E||C(k),w=t+1,B=a.length>0?`${a}_${w}`:`${w}`,I=r&&!!y&&!!y.length,x=I?null===(d=f[_])||void 0===d||d:void 0,T=!(null==h||!h.includes(_)),N=T||S,P=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(_,l),M=c||P&&I;return(0,s.createElement)(m.AsyncModeProvider,{key:_,value:!P},N&&(0,s.createElement)(nv,{block:e,selectBlock:n,isSelected:P,isBranchSelected:M,isDragged:T,level:i,position:w,rowCount:b,siblingBlockCount:b,showBlockMovers:o,path:B,isExpanded:x,listPosition:k}),!N&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),I&&x&&!T&&(0,s.createElement)(lv,{blocks:y,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:i+1,path:B,listPosition:k+1,fixedListWindow:p,isBranchSelected:M,selectedClientIds:l}))})))}lv.defaultProps={selectBlock:()=>{}};var iv=(0,s.memo)(lv);function sv(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 av(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const cv=["top","bottom"];const uv=()=>{},dv=(e,t)=>{switch(t.type){case"expand":return{...e,[t.clientId]:!0};case"collapse":return{...e,[t.clientId]:!1};default:return e}};var pv=(0,s.forwardRef)((function(e,t){let{blocks:n,onSelect:o=uv,__experimentalFeatures:r,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,showNestedBlocks:c,showBlockMovers:u,...f}=e;const{clientIdsTree:g,draggedClientIds:v,selectedClientIds:b}=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),{selectBlock:k}=(0,m.useDispatch)(zn),{visibleBlockCount:_}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(zn),o=(null==v?void 0:v.length)>0?n(v).length+1:0;return{visibleBlockCount:t()-o}}),[v]),y=(0,s.useCallback)((e=>{k(e),o(e)}),[k,o]),[E,C]=(0,s.useReducer)(dv,{}),{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=tm(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]=om(t,s,cv),u=av(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);(0,s.useEffect)((()=>{x.current=!0}),[]);const[T]=(0,d.__experimentalUseFixedWindowList)(B,36,_,{useWindowing:l,windowOverscan:40}),N=(0,s.useCallback)((e=>{e&&C({type:"expand",clientId:e})}),[C]),P=(0,s.useCallback)((e=>{e&&C({type:"collapse",clientId:e})}),[C]),M=(0,s.useCallback)((e=>{var t;N(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[N]),R=(0,s.useCallback)((e=>{var t;P(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[P]),L=(0,s.useMemo)((()=>({__experimentalFeatures:r,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,isTreeGridMounted:x.current,draggedClientIds:v,expandedState:E,expand:N,collapse:P})),[r,l,a,x.current,v,E,N,P]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(sv,{listViewRef:B,blockDropTarget:w}),(0,s.createElement)(p.__experimentalTreeGrid,{className:"block-editor-list-view-tree","aria-label":(0,h.__)("Block navigation structure"),ref:I,onCollapseRow:R,onExpandRow:M},(0,s.createElement)(ev.Provider,{value:L},(0,s.createElement)(iv,i({blocks:g,selectBlock:y,showNestedBlocks:c,showBlockMovers:u,fixedListWindow:T,selectedClientIds:b},f)))))}));function mv(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:qg,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
|
70 |
+
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var fv=(0,s.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(zn).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(mv,i({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:l}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,h.__)("List view")),(0,s.createElement)(pv,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function hv(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=cp(o,r,n),i=(0,s.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,s.createElement)(hu,{item:i,isStylePreview:!0})}function gv(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}function vv(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:f}=dp({clientId:t,onSwitch:n}),[h,g]=(0,s.useState)(null),[v,b]=(0,s.useState)(0),k=(0,d.useViewportMatch)("medium","<");if((0,s.useLayoutEffect)((()=>{const e=document.querySelector(".interface-interface-skeleton__content"),t=(null==e?void 0:e.scrollTop)||0;b(t+16)}),[h]),!i||0===i.length)return null;const _=(0,u.debounce)(g,250),y=e=>{l(e),o(null),g(null),_.cancel()},E=e=>{var t;h!==e?(_(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):_.cancel()};return(0,s.createElement)("div",{className:"block-editor-block-styles"},(0,s.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":a.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>E(e),onFocus:()=>E(e),onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:t=>{va.ENTER!==t.keyCode&&va.SPACE!==t.keyCode||(t.preventDefault(),y(e))},onClick:()=>y(e),role:"button",tabIndex:"0"},(0,s.createElement)(p.__experimentalText,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),h&&!k&&(0,s.createElement)(gv,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>E(null)},(0,s.createElement)(hv,{activeStyle:a,className:f,genericPreviewBlock:m,style:h})))}vv.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var bv=vv,kv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),_v=function(e){let{icon:t=kv,label:n=(0,h.__)("Choose variation"),instructions:o=(0,h.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,s.createElement)(p.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,h.__)("Block variations")},r.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(p.Button,{variant:"link",onClick:()=>l()},(0,h.__)("Skip"))))},yv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const Ev="carousel",Cv="grid",Sv=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{onClick:t},(0,h.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:n},(0,h.__)("Choose")))},wv=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(p.Button,{icon:Gd,label:(0,h.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:Hd,label:(0,h.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var Bv=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===Ev,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:to,label:(0,h.__)("Carousel view"),onClick:()=>n(Ev),isPressed:u}),(0,s.createElement)(p.Button,{icon:yv,label:(0,h.__)("Grid view"),onClick:()=>n(Cv),isPressed:t===Cv}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(wv,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(Sv,{onBlockPatternSelect:a,onStartBlank:c}))};const Iv=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r}=e;const l=(0,p.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===Ev){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:a},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(Tv,{className:e.get(n)||"",key:t.name,pattern:t})))))}return(0,s.createElement)(p.__unstableComposite,i({},l,{role:"listbox",className:a,"aria-label":(0,h.__)("Patterns list")}),o.map((e=>(0,s.createElement)(xv,{key:e.name,pattern:e,onSelect:r,composite:l}))))};function xv(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,title:a,description:c,viewportWidth:u=700}=t,m=(0,d.useInstanceId)(xv,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?m:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(mu,{blocks:l,viewportWidth:u}),(0,s.createElement)("div",{className:`${r}__item-title`},a)),!!c&&(0,s.createElement)(p.VisuallyHidden,{id:m},c))}function Tv(e){let{className:t,pattern:n}=e;const{blocks:o,title:r,description:l}=n,i=(0,d.useInstanceId)(Tv,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":r,"aria-describedby":l?i:void 0},(0,s.createElement)(mu,{blocks:o,__experimentalLive:!0}),!!l&&(0,s.createElement)(p.VisuallyHidden,{id:i},l))}var Nv=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(Ev),[u,d]=(0,s.useState)(0),[p,f]=(0,s.useState)(!1),{replaceBlock:h}=(0,m.useDispatch)(zn),g=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(zn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o);if(null==g||!g.length||p)return l;const v=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));h(t,n)});return(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,s.createElement)(Bv,{viewMode:a,setViewMode:c,activeSlide:u,totalSlides:g.length,handleNext:()=>{d((e=>e+1))},handlePrevious:()=>{d((e=>e-1))},onBlockPatternSelect:()=>{v(g[u].blocks)},onStartBlank:()=>{f(!0)}}),(0,s.createElement)(Iv,{viewMode:a,activeSlide:u,patterns:g,onBlockPatternSelect:v}))};const Pv=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&(0,u.isMatch)(e,n)}));return 1===n.length?n[0]:void 0};var Mv=function(e){let{blockClientId:t}=e;const[n,o]=(0,s.useState)(),{updateBlockAttributes:l}=(0,m.useDispatch)(zn),{variations:i,blockAttributes:a}=(0,m.useSelect)((e=>{const{getBlockVariations:n}=e(r.store),{getBlockName:o,getBlockAttributes:l}=e(zn),i=t&&o(t);return{variations:i&&n(i,"transform"),blockAttributes:l(t)}}),[t]);if((0,s.useEffect)((()=>{var e;o(null===(e=Pv(a,i))||void 0===e?void 0:e.name)}),[a,i]),null==i||!i.length)return null;const c=i.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}})),u=e=>{l(t,{...i.find((t=>{let{name:n}=t;return n===e})).attributes})},d="block-editor-block-variation-transforms";return(0,s.createElement)(p.DropdownMenu,{className:d,label:(0,h.__)("Transform to variation"),text:(0,h.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${d}__popover`},icon:Wd,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${d}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:c,value:n,onSelect:u})))))};const Rv=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Lv=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Av={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,h._x)("Align top","Block vertical alignment setting")},center:{icon:Lv,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Rv,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},Dv=["top","center","bottom"],Ov={isAlternate:!0};var Fv=function(e){let{value:t,onChange:n,controls:o=Dv,isCollapsed:r=!0,isToolbar:l}=e;const a=Av[t],c=Av.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:Ov,icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Av[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};function zv(e){return(0,s.createElement)(Fv,i({},e,{isToolbar:!1}))}function Vv(e){return(0,s.createElement)(Fv,i({},e,{isToolbar:!0}))}var Hv=(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette"),o=!mo("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,u.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),Gv=Hv(p.ColorPalette);function Uv(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(_m,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var Wv=function(e,t){return(Wv=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])})(e,t)},$v=function(){return($v=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}).apply(this,arguments)};function jv(e,t,n,o){void 0===o&&(o=0);var r=ob(e,t,o),l=r.width,i=r.height;return e>=t*n&&l>t*n?{width:t*n,height:t}:l>t*n?{width:e,height:e/n}:l>i*n?{width:i*n,height:i}:{width:l,height:l/n}}function Kv(e,t,n,o,r){void 0===r&&(r=0);var l=ob(t.width,t.height,r),i=l.width,s=l.height;return{x:qv(e.x,i,n.width,o),y:qv(e.y,s,n.height,o)}}function qv(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function Yv(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Zv(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Xv(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?Qv:Jv,a={x:s(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:s(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:s(100,n.width/t.width*100/r),height:s(100,n.height/t.height*100/r)},c=Math.round(s(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(s(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:a,croppedAreaPixels:$v($v({},d),{x:Math.round(s(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(s(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function Qv(e,t){return Math.min(e,Math.max(0,t))}function Jv(e,t){return t}function eb(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function tb(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function nb(e,t,n,o,r){var l=Math.cos,i=Math.sin,s=r*Math.PI/180;return[(e-n)*l(s)-(t-o)*i(s)+n,(e-n)*i(s)+(t-o)*l(s)+o]}function ob(e,t,n){var o=e/2,r=t/2,l=[nb(0,0,o,r,n),nb(e,0,o,r,n),nb(e,t,o,r,n),nb(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),s=Math.max.apply(Math,l.map((function(e){return e[0]}))),a=Math.min.apply(Math,l.map((function(e){return e[1]})));return{width:s-i,height:Math.max.apply(Math,l.map((function(e){return e[1]})))-a}}function rb(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var lb=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=eb(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l=n.imageRef||n.videoRef;if(l){n.mediaSize={width:l.offsetWidth,height:l.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var i=n.props.cropSize?n.props.cropSize:jv(l.offsetWidth,l.offsetHeight,n.props.aspect,n.props.rotation);n.setState({cropSize:i},n.recomputeCropPosition)}n.containerRef&&(n.containerRect=n.containerRef.getBoundingClientRect())},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){e.preventDefault(),document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=$v({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?Kv(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=n.props.zoom-e.deltaY*n.props.zoomSpeed/200;n.setNewZoom(r,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},s=n.props.restrictPosition?Kv(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.emitCropData=function(){if(n.state.cropSize){var e=Xv(n.props.restrictPosition?Kv(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition),t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?Kv(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function __(){this.constructor=e}Wv(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&this.styleRef.remove(),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():e.cropSize!==this.props.cropSize&&this.computeSizes(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=Yv(n,o),this.lastPinchRotation=Zv(n,o),this.onDragStart(tb(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=tb(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=Yv(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=Zv(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.crop,i=l.x,s=l.y,a=t.rotation,c=t.zoom,u=t.cropShape,d=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,h=p.mediaStyle,g=t.classes,v=g.containerClassName,b=g.cropAreaClassName,k=g.mediaClassName;return Ur().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:rb("reactEasyCrop_Container",v)},n?Ur().createElement("img",$v({alt:"",className:rb("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:$v($v({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&Ur().createElement("video",$v({autoPlay:!0,loop:!0,muted:!0,className:rb("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:$v($v({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&Ur().createElement("div",{style:$v($v({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:rb("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",b)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(Ur().Component);const ib={position:"bottom right",isAlternate:!0};var sb=window.wp.apiFetch,ab=n.n(sb);const cb=(0,s.createContext)({}),ub=()=>(0,s.useContext)(cb);function db(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:i,onFinishEditing:a,onSaveImage:c,children:u}=e;const d=function(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)({x:0,y:0}),[p,m]=(0,s.useState)(),[f,h]=(0,s.useState)(),[g,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),h(0),v(n/o),k(n/o)}),[n,o,d,m,h,v,k]),y=(0,s.useCallback)((()=>{const e=(f+90)%360;let r=n/o;if(f%180==90&&(r=o/n),0===e)return i(),h(e),v(1/g),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),h(e),v(1/g),d({x:-u.y*r,y:u.x*r})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof a&&(s.crossOrigin=a)}),[f,n,o,i,h,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:h,rotateClockwise:y,aspect:g,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,f,h,y,g,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:n,naturalWidth:o,naturalHeight:r},i),p=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:d}=(0,m.useDispatch)(Mu.store),[p,f]=(0,s.useState)(!1),g=(0,s.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,s.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,ab()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,h.sprintf)(
|
71 |
/* translators: 1. Error message */
|
72 |
+
(0,h.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{f(!1),u()}))}),[f,t,n,o,r,l,i,c,d,f,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:g})),[p,v,g])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),f=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(cb.Provider,{value:f},u)}function pb(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:a,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:h,setCrop:g,setZoom:v,rotation:b}=ub();let k=o||r*l/i;return b%180==90&&(k=r*i/l),(0,s.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":a}),style:{width:n||r,height:k}},(0,s.createElement)(lb,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:h,onCropComplete:e=>{g(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var mb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function fb(){const{isInProgress:e,zoom:t,setZoom:n}=ub();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:ib,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:mb,label:(0,h.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,h.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var hb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function gb(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,s.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,s.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?ip:void 0},t)})))}function vb(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=ub();return(0,s.createElement)(p.DropdownMenu,{icon:hb,label:(0,h.__)("Aspect Ratio"),popoverProps:ib,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(gb,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("Original"),aspect:l},{title:(0,h.__)("Square"),aspect:1}]}),(0,s.createElement)(gb,{label:(0,h.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("16:10"),aspect:1.6},{title:(0,h.__)("16:9"),aspect:16/9},{title:(0,h.__)("4:3"),aspect:4/3},{title:(0,h.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(gb,{label:(0,h.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("10:16"),aspect:.625},{title:(0,h.__)("9:16"),aspect:9/16},{title:(0,h.__)("3:4"),aspect:3/4},{title:(0,h.__)("2:3"),aspect:2/3}]}))}))}var bb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function kb(){const{isInProgress:e,rotateClockwise:t}=ub();return(0,s.createElement)(p.ToolbarButton,{icon:bb,label:(0,h.__)("Rotate"),onClick:t,disabled:e})}function _b(){const{isInProgress:e,apply:t,cancel:n}=ub();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,h.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,h.__)("Cancel")))}function yb(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(pb,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(Yn,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(fb,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(vb,{toggleProps:e}))),(0,s.createElement)(kb,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(_b,null))))}const Eb=[25,50,75,100];function Cb(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:g,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,c);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(o)&&(0,s.createElement)(p.SelectControl,{label:(0,h.__)("Image size"),value:l,options:o,onChange:d}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,h.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,h.__)("Width"),value:f,min:1,onChange:e=>g("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,h.__)("Height"),value:m,min:1,onChange:e=>g("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,h.__)("Image size presets")},Eb.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,s.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,h.__)("Reset")))))}var Sb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(O.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),wb=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Currently selected link settings")),l)};class Bb extends s.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,s.createRef)(),this.inputRef=(0,s.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,ya()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!r&&(t.length<2||!o&&(0,id.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(t,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,h.sprintf)(
|
73 |
/* translators: %s: number of results. */
|
74 |
+
(0,h._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,h.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===l&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=l}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case va.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case va.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case va.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case va.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case va.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case va.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,h.__)("Link selected.")));break;case va.ENTER:null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:o,disableSuggestions:r,__experimentalShowInitialSuggestions:l=!1}=e,{showSuggestions:i}=t,s=i;const a=n&&n.length;return l||a||(s=!1),!0===r&&(s=!1),{showSuggestions:s,suggestionsListboxId:`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${o}`}}render(){return(0,s.createElement)(s.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,h.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:a,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:f}=this.state,g={id:`url-input-control-${o}`,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},v={value:i,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:r,onKeyDown:this.onKeyDown,role:"combobox","aria-label":(0,h.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(g,v,a):(0,s.createElement)(p.BaseControl,g,(0,s.createElement)("input",v),a&&(0,s.createElement)(p.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:l,selectedSuggestion:a,suggestionsListboxId:d,suggestionOptionIdPrefix:m,loading:f}=this.state,h={id:d,ref:this.autocompleteRef,role:"listbox"},g=(e,t)=>({role:"option",tabIndex:"-1",id:`${m}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===a});return(0,u.isFunction)(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:a,suggestionsListProps:h,buildSuggestionItemProps:g,isLoading:f,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!(0,u.isFunction)(t)&&r&&l.length?(0,s.createElement)(p.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},(0,s.createElement)("div",i({},h,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,s.createElement)(p.Button,i({},g(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===a}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var Ib=(0,d.compose)(d.withSafeTimeout,p.withSpokenMessages,d.withInstanceId,(0,m.withSelect)(((e,t)=>{if((0,u.isFunction)(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(zn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(Bb),xb=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:a}=e;return n?(t=a?(0,u.isFunction)(a)?a(n):a:(0,s.createInterpolateElement)((0,h.sprintf)(
|
75 |
/* translators: %s: search term. */
|
76 |
+
(0,h.__)("Create: <mark>%s</mark>"),n),{mark:(0,s.createElement)("mark",null)}),(0,s.createElement)(p.Button,i({},r,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,s.createElement)(wo,{className:"block-editor-link-control__search-item-icon",icon:Fa}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null},Tb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"})),Nb=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:a="",shouldShowType:u=!1}=e;return(0,s.createElement)(p.Button,i({},t,{onClick:r,className:c()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),l&&(0,s.createElement)(wo,{className:"block-editor-link-control__search-item-icon",icon:Tb}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,s.createElement)(p.TextHighlight,{text:n.title,highlight:a})),(0,s.createElement)("span",{"aria-hidden":!l,className:"block-editor-link-control__search-item-info"},!l&&((0,id.filterURLForDisplay)((0,id.safeDecodeURI)(n.url))||""),l&&(0,h.__)("Press ENTER to add this link"))),u&&n.type&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){return e.isFrontPage?"front page":"post_tag"===e.type?"tag":e.type}(n)))};const Pb="__CREATE__",Mb=[{id:"opensInNewTab",title:(0,h.__)("Open in new tab")}];function Rb(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:a,suggestions:u,selectedSuggestion:d,isLoading:m,isInitialSuggestions:f,createSuggestionButtonText:g,suggestionsQuery:v}=e;const b=c()("block-editor-link-control__search-results",{"is-loading":m}),k=["url","mailto","tel","internal"],_=1===u.length&&k.includes(u[0].type.toLowerCase()),y=n&&!_&&!f,E=!(null!=v&&v.type),C=`block-editor-link-control-search-results-label-${t}`,S=f?(0,h.__)("Recently updated"):(0,h.sprintf)(
|
77 |
/* translators: %s: search term. */
|
78 |
+
(0,h.__)('Search results for "%s"'),o),w=(0,s.createElement)(f?s.Fragment:p.VisuallyHidden,{},(0,s.createElement)("span",{className:"block-editor-link-control__search-results-label",id:C},S));return(0,s.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},w,(0,s.createElement)("div",i({},l,{className:b,"aria-labelledby":C}),u.map(((e,t)=>y&&Pb===e.type?(0,s.createElement)(xb,{searchTerm:o,buttonText:g,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===d}):Pb===e.type?null:(0,s.createElement)(Nb,{key:`${e.id}-${e.type}`,itemProps:a(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:k.includes(e.type.toLowerCase()),searchTerm:o,shouldShowType:E,isFrontPage:null==e?void 0:e.isFrontPage})))))}function Lb(e){const t=(0,u.startsWith)(e,"#");return(0,id.isURL)(e)||e&&e.includes("www.")||t}const Ab=()=>Promise.resolve([]),Db=e=>{let t="URL";const n=(0,id.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,id.prependHTTP)(e):e,type:t}])};const Ob=()=>Promise.resolve([]),Fb=(0,s.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:a=!1,onCreateSuggestion:p=u.noop,onChange:f=u.noop,onSelect:g=u.noop,showSuggestions:v=!0,renderSuggestions:b=(e=>(0,s.createElement)(Rb,e)),fetchSuggestions:k=null,allowDirectEntry:_=!0,showInitialSuggestions:y=!1,suggestionsQuery:E={},withURLSuggestion:C=!0,createSuggestionButtonText:S,useLabel:w=!1}=e;const B=function(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?Db:Ab;return(0,s.useCallback)(((t,s)=>{let{isInitialSuggestions:a}=s;return Lb(t)?i(t,{isInitialSuggestions:a}):(async(e,t,n,o,r,l,i)=>{const{isInitialSuggestions:s}=t;let a=!1,c=await Promise.all([n(e,t),o(e)]);c[0]=c[0].map((e=>Number(e.id)===i?(a=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!a&&u&&l&&!s?c[0].concat(c[1]):c[0],s||Lb(e)||!r?c:c.concat({title:e,url:e,type:Pb})})(t,{...e,isInitialSuggestions:a},r,i,n,o,l)}),[i,r,n])}(E,_,a,C),I=v?k||B:Ob,x=(0,d.useInstanceId)(Fb),[T,N]=(0,s.useState)(),P=async e=>{let t=e;if(Pb!==e.type)(_||t&&Object.keys(t).length>=1)&&g({...(0,u.omit)(r,"id","url"),...t},t);else try{var n;t=await p(e.title),null!==(n=t)&&void 0!==n&&n.url&&g(t)}catch(e){}},M=c()(l,{"has-no-label":!w});return(0,s.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,s.createElement)(Ib,{label:w?"URL":void 0,className:M,value:n,onChange:(e,t)=>{f(e),N(t)},placeholder:null!=i?i:(0,h.__)("Search or type url"),__experimentalRenderSuggestions:v?e=>b({...e,instanceId:x,withCreateSuggestion:a,currentInputValue:n,createSuggestionButtonText:S,suggestionsQuery:E,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),P(t)}}):null,__experimentalFetchLinkSuggestions:I,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:y,onSubmit:(e,t)=>{var o;const r=e||T;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?P(r||{url:n}):t.preventDefault()},ref:t}),o)}));var zb=Fb,Vb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),Hb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));const{Slot:Gb,Fill:Ub}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function Wb(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function $b(e){let{value:t,onEditClick:n,hasRichPreviews:o=!1,hasUnlinkControl:r=!1,onRemove:l}=e;const i=o?null==t?void 0:t.url:null,{richData:a,isFetching:u}=function(e){const[t,n]=(0,s.useReducer)(Wb,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,s.useEffect)((()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t}(i),d=a&&Object.keys(a).length,f=t&&(0,id.filterURLForDisplay)((0,id.safeDecodeURI)(t.url),16)||"",g=(null==a?void 0:a.title)||(null==t?void 0:t.title)||f,v=!t.url.length;let b;return b=null!=a&&a.icon?(0,s.createElement)("img",{src:null==a?void 0:a.icon,alt:""}):v?(0,s.createElement)(wo,{icon:Vb,size:32}):(0,s.createElement)(wo,{icon:Tb}),(0,s.createElement)("div",{"aria-label":(0,h.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":d,"is-fetching":!!u,"is-preview":!0,"is-error":v})},(0,s.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:c()("block-editor-link-control__search-item-icon",{"is-image":null==a?void 0:a.icon})},b),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-details"},v?(0,s.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,h.__)("Link is empty")):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ExternalLink,{className:"block-editor-link-control__search-item-title",href:t.url},(0,rr.__unstableStripHTML)(g)),(null==t?void 0:t.url)&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},f)))),(0,s.createElement)(p.Button,{icon:Hb,label:(0,h.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:n,iconSize:24}),r&&(0,s.createElement)(p.Button,{icon:zm,label:(0,h.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:l,iconSize:24}),(0,s.createElement)(Gb,{fillProps:t})),(d&&((null==a?void 0:a.image)||(null==a?void 0:a.description))||u)&&(0,s.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==a?void 0:a.image)||u)&&(0,s.createElement)("div",{"aria-hidden":!(null!=a&&a.image),className:c()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=a&&a.image)})},(null==a?void 0:a.image)&&(0,s.createElement)("img",{src:null==a?void 0:a.image,alt:""})),((null==a?void 0:a.description)||u)&&(0,s.createElement)("div",{"aria-hidden":!(null!=a&&a.description),className:c()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=a&&a.description)})},(null==a?void 0:a.description)&&(0,s.createElement)(p.__experimentalText,{truncate:!0,numberOfLines:"2"},a.description))))}function jb(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=Mb,onChange:a=u.noop,onRemove:d,noDirectEntry:m=!1,showSuggestions:f=!0,showInitialSuggestions:g,forceIsEditingLink:v,createSuggestion:b,withCreateSuggestion:k,inputValue:_="",suggestionsQuery:y={},noURLSuggestion:E=!1,createSuggestionButtonText:C,hasRichPreviews:S=!1,hasTextControl:w=!1,renderControlBottom:B=null}=e;void 0===k&&b&&(k=!0);const I=(0,s.useRef)(!0),x=(0,s.useRef)(),T=(0,s.useRef)(),[N,P]=(0,s.useState)((null==l?void 0:l.url)||""),[M,R]=(0,s.useState)((null==l?void 0:l.title)||""),L=_||N,[A,D]=(0,s.useState)(void 0!==v?v:!l||!l.url),O=(0,s.useRef)(!1),F=!(null!=L&&null!==(t=L.trim())&&void 0!==t&&t.length);function z(){var e;O.current=!(null===(e=x.current)||void 0===e||!e.contains(x.current.ownerDocument.activeElement)),D(!1)}(0,s.useEffect)((()=>{void 0!==v&&v!==A&&D(v)}),[v]),(0,s.useEffect)((()=>{if(I.current)return void(I.current=!1);const e=null!=T&&T.current?1:0;(rr.focus.focusable.find(x.current)[e]||x.current).focus(),O.current=!1}),[A]),(0,s.useEffect)((()=>{null!=l&&l.title&&l.title!==M&&R(l.title),null!=l&&l.url&&P(l.url)}),[l]);const{createPage:V,isCreatingPage:H,errorMessage:G}=function(e){const t=(0,s.useRef)(),[n,o]=(0,s.useState)(!1),[r,l]=(0,s.useState)(null);return(0,s.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=(e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,h.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(b),U=()=>{L===(null==l?void 0:l.url)&&M===(null==l?void 0:l.title)||a({url:L,title:M}),z()},W=d&&l&&!A&&!H,$=!(null==i||!i.length),j=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&w;return(0,s.createElement)("div",{tabIndex:-1,ref:x,className:"block-editor-link-control"},H&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(p.Spinner,null)," ",(0,h.__)("Creating"),"…"),(A||!l)&&!H&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:c()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":j})},j&&(0,s.createElement)(p.TextControl,{ref:T,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:M,onChange:R,onKeyDown:e=>{const{keyCode:t}=e;t!==va.ENTER||F||(e.preventDefault(),U())}}),(0,s.createElement)(zb,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:L,withCreateSuggestion:k,onCreateSuggestion:V,onChange:P,onSelect:e=>{a({...e,title:M||(null==e?void 0:e.title)}),z()},showInitialSuggestions:g,allowDirectEntry:!m,showSuggestions:f,suggestionsQuery:y,withURLSuggestion:!E,createSuggestionButtonText:C,useLabel:j},(0,s.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,s.createElement)(p.Button,{onClick:U,label:(0,h.__)("Submit"),icon:Sb,className:"block-editor-link-control__search-submit",disabled:F})))),G&&(0,s.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},G)),l&&!A&&!H&&(0,s.createElement)($b,{key:null==l?void 0:l.url,value:l,onEditClick:()=>D(!0),hasRichPreviews:S,hasUnlinkControl:W,onRemove:d}),$&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},(0,s.createElement)(wb,{value:l,settings:i,onChange:a})),B&&B())}jb.ViewerFill=Ub;var Kb=jb,qb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})),Yb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),Zb=(0,p.withFilters)("editor.MediaUpload")((()=>null)),Xb=function(e){let{fallback:t=null,children:n}=e;return(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return!!t().mediaUpload}),[])?n:t},Qb=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Mu.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onSelect:i,onSelectURL:a,onFilesUpload:c=u.noop,onCloseModal:d=u.noop,name:f=(0,h.__)("Replace"),createNotice:g,removeNotice:v,children:b,multiple:k=!1,addToGallery:_,handleUpload:y=!0}=e;const[E,C]=(0,s.useState)(t),S=(0,m.useSelect)((e=>e(zn).getSettings().mediaUpload),[]),w=(0,s.createRef)(),B=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),I=e=>{const t=document.createElement("div");t.innerHTML=(0,s.renderToString)(e);const n=t.textContent||t.innerText||"";setTimeout((()=>{g("error",n,{speak:!0,id:B,isDismissible:!0})}),1e3)},x=(e,t)=>{t(),C(e.url),i(e),(0,Nt.speak)((0,h.__)("The media file has been replaced")),v(B)},T=e=>{e.keyCode===va.DOWN&&(e.preventDefault(),e.target.click())},N=k&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,s.createElement)(p.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{ref:w,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:T},f)},renderContent:e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,s.createElement)(Zb,{gallery:N,addToGallery:_,multiple:k,value:k?o:n,onSelect:e=>x(e,t),allowedTypes:r,onClose:d,render:e=>{let{open:t}=e;return(0,s.createElement)(p.MenuItem,{icon:qb,onClick:t},(0,h.__)("Open Media Library"))}}),(0,s.createElement)(Xb,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!y)return t(),i(n);c(n),S({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;x(n,t)},onError:I})})(e,t)},accept:l,multiple:k,render:e=>{let{openFileDialog:t}=e;return(0,s.createElement)(p.MenuItem,{icon:Yb,onClick:()=>{t()}},(0,h.__)("Upload"))}})),b),a&&(0,s.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,s.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,h.__)("Current media URL:")),(0,s.createElement)(Kb,{value:{url:E},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;C(t),a(t),w.current.focus()}})))}})}));function Jb(e){let{url:t,urlLabel:n,className:o}=e;const r=c()(o,"block-editor-url-popover__link-viewer-url");return t?(0,s.createElement)(p.ExternalLink,{className:r,href:t},n||(0,id.filterURLForDisplay)((0,id.safeDecodeURI)(t))):(0,s.createElement)("span",{className:r})}function ek(e){let{additionalControls:t,children:n,renderSettings:o,position:r="bottom center",focusOnMount:l="firstElement",...a}=e;const[c,u]=(0,s.useState)(!1),d=!!o&&c;return(0,s.createElement)(p.Popover,i({className:"block-editor-url-popover",focusOnMount:l,position:r},a),(0,s.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,s.createElement)("div",{className:"block-editor-url-popover__row"},n,!!o&&(0,s.createElement)(p.Button,{className:"block-editor-url-popover__settings-toggle",icon:Wd,label:(0,h.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c})),d&&(0,s.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),t&&!d&&(0,s.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}ek.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,s.createElement)("form",i({className:c()("block-editor-url-popover__link-editor",n)},l),(0,s.createElement)(Ib,{value:r,onChange:o,autocompleteRef:t}),(0,s.createElement)(p.Button,{icon:Sb,label:(0,h.__)("Apply"),type:"submit"}))},ek.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:l,...a}=e;return(0,s.createElement)("div",i({className:c()("block-editor-url-popover__link-viewer",t)},a),(0,s.createElement)(Jb,{url:r,urlLabel:l,className:n}),o&&(0,s.createElement)(p.Button,{icon:Hb,label:(0,h.__)("Edit"),onClick:o}))};var tk=ek;const nk=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,s.createElement)(tk,{onClose:r},(0,s.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},(0,s.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,h.__)("URL"),placeholder:(0,h.__)("Paste or type URL"),onChange:n,value:t}),(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:Sb,label:(0,h.__)("Apply"),type:"submit"})))};var ok=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:a,isAppender:d,accept:f,addToGallery:g,multiple:v=!1,handleUpload:b=!0,dropZoneUIOnly:k,disableDropZone:_,disableMediaButtons:y,onError:E,onSelect:C,onCancel:S,onSelectURL:w,onDoubleClick:B,onFilesPreUpload:I=u.noop,onHTMLDrop:x=u.noop,onClose:T=u.noop,children:N,mediaLibraryButton:P,placeholder:M,style:R}=e;const L=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return t().mediaUpload}),[]),[A,D]=(0,s.useState)(""),[O,F]=(0,s.useState)(!1);(0,s.useEffect)((()=>{var e;D(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const z=e=>{D(e.target.value)},V=()=>{F(!0)},H=()=>{F(!1)},G=e=>{e.preventDefault(),A&&w&&(w(A),H())},U=e=>{if(!b)return C(e);let o;if(I(e),v)if(g){let e=[];o=n=>{const o=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));C(o.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=C;else o=e=>{let[t]=e;return C(t)};L({allowedTypes:n,filesList:e,onFileChange:o,onError:E})},W=e=>{U(e.target.files)},$=null!=M?M:e=>{let{instructions:t,title:u}=l;if(L||w||(t=(0,h.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===u){const e=null!=n?n:[],[o]=e,r=1===e.length,l=r&&"audio"===o,i=r&&"image"===o,s=r&&"video"===o;void 0===t&&L&&(t=(0,h.__)("Upload a media file or pick one from your media library."),l?t=(0,h.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,h.__)("Upload an image file, pick one from your media library, or add one with a URL."):s&&(t=(0,h.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=(0,h.__)("Media"),l?u=(0,h.__)("Audio"):i?u=(0,h.__)("Image"):s&&(u=(0,h.__)("Video")))}const m=c()("block-editor-media-placeholder",o,{"is-appender":d});return(0,s.createElement)(p.Placeholder,{icon:r,label:u,instructions:t,className:m,notices:a,onDoubleClick:B,preview:i,style:R},e,N)},j=()=>_?null:(0,s.createElement)(p.DropZone,{onFilesDrop:U,onHTMLDrop:x}),K=()=>S&&(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,h.__)("Cancel"),variant:"link",onClick:S},(0,h.__)("Cancel")),q=()=>w&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:V,isPressed:O,variant:"tertiary"},(0,h.__)("Insert from URL")),O&&(0,s.createElement)(nk,{src:A,onChange:z,onSubmit:G,onClose:H}));return k||y?(k&&Rt()("wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop",{since:"5.4",alternative:"disableMediaButtons"}),(0,s.createElement)(Xb,null,j())):(0,s.createElement)(Xb,{fallback:$(q())},(()=>{const e=null!=P?P:e=>{let{open:t}=e;return(0,s.createElement)(p.Button,{variant:"tertiary",onClick:()=>{t()}},(0,h.__)("Media Library"))},o=(0,s.createElement)(Zb,{addToGallery:g,gallery:v&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:v,onSelect:C,onClose:T,allowedTypes:n,value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(L&&d)return(0,s.createElement)(s.Fragment,null,j(),(0,s.createElement)(p.FormFileUpload,{onChange:W,accept:f,multiple:v,render:e=>{let{openFileDialog:t}=e;const n=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,h.__)("Upload")),o,q(),K());return $(n)}}));if(L){const e=(0,s.createElement)(s.Fragment,null,j(),(0,s.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:W,accept:f,multiple:v},(0,h.__)("Upload")),o,q(),K());return $(e)}return $(o)})())})),rk=e=>{let{colorSettings:t,...n}=e;const o=t.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,s.createElement)(vf,i({settings:o,gradients:[],disableCustomGradients:!0},n))};const lk={position:"bottom right",isAlternate:!0};var ik=()=>(0,s.createElement)(s.Fragment,null,["bold","italic","link"].map((e=>(0,s.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,s.createElement)(p.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,s.createElement)(p.ToolbarItem,null,(n=>(0,s.createElement)(p.DropdownMenu,{icon:Wd
|
79 |
+
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("More"),toggleProps:{...n,className:c()(n.className,{"is-pressed":t}),describedBy:(0,h.__)("Displays more block tools")},controls:(0,u.orderBy)(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:lk})))}))),sk=e=>{let{inline:t,anchorRef:n}=e;return t?(0,s.createElement)(p.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:n,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,s.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(ik,null)))):(0,s.createElement)(Yn,{group:"inline"},(0,s.createElement)(ik,null))};function ak(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(zn);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==va.DELETE&&o!==va.BACKSPACE&&o!==va.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function ck(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>`<img src="${(0,Cp.createBlobURL)(e)}">`)).join("")}var uk=window.wp.shortcode;function dk(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function pk(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function mk(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?mk.EMPTY_ARRAY:t||n?t||(Rt()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats"}),n.map((e=>`core/${e}`))):void 0}function fk(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const s=[],[a,c]=(0,Pt.split)(t),u=n.length>0;let d=-1;const p=(0,Pt.isEmpty)(a)&&!(0,Pt.isEmpty)(c);u&&(0,Pt.isEmpty)(a)||(s.push(r((0,Pt.toHTMLString)({value:a,multilineTag:i}),!p)),d+=1),u?(s.push(...n),d+=n.length):l&&s.push(l()),(u||l)&&(0,Pt.isEmpty)(c)||s.push(r((0,Pt.toHTMLString)({value:c,multilineTag:i}),p)),o(s,u?d:1,u?-1:0)}function hk(e,t){return t?(0,Pt.replace)(e,/\n+/g,Pt.__UNSTABLE_LINE_SEPARATOR):(0,Pt.replace)(e,new RegExp(Pt.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function gk(e){const t=(0,s.useRef)(e);return t.current=e,(0,d.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:l,value:i,formatTypes:s,tagName:a,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:f,pastePlainText:h}=t.current;if(!n)return void e.preventDefault();const{clipboardData:g}=e;let v="",b="";try{v=g.getData("text/plain"),b=g.getData("text/html")}catch(e){try{b=g.getData("Text")}catch(e){return}}if(b=function(e){return e.replace(/.*<!--StartFragment-->/s,"").replace(/<!--EndFragment-->.*/s,"")}(b),b=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(t.length):e}(b),e.preventDefault(),window.console.log("Received HTML:\n\n",b),window.console.log("Received plain text:\n\n",v),o)return void l((0,Pt.insert)(i,v));const k=s.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:b,plainText:v})),e}),i);if(k!==i)return void l(k);const _=[...(0,rr.getFilesFromDataTransfer)(g)];if("true"===g.getData("rich-text")){const e=g.getData("rich-text-multi-line-tag")||void 0;let t=(0,Pt.create)({html:b,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:f});return t=hk(t,!!m),dk(t,i.activeFormats),void l((0,Pt.insert)(i,t))}if(h)return void l((0,Pt.insert)(i,(0,Pt.create)({text:v})));if(_&&_.length&&!b){const e=(0,r.pasteHandler)({HTML:ck(_),mode:"BLOCKS",tagName:a,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",_),void(c&&(0,Pt.isEmpty)(i)?c(e):fk({value:i,pastedBlocks:e,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,Pt.isEmpty)(i)&&(E=v,(0,uk.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,Pt.isEmpty)(i)&&(0,id.isURL)(v.trim())&&(y="BLOCKS");const C=(0,r.pasteHandler)({HTML:b,plainText:v,mode:y,tagName:a,preserveWhiteSpace:f});if("string"==typeof C){let e=(0,Pt.create)({html:C});e=hk(e,!!m),dk(e,i.activeFormats),l((0,Pt.insert)(i,e))}else C.length>0&&(c&&(0,Pt.isEmpty)(i)?c(C,C.length-1,-1):fk({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function vk(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(zn),o=(0,s.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function l(){const{value:e,onReplace:t}=o.current;if(!t)return;const{start:l,text:i}=e;if(" "!==i.slice(l-1,l))return;const s=i.slice(0,l).trim(),a=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),c=(0,r.findTransform)(a,(e=>{let{prefix:t}=e;return s===t}));if(!c)return;const u=(0,Pt.toHTMLString)({value:(0,Pt.slice)(e,l,i.length)});t([c.transform(u)]),n()}function i(e){const{inputType:r,type:i}=e,{value:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==r&&"compositionend"!==i)return;c&&l&&l();const d=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<t.length||o.slice(n-t.length,n).toLowerCase()!==t?e:(0,Pt.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(s));d!==s&&(t(),a({...d,activeFormats:s.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function bk(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(zn),n=(0,s.useRef)(e);return n.current=e,(0,d.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:l,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;if(e.keyCode!==va.ENTER)return;e.preventDefault();const m={...l};m.formats=o(l);const f=i&&s;if(i){const e=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,r.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(i([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,Pt.insert)(m,"\n")):f&&(0,Pt.__unstableIsEmptyLine)(m)?fk({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c}):u((0,Pt.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!f&&!r?d||u((0,Pt.insert)(m,"\n")):!f&&r?p():f&&fk({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function kk(e){return e(Pt.store).getFormatTypes()}mk.EMPTY_ARRAY=[];const _k=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function yk(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function Ek(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function Ck(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:l}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const a=(0,Pt.getActiveFormat)(r,t);let c=void 0!==a;const d=(0,Pt.getActiveObject)(r),p=void 0!==d&&d.type===t;if("core/link"===t&&!(0,Pt.isCollapsed)(r)){const e=r.formats,t=(0,u.find)(e[r.start],{type:"core/link"}),n=(0,u.find)(e[r.end-1],{type:"core/link"});t&&n&&t===n||(c=!1)}return(0,s.createElement)(i,{key:t,isActive:c,activeAttributes:c&&a.attributes||{},isObjectActive:p,activeObjectAttributes:p&&d.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const Sk=(0,s.createContext)(),wk=(0,s.createContext)(),Bk=(0,s.forwardRef)((function e(t,n){let{children:o,tagName:l="div",value:a="",onChange:f,isSelected:h,multiline:g,inlineToolbar:v,wrapperClassName:b,autocompleters:k,onReplace:_,placeholder:y,allowedFormats:E,formattingControls:C,withoutInteractiveFormatting:S,onRemove:w,onMerge:B,onSplit:I,__unstableOnSplitAtEnd:x,__unstableOnSplitMiddle:T,identifier:N,preserveWhiteSpace:P,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:R,__unstableDisableFormats:L,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:O,...F}=t;const z=(0,d.useInstanceId)(e);N=N||z,F=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(F);const V=(0,s.useRef)(),{clientId:H}=Un(),{selectionStart:G,selectionEnd:U,isSelected:W,disabled:$}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n,isMultiSelecting:o,hasMultiSelection:r}=e(zn),l=t(),i=n();let s;return void 0===h?s=l.clientId===H&&l.attributeKey===N:h&&(s=l.clientId===H),{selectionStart:s?l.offset:void 0,selectionEnd:s?i.offset:void 0,isSelected:s,disabled:o()||r()}})),{selectionChange:j}=(0,m.useDispatch)(zn),K=pk(g),q=mk({allowedFormats:E,formattingControls:C,disableFormats:L}),Y=!q||q.length>0;let Z=a,X=f;Array.isArray(a)&&(Z=r.children.toHTML(a),X=e=>f(r.children.fromDOM((0,Pt.__unstableCreateElement)(document,e).childNodes)));const Q=(0,s.useCallback)(((e,t)=>{j(H,N,e,t)}),[H,N]),{formatTypes:J,prepareHandlers:ee,valueHandlers:te,changeHandlers:ne,dependencies:oe}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,m.useSelect)(kk,[]),i=(0,s.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&_k.has(n))}))),[l,r,_k]),a=(0,m.useSelect)((e=>i.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o)),{})),[i,t,n]),c=(0,m.useDispatch)(),u=[],d=[],p=[],f=[];return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=a[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)f.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:n,blockClientId:t})),p.push(e.__experimentalCreateOnChangeEditableValue({...a[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:f}}({clientId:H,identifier:N,withoutInteractiveFormatting:S,allowedFormats:q});function re(e){return J.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,Pt.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:le,onChange:ie,ref:se}=(0,Pt.__unstableUseRichText)({value:Z,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;X(e),Object.values(ne).forEach((e=>{e(n,o)}))},selectionStart:G,selectionEnd:U,onSelectionChange:Q,placeholder:y,__unstableIsSelected:W,__unstableMultilineTag:K,__unstableDisableFormats:L,preserveWhiteSpace:P,__unstableDependencies:[...oe,l],__unstableAfterParse:function(e){return te.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:re,__unstableAddInvisibleFormats:function(e){return ee.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ae=function(e){return(0,p.__unstableUseAutocompleteProps)({...e,completers:Dg(e)})}({onReplace:_,completers:k,record:le,onChange:ie});!function(e){let{value:t}=e;const n=t.activeFormats&&!!t.activeFormats.length,{isCaretWithinFormattedText:o}=(0,m.useSelect)(zn),{enterFormattedText:r,exitFormattedText:l}=(0,m.useDispatch)(zn);(0,s.useEffect)((()=>{n?o()||r():o()&&l()}),[n])}({value:le}),function(e){let{html:t,value:n}=e;const o=(0,s.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,m.useDispatch)(zn);(0,s.useLayoutEffect)((()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}l()}else o.current=n.text}),[t,r])}({html:Z,value:le});const ce=(0,s.useRef)(new Set),ue=(0,s.useRef)(new Set);function de(){V.current.focus()}const pe=l,me=(0,s.createElement)(s.Fragment,null,W&&(0,s.createElement)(Sk.Provider,{value:ce},(0,s.createElement)(wk.Provider,{value:ue},(0,s.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:le,onChange:ie,onFocus:de}),(0,s.createElement)(Ck,{value:le,onChange:ie,onFocus:de,formatTypes:J,forwardedRef:V})))),W&&Y&&(0,s.createElement)(sk,{inline:v,anchorRef:V.current}),(0,s.createElement)(pe,i({role:"textbox","aria-multiline":!0,"aria-label":y},F,ae,{ref:(0,d.useMergeRefs)([ae.ref,F.ref,se,vk({value:le,onChange:ie,__unstableAllowPrefixTransformations:O,formatTypes:J,onReplace:_}),(0,d.useRefEffect)((e=>{function t(e){(va.isKeyboardEvent.primary(e,"z")||va.isKeyboardEvent.primary(e,"y")||va.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),yk(ce),Ek(ue),ak(),gk({isSelected:W,disableFormats:L,onChange:ie,value:le,formatTypes:J,tagName:l,onReplace:_,onSplit:I,onSplitMiddle:T,__unstableEmbedURLOnPaste:R,multilineTag:K,preserveWhiteSpace:P,pastePlainText:M}),bk({removeEditorOnlyFormats:re,value:le,onReplace:_,onSplit:I,onSplitMiddle:T,multilineTag:K,onChange:ie,disableLineBreaks:A,onSplitAtEnd:x}),V,n]),contentEditable:!$||void 0,suppressContentEditableWarning:!$,className:c()("block-editor-rich-text__editable",F.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===va.DELETE||t===va.BACKSPACE)){const{start:n,end:o,text:r}=le,l=t===va.BACKSPACE,i=le.activeFormats&&!!le.activeFormats.length;if(!(0,Pt.isCollapsed)(le)||i||l&&0!==n||!l&&o!==r.length)return;B&&B(!l),w&&(0,Pt.isEmpty)(le)&&l&&w(!l),e.preventDefault()}}})));if(!b)return me;Rt()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div"});const fe=c()("block-editor-rich-text",b);return(0,s.createElement)("div",{className:fe},me)}));Bk.Content=e=>{let{value:t,tagName:n,multiline:o,...l}=e;Array.isArray(t)&&(t=r.children.toHTML(t));const i=pk(o);!t&&i&&(t=`<${i}></${i}>`);const a=(0,s.createElement)(s.RawHTML,null,t);return n?(0,s.createElement)(n,(0,u.omit)(l,["format"]),a):a},Bk.isEmpty=e=>!e||0===e.length;var Ik=Bk;const xk=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Ik,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));xk.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,s.createElement)(n,o,t)};var Tk=xk,Nk=(0,s.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,s.createElement)(Tk,i({ref:t},o));const{className:r,onChange:l,...a}=o;return(0,s.createElement)(Er.Z,i({ref:t,className:c()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},a))}));function Pk(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(Pk),l=o||(0,h.sprintf)(
|
80 |
/* translators: 1: property name. 2: viewport name. */
|
81 |
+
(0,h._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{"aria-describedby":`rbc-desc-${r}`},n.label),(0,s.createElement)(p.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}var Mk=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:a=!1,defaultLabel:u={id:"all",
|
82 |
/* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
|
83 |
label:(0,h.__)("All")},viewports:d=[{id:"small",label:(0,h.__)("Small screens")},{id:"medium",label:(0,h.__)("Medium screens")},{id:"large",label:(0,h.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const m=o||(0,h.sprintf)(
|
84 |
/* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */
|
85 |
+
(0,h.__)("Use the same %s on all screensizes."),n),f=(0,h.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),g=l((0,s.createElement)(Pk,{property:n,viewport:u}),u);
|
86 |
+
/* translators: 'Help text for the responsive mode toggle control.' */return(0,s.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,s.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,s.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,s.createElement)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,checked:!a,onChange:r,help:f}),(0,s.createElement)("div",{className:c()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&g,a&&(i?i(d):d.map((e=>(0,s.createElement)(s.Fragment,{key:e.id},l((0,s.createElement)(Pk,{property:n,viewport:e}),e))))))))};function Rk(e){let{character:t,type:n,onUse:o}=e;const r=(0,s.useContext)(Sk),l=(0,s.useRef)();return l.current=o,(0,s.useEffect)((()=>{function e(e){va.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function Lk(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,a="RichText.ToolbarControls";return n&&(a+=`.${n}`),o&&r&&(t=va.displayShortcut[o](r)),(0,s.createElement)(p.Fill,{name:a},(0,s.createElement)(p.ToolbarButton,i({},l,{shortcut:t})))}function Ak(e){let{inputType:t,onInput:n}=e;const o=(0,s.useContext)(wk),r=(0,s.useRef)();return r.current=n,(0,s.useEffect)((()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t]),null}const Dk=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"}));var Ok=(0,s.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(zn).isNavigationMode()),[]),{setNavigationMode:o}=(0,m.useDispatch)(zn),r=e=>{o("edit"!==e)};return(0,s.createElement)(p.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,s.createElement)(p.Button,i({},e,{ref:t,icon:n?Dk:Hb,"aria-expanded":r,"aria-haspopup":"true",onClick:l
|
87 |
+
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("Tools")}))},position:"bottom right",renderContent:()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{role:"menu","aria-label":(0,h.__)("Tools")},(0,s.createElement)(p.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wo,{icon:Hb}),(0,h.__)("Edit"))},{value:"select",label:(0,s.createElement)(s.Fragment,null,Dk,(0,h.__)("Select"))}]})),(0,s.createElement)("div",{className:"block-editor-tool-selector__help"},(0,h.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function Fk(e){let{units:t,...n}=e;const o=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,s.createElement)(p.__experimentalUnitControl,i({units:o},n))}var zk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));class Vk extends s.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,h.__)("Edit link"):(0,h.__)("Insert link");return(0,s.createElement)("div",{className:"block-editor-url-input__button"},(0,s.createElement)(p.Button,{icon:Fm,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,s.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,s.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,s.createElement)(p.Button,{className:"block-editor-url-input__back",icon:zk,label:(0,h.__)("Close"),onClick:this.toggle}),(0,s.createElement)(Ib,{value:e||"",onChange:t}),(0,s.createElement)(p.Button,{icon:Sb,label:(0,h.__)("Submit"),type:"submit"}))))}}var Hk=Vk,Gk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));const Uk="none",Wk="custom",$k="media",jk="attachment",Kk=["noreferrer","noopener"],qk=(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,s.createElement)(p.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),Yk=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:a,linkClass:c,rel:d}=e;const[m,f]=(0,s.useState)(!1),g=(0,s.useCallback)((()=>{f(!0)})),[v,b]=(0,s.useState)(!1),[k,_]=(0,s.useState)(null),y=(0,s.useRef)(null),E=(0,s.useCallback)((()=>{t!==$k&&t!==jk||_(""),b(!0)})),C=(0,s.useCallback)((()=>{b(!1)})),S=(0,s.useCallback)((()=>{_(null),C(),f(!1)})),w=e=>{let t=e;return void 0===e||(0,u.isEmpty)(t)||(0,u.isEmpty)(t)||((0,u.each)(Kk,(e=>{const n=new RegExp("\\b"+e+"\\b","gi");t=t.replace(n,"")})),t!==e&&(t=t.trim()),(0,u.isEmpty)(t)&&(t=void 0)),t},B=(0,s.useCallback)((()=>e=>{const t=y.current;t&&t.contains(e.target)||(f(!1),_(null),C())})),I=(0,s.useCallback)((()=>e=>{if(k){var t;const e=(null===(t=T().find((e=>e.url===k)))||void 0===t?void 0:t.linkDestination)||Wk;n({href:k,linkDestination:e})}C(),_(null),e.preventDefault()})),x=(0,s.useCallback)((()=>{n({linkDestination:Uk,href:""})})),T=()=>{const e=[{linkDestination:$k,title:(0,h.__)("Media File"),url:"image"===r?l:void 0,icon:qk}];return"image"===r&&i&&e.push({linkDestination:jk,title:(0,h.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},N=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;return n=t||d?w(d):void 0,{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===a}),(0,s.createElement)(p.TextControl,{label:(0,h.__)("Link Rel"),value:w(d)||"",onChange:e=>{n({rel:e})}}),(0,s.createElement)(p.TextControl,{label:(0,h.__)("Link CSS Class"),value:c||"",onChange:e=>{n({linkClass:e})}})),P=null!==k?k:o,M=((0,u.find)(T(),["linkDestination",t])||{}).title;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{icon:Fm,className:"components-toolbar__control",label:o?(0,h.__)("Edit link"):(0,h.__)("Insert link"),"aria-expanded":m,onClick:g}),m&&(0,s.createElement)(tk,{onFocusOutside:B(),onClose:S,renderSettings:()=>N,additionalControls:!P&&(0,s.createElement)(p.NavigableMenu,null,(0,u.map)(T(),(e=>(0,s.createElement)(p.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{_(null),(e=>{const t=T();let o;o=e?((0,u.find)(t,(t=>t.url===e))||{linkDestination:Wk}).linkDestination:Uk,n({linkDestination:o,href:e})})(e.url),C()}},e.title))))},(!o||v)&&(0,s.createElement)(tk.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:P,onChangeInputValue:_,onSubmit:I(),autocompleteRef:y}),o&&!v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(tk.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:E,urlLabel:M}),(0,s.createElement)(p.Button,{icon:Gk,label:(0,h.__)("Remove link"),onClick:x}))))};function Zk(e){let{children:t,className:n,isEnabled:o=!0,deviceType:r,setDeviceType:l}=e;if((0,d.useViewportMatch)("small","<"))return null;const i={className:c()(n,"block-editor-post-preview__dropdown-content"),position:"bottom left"},a={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!o,
|
88 |
/* translators: button label text should, if possible, be under 16 characters. */
|
89 |
+
children:(0,h.__)("Preview")};return(0,s.createElement)(p.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:i,toggleProps:a,icon:null},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&ip},(0,h.__)("Desktop")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Tablet"),icon:"Tablet"===r&&ip},(0,h.__)("Tablet")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Mobile"),icon:"Mobile"===r&&ip},(0,h.__)("Mobile"))),t)))}function Xk(e){const[t,n]=(0,s.useState)(window.innerWidth);(0,s.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n<t?n:t};return(e=>{const t="Mobile"===e?"768px":"1024px";switch(e){case"Tablet":case"Mobile":return{width:o(e),margin:(window.innerHeight<800?36:72)+"px auto",height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}var Qk=(0,m.withSelect)((e=>({selectedBlockClientId:e(zn).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=Ba(t);return t?(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,h.__)("Skip to the selected block")):null})),Jk=window.wp.wordcount,e_=(0,m.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(zn);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,Jk.count)((0,r.serialize)(t),"words");return(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,s.createElement)(Ga,{icon:op,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,h.sprintf)(
|
90 |
/* translators: %d: number of blocks */
|
91 |
(0,h._n)("%d block","%d blocks",t.length),t.length)),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,h.sprintf)(
|
92 |
/* translators: %d: number of words */
|
93 |
+
(0,h._n)("%d word","%d words",n),n))))}));function t_(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:l}=(0,m.useSelect)((e=>{var n,o;const l=e(zn).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==l||null===(n=l.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==l?void 0:l.onChange)&&void 0!==o?o:null,styles:e(r.store).getBlockStyles(t)}}),[t]),i=(0,s.useMemo)((()=>[{label:(0,h.__)("Not set"),value:""},...l.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[l]),a=(0,s.useMemo)((()=>{var e;return null===(e=up(l))||void 0===e?void 0:e.name}),[l]),c=(0,s.useCallback)((e=>{o(t,e)}),[t,o]);return n&&n!==a?o&&(0,s.createElement)("div",{className:"default-style-picker__default-switcher"},(0,s.createElement)(p.SelectControl,{options:i,value:n||"",label:(0,h.__)("Default Style"),onChange:c})):null}const n_=e=>{let{clientId:t,blockName:n,hasBlockStyles:o}=e;const l=Ad(t);return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(Ua,l),(0,s.createElement)(Mv,{blockClientId:t}),o&&(0,s.createElement)("div",null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Styles")},(0,s.createElement)(bv,{scope:"core/block-inspector",clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,s.createElement)(t_,{blockName:n}))),(0,s.createElement)(er.Slot,null),(0,s.createElement)(er.Slot,{__experimentalGroup:"typography",label:(0,h.__)("Typography")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"dimensions",label:(0,h.__)("Dimensions")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}),(0,s.createElement)("div",null,(0,s.createElement)(o_,null)),(0,s.createElement)(Qk,{key:"back"}))},o_=()=>{const e=(0,p.__experimentalUseSlot)(Jo.slotName);return Boolean(e.fills&&e.fills.length)?(0,s.createElement)(p.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,h.__)("Advanced"),initialOpen:!1},(0,s.createElement)(er.Slot,{__experimentalGroup:"advanced"})):null};var r_=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,hasBlockStyles:o,selectedBlockName:l,selectedBlockClientId:i,blockType:a}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(zn),{getBlockStyles:l}=e(r.store),i=t(),s=i&&o(i),a=s&&(0,r.getBlockType)(s),c=s&&l(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:a,hasBlockStyles:c&&c.length>0}}),[]);if(n>1)return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(e_,null),(0,s.createElement)(er.Slot,null),(0,s.createElement)(er.Slot,{__experimentalGroup:"typography",label:(0,h.__)("Typography")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"dimensions",label:(0,h.__)("Dimensions")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}));const c=l===(0,r.getUnregisteredTypeHandlerName)();return a&&i&&!c?(0,s.createElement)(n_,{clientId:i,blockName:a.name,hasBlockStyles:o}):t?(0,s.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,h.__)("No block selected.")):null};function l_(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,d.useViewportMatch)("medium"),l=(0,m.useSelect)((e=>e(zn).getSettings().hasFixedToolbar),[]),a=(0,tc.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:c,getBlockRootClientId:f}=(0,m.useSelect)(zn),{duplicateBlocks:h,removeBlocks:g,insertAfterBlock:v,insertBeforeBlock:b,clearSelectedBlock:k,moveBlocksUp:_,moveBlocksDown:y}=(0,m.useDispatch)(zn);return(0,s.createElement)("div",i({},o,{onKeyDown:function(e){if(a("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));_(t,n)}}else if(a("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));y(t,n)}}else if(a("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),h(t))}else if(a("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),g(t))}else if(a("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),v((0,u.last)(t)))}else if(a("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),b((0,u.first)(t)))}else if(a("core/block-editor/delete-multi-selection",e)){if(["INPUT","TEXTAREA"].includes(e.target.nodeName)||e.defaultPrevented)return;const t=c();t.length>1&&(e.preventDefault(),g(t))}else a("core/block-editor/unselect",e)&&c().length>1&&(e.preventDefault(),k(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}),(0,s.createElement)(Pd,{__unstableContentRef:n},(l||!r)&&(0,s.createElement)(Up,{isFixed:!0}),(0,s.createElement)(Kp,{__unstableContentRef:n}),(0,s.createElement)(p.Popover.Slot,{name:"block-toolbar",ref:xd(n)}),t,(0,s.createElement)(p.Popover.Slot,{name:"__unstable-block-tools-after",ref:xd(n)})))}var i_=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:a,__experimentalFilterValue:c,onSelect:d=u.noop,shouldFocusBlock:p=!1}=e;const f=(0,m.useSelect)((e=>{const{getBlockRootClientId:t}=e(zn);return n||t(o)||void 0}),[o,n]);return(0,s.createElement)(bd,{onSelect:d,rootClientId:f,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:a,__experimentalFilterValue:c,shouldFocusBlock:p,ref:t})}));function s_(){return null}s_.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(tc.store);return(0,s.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,h.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,h.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,h.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,h.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,h.__)("Remove multiple selected blocks."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,h.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,h.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,h.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,h.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,h.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var a_=s_;function c_(){return Rt()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const u_=new Set([va.UP,va.RIGHT,va.DOWN,va.LEFT,va.ENTER,va.BACKSPACE]);function d_(){const e=(0,m.useSelect)((e=>e(zn).isTyping()),[]),{stopTyping:t}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function p_(){const e=(0,m.useSelect)((e=>e(zn).isTyping())),{startTyping:t,stopTyping:n}=(0,m.useDispatch)(zn),o=d_(),r=(0,d.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:l}=r;if(e){let e;function t(t){const{target:o}=t;e=l.setTimeout((()=>{(0,rr.isTextField)(o)||n()}))}function i(e){const{keyCode:t}=e;t!==va.ESCAPE&&t!==va.TAB||n()}function s(){const e=l.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",t),o.addEventListener("keydown",i),r.addEventListener("selectionchange",s),()=>{l.clearTimeout(e),o.removeEventListener("focus",t),o.removeEventListener("keydown",i),r.removeEventListener("selectionchange",s)}}function i(e){const{type:n,target:r}=e;(0,rr.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&u_.has(t)}(e))&&t()}return o.addEventListener("keypress",i),o.addEventListener("keydown",i),()=>{o.removeEventListener("keypress",i),o.removeEventListener("keydown",i)}}),[e,t,n]);return(0,d.useMergeRefs)([o,r])}var m_=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:p_()},t)};function f_(){return Rt()("PreserveScrollInReorder component",{since:"5.4",hint:"This behavior is now built-in the block list"}),null}const h_=-1!==window.navigator.userAgent.indexOf("Trident"),g_=new Set([va.UP,va.DOWN,va.LEFT,va.RIGHT]);function v_(){const e=(0,m.useSelect)((e=>e(zn).hasSelectedBlock()),[]);return(0,d.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function s(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c(e){let{keyCode:r}=e;if(!m())return;const l=(0,rr.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(g_.has(r))return void(i=l);const s=l.top-i.top;if(0===s)return;const a=(0,rr.getScrollContainer)(t);if(!a)return;const c=a===n.body,u=c?o.scrollY:a.scrollTop,d=c?0:a.getBoundingClientRect().top,p=c?i.top/o.innerHeight:(i.top-d)/(o.innerHeight-d);if(0===u&&p<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=l);const f=c?o.innerHeight:a.clientHeight;i.top+i.height>d+f||i.top<d?i=l:c?o.scrollBy(0,s):a.scrollTop+=s}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,rr.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",s,!0),o.addEventListener("resize",s,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",s,!0),o.removeEventListener("resize",s,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}var b_=h_?e=>e.children:function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:v_(),className:"block-editor__typewriter"},t)};const k_=(0,s.createContext)({});function y_(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function E_(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,s.useContext)(k_),{name:r}=Un();n=n||r;const l=Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e)),i=(0,s.useMemo)((()=>y_(o,n,e)),[o,n,e]),a=(0,s.useCallback)((e=>{let{children:t}=e;return(0,s.createElement)(k_.Provider,{value:i},t)}),[i]);return[l,a]}function C_(e){if(void 0===e)e=v.colors;else{const t=e.filter((e=>e.color));0===t.length?e=v.colors:t.length<e.length&&(e=t)}return e}function S_(e){if(void 0===e)e=v.gradients;else{const t=e.filter((e=>e.gradient));0===t.length?e=v.gradients:t.length<e.length&&(e=t)}return e}function w_(e){const t=null==e?void 0:e.trim().match(/^(0?[-.]?\d*\.?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function B_(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>w_(P_(e,t)).value)).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]<o[0]?o[0]+"px":o[1]>o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function I_(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=B_(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return w_(e)}function x_(e){for(let t=0;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}function T_(e){let t=!1;const n=e.split(/[+-/*/]/g).filter(Boolean);for(const o of n){const n=w_(P_(o));if(!parseFloat(n.value)){t=!0;break}e=e.replace(o,n.value)}return t?null:(o=e,Function(`'use strict'; return (${o})`)()).toFixed(0)+"px";var o}function N_(e,t){const n=.01,o=Object.assign({},{fontSize:16,lineHeight:16,width:375,height:812,type:"font"},t),r={em:o.fontSize,rem:o.fontSize,vh:o.height*n,vw:o.width*n,vmin:(o.width<o.height?o.width:o.height)*n,vmax:(o.width>o.height?o.width:o.height)*n,"%":("font"===o.type?o.fontSize:o.width)*n,ch:8,ex:7.15625,lh:o.lineHeight},l={in:96,cm:37.79527559055118,mm:3.7795275590551185,pt:1.3333333333333333,pc:16,px:1,Q:.9448818897637794};return r[e.unit]?(r[e.unit]*e.value).toFixed(0)+"px":l[e.unit]?(l[e.unit]*e.value).toFixed(0)+"px":null}function P_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=w_(e);return n.unit||(n=I_(e)),x_(e)&&!n.unit?T_(e):N_(n,t)}const M_={};function R_(e){let t="";return e.hasOwnProperty("fontSize")&&(t=":"+e.width),e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight),e.hasOwnProperty("width")&&(t=":"+e.width),e.hasOwnProperty("height")&&(t=":"+e.height),e.hasOwnProperty("type")&&(t=":"+e.type),t}var L_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+R_(t);return M_[n]||(M_[n]=P_(e,t)),M_[n]}}(),(window.wp=window.wp||{}).blockEditor=o}();
|
build/block-editor/style-rtl.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.block-editor-autocompleters__block{white-space:nowrap}.block-editor-autocompleters__block .block-editor-block-icon{margin-left:8px}.block-editor-block-alignment-control__menu-group .components-menu-item__info{margin-top:0}.block-editor-block-alignment-matrix-control__popover .components-popover__content{min-width:0;width:auto}.block-editor-block-alignment-matrix-control__popover .components-popover__content>div{padding:8px}.block-editor-block-icon{align-items:center;display:flex;height:24px;justify-content:center;width:24px}.block-editor-block-icon.has-colors svg{fill:currentColor}@media (forced-colors:active){.block-editor-block-icon.has-colors svg{fill:CanvasText}}.block-editor-block-icon svg{max-height:24px;max-width:24px;min-height:20px;min-width:20px}.block-editor-block-inspector p{margin-top:0}.block-editor-block-inspector h2,.block-editor-block-inspector h3{color:#1e1e1e;font-size:13px;margin-bottom:1.5em}.block-editor-block-inspector .components-base-control{margin-bottom:24px}.block-editor-block-inspector .components-base-control:last-child{margin-bottom:8px}.block-editor-block-inspector .components-panel__body{border:none;border-top:1px solid #e0e0e0}.block-editor-block-inspector .block-editor-block-card{padding:16px}.block-editor-block-inspector__no-blocks{background:#fff;display:block;font-size:13px;padding:32px 16px;text-align:center}.block-editor-block-styles .block-editor-block-list__block{margin:0}.block-editor-block-list__layout{position:relative}.block-editor-block-list__layout.is-navigate-mode{cursor:default}.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted:after,.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:after,.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered:after,.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected:after{border-radius:1px;bottom:1px;box-shadow:0 0 0 1px var(--wp-admin-theme-color);content:"";left:1px;outline:2px solid transparent;pointer-events:none;position:absolute;right:1px;top:1px;z-index:1}.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted:after,.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:after,.is-dark-theme .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered:after,.is-dark-theme .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected:after{box-shadow:0 0 0 1px #fff}.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted .components-placeholder ::selection,.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected .components-placeholder ::selection,.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered .components-placeholder ::selection,.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected .components-placeholder ::selection{background:transparent}.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered:not(.is-selected):after{box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted:after{box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:1px solid transparent}.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:after,.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.has-child-selected,.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected:after{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected:before{border-radius:2px;border-top:4px solid #ccc;content:"";left:0;pointer-events:none;position:absolute;right:0;top:-14px;transition:border-color .1s linear,border-style .1s linear,box-shadow .1s linear;z-index:0}.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected:after{content:none}.block-editor-block-list__layout .is-block-moving-mode.can-insert-moving-block.block-editor-block-list__block.is-selected:before{border-color:var(--wp-admin-theme-color)}.is-block-moving-mode.block-editor-block-list__block-selection-button{font-size:1px;height:1px;opacity:0;padding:0}.block-editor-block-list__layout .block-editor-block-list__block{overflow-wrap:break-word;position:relative}.block-editor-block-list__layout .block-editor-block-list__block .reusable-block-edit-panel *{z-index:1}.block-editor-block-list__layout .block-editor-block-list__block .components-placeholder .components-with-notices-ui{margin:-10px 0 12px}.block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui{margin:0 0 12px;width:100%}.block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice{margin-left:0;margin-right:0}.block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice .components-notice__content{font-size:13px}.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus{outline:none}.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus:after{border-radius:1px;bottom:1px;box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";left:1px;outline:2px solid transparent;pointer-events:none;position:absolute;right:1px;top:1px;z-index:1}.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus:after{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #fff}.block-editor-block-list__layout .block-editor-block-list__block:after{border-radius:2px;bottom:0;box-shadow:0 0 0 var(--wp-admin-border-width-focus) transparent;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}.block-editor-block-list__layout .block-editor-block-list__block.has-warning{min-height:48px}.block-editor-block-list__layout .block-editor-block-list__block.has-warning>*{pointer-events:none;-webkit-user-select:none;user-select:none}.block-editor-block-list__layout .block-editor-block-list__block.has-warning .block-editor-warning{pointer-events:all}.block-editor-block-list__layout .block-editor-block-list__block.has-warning:after{background-color:hsla(0,0%,100%,.4);border-radius:2px;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.block-editor-block-list__layout .block-editor-block-list__block.has-warning.is-multi-selected:after{background-color:transparent}.block-editor-block-list__layout .block-editor-block-list__block.is-reusable>.block-editor-inner-blocks>.block-editor-block-list__layout.has-overlay:after{display:none}.block-editor-block-list__layout .block-editor-block-list__block.is-reusable>.block-editor-inner-blocks>.block-editor-block-list__layout.has-overlay .block-editor-block-list__layout.has-overlay:after{display:block}.block-editor-block-list__layout .block-editor-block-list__block.is-reusable.has-child-selected:after{box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.block-editor-block-list__layout .block-editor-block-list__block[data-clear=true]{float:none}.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered{cursor:default}.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered:after{border-radius:1px;bottom:1px;box-shadow:0 0 0 1px var(--wp-admin-theme-color);left:1px;right:1px;top:1px}.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected{cursor:unset}.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected:after{border-radius:1px;bottom:1px;box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);left:1px;right:1px;top:1px}.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected:focus:after{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.is-focus-mode .block-editor-block-list__block:not(.has-child-selected){opacity:.5;transition:opacity .1s linear}@media (prefers-reduced-motion:reduce){.is-focus-mode .block-editor-block-list__block:not(.has-child-selected){transition-delay:0s;transition-duration:0s}}.is-focus-mode .block-editor-block-list__block:not(.has-child-selected) .block-editor-block-list__block,.is-focus-mode .block-editor-block-list__block:not(.has-child-selected).is-multi-selected,.is-focus-mode .block-editor-block-list__block:not(.has-child-selected).is-selected{opacity:1}.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity{opacity:.5;transition:opacity .1s linear}@media (prefers-reduced-motion:reduce){.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity{transition-delay:0s;transition-duration:0s}}.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity.has-child-selected,.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity.is-active-entity,.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity.is-active-entity .block-editor-block-list__block,.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity .is-active-entity .block-editor-block-list__block,.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity:not(.has-child-selected) .block-editor-block-list__block{opacity:1}.wp-block[data-align=left]>*,.wp-block[data-align=right]>*{z-index:21}.wp-site-blocks>[data-align=left]{float:right;margin-left:2em}.wp-site-blocks>[data-align=right]{float:left;margin-right:2em}.wp-site-blocks>[data-align=center]{justify-content:center;margin-left:auto;margin-right:auto}.block-editor-block-list .block-editor-inserter{cursor:move;cursor:grab;margin:8px}@keyframes block-editor-inserter__toggle__fade-in-animation{0%{opacity:0}to{opacity:1}}.wp-block .block-list-appender .block-editor-inserter__toggle{animation:block-editor-inserter__toggle__fade-in-animation .1s ease;animation-fill-mode:forwards}@media (prefers-reduced-motion:reduce){.wp-block .block-list-appender .block-editor-inserter__toggle{animation-delay:0s;animation-duration:1ms}}.block-editor-block-list__block:not(.is-selected):not(.has-child-selected) .block-editor-default-block-appender{display:none}.block-editor-block-list__block:not(.is-selected):not(.has-child-selected) .block-editor-default-block-appender .block-editor-inserter__toggle{opacity:0;transform:scale(0)}.block-editor-block-list__block .block-editor-block-list__block-html-textarea{border:none;border-radius:2px;box-shadow:inset 0 0 0 1px #1e1e1e;display:block;font-family:Menlo,Consolas,monaco,monospace;font-size:15px;line-height:1.5;margin:0;outline:none;overflow:hidden;padding:12px;resize:none;transition:padding .2s linear;width:100%}@media (prefers-reduced-motion:reduce){.block-editor-block-list__block .block-editor-block-list__block-html-textarea{transition-delay:0s;transition-duration:0s}}.block-editor-block-list__block .block-editor-block-list__block-html-textarea:focus{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.block-editor-block-list__block .block-editor-warning{position:relative;z-index:5}.block-editor-block-list__block .block-editor-warning.block-editor-block-list__block-crash-warning{margin-bottom:auto}.block-editor-block-list__insertion-point{position:absolute}.block-editor-block-list__insertion-point-indicator{background:var(--wp-admin-theme-color);position:absolute}.block-editor-block-list__insertion-point.is-vertical>.block-editor-block-list__insertion-point-indicator{height:1px;top:50%}.block-editor-block-list__insertion-point.is-horizontal>.block-editor-block-list__insertion-point-indicator{left:0;right:50%;top:0;width:1px}.block-editor-block-list__insertion-point-inserter{display:none;justify-content:center;position:absolute;right:calc(50% - 12px);top:calc(50% - 12px)}@media (min-width:480px){.block-editor-block-list__insertion-point-inserter{display:flex}}.block-editor-block-list__block-popover-inserter{margin-bottom:14px;position:absolute;top:-9999em}.block-editor-block-list__block-popover-inserter.is-visible{position:static}.block-editor-block-list__block-popover-inserter .block-editor-inserter__toggle.components-button.has-icon,.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle.components-button.has-icon,.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle.components-button.has-icon,.block-editor-default-block-appender .block-editor-inserter__toggle.components-button.has-icon{background:#1e1e1e;border-radius:2px;color:#fff;height:24px;min-width:24px;padding:0}.block-editor-block-list__block-popover-inserter .block-editor-inserter__toggle.components-button.has-icon:hover,.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle.components-button.has-icon:hover,.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle.components-button.has-icon:hover,.block-editor-default-block-appender .block-editor-inserter__toggle.components-button.has-icon:hover{background:var(--wp-admin-theme-color);color:#fff}.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle.components-button.has-icon{background:var(--wp-admin-theme-color)}.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle.components-button.has-icon:hover{background:#1e1e1e}.block-editor-block-contextual-toolbar{background-color:#fff;border:1px solid #1e1e1e;border-radius:2px;display:inline-flex}.block-editor-block-contextual-toolbar .block-editor-block-toolbar .components-toolbar,.block-editor-block-contextual-toolbar .block-editor-block-toolbar .components-toolbar-group{border-left-color:#1e1e1e}.block-editor-block-contextual-toolbar.is-fixed{border:none;border-bottom:1px solid #e0e0e0;border-radius:0;display:block;min-height:48px;position:sticky;top:0;width:100%;z-index:31}.block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar,.block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar-group{border-left-color:#e0e0e0}.block-editor-block-contextual-toolbar .block-editor-block-mover-button{overflow:hidden}.block-editor-block-contextual-toolbar .block-editor-block-mover.is-horizontal .block-editor-block-mover-button.block-editor-block-mover-button{min-width:24px;width:24px}.block-editor-block-contextual-toolbar .block-editor-block-mover.is-horizontal .block-editor-block-mover-button.block-editor-block-mover-button svg{min-width:24px}.block-editor-block-contextual-toolbar .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover-button:focus:before{min-width:0;right:0!important;width:100%}@media (min-width:600px){.block-editor-block-contextual-toolbar .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover-button.is-up-button svg{top:5px}.block-editor-block-contextual-toolbar .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover-button.is-down-button svg{bottom:5px}}.block-editor-block-list__block-selection-button{background-color:#1e1e1e;border-radius:2px;display:inline-flex;font-size:13px;height:48px;padding:0 12px;z-index:22}.block-editor-block-list__block-selection-button .block-editor-block-list__block-selection-button__content{align-items:center;display:inline-flex;margin:auto}.block-editor-block-list__block-selection-button .block-editor-block-list__block-selection-button__content>.components-flex__item{margin-left:6px}.block-editor-block-list__block-selection-button .components-button.has-icon.block-selection-button_drag-handle{cursor:grab;height:24px;margin-right:-2px;min-width:24px;padding:0}.block-editor-block-list__block-selection-button .components-button.has-icon.block-selection-button_drag-handle svg{min-height:18px;min-width:18px}.block-editor-block-list__block-selection-button .block-editor-block-icon{color:#fff;font-size:13px;height:48px}.block-editor-block-list__block-selection-button .components-button{color:#fff;display:flex;height:48px;min-width:36px}.block-editor-block-list__block-selection-button .components-button:focus{border:none;box-shadow:none}.block-editor-block-list__block-selection-button .components-button:active{color:#fff}.block-editor-block-list__block-selection-button .block-selection-button_select-button.components-button{padding:0}.block-editor-block-list__insertion-point-popover.is-without-arrow{pointer-events:none;position:absolute;z-index:28}.block-editor-block-list__insertion-point-popover.is-without-arrow *{pointer-events:none}.block-editor-block-list__insertion-point-popover.is-without-arrow .is-with-inserter,.block-editor-block-list__insertion-point-popover.is-without-arrow .is-with-inserter *{pointer-events:all}.block-editor-block-list__insertion-point-popover.is-without-arrow .components-popover__content.components-popover__content{background:none;border:none;box-shadow:none;margin-right:0;overflow-y:visible}@keyframes hide-during-dragging{to{position:fixed;transform:translate(-9999px,9999px)}}.components-popover.block-editor-block-list__block-popover{position:absolute;z-index:31}.components-popover.block-editor-block-list__block-popover .components-popover__content{background:none;border:none;box-shadow:none;margin:0!important;min-width:auto;overflow-y:visible;pointer-events:none;width:max-content}.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-contextual-toolbar,.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-list__block-selection-button,.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-list__empty-block-inserter{pointer-events:all}.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-contextual-toolbar,.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-list__block-selection-button{margin-bottom:12px;margin-top:12px}.components-popover.block-editor-block-list__block-popover.is-insertion-point-visible{visibility:hidden}.is-dragging-components-draggable .components-popover.block-editor-block-list__block-popover{animation:hide-during-dragging 1ms linear forwards;opacity:0}.is-dragging-components-draggable .components-tooltip{display:none}.is-vertical .block-list-appender{margin-left:auto;margin-right:12px;margin-top:12px;width:24px}.block-list-appender>.block-editor-inserter{display:block}.block-editor-block-list__block:not(.is-selected):not(.has-child-selected):not(.block-editor-block-list__layout) .block-editor-block-list__layout>.block-list-appender .block-list-appender__toggle{opacity:0;transform:scale(0)}.block-editor-block-breadcrumb{list-style:none;margin:0;padding:0}.block-editor-block-breadcrumb li{display:inline-flex;margin:0}.block-editor-block-breadcrumb li .block-editor-block-breadcrumb__separator{fill:currentColor;margin-left:-4px;margin-right:-4px;transform:scaleX(-1)}.block-editor-block-breadcrumb li:last-child .block-editor-block-breadcrumb__separator{display:none}.block-editor-block-breadcrumb__button.components-button{height:24px;line-height:24px;padding:0;position:relative}.block-editor-block-breadcrumb__button.components-button:hover:not(:disabled){box-shadow:none;text-decoration:underline}.block-editor-block-breadcrumb__button.components-button:focus{box-shadow:none}.block-editor-block-breadcrumb__button.components-button:focus:before{border-radius:2px;bottom:1px;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";display:block;left:1px;position:absolute;right:1px;top:1px}.block-editor-block-breadcrumb__current{cursor:default}.block-editor-block-breadcrumb__button.components-button,.block-editor-block-breadcrumb__current{color:#1e1e1e;font-size:inherit;padding:0 8px}.block-editor-block-card{align-items:flex-start;display:flex}.block-editor-block-card__content{flex-grow:1;margin-bottom:4px}.block-editor-block-card__title{font-weight:500}.block-editor-block-card__title.block-editor-block-card__title{line-height:24px;margin:0 0 4px}.block-editor-block-card__description{font-size:13px}.block-editor-block-card .block-editor-block-icon{flex:0 0 24px;height:24px;margin-left:12px;margin-right:0;width:24px}.block-editor-block-compare{height:auto}.block-editor-block-compare__wrapper{display:flex;padding-bottom:16px}.block-editor-block-compare__wrapper>div{display:flex;flex-direction:column;justify-content:space-between;max-width:600px;min-width:200px;padding:0 0 0 16px;width:50%}.block-editor-block-compare__wrapper>div button{float:left}.block-editor-block-compare__wrapper .block-editor-block-compare__converted{border-right:1px solid #ddd;padding-left:0;padding-right:15px}.block-editor-block-compare__wrapper .block-editor-block-compare__html{border-bottom:1px solid #ddd;color:#1e1e1e;font-family:Menlo,Consolas,monaco,monospace;font-size:12px;line-height:1.7;padding-bottom:15px}.block-editor-block-compare__wrapper .block-editor-block-compare__html span{background-color:#e6ffed;padding-bottom:3px;padding-top:3px}.block-editor-block-compare__wrapper .block-editor-block-compare__html span.block-editor-block-compare__added{background-color:#acf2bd}.block-editor-block-compare__wrapper .block-editor-block-compare__html span.block-editor-block-compare__removed{background-color:#cc1818}.block-editor-block-compare__wrapper .block-editor-block-compare__preview{padding:16px 0 0}.block-editor-block-compare__wrapper .block-editor-block-compare__preview p{font-size:12px;margin-top:0}.block-editor-block-compare__wrapper .block-editor-block-compare__action{margin-top:16px}.block-editor-block-compare__wrapper .block-editor-block-compare__heading{font-size:1em;font-weight:400;margin:.67em 0}.block-editor-block-content-overlay.overlay-active:before{background:transparent;border:none;border-radius:2px;content:"";height:100%;pointer-events:none;position:absolute;right:0;top:0;width:100%;z-index:10}.block-editor-block-content-overlay.parent-highlighted.overlay-active:before,.block-editor-block-content-overlay:hover:not(.is-dragging-blocks).overlay-active:before{background:rgba(var(--wp-admin-theme-color--rgb),.1);box-shadow:0 0 0 1px var(--wp-admin-theme-color) inset}.block-editor-block-content-overlay.overlay-active:not(.is-dragging-blocks) *{pointer-events:none}.block-editor-block-content-overlay.is-dragging-blocks{box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.block-editor-block-draggable-chip-wrapper{position:absolute;right:0;top:-24px}.block-editor-block-draggable-chip{background-color:#1e1e1e;border-radius:2px;box-shadow:0 6px 8px rgba(0,0,0,.3);color:#fff;cursor:grabbing;display:inline-flex;height:48px;padding:0 13px;-webkit-user-select:none;user-select:none}.block-editor-block-draggable-chip svg{fill:currentColor}.block-editor-block-draggable-chip .block-editor-block-draggable-chip__content{justify-content:flex-start;margin:auto}.block-editor-block-draggable-chip .block-editor-block-draggable-chip__content>.components-flex__item{margin-left:6px}.block-editor-block-draggable-chip .block-editor-block-draggable-chip__content>.components-flex__item:last-child{margin-left:0}.block-editor-block-draggable-chip .block-editor-block-draggable-chip__content .block-editor-block-icon svg{min-height:18px;min-width:18px}.block-editor-block-draggable-chip .components-flex__item{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.block-editor-block-list__layout .is-dragging{background-color:currentColor!important;border-radius:2px!important;opacity:.05!important;pointer-events:none!important}.block-editor-block-list__layout .is-dragging::selection{background:transparent!important}.block-editor-block-list__layout .is-dragging:after{content:none!important}.block-editor-block-mobile-toolbar{border-left:1px solid #ddd;display:flex;flex-direction:row}.block-editor-block-mobile-toolbar .block-editor-block-mover-button{align-items:center;border-radius:2px;height:36px;justify-content:center;margin:0;padding:3px;width:36px}.block-editor-block-mobile-toolbar .block-editor-block-mover-button .dashicon{margin:auto}.block-editor-block-mobile-toolbar .block-editor-block-mover{display:flex;margin-left:auto}.block-editor-block-mobile-toolbar .block-editor-block-mover .block-editor-block-mover-button{float:right}.block-editor-block-mover-button__description{display:none}.block-editor-block-mover-button.has-icon{padding:0}.block-editor-block-mover{display:inline-flex;flex-direction:row}.block-editor-block-mover .block-editor-block-mover__move-button-container,.block-editor-block-mover .components-toolbar{border-left:none!important;flex:1;flex-direction:row}@media (min-width:600px){.block-editor-block-mover .block-editor-block-mover__move-button-container,.block-editor-block-mover .components-toolbar{flex-direction:column}}.block-editor-block-mover.is-horizontal .block-editor-block-mover__move-button-container,.block-editor-block-mover.is-horizontal .components-toolbar{flex-direction:row}.block-editor-block-mover .block-editor-block-mover-button.block-editor-block-mover-button{min-width:36px;padding-left:0;padding-right:0}@media (min-width:600px){.block-editor-block-mover .block-editor-block-mover-button{height:24px;padding-left:11px!important;padding-right:6px!important;width:42px}.block-editor-block-mover .block-editor-block-mover-button.block-editor-block-mover-button{min-width:42px}.block-editor-block-mover .block-editor-block-mover-button:before{left:8px!important;right:8px!important}}.block-editor-block-mover .block-editor-block-mover__drag-handle{cursor:grab;min-width:24px!important;padding:0!important;width:24px}.block-editor-block-mover .block-editor-block-mover__drag-handle:focus:before{left:0!important;right:0!important}@media (min-width:600px){.block-editor-block-mover .components-toolbar-group .block-editor-block-mover-button,.block-editor-block-mover .components-toolbar .block-editor-block-mover-button{margin:0 0 0 auto}.block-editor-block-mover .components-toolbar-group .block-editor-block-mover-button.is-up-button:before,.block-editor-block-mover .components-toolbar .block-editor-block-mover-button.is-up-button:before{bottom:0;height:calc(100% - 1px)}.block-editor-block-mover .components-toolbar-group .block-editor-block-mover-button.is-down-button:before,.block-editor-block-mover .components-toolbar .block-editor-block-mover-button.is-down-button:before{height:calc(100% - 1px);top:0}}.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.has-icon{height:48px;padding-left:0;padding-right:0;width:24px}.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.has-icon:before{bottom:1px;height:auto;min-width:0;top:1px;width:auto}.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.is-up-button.has-icon svg{margin-bottom:0;margin-left:-8px;margin-right:0}.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.is-up-button.has-icon:before{left:0!important;right:0!important}.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.is-down-button.has-icon svg{margin-left:0;margin-right:-8px;margin-top:0}.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.is-down-button.has-icon:before{left:0!important;right:0!important;width:calc(100% + 1px)}.block-editor-block-navigation__container{min-width:280px}.block-editor-block-navigation__label{color:#757575;font-size:11px;font-weight:500;margin:0 0 12px;text-transform:uppercase}.block-editor-block-parent-selector{background:#fff;border-radius:2px}.block-editor-block-parent-selector .block-editor-block-parent-selector__button{border:1px solid #1e1e1e;border-radius:2px;height:48px;width:48px}.block-editor-block-patterns-list__list-item{cursor:pointer;margin-bottom:24px}.block-editor-block-patterns-list__list-item.is-placeholder{min-height:100px}.block-editor-block-patterns-list__list-item[draggable=true] .block-editor-block-preview__container{cursor:grab}.block-editor-block-patterns-list__item{height:100%}.block-editor-block-patterns-list__item .block-editor-block-preview__container{align-items:center;border:1px solid #f0f0f0;border-radius:2px;display:flex;overflow:hidden}.block-editor-block-patterns-list__item .block-editor-block-patterns-list__item-title{font-size:12px;padding-top:8px;text-align:center}.block-editor-block-patterns-list__item:hover .block-editor-block-preview__container{border:1px solid var(--wp-admin-theme-color)}.block-editor-block-patterns-list__item:focus .block-editor-block-preview__container{box-shadow:inset 0 0 0 1px #fff,0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.block-editor-block-patterns-list__item:focus .block-editor-block-patterns-list__item-title,.block-editor-block-patterns-list__item:hover .block-editor-block-patterns-list__item-title{color:var(--wp-admin-theme-color)}.block-editor-block-preview__container{overflow:hidden;position:relative;width:100%}.block-editor-block-preview__container .block-editor-block-preview__content{margin:0;min-height:auto;overflow:visible;right:0;text-align:initial;top:0;transform-origin:top right}.block-editor-block-preview__container .block-editor-block-preview__content .block-editor-block-drop-zone,.block-editor-block-preview__container .block-editor-block-preview__content .block-editor-block-list__insertion-point,.block-editor-block-preview__container .block-editor-block-preview__content .block-list-appender,.block-editor-block-preview__container .block-editor-block-preview__content .reusable-block-indicator,.block-editor-block-preview__content-iframe .block-list-appender{display:none}.block-editor-block-preview__live-content *{pointer-events:none}.block-editor-block-preview__live-content .block-list-appender{display:none}.block-editor-block-preview__live-content .components-button:disabled{opacity:1}.block-editor-block-preview__live-content .block-editor-block-list__block[data-empty=true],.block-editor-block-preview__live-content .components-placeholder{display:none}.block-editor-block-settings-menu__popover .components-dropdown-menu__menu{padding:0}.block-editor-block-styles+.default-style-picker__default-switcher{margin-top:16px}.block-editor-block-styles__preview-panel{display:none;left:16px;position:absolute;right:auto;z-index:90}@media (min-width:782px){.block-editor-block-styles__preview-panel{display:block}}.block-editor-block-styles__preview-panel .block-editor-inserter__preview-container{left:auto;position:static;right:auto;top:auto}.block-editor-block-styles__preview-panel .block-editor-block-card__title.block-editor-block-card__title{margin:0}.block-editor-block-styles__preview-panel .block-editor-block-icon{display:none}.block-editor-block-styles__variants{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between}.block-editor-block-styles__variants .block-editor-block-styles__item{box-shadow:inset 0 0 0 1px #ccc;color:#2f2f2f;display:inline-block;width:calc(50% - 4px)}.block-editor-block-styles__variants .block-editor-block-styles__item:focus,.block-editor-block-styles__variants .block-editor-block-styles__item:hover{box-shadow:inset 0 0 0 2px var(--wp-admin-theme-color);color:var(--wp-admin-theme-color)}.block-editor-block-styles__variants .block-editor-block-styles__item.is-active,.block-editor-block-styles__variants .block-editor-block-styles__item.is-active:hover{background-color:#2f2f2f;box-shadow:none}.block-editor-block-styles__variants .block-editor-block-styles__item.is-active .block-editor-block-styles__item-text,.block-editor-block-styles__variants .block-editor-block-styles__item.is-active:hover .block-editor-block-styles__item-text{color:#fff}.block-editor-block-styles__variants .block-editor-block-styles__item.is-active:focus{box-shadow:inset 0 0 0 1px #fff,0 0 0 2px var(--wp-admin-theme-color)}.block-editor-block-styles__block-preview-container,.block-editor-block-styles__block-preview-container *{box-sizing:border-box!important}.block-editor-block-switcher,.block-editor-block-switcher__no-switcher-icon,.block-editor-block-switcher__toggle{position:relative}.components-button.block-editor-block-switcher__no-switcher-icon,.components-button.block-editor-block-switcher__toggle{display:block;height:48px;margin:0}.components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-icon,.components-button.block-editor-block-switcher__toggle .block-editor-block-icon{margin:auto}.block-editor-block-switcher__toggle-text{margin-right:8px}.show-icon-labels .block-editor-block-switcher__toggle-text{display:none}.show-icon-labels .block-editor-block-toolbar .block-editor-block-switcher .components-button.has-icon:after{font-size:14px}.block-editor-block-switcher__popover{margin-right:6px}.components-button.block-editor-block-switcher__no-switcher-icon{width:48px}.components-button.block-editor-block-switcher__no-switcher-icon .block-editor-blocks-icon{margin-left:auto;margin-right:auto}.components-button.block-editor-block-switcher__no-switcher-icon:disabled{opacity:1}.components-button.block-editor-block-switcher__no-switcher-icon:disabled,.components-button.block-editor-block-switcher__no-switcher-icon:disabled .block-editor-block-icon.has-colors{color:#1e1e1e}.block-editor-block-toolbar .components-toolbar-group .components-button.block-editor-block-switcher__no-switcher-icon.has-icon.has-icon .block-editor-block-icon,.block-editor-block-toolbar .components-toolbar-group .components-button.block-editor-block-switcher__toggle.has-icon.has-icon .block-editor-block-icon,.block-editor-block-toolbar .components-toolbar .components-button.block-editor-block-switcher__no-switcher-icon.has-icon.has-icon .block-editor-block-icon,.block-editor-block-toolbar .components-toolbar .components-button.block-editor-block-switcher__toggle.has-icon.has-icon .block-editor-block-icon{align-items:center;display:flex;height:100%;margin:0 auto;min-width:100%;position:relative}.block-editor-block-toolbar .components-toolbar-group .components-button.block-editor-block-switcher__no-switcher-icon.has-icon.has-icon:before,.block-editor-block-toolbar .components-toolbar-group .components-button.block-editor-block-switcher__toggle.has-icon.has-icon:before,.block-editor-block-toolbar .components-toolbar .components-button.block-editor-block-switcher__no-switcher-icon.has-icon.has-icon:before,.block-editor-block-toolbar .components-toolbar .components-button.block-editor-block-switcher__toggle.has-icon.has-icon:before{bottom:8px;left:8px;right:8px;top:8px}.components-popover.block-editor-block-switcher__popover .components-popover__content{min-width:300px}.components-popover.block-editor-block-switcher__popover .components-popover__content>div{background:#fff;display:flex;min-width:auto;padding:0}.components-popover.block-editor-block-switcher__popover .components-popover__content>div .components-menu-group{margin:0}.block-editor-block-switcher__popover .components-popover__content .block-editor-block-styles{margin:0 -3px}.block-editor-block-switcher__popover .components-popover__content .components-panel__body{border:0;position:relative;z-index:1}.block-editor-block-switcher__popover .components-popover__content .components-panel__body+.components-panel__body{border-top:1px solid #e0e0e0}.block-editor-block-switcher__popover__preview__parent .block-editor-block-switcher__popover__preview__container{position:absolute;right:calc(100% + 32px);top:-12px}.block-editor-block-switcher__preview__popover{display:none}.block-editor-block-switcher__preview__popover.components-popover{margin-right:4px;margin-top:11px}@media (min-width:782px){.block-editor-block-switcher__preview__popover{display:block}}.block-editor-block-switcher__preview__popover .components-popover__content{background:#fff;border:1px solid #1e1e1e;border-radius:2px;box-shadow:none}.block-editor-block-switcher__preview__popover .block-editor-block-switcher__preview{height:auto;max-height:500px;padding:16px;width:300px}.block-editor-block-switcher__preview-title{color:#757575;font-size:11px;font-weight:500;margin-bottom:12px;text-transform:uppercase}.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon{width:48px}.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon,.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle{height:48px}.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-icon,.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-switcher__transform,.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle .block-editor-block-icon,.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle .block-editor-block-switcher__transform{height:48px;width:48px}.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-switcher__transform,.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle .block-editor-block-switcher__transform{padding:12px}.block-editor-block-switcher__preview-patterns-container{padding-bottom:16px}.block-editor-block-switcher__preview-patterns-container .block-editor-block-switcher__preview-patterns-container-list__list-item{margin-top:16px}.block-editor-block-switcher__preview-patterns-container .block-editor-block-switcher__preview-patterns-container-list__list-item .block-editor-block-preview__container{cursor:pointer}.block-editor-block-switcher__preview-patterns-container .block-editor-block-switcher__preview-patterns-container-list__list-item .block-editor-block-switcher__preview-patterns-container-list__item{border:1px solid transparent;border-radius:2px;height:100%;position:relative;transition:all .05s ease-in-out}.block-editor-block-switcher__preview-patterns-container .block-editor-block-switcher__preview-patterns-container-list__list-item .block-editor-block-switcher__preview-patterns-container-list__item:focus,.block-editor-block-switcher__preview-patterns-container .block-editor-block-switcher__preview-patterns-container-list__list-item .block-editor-block-switcher__preview-patterns-container-list__item:hover{box-shadow:inset 0 0 0 1px #fff,0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.block-editor-block-switcher__preview-patterns-container .block-editor-block-switcher__preview-patterns-container-list__list-item .block-editor-block-switcher__preview-patterns-container-list__item:hover{box-shadow:inset 0 0 0 1px #fff,0 0 0 var(--wp-admin-border-width-focus) #1e1e1e}.block-editor-block-switcher__preview-patterns-container .block-editor-block-switcher__preview-patterns-container-list__list-item .block-editor-block-switcher__preview-patterns-container-list__item .block-editor-block-switcher__preview-patterns-container-list__item-title{cursor:pointer;font-size:12px;padding:4px;text-align:center}.block-editor-block-types-list>[role=presentation]{display:flex;flex-wrap:wrap;overflow:hidden}.block-editor-block-variation-picker .components-placeholder__instructions{margin-bottom:0}.block-editor-block-variation-picker .components-placeholder__fieldset{flex-direction:column}.block-editor-block-variation-picker.has-many-variations .components-placeholder__fieldset{max-width:90%}.block-editor-block-variation-picker__variations.block-editor-block-variation-picker__variations{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;list-style:none;margin:16px 0;padding:0;width:100%}.block-editor-block-variation-picker__variations.block-editor-block-variation-picker__variations>li{flex-shrink:1;list-style:none;margin:8px 0 0 20px;text-align:center;width:75px}.block-editor-block-variation-picker__variations.block-editor-block-variation-picker__variations>li button{display:inline-flex;margin-left:0}.block-editor-block-variation-picker__variations.block-editor-block-variation-picker__variations .block-editor-block-variation-picker__variation{padding:8px}.block-editor-block-variation-picker__variations.block-editor-block-variation-picker__variations .block-editor-block-variation-picker__variation-label{display:block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:12px;line-height:1.4}.block-editor-block-variation-picker__variation{width:100%}.block-editor-block-variation-picker__variation.components-button.has-icon{justify-content:center;width:auto}.block-editor-block-variation-picker__variation.components-button.has-icon.is-secondary{background-color:#fff}.block-editor-block-variation-picker__variation.components-button{height:auto;padding:0}.block-editor-block-variation-picker__variation:before{content:"";padding-bottom:100%}.block-editor-block-variation-picker__variation:first-child{margin-right:0}.block-editor-block-variation-picker__variation:last-child{margin-left:0}.block-editor-block-pattern-setup{align-items:flex-start;border-radius:2px;box-shadow:inset 0 0 0 1px #1e1e1e;display:flex;flex-direction:column;justify-content:center;outline:1px solid transparent;width:100%}.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__toolbar{justify-content:center}.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container{grid-gap:16px;background:#fff;display:grid;grid-template-columns:1fr 1fr;margin:0 1px 1px;max-height:550px;overflow:auto;padding:16px;width:calc(100% - 2px)}.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-preview__container,.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container div[role=button]{cursor:pointer}.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item-title{font-size:12px;padding:4px;text-align:center}.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-preview__container{border:1px solid #ddd;border-radius:2px}.block-editor-block-pattern-setup .block-editor-block-pattern-setup__toolbar{align-items:center;background-color:#fff;border-radius:2px 2px 0 0;box-shadow:inset 0 0 0 1px #1e1e1e;box-sizing:border-box;color:#1e1e1e;display:flex;flex-direction:row;justify-content:space-between;margin:0;outline:1px solid transparent;padding:16px;position:relative;text-align:right;width:100%}.block-editor-block-pattern-setup .block-editor-block-pattern-setup__toolbar .block-editor-block-pattern-setup__display-controls{display:flex}.block-editor-block-pattern-setup .block-editor-block-pattern-setup__toolbar .block-editor-block-pattern-setup__actions,.block-editor-block-pattern-setup .block-editor-block-pattern-setup__toolbar .block-editor-block-pattern-setup__navigation{display:flex;width:calc(50% - 36px)}.block-editor-block-pattern-setup .block-editor-block-pattern-setup__toolbar .block-editor-block-pattern-setup__actions{justify-content:flex-end}.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container{box-sizing:border-box;display:flex;flex-direction:column;width:100%}.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container .carousel-container{list-style:none;margin:0;overflow:hidden;padding:0;position:relative;transform-style:preserve-3d}.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container .carousel-container *{box-sizing:border-box}.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container .carousel-container .pattern-slide{margin:auto;opacity:0;padding:16px;position:absolute;top:0;transition:transform .5s,opacity .5s,z-index .5s;width:100%;z-index:100}.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container .carousel-container .pattern-slide.active-slide{opacity:1;position:relative;z-index:102}.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container .carousel-container .pattern-slide.previous-slide{transform:translateX(100%);z-index:101}.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container .carousel-container .pattern-slide.next-slide{transform:translateX(-100%);z-index:101}.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container .block-list-appender{display:none}.block-editor-block-variation-transforms{padding:0 56px 16px 16px;width:100%}.block-editor-block-variation-transforms .components-dropdown-menu__toggle{border:1px solid #757575;border-radius:2px;justify-content:left;min-height:30px;padding:6px 12px;position:relative;text-align:right;width:100%}.block-editor-block-variation-transforms .components-dropdown-menu__toggle.components-dropdown-menu__toggle{padding-left:24px}.block-editor-block-variation-transforms .components-dropdown-menu__toggle:focus:not(:disabled){border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 calc(var(--wp-admin-border-width-focus) - 1px) var(--wp-admin-theme-color)}.block-editor-block-variation-transforms .components-dropdown-menu__toggle svg{height:100%;left:0;padding:0;position:absolute;top:0}.block-editor-block-variation-transforms__popover .components-popover__content{min-width:230px}.components-border-radius-control{margin-bottom:12px}.components-border-radius-control legend{padding-bottom:4px}.components-border-radius-control .components-border-radius-control__wrapper{align-items:flex-start;display:flex;justify-content:space-between}.components-border-radius-control .components-border-radius-control__wrapper .components-range-control,.components-border-radius-control .components-border-radius-control__wrapper>.components-unit-control-wrapper{margin-bottom:0;width:calc(50% - 26px)}.components-border-radius-control .components-border-radius-control__wrapper .components-range-control .components-base-control__field{height:30px;margin-bottom:0}.components-border-radius-control .components-border-radius-control__wrapper .components-range-control .components-range-control__wrapper{margin-left:10px}.components-border-radius-control .components-border-radius-control__wrapper>span{flex:0 0 auto}.components-border-radius-control .components-border-radius-control__input-controls-wrapper{display:flex;flex-wrap:wrap;width:70%}.components-border-radius-control .components-border-radius-control__input-controls-wrapper .components-unit-control-wrapper{margin-bottom:8px;margin-left:8px;width:calc(50% - 8px)}.components-border-radius-control .component-border-radius-control__linked-button.has-icon{display:flex;justify-content:center}.components-border-radius-control .component-border-radius-control__linked-button.has-icon svg{margin-left:0}.components-border-style-control legend{line-height:1.4;margin-bottom:8px;padding:0}.components-border-style-control .components-border-style-control__buttons{display:inline-flex}.components-border-style-control .components-border-style-control__buttons .components-button.has-icon{height:30px;margin-left:4px;min-width:30px;padding:3px}.block-editor-button-block-appender{align-items:center;box-shadow:inset 0 0 0 1px #1e1e1e;color:#1e1e1e;display:flex;flex-direction:column;height:auto;justify-content:center;padding:8px;width:100%}.is-dark-theme .block-editor-button-block-appender{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.65);color:hsla(0,0%,100%,.65)}.block-editor-button-block-appender:hover{box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color);color:var(--wp-admin-theme-color)}.block-editor-button-block-appender:focus{box-shadow:inset 0 0 0 2px var(--wp-admin-theme-color)}.block-editor-button-block-appender:active{color:#000}.block-editor-color-gradient-control .block-editor-color-gradient-control__color-indicator{margin-bottom:12px}.block-editor-panel-color-gradient-settings .block-editor-panel-color-gradient-settings__panel-title{display:flex;gap:8px}.block-editor-panel-color-gradient-settings .block-editor-panel-color-gradient-settings__panel-title .component-color-indicator{align-self:center;height:12px;width:12px}.block-editor-panel-color-gradient-settings .block-editor-panel-color-gradient-settings__panel-title .component-color-indicator:first-child{margin-right:12px}.block-editor-panel-color-gradient-settings.is-opened .block-editor-panel-color-gradient-settings__panel-title .component-color-indicator{display:none}@media screen and (min-width:782px){.block-editor-panel-color-gradient-settings .components-circular-option-picker__swatches{display:grid;grid-template-columns:repeat(6,28px);justify-content:space-between}}.block-editor-block-inspector .block-editor-panel-color-gradient-settings .components-base-control{margin-bottom:inherit}.block-editor-panel-color-gradient-settings .block-editor-panel-color-gradient-settings__dropdown{display:block}.block-editor-panel-color-gradient-settings__dropdown{width:100%}.block-editor-panel-color-gradient-settings__dropdown-content .components-popover__content>div{width:280px}@media (min-width:782px){.block-editor-panel-color-gradient-settings__dropdown-content .components-popover__content{margin-left:156px!important}.block-editor-panel-color-gradient-settings__dropdown-content.is-from-top .components-popover__content{margin-top:-60px!important}.block-editor-panel-color-gradient-settings__dropdown-content.is-from-bottom .components-popover__content{margin-bottom:-60px!important}}.block-editor-panel-color-gradient-settings__dropdown:last-child>div{border-bottom-width:0}.block-editor-panel-color-gradient-settings__item{padding-bottom:12px!important;padding-top:12px!important}.block-editor-panel-color-gradient-settings__item .block-editor-panel-color-gradient-settings__color-indicator{background:linear-gradient(45deg,transparent 48%,#ddd 0,#ddd 52%,transparent 0)}.block-editor-panel-color-gradient-settings__item.is-open{background:#f0f0f0;color:var(--wp-admin-theme-color)}.block-editor-contrast-checker>.components-notice{margin:0}.block-editor-default-block-appender{clear:both;margin-left:auto;margin-right:auto;position:relative}.block-editor-default-block-appender[data-root-client-id=""] .block-editor-default-block-appender__content:hover{outline:1px solid transparent}.block-editor-default-block-appender .block-editor-default-block-appender__content{opacity:.62}.block-editor-default-block-appender .components-drop-zone__content-icon{display:none}.block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter,.block-editor-default-block-appender .block-editor-inserter{left:0;line-height:0;position:absolute;top:0}.block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter:disabled,.block-editor-default-block-appender .block-editor-inserter:disabled{display:none}.block-editor-block-list__block .block-list-appender{bottom:0;left:0;list-style:none;padding:0;position:absolute;z-index:2}.block-editor-block-list__block .block-list-appender.block-list-appender{line-height:0;margin:0}.block-editor-block-list__block .block-list-appender .block-editor-default-block-appender{height:24px}.block-editor-block-list__block .block-list-appender .block-editor-inserter__toggle.components-button.has-icon,.block-editor-block-list__block .block-list-appender .block-list-appender__toggle{background:#1e1e1e;box-shadow:none;color:#fff;display:none;flex-direction:row;height:24px;padding:0!important;width:24px}.block-editor-block-list__block .block-list-appender .block-editor-inserter__toggle.components-button.has-icon:hover,.block-editor-block-list__block .block-list-appender .block-list-appender__toggle:hover{background:var(--wp-admin-theme-color);color:#fff}.block-editor-block-list__block .block-list-appender .block-editor-default-block-appender__content{display:none}.block-editor-block-list__block .block-list-appender:only-child{align-self:center;left:auto;line-height:inherit;list-style:none;position:relative}.block-editor-block-list__block .block-list-appender:only-child .block-editor-default-block-appender__content{display:block}.block-editor-block-list__block.is-selected .block-editor-block-list__layout>.block-list-appender .block-editor-inserter__toggle.components-button.has-icon,.block-editor-block-list__block.is-selected .block-editor-block-list__layout>.block-list-appender .block-list-appender__toggle,.block-editor-block-list__block.is-selected>.block-list-appender .block-editor-inserter__toggle.components-button.has-icon,.block-editor-block-list__block.is-selected>.block-list-appender .block-list-appender__toggle{display:flex}.block-editor-default-block-appender__content{cursor:text}.block-editor-duotone-control__popover>.components-popover__content>div{padding:16px;width:280px}.block-editor-duotone-control__popover .components-menu-group__label{padding:0}.block-editor-duotone-control__popover .components-custom-gradient-picker__gradient-bar{margin:16px 0 12px}.block-editor-duotone-control__popover .components-circular-option-picker__swatches{display:grid;gap:12px;grid-template-columns:repeat(6,28px);justify-content:space-between}.block-editor-duotone-control__description{font-size:12px;margin:16px 0}.block-editor-duotone-control__popover:not([data-y-axis=middle][data-x-axis=right])>.components-popover__content{margin-right:-14px}.components-font-appearance-control{margin-bottom:24px}.components-font-appearance-control ul li{color:#1e1e1e;text-transform:capitalize}.block-editor-image-size-control{margin-bottom:1em}.block-editor-image-size-control .block-editor-image-size-control__row{display:flex;justify-content:space-between}.block-editor-image-size-control .block-editor-image-size-control__row .block-editor-image-size-control__height,.block-editor-image-size-control .block-editor-image-size-control__row .block-editor-image-size-control__width{margin-bottom:.5em}.block-editor-image-size-control .block-editor-image-size-control__row .block-editor-image-size-control__height input,.block-editor-image-size-control .block-editor-image-size-control__row .block-editor-image-size-control__width input{line-height:1.25}.block-editor-image-size-control .block-editor-image-size-control__row .block-editor-image-size-control__width{margin-left:5px}.block-editor-image-size-control .block-editor-image-size-control__row .block-editor-image-size-control__height{margin-right:5px}.block-editor-block-list__layout.has-overlay:after{bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:60}.block-editor-block-types-list__list-item{display:block;margin:0;padding:0;width:33.33%}.components-button.block-editor-block-types-list__item{align-items:stretch;background:transparent;border-radius:2px;color:#1e1e1e;cursor:pointer;display:flex;flex-direction:column;font-size:13px;height:auto;justify-content:center;padding:8px;position:relative;transition:all .05s ease-in-out;width:100%;word-break:break-word}@media (prefers-reduced-motion:reduce){.components-button.block-editor-block-types-list__item{transition-delay:0s;transition-duration:0s}}.components-button.block-editor-block-types-list__item:disabled{cursor:default;opacity:.6}.components-button.block-editor-block-types-list__item:not(:disabled):hover{color:var(--wp-admin-theme-color)!important}.components-button.block-editor-block-types-list__item:not(:disabled):focus{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.components-button.block-editor-block-types-list__item:not(:disabled).is-active{background:#1e1e1e;color:#fff;outline:2px solid transparent;outline-offset:-2px}.block-editor-block-types-list__item-icon{border-radius:2px;color:#1e1e1e;padding:12px 20px;transition:all .05s ease-in-out}@media (prefers-reduced-motion:reduce){.block-editor-block-types-list__item-icon{transition-delay:0s;transition-duration:0s}}.block-editor-block-types-list__item-icon .block-editor-block-icon{margin-left:auto;margin-right:auto}.block-editor-block-types-list__item-icon svg{transition:all .15s ease-out}@media (prefers-reduced-motion:reduce){.block-editor-block-types-list__item-icon svg{transition-delay:0s;transition-duration:0s}}.block-editor-block-types-list__list-item[draggable=true] .block-editor-block-types-list__item-icon{cursor:grab}.block-editor-block-types-list__item-title{font-size:12px;padding:4px 2px 8px}.items-justified-left{justify-content:flex-start}.items-justified-center{justify-content:center}.items-justified-right{justify-content:flex-end}.items-justified-space-between{justify-content:space-between}.block-editor-line-height-control{margin-bottom:24px}.block-editor-line-height-control input{display:block;max-width:60px}@keyframes loadingpulse{0%{opacity:1}50%{opacity:0}to{opacity:1}}.block-editor-link-control{min-width:360px;position:relative}.components-popover__content .block-editor-link-control{max-width:360px;min-width:auto;width:90vw}.block-editor-link-control__search-input-container,.block-editor-link-control__search-input-wrapper{position:relative}.block-editor-link-control__search-input.has-no-label .block-editor-url-input__input{flex:1}.block-editor-link-control__field{margin:16px}.block-editor-link-control__field>.components-base-control__field{align-items:center;display:flex;margin:0}.block-editor-link-control__field .components-base-control__label{margin-bottom:0;margin-left:16px}.block-editor-link-control__field.block-editor-url-input input[type=text].block-editor-url-input__input,.block-editor-link-control__field input[type=text]{border:1px solid #ddd;border-radius:2px;box-shadow:0 0 0 transparent;display:block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin:0;padding:11px 16px 11px 36px;position:relative;transition:box-shadow .1s linear;width:calc(100% - 32px)}@media (prefers-reduced-motion:reduce){.block-editor-link-control__field.block-editor-url-input input[type=text].block-editor-url-input__input,.block-editor-link-control__field input[type=text]{transition-delay:0s;transition-duration:0s}}@media (min-width:600px){.block-editor-link-control__field.block-editor-url-input input[type=text].block-editor-url-input__input,.block-editor-link-control__field input[type=text]{font-size:13px;line-height:normal}}.block-editor-link-control__field.block-editor-url-input input[type=text].block-editor-url-input__input:focus,.block-editor-link-control__field input[type=text]:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.block-editor-link-control__field.block-editor-url-input input[type=text].block-editor-url-input__input::-webkit-input-placeholder,.block-editor-link-control__field input[type=text]::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.block-editor-link-control__field.block-editor-url-input input[type=text].block-editor-url-input__input::-moz-placeholder,.block-editor-link-control__field input[type=text]::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.block-editor-link-control__field.block-editor-url-input input[type=text].block-editor-url-input__input:-ms-input-placeholder,.block-editor-link-control__field input[type=text]:-ms-input-placeholder{color:rgba(30,30,30,.62)}.block-editor-link-control__search-error{margin:-8px 16px 16px}.block-editor-link-control__search-actions{left:19px;position:absolute;top:3px}.components-button .block-editor-link-control__search-submit .has-icon{margin:-1px}.block-editor-link-control__search-results-wrapper{margin-top:-15px;position:relative}.block-editor-link-control__search-results-wrapper:after,.block-editor-link-control__search-results-wrapper:before{content:"";display:block;left:16px;pointer-events:none;position:absolute;right:-1px;z-index:100}.block-editor-link-control__search-results-wrapper:before{bottom:auto;height:8px;top:0}.block-editor-link-control__search-results-wrapper:after{bottom:0;height:16px;top:auto}.block-editor-link-control__search-results-label{display:block;font-weight:600;padding:16px 32px 0}.block-editor-link-control__search-results{margin:0;max-height:200px;overflow-y:auto;padding:8px 16px}.block-editor-link-control__search-results.is-loading{opacity:.2}.block-editor-link-control__search-item{align-items:flex-start;background:#fff;border:none;border-radius:2px;cursor:pointer;display:flex;font-size:13px;height:auto;padding:12px 16px;position:relative;text-align:right;width:100%}.block-editor-link-control__search-item:focus,.block-editor-link-control__search-item:hover{background-color:#f0f0f0}.block-editor-link-control__search-item:focus .block-editor-link-control__search-item-type,.block-editor-link-control__search-item:hover .block-editor-link-control__search-item-type{background:#fff}.block-editor-link-control__search-item:focus:not(:disabled){box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color) inset}.block-editor-link-control__search-item.is-selected{background:#f0f0f0}.block-editor-link-control__search-item.is-selected .block-editor-link-control__search-item-type{background:#fff}.block-editor-link-control__search-item.is-current{background:transparent;border:0;cursor:default;flex-direction:column;padding:16px;width:100%}.block-editor-link-control__search-item .block-editor-link-control__search-item-header{align-items:flex-start;display:block;flex-direction:row;margin-left:8px;overflow-wrap:break-word;white-space:pre-wrap}.block-editor-link-control__search-item .block-editor-link-control__search-item-header .block-editor-link-control__search-item-info{word-break:break-all}.block-editor-link-control__search-item.is-preview .block-editor-link-control__search-item-header{display:flex;flex:1}.block-editor-link-control__search-item.is-error .block-editor-link-control__search-item-header{align-items:center}.block-editor-link-control__search-item .block-editor-link-control__search-item-icon{display:flex;flex-shrink:0;justify-content:center;margin-left:8px;max-height:24px;position:relative;top:.2em;width:24px}.block-editor-link-control__search-item .block-editor-link-control__search-item-icon img{width:16px}.block-editor-link-control__search-item.is-error .block-editor-link-control__search-item-icon{max-height:32px;top:0;width:32px}.block-editor-link-control__search-item .block-editor-link-control__search-item-info,.block-editor-link-control__search-item .block-editor-link-control__search-item-title{overflow:hidden;text-overflow:ellipsis}.block-editor-link-control__search-item .block-editor-link-control__search-item-info .components-external-link__icon,.block-editor-link-control__search-item .block-editor-link-control__search-item-title .components-external-link__icon{left:0;margin-top:0;position:absolute}.block-editor-link-control__search-item .block-editor-link-control__search-item-title{display:block;font-weight:500;margin-bottom:.2em;position:relative}.block-editor-link-control__search-item .block-editor-link-control__search-item-title mark{background-color:transparent;color:inherit;font-weight:700}.block-editor-link-control__search-item .block-editor-link-control__search-item-title span{font-weight:400}.block-editor-link-control__search-item .block-editor-link-control__search-item-title svg{display:none}.block-editor-link-control__search-item .block-editor-link-control__search-item-info{color:#757575;display:block;font-size:.9em;line-height:1.3}.block-editor-link-control__search-item .block-editor-link-control__search-item-error-notice{font-size:1.1em;font-style:italic}.block-editor-link-control__search-item .block-editor-link-control__search-item-type{background-color:#f0f0f0;border-radius:2px;display:block;font-size:.9em;margin-right:auto;padding:3px 6px}.block-editor-link-control__search-item .block-editor-link-control__search-item-description{margin:0;padding-top:12px}.block-editor-link-control__search-item .block-editor-link-control__search-item-description.is-placeholder{display:flex;flex-direction:column;height:28px;justify-content:space-around;margin-top:12px;padding-top:0}.block-editor-link-control__search-item .block-editor-link-control__search-item-description.is-placeholder:after,.block-editor-link-control__search-item .block-editor-link-control__search-item-description.is-placeholder:before{background-color:#f0f0f0;border-radius:3px;content:"";display:block;height:.7em;width:100%}.block-editor-link-control__search-item .block-editor-link-control__search-item-description .components-text{font-size:.9em}.block-editor-link-control__search-item .block-editor-link-control__search-item-image{background-color:#f0f0f0;border-radius:2px;display:flex;height:140px;justify-content:center;margin-top:12px;max-height:140px;overflow:hidden;width:100%}.block-editor-link-control__search-item .block-editor-link-control__search-item-image.is-placeholder{background-color:#f0f0f0;border-radius:3px}.block-editor-link-control__search-item .block-editor-link-control__search-item-image img{display:block;height:140px;max-height:140px;max-width:100%}.block-editor-link-control__search-item-top{display:flex;flex-direction:row;width:100%}.block-editor-link-control__search-item-bottom{transition:opacity 1.5s;width:100%}.block-editor-link-control__search-item.is-fetching .block-editor-link-control__search-item-description:after,.block-editor-link-control__search-item.is-fetching .block-editor-link-control__search-item-description:before,.block-editor-link-control__search-item.is-fetching .block-editor-link-control__search-item-image{animation:loadingpulse 1s linear infinite;animation-delay:.5s}.block-editor-link-control__search-item.is-fetching .block-editor-link-control__search-item-icon img,.block-editor-link-control__search-item.is-fetching .block-editor-link-control__search-item-icon svg{opacity:0}.block-editor-link-control__search-item.is-fetching .block-editor-link-control__search-item-icon:before{animation:loadingpulse 1s linear infinite;animation-delay:.5s;background-color:#f0f0f0;border-radius:100%;bottom:0;content:"";display:block;left:0;position:absolute;right:0;top:0}.block-editor-link-control__loading{align-items:center;display:flex;margin:16px}.block-editor-link-control__loading .components-spinner{margin-top:0}.components-button+.block-editor-link-control__search-create{overflow:visible;padding:12px 16px}.components-button+.block-editor-link-control__search-create:before{content:"";display:block;position:absolute;right:0;top:-10px;width:100%}.block-editor-link-control__search-create{align-items:center}.block-editor-link-control__search-create .block-editor-link-control__search-item-title{margin-bottom:0}.block-editor-link-control__search-create .block-editor-link-control__search-item-icon{top:0}.block-editor-link-control__search-results div[role=menu]>.block-editor-link-control__search-item.block-editor-link-control__search-item{padding:10px}.block-editor-link-control__tools{align-items:center;border-top:1px solid #ddd;display:flex;margin:0;padding:16px}.block-editor-link-control__unlink{padding-left:16px;padding-right:16px}.block-editor-link-control__settings{flex:1;margin:0}.block-editor-link-control__settings :last-child{margin-bottom:0}.is-alternate .block-editor-link-control__settings{border-top:1px solid #1e1e1e}.block-editor-link-control__setting{margin-bottom:16px}.block-editor-link-control__setting :last-child{margin-bottom:0}.block-editor-link-control .block-editor-link-control__search-input .components-spinner{display:block}.block-editor-link-control .block-editor-link-control__search-input .components-spinner.components-spinner{bottom:auto;left:62px;position:absolute;right:auto;top:28px}.block-editor-link-control__search-item-action{flex-shrink:0;margin-right:auto}.block-editor-list-view-tree{border-collapse:collapse;margin:0;padding:0;width:100%}.components-modal__content .block-editor-list-view-tree{margin:-12px -6px 0;width:calc(100% + 12px)}.block-editor-list-view-leaf{position:relative}.block-editor-list-view-leaf.is-selected{background:var(--wp-admin-theme-color)}.block-editor-list-view-leaf.is-selected .block-editor-list-view-block-contents,.block-editor-list-view-leaf.is-selected .components-button.has-icon{color:#fff}.is-dragging-components-draggable .block-editor-list-view-leaf.is-selected .block-editor-list-view-block-contents{background:none;color:#1e1e1e}.block-editor-list-view-leaf.is-selected .block-editor-list-view-block-contents:focus:after{box-shadow:inset 0 0 0 1px #fff,0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.block-editor-list-view-leaf.is-selected .block-editor-list-view-block__menu:focus{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) #fff}.block-editor-list-view-leaf.is-branch-selected:not(.is-selected){background:linear-gradient(hsla(0,0%,100%,.9),hsla(0,0%,100%,.9)),linear-gradient(var(--wp-admin-theme-color),var(--wp-admin-theme-color))}.block-editor-list-view-leaf.is-branch-selected.is-selected .block-editor-list-view-block-contents{border-radius:2px 2px 0 0}.block-editor-list-view-leaf[aria-expanded=false].is-branch-selected.is-selected .block-editor-list-view-block-contents{border-radius:2px}.block-editor-list-view-leaf.is-branch-selected:not(.is-selected) .block-editor-list-view-block-contents{border-radius:0}.block-editor-list-view-leaf.is-dragging{display:none}.block-editor-list-view-leaf .block-editor-list-view-block-contents{align-items:center;border-radius:2px;color:#1e1e1e;display:flex;height:auto;padding:6px 0 6px 12px;position:relative;text-align:right;white-space:nowrap;width:100%}.block-editor-list-view-leaf .block-editor-list-view-block-contents.is-dropping-before:before{border-top:4px solid var(--wp-admin-theme-color);content:"";left:0;pointer-events:none;position:absolute;right:0;top:-2px;transition:border-color .1s linear,border-style .1s linear,box-shadow .1s linear}.components-modal__content .block-editor-list-view-leaf .block-editor-list-view-block-contents{padding-left:0;padding-right:0}.block-editor-list-view-leaf .block-editor-list-view-block-contents:focus{box-shadow:none}.block-editor-list-view-leaf .block-editor-list-view-block-contents:focus:after{border-radius:inherit;bottom:0;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";left:-29px;pointer-events:none;position:absolute;right:0;top:0;z-index:1}.is-dragging-components-draggable .block-editor-list-view-leaf .block-editor-list-view-block-contents:focus:after{box-shadow:none}.block-editor-list-view-leaf.has-single-cell .block-editor-list-view-block-contents:focus:after{left:0}.block-editor-list-view-leaf .block-editor-list-view-block__menu:focus{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);z-index:1}.is-dragging-components-draggable .block-editor-list-view-leaf .block-editor-list-view-block__menu:focus{box-shadow:none}.block-editor-list-view-leaf.is-visible .block-editor-list-view-block-contents{animation:edit-post__fade-in-animation .2s ease-out 0s;animation-fill-mode:forwards;opacity:1}@media (prefers-reduced-motion:reduce){.block-editor-list-view-leaf.is-visible .block-editor-list-view-block-contents{animation-delay:0s;animation-duration:1ms}}.block-editor-list-view-leaf .block-editor-block-icon{align-self:flex-start;margin-left:8px;width:24px}.block-editor-list-view-leaf .block-editor-list-view-block__contents-cell,.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell,.block-editor-list-view-leaf .block-editor-list-view-block__mover-cell{padding-bottom:0;padding-top:0}.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell,.block-editor-list-view-leaf .block-editor-list-view-block__mover-cell{line-height:0;opacity:0;vertical-align:middle;width:36px}@media (prefers-reduced-motion:reduce){.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell,.block-editor-list-view-leaf .block-editor-list-view-block__mover-cell{transition-delay:0s;transition-duration:0s}}.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell.is-visible,.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell:hover,.block-editor-list-view-leaf .block-editor-list-view-block__mover-cell.is-visible,.block-editor-list-view-leaf .block-editor-list-view-block__mover-cell:hover{animation:edit-post__fade-in-animation .2s ease-out 0s;animation-fill-mode:forwards;opacity:1;position:relative;z-index:1}@media (prefers-reduced-motion:reduce){.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell.is-visible,.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell:hover,.block-editor-list-view-leaf .block-editor-list-view-block__mover-cell.is-visible,.block-editor-list-view-leaf .block-editor-list-view-block__mover-cell:hover{animation-delay:0s;animation-duration:1ms}}.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell,.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell .components-button.has-icon,.block-editor-list-view-leaf .block-editor-list-view-block__mover-cell,.block-editor-list-view-leaf .block-editor-list-view-block__mover-cell .components-button.has-icon{min-width:24px;padding:0;width:24px}.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell{padding-left:5px}.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell .components-button.has-icon{height:24px}.block-editor-list-view-leaf .block-editor-list-view-block__mover-cell-alignment-wrapper{align-items:center;display:flex;flex-direction:column;height:100%}.block-editor-list-view-leaf .block-editor-block-mover-button{height:24px;position:relative;width:36px}.block-editor-list-view-leaf .block-editor-block-mover-button svg{height:24px;position:relative}.block-editor-list-view-leaf .block-editor-block-mover-button.is-up-button{align-items:flex-end;margin-top:-6px}.block-editor-list-view-leaf .block-editor-block-mover-button.is-up-button svg{bottom:-4px}.block-editor-list-view-leaf .block-editor-block-mover-button.is-down-button{align-items:flex-start;margin-bottom:-6px}.block-editor-list-view-leaf .block-editor-block-mover-button.is-down-button svg{top:-4px}.block-editor-list-view-leaf .block-editor-block-mover-button:focus,.block-editor-list-view-leaf .block-editor-block-mover-button:focus:enabled{box-shadow:none;outline:none}.block-editor-list-view-leaf .block-editor-block-mover-button:focus:before{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color),inset 0 0 0 4px #fff;outline:2px solid transparent}.block-editor-list-view-leaf .block-editor-block-mover-button:before{animation:components-button__appear-animation .1s ease;animation-fill-mode:forwards;border-radius:2px;content:"";display:block;height:16px;left:0;min-width:100%;position:absolute;right:0}@media (prefers-reduced-motion:reduce){.block-editor-list-view-leaf .block-editor-block-mover-button:before{animation-delay:0s;animation-duration:1ms}}.block-editor-list-view-leaf .block-editor-inserter__toggle{background:#1e1e1e;color:#fff;height:24px;margin:6px 1px 6px 6px;min-width:24px}.block-editor-list-view-leaf .block-editor-inserter__toggle:active{color:#fff}.block-editor-list-view-leaf .block-editor-list-view-block-select-button__anchor{background:rgba(0,0,0,.1);border-radius:2px;display:inline-block;margin:0 8px;max-width:120px;overflow:hidden;padding:2px 6px;text-overflow:ellipsis}.block-editor-list-view-leaf.is-selected .block-editor-list-view-block-select-button__anchor{background:rgba(0,0,0,.3)}.block-editor-list-view-appender__description,.block-editor-list-view-block-select-button__description{display:none}.block-editor-list-view-appender__cell .block-editor-list-view-appender__container,.block-editor-list-view-appender__cell .block-editor-list-view-block__contents-container,.block-editor-list-view-block__contents-cell .block-editor-list-view-appender__container,.block-editor-list-view-block__contents-cell .block-editor-list-view-block__contents-container{display:flex}.block-editor-list-view__expander{height:24px;margin-right:4px;width:24px}.block-editor-list-view-leaf[aria-level] .block-editor-list-view__expander{margin-right:220px}.block-editor-list-view-leaf:not([aria-level="1"]) .block-editor-list-view__expander{margin-left:4px}.block-editor-list-view-leaf[aria-level="1"] .block-editor-list-view__expander{margin-right:0}.block-editor-list-view-leaf[aria-level="2"] .block-editor-list-view__expander{margin-right:24px}.block-editor-list-view-leaf[aria-level="3"] .block-editor-list-view__expander{margin-right:52px}.block-editor-list-view-leaf[aria-level="4"] .block-editor-list-view__expander{margin-right:80px}.block-editor-list-view-leaf[aria-level="5"] .block-editor-list-view__expander{margin-right:108px}.block-editor-list-view-leaf[aria-level="6"] .block-editor-list-view__expander{margin-right:136px}.block-editor-list-view-leaf[aria-level="7"] .block-editor-list-view__expander{margin-right:164px}.block-editor-list-view-leaf[aria-level="8"] .block-editor-list-view__expander{margin-right:192px}.block-editor-list-view-leaf .block-editor-list-view__expander{visibility:hidden}.block-editor-list-view-leaf[aria-expanded=true] .block-editor-list-view__expander svg{transform:rotate(-90deg);transition:transform .2s ease;visibility:visible}@media (prefers-reduced-motion:reduce){.block-editor-list-view-leaf[aria-expanded=true] .block-editor-list-view__expander svg{transition-delay:0s;transition-duration:0s}}.block-editor-list-view-leaf[aria-expanded=false] .block-editor-list-view__expander svg{transform:rotate(0deg);transition:transform .2s ease;visibility:visible}@media (prefers-reduced-motion:reduce){.block-editor-list-view-leaf[aria-expanded=false] .block-editor-list-view__expander svg{transition-delay:0s;transition-duration:0s}}.block-editor-list-view-drop-indicator{pointer-events:none}.block-editor-list-view-drop-indicator .block-editor-list-view-drop-indicator__line{background:var(--wp-admin-theme-color);height:1px}.block-editor-list-view-drop-indicator:not([data-y-axis=middle][data-x-axis=right])>.components-popover__content{border:none;box-shadow:none;margin-right:0}.block-editor-list-view-placeholder{height:36px;margin:0;padding:0}.modal-open .block-editor-media-replace-flow__options{display:none}.block-editor-media-replace-flow__indicator{margin-right:4px}.block-editor-media-flow__url-input{border-top:1px solid #1e1e1e;margin-left:-8px;margin-right:-8px;margin-top:8px;padding:16px}.block-editor-media-flow__url-input .block-editor-media-replace-flow__image-url-label{display:block;margin-bottom:8px;top:16px}.block-editor-media-flow__url-input .block-editor-link-control{width:220px}.block-editor-media-flow__url-input .block-editor-link-control .block-editor-url-input{padding:0}.block-editor-media-flow__url-input .block-editor-link-control .components-base-control .components-base-control__field{margin-bottom:0}.block-editor-media-flow__url-input .block-editor-link-control .block-editor-link-control__search-item-title{max-width:180px;white-space:nowrap}.block-editor-media-flow__url-input .block-editor-link-control .block-editor-link-control__search-item-info{white-space:nowrap}.block-editor-media-flow__url-input .block-editor-link-control .block-editor-link-control__search-item.is-current{padding:0;width:auto}.block-editor-media-flow__url-input .block-editor-link-control .block-editor-link-control__search-input.block-editor-link-control__search-input input[type=text]{margin:0;width:100%}.block-editor-media-flow__url-input .block-editor-link-control .block-editor-link-control__search-actions{left:4px;top:0}.block-editor-media-flow__error{max-width:255px;padding:0 20px 20px}.block-editor-media-flow__error .components-with-notices-ui{max-width:255px}.block-editor-media-flow__error .components-with-notices-ui .components-notice__content{word-wrap:break-word;overflow:hidden}.block-editor-media-flow__error .components-with-notices-ui .components-notice__dismiss{left:10px;position:absolute}.block-editor-media-placeholder__url-input-container .block-editor-media-placeholder__button{margin-bottom:0}.block-editor-media-placeholder__url-input-form{display:flex}.block-editor-media-placeholder__url-input-form input[type=url].block-editor-media-placeholder__url-input-field{border:none;border-radius:0;flex-grow:1;margin:2px;min-width:200px;width:100%}@media (min-width:600px){.block-editor-media-placeholder__url-input-form input[type=url].block-editor-media-placeholder__url-input-field{width:300px}}.block-editor-media-placeholder__url-input-submit-button{flex-shrink:1}.block-editor-media-placeholder__button{margin-bottom:.5rem}.block-editor-media-placeholder__cancel-button.is-link{display:block;margin:1em}.block-editor-media-placeholder.is-appender{min-height:0}.block-editor-media-placeholder.is-appender:hover{box-shadow:0 0 0 1px var(--wp-admin-theme-color);cursor:pointer}.block-editor-multi-selection-inspector__card{align-items:flex-start;display:flex;padding:16px}.block-editor-multi-selection-inspector__card-content{flex-grow:1}.block-editor-multi-selection-inspector__card-title{font-weight:500;margin-bottom:5px}.block-editor-multi-selection-inspector__card-description{font-size:13px}.block-editor-multi-selection-inspector__card .block-editor-block-icon{height:24px;margin-left:10px;margin-right:-2px;padding:0 3px;width:36px}.block-editor-plain-text{border:none;box-shadow:none;color:inherit;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;padding:0;width:100%}.block-editor-responsive-block-control{border-bottom:1px solid #ccc;margin-bottom:28px;padding-bottom:14px}.block-editor-responsive-block-control:last-child{border-bottom:0;padding-bottom:0}.block-editor-responsive-block-control__title{margin:0 -3px .6em 0}.block-editor-responsive-block-control__label{font-weight:600;margin-bottom:.6em;margin-right:-3px}.block-editor-responsive-block-control__inner{margin-right:-1px}.block-editor-responsive-block-control__toggle{margin-right:1px}.block-editor-responsive-block-control .components-base-control__help{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.rich-text [data-rich-text-placeholder]{pointer-events:none}.rich-text [data-rich-text-placeholder]:after{content:attr(data-rich-text-placeholder);opacity:.62}.rich-text:focus{outline:none}.rich-text:focus [data-rich-text-format-boundary]{border-radius:2px}.block-editor-rich-text__editable>p:first-child{margin-top:0}figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]:before{opacity:.8}.components-popover.block-editor-rich-text__inline-format-toolbar{z-index:99998}.components-popover.block-editor-rich-text__inline-format-toolbar .components-popover__content{background-color:#fff;border:1px solid #1e1e1e;border-radius:2px;box-shadow:none;margin-bottom:8px;min-width:auto;width:auto}.components-popover.block-editor-rich-text__inline-format-toolbar .components-toolbar,.components-popover.block-editor-rich-text__inline-format-toolbar .components-toolbar-group{border:none}.components-popover.block-editor-rich-text__inline-format-toolbar .components-dropdown-menu__toggle,.components-popover.block-editor-rich-text__inline-format-toolbar .components-toolbar__control{min-height:48px;min-width:48px;padding-left:12px;padding-right:12px}.block-editor-rich-text__inline-format-toolbar-group .components-dropdown-menu__toggle{justify-content:center}.show-icon-labels .block-editor-rich-text__inline-format-toolbar-group .components-button.has-icon{width:auto}.show-icon-labels .block-editor-rich-text__inline-format-toolbar-group .components-button.has-icon svg{display:none}.show-icon-labels .block-editor-rich-text__inline-format-toolbar-group .components-button.has-icon:after{content:attr(aria-label)}[data-rich-text-script]{display:inline}[data-rich-text-script]:before{background:#ff0;content:"</>"}.block-editor-skip-to-selected-block{position:absolute;top:-9999em}.block-editor-skip-to-selected-block:focus{background:#f1f1f1;box-shadow:0 0 2px 2px rgba(0,0,0,.6);color:var(--wp-admin-theme-color);display:block;font-size:14px;font-weight:600;height:auto;line-height:normal;outline:none;padding:15px 23px 14px;text-decoration:none;width:auto;z-index:100000}.block-editor-text-transform-control{flex:0 0 50%}.block-editor-text-transform-control legend{margin-bottom:8px}.block-editor-text-transform-control .block-editor-text-transform-control__buttons{display:inline-flex;margin-bottom:24px}.block-editor-text-transform-control .block-editor-text-transform-control__buttons .components-button.has-icon{margin-left:4px;min-width:24px;padding:0}.block-editor-text-decoration-control{flex:0 0 50%}.block-editor-text-decoration-control legend{margin-bottom:8px}.block-editor-text-decoration-control .block-editor-text-decoration-control__buttons{display:inline-flex;margin-bottom:24px}.block-editor-text-decoration-control .block-editor-text-decoration-control__buttons .components-button.has-icon{margin-left:4px;min-width:24px;padding:0}.block-editor-tool-selector__help{border-top:1px solid #ddd;color:#757575;margin:8px -8px -8px;min-width:280px;padding:16px}.block-editor-block-list__block .block-editor-url-input,.block-editor-url-input,.components-popover .block-editor-url-input{flex-grow:1;padding:1px;position:relative}.block-editor-block-list__block .block-editor-url-input input[type=text],.block-editor-url-input input[type=text],.components-popover .block-editor-url-input input[type=text]{border:none;border-radius:0;font-size:16px;margin-left:0;margin-right:0;padding:8px 12px 8px 8px;width:100%}@media (min-width:600px){.block-editor-block-list__block .block-editor-url-input input[type=text],.block-editor-url-input input[type=text],.components-popover .block-editor-url-input input[type=text]{font-size:13px;width:300px}}.block-editor-block-list__block .block-editor-url-input input[type=text]::-ms-clear,.block-editor-url-input input[type=text]::-ms-clear,.components-popover .block-editor-url-input input[type=text]::-ms-clear{display:none}.block-editor-block-list__block .block-editor-url-input.is-full-width,.block-editor-block-list__block .block-editor-url-input.is-full-width .block-editor-url-input__input[type=text],.block-editor-block-list__block .block-editor-url-input.is-full-width__suggestions,.block-editor-url-input.is-full-width,.block-editor-url-input.is-full-width .block-editor-url-input__input[type=text],.block-editor-url-input.is-full-width__suggestions,.components-popover .block-editor-url-input.is-full-width,.components-popover .block-editor-url-input.is-full-width .block-editor-url-input__input[type=text],.components-popover .block-editor-url-input.is-full-width__suggestions{width:100%}.block-editor-block-list__block .block-editor-url-input .components-spinner,.block-editor-url-input .components-spinner,.components-popover .block-editor-url-input .components-spinner{bottom:8px 8px 8px 12px8px1;left:8px 8px 8px 12px;margin:0;position:absolute}.block-editor-url-input__input[type=text]{border:1px solid #757575;border-radius:2px;box-shadow:0 0 0 transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;padding:6px 8px;transition:box-shadow .1s linear}@media (prefers-reduced-motion:reduce){.block-editor-url-input__input[type=text]{transition-delay:0s;transition-duration:0s}}@media (min-width:600px){.block-editor-url-input__input[type=text]{font-size:13px;line-height:normal}}.block-editor-url-input__input[type=text]:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.block-editor-url-input__input[type=text]::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.block-editor-url-input__input[type=text]::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.block-editor-url-input__input[type=text]:-ms-input-placeholder{color:rgba(30,30,30,.62)}.block-editor-url-input__suggestions{max-height:200px;overflow-y:auto;padding:4px 0;transition:all .15s ease-in-out;width:302px}@media (prefers-reduced-motion:reduce){.block-editor-url-input__suggestions{transition-delay:0s;transition-duration:0s}}.block-editor-url-input .components-spinner,.block-editor-url-input__suggestions{display:none}@media (min-width:600px){.block-editor-url-input .components-spinner,.block-editor-url-input__suggestions{display:inherit}}.block-editor-url-input__suggestion{background:#fff;border:none;box-shadow:none;color:#757575;cursor:pointer;display:block;font-size:13px;padding:4px 8px 8px;text-align:right;width:100%}.block-editor-url-input__suggestion:hover{background:#ddd}.block-editor-url-input__suggestion.is-selected,.block-editor-url-input__suggestion:focus{background:var(--wp-admin-theme-color-darker-20);color:#fff;outline:none}.components-toolbar-group>.block-editor-url-input__button,.components-toolbar>.block-editor-url-input__button{position:inherit}.block-editor-url-input__button .block-editor-url-input__back{margin-left:4px;overflow:visible}.block-editor-url-input__button .block-editor-url-input__back:after{background:#ddd;content:"";display:block;height:24px;left:-1px;position:absolute;width:1px}.block-editor-url-input__button-modal{background:#fff;border:1px solid #ddd;box-shadow:0 2px 6px rgba(0,0,0,.05)}.block-editor-url-input__button-modal-line{align-items:flex-start;display:flex;flex-direction:row;flex-grow:1;flex-shrink:1;min-width:0}.block-editor-url-input__button-modal-line .components-button{flex-shrink:0;height:36px;width:36px}.block-editor-url-popover__additional-controls{border-top:1px solid #ddd}.block-editor-url-popover__additional-controls>div[role=menu] .components-button:not(:disabled):not([aria-disabled=true]):not(.is-secondary)>svg{box-shadow:none}.block-editor-url-popover__additional-controls div[role=menu]>.components-button{padding-right:12px}.block-editor-url-popover__row{display:flex}.block-editor-url-popover__row>:not(.block-editor-url-popover__settings-toggle){flex-grow:1}.block-editor-url-popover .components-button.has-icon{padding:3px}.block-editor-url-popover .components-button.has-icon>svg{border-radius:2px;height:30px;padding:5px;width:30px}.block-editor-url-popover .components-button.has-icon:not(:disabled):focus{box-shadow:none}.block-editor-url-popover .components-button.has-icon:not(:disabled):focus>svg{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color),inset 0 0 0 4px #fff;outline:2px solid transparent}.block-editor-url-popover__settings-toggle{border-radius:0;border-right:1px solid #ddd;flex-shrink:0;margin-right:1px}.block-editor-url-popover__settings-toggle[aria-expanded=true] .dashicon{transform:rotate(-180deg)}.block-editor-url-popover__input-container .components-base-control:last-child,.block-editor-url-popover__input-container .components-base-control:last-child .components-base-control__field{margin-bottom:0}.block-editor-url-popover__settings{border-top:1px solid #ddd;display:block;padding:16px}.block-editor-url-popover__link-editor,.block-editor-url-popover__link-viewer{display:flex}.block-editor-url-popover__link-editor .block-editor-url-input .components-base-control__field,.block-editor-url-popover__link-viewer .block-editor-url-input .components-base-control__field{margin-bottom:0}.block-editor-url-popover__link-editor .block-editor-url-input .components-spinner,.block-editor-url-popover__link-viewer .block-editor-url-input .components-spinner{bottom:8px 8px 8px 12px1}.block-editor-url-popover__link-viewer-url{flex-grow:1;flex-shrink:1;margin:7px;max-width:500px;min-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.block-editor-url-popover__link-viewer-url.has-invalid-link{color:#cc1818}.block-editor-warning{align-items:center;background-color:#fff;border:1px solid #1e1e1e;border-radius:2px;display:flex;flex-wrap:wrap;padding:1em}.block-editor-warning,.block-editor-warning .block-editor-warning__message{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}.block-editor-warning .block-editor-warning__message{color:#1e1e1e;font-size:13px;line-height:1.4;margin:0}.block-editor-warning p.block-editor-warning__message.block-editor-warning__message{min-height:auto}.block-editor-warning .block-editor-warning__contents{align-items:baseline;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;width:100%}.block-editor-warning .block-editor-warning__actions{display:flex;margin-top:1em}.block-editor-warning .block-editor-warning__action{margin:0 0 0 8px}.block-editor-warning__secondary{margin:auto 8px auto 0}.components-popover.block-editor-warning__dropdown{z-index:99998}.html-anchor-control .components-external-link{display:block;margin-top:8px}.block-editor-hooks__layout-controls{display:flex;margin-bottom:16px}.block-editor-hooks__layout-controls .block-editor-hooks__layout-controls-unit{display:flex;margin-left:24px}.block-editor-hooks__layout-controls .block-editor-hooks__layout-controls-unit svg{margin:auto 8px 4px 0}.block-editor-hooks__layout-controls-reset{display:flex;justify-content:flex-end;margin-bottom:24px}.block-editor-hooks__layout-controls-helptext{font-size:12px}.block-editor-hooks__flex-layout-justification-controls,.block-editor-hooks__flex-layout-orientation-controls{margin-bottom:12px}.block-editor-hooks__flex-layout-justification-controls legend,.block-editor-hooks__flex-layout-orientation-controls legend{margin-bottom:8px}.border-block-support-panel .single-column,.dimensions-block-support-panel .single-column{grid-column:span 1}.typography-block-support-panel .block-editor-text-decoration-control__buttons,.typography-block-support-panel .block-editor-text-transform-control__buttons,.typography-block-support-panel .components-font-appearance-control,.typography-block-support-panel .components-font-size-picker__controls{margin-bottom:0}.typography-block-support-panel .block-editor-line-height-control input{max-width:100%}.typography-block-support-panel .single-column{grid-column:span 1}.block-editor-block-toolbar{display:flex;flex-grow:1;overflow-x:auto;overflow-y:hidden;position:relative;transition:border-color .1s linear,box-shadow .1s linear;width:100%}@media (prefers-reduced-motion:reduce){.block-editor-block-toolbar{transition-delay:0s;transition-duration:0s}}@media (min-width:600px){.block-editor-block-toolbar{overflow:inherit}}.block-editor-block-toolbar .components-toolbar,.block-editor-block-toolbar .components-toolbar-group{background:none;border:0;border-left:1px solid #ddd;line-height:0;margin-bottom:-1px;margin-top:-1px}.block-editor-block-toolbar>:last-child,.block-editor-block-toolbar>:last-child .components-toolbar,.block-editor-block-toolbar>:last-child .components-toolbar-group{border-left:none}.block-editor-block-contextual-toolbar.has-parent:not(.is-fixed){margin-right:56px}.show-icon-labels .block-editor-block-contextual-toolbar.has-parent:not(.is-fixed){margin-right:0}.block-editor-block-parent-selector{position:absolute;right:-57px;top:-1px}.show-icon-labels .block-editor-block-parent-selector{margin-bottom:-1px;margin-right:-1px;margin-top:-1px;position:relative;right:auto;top:auto}.block-editor-block-toolbar__block-controls{height:auto!important;margin-right:-1px;padding:0!important}.block-editor-block-toolbar__block-controls .block-editor-block-switcher .components-dropdown-menu__toggle .block-editor-block-icon,.block-editor-block-toolbar__block-controls .block-editor-block-switcher__no-switcher-icon .block-editor-block-icon{margin:0!important;width:24px!important}.block-editor-block-toolbar__block-controls .block-editor-block-mover{margin-right:-6px}.block-editor-block-toolbar .components-toolbar,.block-editor-block-toolbar .components-toolbar-group,.block-editor-rich-text__inline-format-toolbar-group .components-toolbar,.block-editor-rich-text__inline-format-toolbar-group .components-toolbar-group{display:flex;flex-wrap:nowrap}.block-editor-block-toolbar__slot{display:inline-block;line-height:0}@supports (position:sticky){.block-editor-block-toolbar__slot{display:inline-flex}}.show-icon-labels .block-editor-block-toolbar .components-button.has-icon{width:auto}.show-icon-labels .block-editor-block-toolbar .components-button.has-icon svg{display:none}.show-icon-labels .block-editor-block-toolbar .components-button.has-icon:after{content:attr(aria-label);font-size:12px}.show-icon-labels .components-accessible-toolbar .components-toolbar-group>div:first-child:last-child>.components-button.has-icon{padding-left:6px;padding-right:6px}.show-icon-labels .block-editor-block-switcher{border-left:1px solid #1e1e1e}.show-icon-labels .block-editor-block-switcher .components-dropdown-menu__toggle{margin-right:0}.show-icon-labels .block-editor-block-switcher .components-dropdown-menu__toggle .block-editor-block-icon,.show-icon-labels .block-editor-block-switcher__no-switcher-icon .block-editor-block-icon{height:0!important;width:0!important}.show-icon-labels .block-editor-block-parent-selector__button .block-editor-block-icon{width:0}.show-icon-labels .block-editor-block-toolbar__block-controls .block-editor-block-mover{margin-right:0;white-space:nowrap}.show-icon-labels .block-editor-block-mover-button{padding-left:8px!important;padding-right:8px!important}.show-icon-labels .block-editor-block-mover__drag-handle.has-icon{border-left:1px solid #1e1e1e;padding-left:6px!important;padding-right:6px!important}@media (min-width:600px){.show-icon-labels .is-up-button.is-up-button.is-up-button{border-bottom:1px solid #1e1e1e;border-radius:0;margin-left:0}}.show-icon-labels .block-editor-block-contextual-toolbar .block-editor-block-mover.is-horizontal .block-editor-block-mover-button.block-editor-block-mover-button{width:auto}.show-icon-labels .components-toolbar,.show-icon-labels .components-toolbar-group{flex-shrink:1}.show-icon-labels .block-editor-rich-text__inline-format-toolbar-group .components-button+.components-button{margin-right:6px}.block-editor-inserter{background:none;border:none;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;line-height:0;padding:0}@media (min-width:782px){.block-editor-inserter{position:relative}}.block-editor-inserter__content{position:relative}.block-editor-inserter__popover.is-quick .components-popover__content{border:none}.block-editor-inserter__popover.is-quick .components-popover__content .block-editor-inserter__quick-inserter>*{border-left:1px solid #ccc;border-right:1px solid #ccc}.block-editor-inserter__popover.is-quick .components-popover__content .block-editor-inserter__quick-inserter>:first-child{border-top:1px solid #ccc}.block-editor-inserter__popover.is-quick .components-popover__content .block-editor-inserter__quick-inserter>:last-child{border-bottom:1px solid #ccc}.block-editor-inserter__popover.is-quick .components-popover__content .block-editor-inserter__quick-inserter>.components-button{border:1px solid #1e1e1e}.block-editor-inserter__popover .block-editor-inserter__menu{margin:-12px}.block-editor-inserter__popover .block-editor-inserter__menu .block-editor-inserter__tabs .components-tab-panel__tabs{top:60px}.block-editor-inserter__popover .block-editor-inserter__menu .block-editor-inserter__main-area{height:auto;overflow:visible}.block-editor-inserter__popover .block-editor-inserter__menu .block-editor-inserter__preview-container{display:none}.block-editor-inserter__toggle.components-button{align-items:center;border:none;cursor:pointer;display:inline-flex;outline:none;padding:0;transition:color .2s ease}@media (prefers-reduced-motion:reduce){.block-editor-inserter__toggle.components-button{transition-del
|
|