Gutenberg - Version 14.2.0

Version Description

Download this release

Release Info

Developer gutenbergplugin
Plugin Icon 128x128 Gutenberg
Version 14.2.0
Comparing to
See all releases

Code changes from version 14.1.1 to 14.2.0

build/block-directory/index.js CHANGED
@@ -1216,10 +1216,10 @@ function AutoBlockUninstaller() {
1216
  return null;
1217
  }
1218
 
1219
- ;// CONCATENATED MODULE: external ["wp","components"]
1220
- const external_wp_components_namespaceObject = window["wp"]["components"];
1221
  ;// CONCATENATED MODULE: external ["wp","compose"]
1222
  const external_wp_compose_namespaceObject = window["wp"]["compose"];
 
 
1223
  ;// CONCATENATED MODULE: external ["wp","coreData"]
1224
  const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
1225
  ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
@@ -1832,10 +1832,6 @@ function DownloadableBlocksPanel(_ref) {
1832
  ;// CONCATENATED MODULE: ./packages/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js
1833
 
1834
 
1835
- /**
1836
- * External dependencies
1837
- */
1838
-
1839
  /**
1840
  * WordPress dependencies
1841
  */
@@ -1850,7 +1846,7 @@ function DownloadableBlocksPanel(_ref) {
1850
 
1851
  function InserterMenuDownloadableBlocksPanel() {
1852
  const [debouncedFilterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)('');
1853
- const debouncedSetFilterValue = (0,external_lodash_namespaceObject.debounce)(setFilterValue, 400);
1854
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableInserterMenuExtension, null, _ref => {
1855
  let {
1856
  onSelect,
@@ -2076,7 +2072,8 @@ const ModifiedWarning = _ref2 => {
2076
  } = _ref2;
2077
  const {
2078
  originalName,
2079
- originalUndelimitedContent
 
2080
  } = props.attributes;
2081
  const {
2082
  replaceBlock
@@ -2089,7 +2086,13 @@ const ModifiedWarning = _ref2 => {
2089
  };
2090
 
2091
  const hasContent = !!originalUndelimitedContent;
2092
- const hasHTMLBlock = (0,external_wp_blocks_namespaceObject.getBlockType)('core/html');
 
 
 
 
 
 
2093
  let messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(
2094
  /* translators: %s: block name */
2095
  (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'), originalBlock.title || originalName);
1216
  return null;
1217
  }
1218
 
 
 
1219
  ;// CONCATENATED MODULE: external ["wp","compose"]
1220
  const external_wp_compose_namespaceObject = window["wp"]["compose"];
1221
+ ;// CONCATENATED MODULE: external ["wp","components"]
1222
+ const external_wp_components_namespaceObject = window["wp"]["components"];
1223
  ;// CONCATENATED MODULE: external ["wp","coreData"]
1224
  const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
1225
  ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
1832
  ;// CONCATENATED MODULE: ./packages/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js
1833
 
1834
 
 
 
 
 
1835
  /**
1836
  * WordPress dependencies
1837
  */
1846
 
1847
  function InserterMenuDownloadableBlocksPanel() {
1848
  const [debouncedFilterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)('');
1849
+ const debouncedSetFilterValue = (0,external_wp_compose_namespaceObject.debounce)(setFilterValue, 400);
1850
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableInserterMenuExtension, null, _ref => {
1851
  let {
1852
  onSelect,
2072
  } = _ref2;
2073
  const {
2074
  originalName,
2075
+ originalUndelimitedContent,
2076
+ clientId
2077
  } = props.attributes;
2078
  const {
2079
  replaceBlock
2086
  };
2087
 
2088
  const hasContent = !!originalUndelimitedContent;
2089
+ const hasHTMLBlock = (0,external_wp_data_namespaceObject.useSelect)(select => {
2090
+ const {
2091
+ canInsertBlockType,
2092
+ getBlockRootClientId
2093
+ } = select(external_wp_blockEditor_namespaceObject.store);
2094
+ return canInsertBlockType('core/html', getBlockRootClientId(clientId));
2095
+ }, [clientId]);
2096
  let messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(
2097
  /* translators: %s: block name */
2098
  (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'), originalBlock.title || originalName);
build/block-directory/index.min.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'b64d77e0cd2dcd7c7cf2');
1
+ <?php return array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '58649d3a68950acc5078');
build/block-directory/index.min.js CHANGED
@@ -1,20 +1,20 @@
1
- (()=>{"use strict";var e={n:t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:()=>W});var l={};e.r(l),e.d(l,{getDownloadableBlocks:()=>b,getErrorNoticeForBlock:()=>y,getErrorNotices:()=>h,getInstalledBlockTypes:()=>g,getNewBlockTypes:()=>_,getUnusedBlockTypes:()=>w,isInstalling:()=>E,isRequestingDownloadableBlocks:()=>k});var n={};e.r(n),e.d(n,{addInstalledBlockType:()=>R,clearErrorNotice:()=>F,fetchDownloadableBlocks:()=>O,installBlockType:()=>A,receiveDownloadableBlocks:()=>C,removeInstalledBlockType:()=>P,setErrorNotice:()=>x,setIsInstalling:()=>M,uninstallBlockType:()=>D});var o={};e.r(o),e.d(o,{getDownloadableBlocks:()=>q});const r=window.wp.element,a=window.wp.plugins,s=window.wp.hooks,i=window.wp.blocks,c=window.wp.data,d=window.wp.editor,u=(0,c.combineReducers)({downloadableBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{isRequesting:!0}};case"RECEIVE_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{results:t.downloadableBlocks,isRequesting:!1}}}return e},blockManagement:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{installedBlockTypes:[],isInstalling:{}},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:[...e.installedBlockTypes,t.item]};case"REMOVE_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:e.installedBlockTypes.filter((e=>e.name!==t.item.name))};case"SET_INSTALLING_BLOCK":return{...e,isInstalling:{...e.isInstalling,[t.blockId]:t.isInstalling}}}return e},errorNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ERROR_NOTICE":return{...e,[t.blockId]:{message:t.message,isFatal:t.isFatal}};case"CLEAR_ERROR_NOTICE":const{[t.blockId]:l,...n}=e;return n}return e}}),m=window.wp.blockEditor;function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t.length)return!1;if(t.some((t=>{let{name:l}=t;return l===e.name})))return!0;for(let l=0;l<t.length;l++)if(p(e,t[l].innerBlocks))return!0;return!1}function k(e,t){var l,n;return null!==(l=null===(n=e.downloadableBlocks[t])||void 0===n?void 0:n.isRequesting)&&void 0!==l&&l}function b(e,t){var l,n;return null!==(l=null===(n=e.downloadableBlocks[t])||void 0===n?void 0:n.results)&&void 0!==l?l:[]}function g(e){return e.blockManagement.installedBlockTypes}const _=(0,c.createRegistrySelector)((e=>t=>{const l=e(m.store).getBlocks();return g(t).filter((e=>p(e,l)))})),w=(0,c.createRegistrySelector)((e=>t=>{const l=e(m.store).getBlocks();return g(t).filter((e=>!p(e,l)))}));function E(e,t){return e.blockManagement.isInstalling[t]||!1}function h(e){return e.errorNotices}function y(e,t){return e.errorNotices[t]}const f=window.lodash,v=window.wp.i18n,B=window.wp.apiFetch;var N=e.n(B);const I=window.wp.notices,T=window.wp.url,L=e=>new Promise(((t,l)=>{const n=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach((t=>{e[t]&&(n[t]=e[t])})),e.innerHTML&&n.appendChild(document.createTextNode(e.innerHTML)),n.onload=()=>t(!0),n.onerror=()=>l(new Error("Error loading asset.")),document.body.appendChild(n),("link"===n.nodeName.toLowerCase()||"script"===n.nodeName.toLowerCase()&&!n.src)&&t()}));function S(e){if(!e)return!1;const t=e.links["wp:plugin"]||e.links.self;return!(!t||!t.length)&&t[0].href}function O(e){return{type:"FETCH_DOWNLOADABLE_BLOCKS",filterValue:e}}function C(e,t){return{type:"RECEIVE_DOWNLOADABLE_BLOCKS",downloadableBlocks:e,filterValue:t}}const A=e=>async t=>{let{registry:l,dispatch:n}=t;const{id:o,name:r}=e;let a=!1;n.clearErrorNotice(o);try{n.setIsInstalling(o,!0);const t=S(e);let s={};t?await N()({method:"PUT",url:t,data:{status:"active"}}):s=(await N()({method:"POST",path:"wp/v2/plugins",data:{slug:o,status:"active"}}))._links,n.addInstalledBlockType({...e,links:{...e.links,...s}});const c=["api_version","title","category","parent","icon","description","keywords","attributes","provides_context","uses_context","supports","styles","example","variations"];if(await N()({path:(0,T.addQueryArgs)(`/wp/v2/block-types/${r}`,{_fields:c})}).catch((()=>{})).then((e=>{e&&(0,i.unstable__bootstrapServerSideBlockDefinitions)({[r]:(0,f.pick)(e,c)})})),await async function(){const e=await N()({url:document.location.href,parse:!1}),t=await e.text(),l=(new window.DOMParser).parseFromString(t,"text/html"),n=Array.from(l.querySelectorAll('link[rel="stylesheet"],script')).filter((e=>e.id&&!document.getElementById(e.id)));for(const e of n)await L(e)}(),!l.select(i.store).getBlockTypes().some((e=>e.name===r)))throw new Error((0,v.__)("Error registering block. Try reloading the page."));l.dispatch(I.store).createInfoNotice((0,v.sprintf)(// translators: %s is the block title.
2
- (0,v.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),a=!0}catch(e){let t=e.message||(0,v.__)("An error occurred."),r=e instanceof Error;const a={folder_exists:(0,v.__)("This block is already installed. Try reloading the page."),unable_to_connect_to_filesystem:(0,v.__)("Error installing block. You can reload the page and try again.")};a[e.code]&&(r=!0,t=a[e.code]),n.setErrorNotice(o,t,r),l.dispatch(I.store).createErrorNotice(t,{speak:!0,isDismissible:!0})}return n.setIsInstalling(o,!1),a},D=e=>async t=>{let{registry:l,dispatch:n}=t;try{const t=S(e);await N()({method:"PUT",url:t,data:{status:"inactive"}}),await N()({method:"DELETE",url:t}),n.removeInstalledBlockType(e)}catch(e){l.dispatch(I.store).createErrorNotice(e.message||(0,v.__)("An error occurred."))}};function R(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function P(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}function M(e,t){return{type:"SET_INSTALLING_BLOCK",blockId:e,isInstalling:t}}function x(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"SET_ERROR_NOTICE",blockId:e,message:t,isFatal:l}}function F(e){return{type:"CLEAR_ERROR_NOTICE",blockId:e}}var V=function(){return(V=Object.assign||function(e){for(var t,l=1,n=arguments.length;l<n;l++)for(var o in t=arguments[l])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function H(e){return e.toLowerCase()}Object.create,Object.create;var $=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],j=/[^A-Z0-9]+/gi;function z(e,t,l){return t instanceof RegExp?e.replace(t,l):t.reduce((function(e,t){return e.replace(t,l)}),e)}function K(e,t){var l=e.charAt(0),n=e.substr(1).toLowerCase();return t>0&&l>="0"&&l<="9"?"_"+l+n:""+l.toUpperCase()+n}function U(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var l=t.splitRegexp,n=void 0===l?$:l,o=t.stripRegexp,r=void 0===o?j:o,a=t.transform,s=void 0===a?H:a,i=t.delimiter,c=void 0===i?" ":i,d=z(z(e,n,"$1\0$2"),r,"\0"),u=0,m=d.length;"\0"===d.charAt(u);)u++;for(;"\0"===d.charAt(m-1);)m--;return d.slice(u,m).split("\0").map(s).join(c)}(e,V({delimiter:"",transform:K},t))}function Y(e,t){return 0===t?e.toLowerCase():K(e,t)}const q=e=>async t=>{let{dispatch:l}=t;if(e)try{l(O(e));l(C((await N()({path:`wp/v2/block-directory/search?term=${e}`})).map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,l]=e;return[(n=t,void 0===o&&(o={}),U(n,V({transform:Y},o))),l];var n,o}))))),e))}catch{}},G={reducer:u,selectors:l,actions:n,resolvers:o},W=(0,c.createReduxStore)("core/block-directory",G);function Z(){const{uninstallBlockType:e}=(0,c.useDispatch)(W),t=(0,c.useSelect)((e=>{const{isAutosavingPost:t,isSavingPost:l}=e(d.store);return l()&&!t()}),[]),l=(0,c.useSelect)((e=>e(W).getUnusedBlockTypes()),[]);return(0,r.useEffect)((()=>{t&&l.length&&l.forEach((t=>{e(t),(0,i.unregisterBlockType)(t.name)}))}),[t]),null}(0,c.register)(W);const Q=window.wp.components,J=window.wp.compose,X=window.wp.coreData;function ee(){return(ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(this,arguments)}const te=window.wp.htmlEntities,le=function(e){let{icon:t,size:l=24,...n}=e;return(0,r.cloneElement)(t,{width:l,height:l,...n})},ne=window.wp.primitives,oe=(0,r.createElement)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(ne.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})),re=(0,r.createElement)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(ne.Path,{d:"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"})),ae=(0,r.createElement)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(ne.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),se=function(e){let{rating:t}=e;const l=.5*Math.round(t/.5),n=Math.floor(t),o=Math.ceil(t-n),a=5-(n+o);return(0,r.createElement)("span",{"aria-label":(0,v.sprintf)(
3
  /* translators: %s: number of stars. */
4
  (0,v.__)("%s out of 5 stars"),l)},Array.from({length:n}).map(((e,t)=>(0,r.createElement)(le,{key:`full_stars_${t}`,className:"block-directory-block-ratings__star-full",icon:oe,size:16}))),Array.from({length:o}).map(((e,t)=>(0,r.createElement)(le,{key:`half_stars_${t}`,className:"block-directory-block-ratings__star-half-full",icon:re,size:16}))),Array.from({length:a}).map(((e,t)=>(0,r.createElement)(le,{key:`empty_stars_${t}`,className:"block-directory-block-ratings__star-empty",icon:ae,size:16}))))},ie=e=>{let{rating:t}=e;return(0,r.createElement)("span",{className:"block-directory-block-ratings"},(0,r.createElement)(se,{rating:t}))},ce=function(e){let{icon:t}=e;const l="block-directory-downloadable-block-icon";return null!==t.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/)?(0,r.createElement)("img",{className:l,src:t,alt:""}):(0,r.createElement)(m.BlockIcon,{className:l,icon:t,showColors:!0})},de=e=>{let{block:t}=e;const l=(0,c.useSelect)((e=>e(W).getErrorNoticeForBlock(t.id)),[t]);return l?(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice"},(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice__content"},l.message,l.isFatal?" "+(0,v.__)("Try reloading the page."):null)):null};function ue(e,t){let{title:l,rating:n,ratingCount:o}=e,{hasNotice:r,isInstalled:a,isInstalling:s}=t;const i=.5*Math.round(n/.5);return!a&&r?(0,v.sprintf)("Retry installing %s.",(0,te.decodeEntities)(l)):a?(0,v.sprintf)("Add %s.",(0,te.decodeEntities)(l)):s?(0,v.sprintf)("Installing %s.",(0,te.decodeEntities)(l)):o<1?(0,v.sprintf)("Install %s.",(0,te.decodeEntities)(l)):(0,v.sprintf)(
5
  /* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */
6
- (0,v._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",o),(0,te.decodeEntities)(l),i,o)}const me=function(e){let{composite:t,item:l,onClick:n}=e;const{author:o,description:a,icon:s,rating:d,title:u}=l,m=!!(0,i.getBlockType)(l.name),{hasNotice:p,isInstalling:k,isInstallable:b}=(0,c.useSelect)((e=>{const{getErrorNoticeForBlock:t,isInstalling:n}=e(W),o=t(l.id),r=o&&o.isFatal;return{hasNotice:!!o,isInstalling:n(l.id),isInstallable:!r}}),[l]);let g="";return m?g=(0,v.__)("Installed!"):k&&(g=(0,v.__)("Installing…")),(0,r.createElement)(Q.__unstableCompositeItem,ee({__experimentalIsFocusable:!0,role:"option",as:Q.Button},t,{className:"block-directory-downloadable-block-list-item",onClick:e=>{e.preventDefault(),n()},isBusy:k,disabled:k||!b,label:ue(l,{hasNotice:p,isInstalled:m,isInstalling:k}),showTooltip:!0,tooltipPosition:"top center"}),(0,r.createElement)("div",{className:"block-directory-downloadable-block-list-item__icon"},(0,r.createElement)(ce,{icon:s,title:u}),k?(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__spinner"},(0,r.createElement)(Q.Spinner,null)):(0,r.createElement)(ie,{rating:d})),(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__details"},(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__title"},(0,r.createInterpolateElement)((0,v.sprintf)(
7
  /* translators: %1$s: block title, %2$s: author name. */
8
- (0,v.__)("%1$s <span>by %2$s</span>"),(0,te.decodeEntities)(u),o),{span:(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__author"})})),p?(0,r.createElement)(de,{block:l}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__desc"},g||(0,te.decodeEntities)(a)),b&&!(m||k)&&(0,r.createElement)(Q.VisuallyHidden,null,(0,v.__)("Install block")))))},pe=()=>{},ke=function(e){let{items:t,onHover:l=pe,onSelect:n}=e;const o=(0,Q.__unstableUseCompositeState)(),{installBlockType:a}=(0,c.useDispatch)(W);return t.length?(0,r.createElement)(Q.__unstableComposite,ee({},o,{role:"listbox",className:"block-directory-downloadable-blocks-list","aria-label":(0,v.__)("Blocks available for install")}),t.map((e=>(0,r.createElement)(me,{key:e.id,composite:o,onClick:()=>{(0,i.getBlockType)(e.name)?n(e):a(e).then((t=>{t&&n(e)})),l(null)},onHover:l,item:e})))):null},be=window.wp.a11y,ge=function(e){let{children:t,downloadableItems:l,hasLocalBlocks:n}=e;const o=l.length;return(0,r.useEffect)((()=>{(0,be.speak)((0,v.sprintf)(
9
  /* translators: %d: number of available blocks. */
10
- (0,v._n)("%d additional block is available to install.","%d additional blocks are available to install.",o),o))}),[o]),(0,r.createElement)(r.Fragment,null,!n&&(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel"},(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel__header"},(0,r.createElement)("h2",{className:"block-directory-downloadable-blocks-panel__title"},(0,v.__)("Available to install")),(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description"},(0,v.__)("Select a block to install and add it to your post."))),t))},_e=(0,r.createElement)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(ne.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"})),we=function(){return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"block-editor-inserter__no-results"},(0,r.createElement)(le,{className:"block-editor-inserter__no-results-icon",icon:_e}),(0,r.createElement)("p",null,(0,v.__)("No results found."))),(0,r.createElement)("div",{className:"block-editor-inserter__tips"},(0,r.createElement)(Q.Tip,null,(0,v.__)("Interested in creating your own block?"),(0,r.createElement)("br",null),(0,r.createElement)(Q.ExternalLink,{href:"https://developer.wordpress.org/block-editor/"},(0,v.__)("Get started here"),"."))))},Ee=(0,J.compose)([(0,c.withSelect)(((e,t)=>{let{filterValue:l,rootClientId:n=null}=t;const{getDownloadableBlocks:o,isRequestingDownloadableBlocks:r}=e(W),{canInsertBlockType:a}=e(m.store),s=e(X.store).canUser("read","block-directory/search");return{downloadableItems:s?o(l).filter((e=>a(e,n,!0))):[],hasPermission:s,isLoading:r(l)}}))])((function(e){let{downloadableItems:t,onSelect:l,onHover:n,hasLocalBlocks:o,hasPermission:a,isLoading:s,isTyping:i}=e;return void 0===a||s||i?(0,r.createElement)(r.Fragment,null,a&&!o&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"})),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading"},(0,r.createElement)(Q.Spinner,null))):!1===a?o?null:(0,r.createElement)(we,null):t.length?(0,r.createElement)(ge,{downloadableItems:t,hasLocalBlocks:o},(0,r.createElement)(ke,{items:t,onSelect:l,onHover:n})):!o&&(0,r.createElement)(we,null)})),he=function(){const[e,t]=(0,r.useState)(""),l=(0,f.debounce)(t,400);return(0,r.createElement)(m.__unstableInserterMenuExtension,null,(t=>{let{onSelect:n,onHover:o,filterValue:a,hasItems:s,rootClientId:i}=t;return e!==a&&l(a),e?(0,r.createElement)(Ee,{onSelect:n,onHover:o,rootClientId:i,filterValue:e,hasLocalBlocks:s,isTyping:a!==e}):null}))},ye=window.wp.editPost;function fe(e){let{items:t}=e;return t.length?(0,r.createElement)("ul",{className:"block-directory-compact-list"},t.map((e=>{let{icon:t,id:l,title:n,author:o}=e;return(0,r.createElement)("li",{key:l,className:"block-directory-compact-list__item"},(0,r.createElement)(ce,{icon:t,title:n}),(0,r.createElement)("div",{className:"block-directory-compact-list__item-details"},(0,r.createElement)("div",{className:"block-directory-compact-list__item-title"},n),(0,r.createElement)("div",{className:"block-directory-compact-list__item-author"},(0,v.sprintf)(
11
  /* translators: %s: Name of the block author. */
12
  (0,v.__)("By %s"),o))))}))):null}function ve(){const e=(0,c.useSelect)((e=>e(W).getNewBlockTypes()),[]);return e.length?(0,r.createElement)(ye.PluginPrePublishPanel,{icon:_e,title:(0,v.sprintf)(// translators: %d: number of blocks (number).
13
- (0,v._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0},(0,r.createElement)("p",{className:"installed-blocks-pre-publish-panel__copy"},(0,v._n)("The following block has been added to your site.","The following blocks have been added to your site.",e.length)),(0,r.createElement)(fe,{items:e})):null}function Be(e){let{attributes:t,block:l,clientId:n}=e;const o=(0,c.useSelect)((e=>e(W).isInstalling(l.id)),[l.id]),{installBlockType:a}=(0,c.useDispatch)(W),{replaceBlock:s}=(0,c.useDispatch)(m.store);return(0,r.createElement)(Q.Button,{onClick:()=>a(l).then((e=>{if(e){const e=(0,i.getBlockType)(l.name),[o]=(0,i.parse)(t.originalContent);o&&e&&s(n,(0,i.createBlock)(e.name,o.attributes,o.innerBlocks))}})),disabled:o,isBusy:o,variant:"primary"},(0,v.sprintf)(
14
  /* translators: %s: block name */
15
- (0,v.__)("Install %s"),l.title))}const Ne=e=>{let{originalBlock:t,...l}=e;const{originalName:n,originalUndelimitedContent:o}=l.attributes,{replaceBlock:a}=(0,c.useDispatch)(m.store),s=!!o,d=(0,i.getBlockType)("core/html");let u=(0,v.sprintf)(
16
  /* translators: %s: block name */
17
- (0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely."),t.title||n);const p=[(0,r.createElement)(Be,{key:"install",block:t,attributes:l.attributes,clientId:l.clientId})];return s&&d&&(u=(0,v.sprintf)(
18
  /* translators: %s: block name */
19
- (0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),t.title||n),p.push((0,r.createElement)(Q.Button,{key:"convert",onClick:()=>{a(l.clientId,(0,i.createBlock)("core/html",{content:o}))},variant:"link"},(0,v.__)("Keep as HTML")))),(0,r.createElement)("div",(0,m.useBlockProps)(),(0,r.createElement)(m.Warning,{actions:p},u),(0,r.createElement)(r.RawHTML,null,o))};(0,a.registerPlugin)("block-directory",{render:()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Z,null),(0,r.createElement)(he,null),(0,r.createElement)(ve,null))}),(0,s.addFilter)("blocks.registerBlockType","block-directory/fallback",((e,t)=>{return"core/missing"!==t||(e.edit=(l=e.edit,e=>{const{originalName:t}=e.attributes,{block:n,hasPermission:o}=(0,c.useSelect)((e=>{const{getDownloadableBlocks:l}=e(W),n=l("block:"+t).filter((e=>{let{name:l}=e;return t===l}));return{hasPermission:e(X.store).canUser("read","block-directory/search"),block:n.length&&n[0]}}),[t]);return o&&n?(0,r.createElement)(Ne,ee({},e,{originalBlock:n})):(0,r.createElement)(l,e)})),e;var l})),(window.wp=window.wp||{}).blockDirectory=t})();
20
  //# sourceMappingURL=index.min.js.map
1
+ (()=>{"use strict";var e={n:t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:()=>W});var l={};e.r(l),e.d(l,{getDownloadableBlocks:()=>b,getErrorNoticeForBlock:()=>y,getErrorNotices:()=>h,getInstalledBlockTypes:()=>g,getNewBlockTypes:()=>_,getUnusedBlockTypes:()=>w,isInstalling:()=>E,isRequestingDownloadableBlocks:()=>k});var n={};e.r(n),e.d(n,{addInstalledBlockType:()=>R,clearErrorNotice:()=>F,fetchDownloadableBlocks:()=>O,installBlockType:()=>A,receiveDownloadableBlocks:()=>C,removeInstalledBlockType:()=>P,setErrorNotice:()=>x,setIsInstalling:()=>M,uninstallBlockType:()=>D});var o={};e.r(o),e.d(o,{getDownloadableBlocks:()=>q});const r=window.wp.element,a=window.wp.plugins,s=window.wp.hooks,i=window.wp.blocks,c=window.wp.data,d=window.wp.editor,u=(0,c.combineReducers)({downloadableBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{isRequesting:!0}};case"RECEIVE_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{results:t.downloadableBlocks,isRequesting:!1}}}return e},blockManagement:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{installedBlockTypes:[],isInstalling:{}},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:[...e.installedBlockTypes,t.item]};case"REMOVE_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:e.installedBlockTypes.filter((e=>e.name!==t.item.name))};case"SET_INSTALLING_BLOCK":return{...e,isInstalling:{...e.isInstalling,[t.blockId]:t.isInstalling}}}return e},errorNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ERROR_NOTICE":return{...e,[t.blockId]:{message:t.message,isFatal:t.isFatal}};case"CLEAR_ERROR_NOTICE":const{[t.blockId]:l,...n}=e;return n}return e}}),m=window.wp.blockEditor;function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t.length)return!1;if(t.some((t=>{let{name:l}=t;return l===e.name})))return!0;for(let l=0;l<t.length;l++)if(p(e,t[l].innerBlocks))return!0;return!1}function k(e,t){var l,n;return null!==(l=null===(n=e.downloadableBlocks[t])||void 0===n?void 0:n.isRequesting)&&void 0!==l&&l}function b(e,t){var l,n;return null!==(l=null===(n=e.downloadableBlocks[t])||void 0===n?void 0:n.results)&&void 0!==l?l:[]}function g(e){return e.blockManagement.installedBlockTypes}const _=(0,c.createRegistrySelector)((e=>t=>{const l=e(m.store).getBlocks();return g(t).filter((e=>p(e,l)))})),w=(0,c.createRegistrySelector)((e=>t=>{const l=e(m.store).getBlocks();return g(t).filter((e=>!p(e,l)))}));function E(e,t){return e.blockManagement.isInstalling[t]||!1}function h(e){return e.errorNotices}function y(e,t){return e.errorNotices[t]}const f=window.lodash,v=window.wp.i18n,B=window.wp.apiFetch;var I=e.n(B);const N=window.wp.notices,T=window.wp.url,L=e=>new Promise(((t,l)=>{const n=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach((t=>{e[t]&&(n[t]=e[t])})),e.innerHTML&&n.appendChild(document.createTextNode(e.innerHTML)),n.onload=()=>t(!0),n.onerror=()=>l(new Error("Error loading asset.")),document.body.appendChild(n),("link"===n.nodeName.toLowerCase()||"script"===n.nodeName.toLowerCase()&&!n.src)&&t()}));function S(e){if(!e)return!1;const t=e.links["wp:plugin"]||e.links.self;return!(!t||!t.length)&&t[0].href}function O(e){return{type:"FETCH_DOWNLOADABLE_BLOCKS",filterValue:e}}function C(e,t){return{type:"RECEIVE_DOWNLOADABLE_BLOCKS",downloadableBlocks:e,filterValue:t}}const A=e=>async t=>{let{registry:l,dispatch:n}=t;const{id:o,name:r}=e;let a=!1;n.clearErrorNotice(o);try{n.setIsInstalling(o,!0);const t=S(e);let s={};t?await I()({method:"PUT",url:t,data:{status:"active"}}):s=(await I()({method:"POST",path:"wp/v2/plugins",data:{slug:o,status:"active"}}))._links,n.addInstalledBlockType({...e,links:{...e.links,...s}});const c=["api_version","title","category","parent","icon","description","keywords","attributes","provides_context","uses_context","supports","styles","example","variations"];if(await I()({path:(0,T.addQueryArgs)(`/wp/v2/block-types/${r}`,{_fields:c})}).catch((()=>{})).then((e=>{e&&(0,i.unstable__bootstrapServerSideBlockDefinitions)({[r]:(0,f.pick)(e,c)})})),await async function(){const e=await I()({url:document.location.href,parse:!1}),t=await e.text(),l=(new window.DOMParser).parseFromString(t,"text/html"),n=Array.from(l.querySelectorAll('link[rel="stylesheet"],script')).filter((e=>e.id&&!document.getElementById(e.id)));for(const e of n)await L(e)}(),!l.select(i.store).getBlockTypes().some((e=>e.name===r)))throw new Error((0,v.__)("Error registering block. Try reloading the page."));l.dispatch(N.store).createInfoNotice((0,v.sprintf)(// translators: %s is the block title.
2
+ (0,v.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),a=!0}catch(e){let t=e.message||(0,v.__)("An error occurred."),r=e instanceof Error;const a={folder_exists:(0,v.__)("This block is already installed. Try reloading the page."),unable_to_connect_to_filesystem:(0,v.__)("Error installing block. You can reload the page and try again.")};a[e.code]&&(r=!0,t=a[e.code]),n.setErrorNotice(o,t,r),l.dispatch(N.store).createErrorNotice(t,{speak:!0,isDismissible:!0})}return n.setIsInstalling(o,!1),a},D=e=>async t=>{let{registry:l,dispatch:n}=t;try{const t=S(e);await I()({method:"PUT",url:t,data:{status:"inactive"}}),await I()({method:"DELETE",url:t}),n.removeInstalledBlockType(e)}catch(e){l.dispatch(N.store).createErrorNotice(e.message||(0,v.__)("An error occurred."))}};function R(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function P(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}function M(e,t){return{type:"SET_INSTALLING_BLOCK",blockId:e,isInstalling:t}}function x(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"SET_ERROR_NOTICE",blockId:e,message:t,isFatal:l}}function F(e){return{type:"CLEAR_ERROR_NOTICE",blockId:e}}var V=function(){return(V=Object.assign||function(e){for(var t,l=1,n=arguments.length;l<n;l++)for(var o in t=arguments[l])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function H(e){return e.toLowerCase()}Object.create,Object.create;var $=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],j=/[^A-Z0-9]+/gi;function z(e,t,l){return t instanceof RegExp?e.replace(t,l):t.reduce((function(e,t){return e.replace(t,l)}),e)}function K(e,t){var l=e.charAt(0),n=e.substr(1).toLowerCase();return t>0&&l>="0"&&l<="9"?"_"+l+n:""+l.toUpperCase()+n}function U(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var l=t.splitRegexp,n=void 0===l?$:l,o=t.stripRegexp,r=void 0===o?j:o,a=t.transform,s=void 0===a?H:a,i=t.delimiter,c=void 0===i?" ":i,d=z(z(e,n,"$1\0$2"),r,"\0"),u=0,m=d.length;"\0"===d.charAt(u);)u++;for(;"\0"===d.charAt(m-1);)m--;return d.slice(u,m).split("\0").map(s).join(c)}(e,V({delimiter:"",transform:K},t))}function Y(e,t){return 0===t?e.toLowerCase():K(e,t)}const q=e=>async t=>{let{dispatch:l}=t;if(e)try{l(O(e));l(C((await I()({path:`wp/v2/block-directory/search?term=${e}`})).map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,l]=e;return[(n=t,void 0===o&&(o={}),U(n,V({transform:Y},o))),l];var n,o}))))),e))}catch{}},G={reducer:u,selectors:l,actions:n,resolvers:o},W=(0,c.createReduxStore)("core/block-directory",G);function Z(){const{uninstallBlockType:e}=(0,c.useDispatch)(W),t=(0,c.useSelect)((e=>{const{isAutosavingPost:t,isSavingPost:l}=e(d.store);return l()&&!t()}),[]),l=(0,c.useSelect)((e=>e(W).getUnusedBlockTypes()),[]);return(0,r.useEffect)((()=>{t&&l.length&&l.forEach((t=>{e(t),(0,i.unregisterBlockType)(t.name)}))}),[t]),null}(0,c.register)(W);const Q=window.wp.compose,J=window.wp.components,X=window.wp.coreData;function ee(){return(ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(this,arguments)}const te=window.wp.htmlEntities,le=function(e){let{icon:t,size:l=24,...n}=e;return(0,r.cloneElement)(t,{width:l,height:l,...n})},ne=window.wp.primitives,oe=(0,r.createElement)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(ne.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})),re=(0,r.createElement)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(ne.Path,{d:"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"})),ae=(0,r.createElement)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(ne.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),se=function(e){let{rating:t}=e;const l=.5*Math.round(t/.5),n=Math.floor(t),o=Math.ceil(t-n),a=5-(n+o);return(0,r.createElement)("span",{"aria-label":(0,v.sprintf)(
3
  /* translators: %s: number of stars. */
4
  (0,v.__)("%s out of 5 stars"),l)},Array.from({length:n}).map(((e,t)=>(0,r.createElement)(le,{key:`full_stars_${t}`,className:"block-directory-block-ratings__star-full",icon:oe,size:16}))),Array.from({length:o}).map(((e,t)=>(0,r.createElement)(le,{key:`half_stars_${t}`,className:"block-directory-block-ratings__star-half-full",icon:re,size:16}))),Array.from({length:a}).map(((e,t)=>(0,r.createElement)(le,{key:`empty_stars_${t}`,className:"block-directory-block-ratings__star-empty",icon:ae,size:16}))))},ie=e=>{let{rating:t}=e;return(0,r.createElement)("span",{className:"block-directory-block-ratings"},(0,r.createElement)(se,{rating:t}))},ce=function(e){let{icon:t}=e;const l="block-directory-downloadable-block-icon";return null!==t.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/)?(0,r.createElement)("img",{className:l,src:t,alt:""}):(0,r.createElement)(m.BlockIcon,{className:l,icon:t,showColors:!0})},de=e=>{let{block:t}=e;const l=(0,c.useSelect)((e=>e(W).getErrorNoticeForBlock(t.id)),[t]);return l?(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice"},(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice__content"},l.message,l.isFatal?" "+(0,v.__)("Try reloading the page."):null)):null};function ue(e,t){let{title:l,rating:n,ratingCount:o}=e,{hasNotice:r,isInstalled:a,isInstalling:s}=t;const i=.5*Math.round(n/.5);return!a&&r?(0,v.sprintf)("Retry installing %s.",(0,te.decodeEntities)(l)):a?(0,v.sprintf)("Add %s.",(0,te.decodeEntities)(l)):s?(0,v.sprintf)("Installing %s.",(0,te.decodeEntities)(l)):o<1?(0,v.sprintf)("Install %s.",(0,te.decodeEntities)(l)):(0,v.sprintf)(
5
  /* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */
6
+ (0,v._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",o),(0,te.decodeEntities)(l),i,o)}const me=function(e){let{composite:t,item:l,onClick:n}=e;const{author:o,description:a,icon:s,rating:d,title:u}=l,m=!!(0,i.getBlockType)(l.name),{hasNotice:p,isInstalling:k,isInstallable:b}=(0,c.useSelect)((e=>{const{getErrorNoticeForBlock:t,isInstalling:n}=e(W),o=t(l.id),r=o&&o.isFatal;return{hasNotice:!!o,isInstalling:n(l.id),isInstallable:!r}}),[l]);let g="";return m?g=(0,v.__)("Installed!"):k&&(g=(0,v.__)("Installing…")),(0,r.createElement)(J.__unstableCompositeItem,ee({__experimentalIsFocusable:!0,role:"option",as:J.Button},t,{className:"block-directory-downloadable-block-list-item",onClick:e=>{e.preventDefault(),n()},isBusy:k,disabled:k||!b,label:ue(l,{hasNotice:p,isInstalled:m,isInstalling:k}),showTooltip:!0,tooltipPosition:"top center"}),(0,r.createElement)("div",{className:"block-directory-downloadable-block-list-item__icon"},(0,r.createElement)(ce,{icon:s,title:u}),k?(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__spinner"},(0,r.createElement)(J.Spinner,null)):(0,r.createElement)(ie,{rating:d})),(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__details"},(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__title"},(0,r.createInterpolateElement)((0,v.sprintf)(
7
  /* translators: %1$s: block title, %2$s: author name. */
8
+ (0,v.__)("%1$s <span>by %2$s</span>"),(0,te.decodeEntities)(u),o),{span:(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__author"})})),p?(0,r.createElement)(de,{block:l}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__desc"},g||(0,te.decodeEntities)(a)),b&&!(m||k)&&(0,r.createElement)(J.VisuallyHidden,null,(0,v.__)("Install block")))))},pe=()=>{},ke=function(e){let{items:t,onHover:l=pe,onSelect:n}=e;const o=(0,J.__unstableUseCompositeState)(),{installBlockType:a}=(0,c.useDispatch)(W);return t.length?(0,r.createElement)(J.__unstableComposite,ee({},o,{role:"listbox",className:"block-directory-downloadable-blocks-list","aria-label":(0,v.__)("Blocks available for install")}),t.map((e=>(0,r.createElement)(me,{key:e.id,composite:o,onClick:()=>{(0,i.getBlockType)(e.name)?n(e):a(e).then((t=>{t&&n(e)})),l(null)},onHover:l,item:e})))):null},be=window.wp.a11y,ge=function(e){let{children:t,downloadableItems:l,hasLocalBlocks:n}=e;const o=l.length;return(0,r.useEffect)((()=>{(0,be.speak)((0,v.sprintf)(
9
  /* translators: %d: number of available blocks. */
10
+ (0,v._n)("%d additional block is available to install.","%d additional blocks are available to install.",o),o))}),[o]),(0,r.createElement)(r.Fragment,null,!n&&(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel"},(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel__header"},(0,r.createElement)("h2",{className:"block-directory-downloadable-blocks-panel__title"},(0,v.__)("Available to install")),(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description"},(0,v.__)("Select a block to install and add it to your post."))),t))},_e=(0,r.createElement)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(ne.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"})),we=function(){return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"block-editor-inserter__no-results"},(0,r.createElement)(le,{className:"block-editor-inserter__no-results-icon",icon:_e}),(0,r.createElement)("p",null,(0,v.__)("No results found."))),(0,r.createElement)("div",{className:"block-editor-inserter__tips"},(0,r.createElement)(J.Tip,null,(0,v.__)("Interested in creating your own block?"),(0,r.createElement)("br",null),(0,r.createElement)(J.ExternalLink,{href:"https://developer.wordpress.org/block-editor/"},(0,v.__)("Get started here"),"."))))},Ee=(0,Q.compose)([(0,c.withSelect)(((e,t)=>{let{filterValue:l,rootClientId:n=null}=t;const{getDownloadableBlocks:o,isRequestingDownloadableBlocks:r}=e(W),{canInsertBlockType:a}=e(m.store),s=e(X.store).canUser("read","block-directory/search");return{downloadableItems:s?o(l).filter((e=>a(e,n,!0))):[],hasPermission:s,isLoading:r(l)}}))])((function(e){let{downloadableItems:t,onSelect:l,onHover:n,hasLocalBlocks:o,hasPermission:a,isLoading:s,isTyping:i}=e;return void 0===a||s||i?(0,r.createElement)(r.Fragment,null,a&&!o&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"})),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading"},(0,r.createElement)(J.Spinner,null))):!1===a?o?null:(0,r.createElement)(we,null):t.length?(0,r.createElement)(ge,{downloadableItems:t,hasLocalBlocks:o},(0,r.createElement)(ke,{items:t,onSelect:l,onHover:n})):!o&&(0,r.createElement)(we,null)})),he=function(){const[e,t]=(0,r.useState)(""),l=(0,Q.debounce)(t,400);return(0,r.createElement)(m.__unstableInserterMenuExtension,null,(t=>{let{onSelect:n,onHover:o,filterValue:a,hasItems:s,rootClientId:i}=t;return e!==a&&l(a),e?(0,r.createElement)(Ee,{onSelect:n,onHover:o,rootClientId:i,filterValue:e,hasLocalBlocks:s,isTyping:a!==e}):null}))},ye=window.wp.editPost;function fe(e){let{items:t}=e;return t.length?(0,r.createElement)("ul",{className:"block-directory-compact-list"},t.map((e=>{let{icon:t,id:l,title:n,author:o}=e;return(0,r.createElement)("li",{key:l,className:"block-directory-compact-list__item"},(0,r.createElement)(ce,{icon:t,title:n}),(0,r.createElement)("div",{className:"block-directory-compact-list__item-details"},(0,r.createElement)("div",{className:"block-directory-compact-list__item-title"},n),(0,r.createElement)("div",{className:"block-directory-compact-list__item-author"},(0,v.sprintf)(
11
  /* translators: %s: Name of the block author. */
12
  (0,v.__)("By %s"),o))))}))):null}function ve(){const e=(0,c.useSelect)((e=>e(W).getNewBlockTypes()),[]);return e.length?(0,r.createElement)(ye.PluginPrePublishPanel,{icon:_e,title:(0,v.sprintf)(// translators: %d: number of blocks (number).
13
+ (0,v._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0},(0,r.createElement)("p",{className:"installed-blocks-pre-publish-panel__copy"},(0,v._n)("The following block has been added to your site.","The following blocks have been added to your site.",e.length)),(0,r.createElement)(fe,{items:e})):null}function Be(e){let{attributes:t,block:l,clientId:n}=e;const o=(0,c.useSelect)((e=>e(W).isInstalling(l.id)),[l.id]),{installBlockType:a}=(0,c.useDispatch)(W),{replaceBlock:s}=(0,c.useDispatch)(m.store);return(0,r.createElement)(J.Button,{onClick:()=>a(l).then((e=>{if(e){const e=(0,i.getBlockType)(l.name),[o]=(0,i.parse)(t.originalContent);o&&e&&s(n,(0,i.createBlock)(e.name,o.attributes,o.innerBlocks))}})),disabled:o,isBusy:o,variant:"primary"},(0,v.sprintf)(
14
  /* translators: %s: block name */
15
+ (0,v.__)("Install %s"),l.title))}const Ie=e=>{let{originalBlock:t,...l}=e;const{originalName:n,originalUndelimitedContent:o,clientId:a}=l.attributes,{replaceBlock:s}=(0,c.useDispatch)(m.store),d=!!o,u=(0,c.useSelect)((e=>{const{canInsertBlockType:t,getBlockRootClientId:l}=e(m.store);return t("core/html",l(a))}),[a]);let p=(0,v.sprintf)(
16
  /* translators: %s: block name */
17
+ (0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely."),t.title||n);const k=[(0,r.createElement)(Be,{key:"install",block:t,attributes:l.attributes,clientId:l.clientId})];return d&&u&&(p=(0,v.sprintf)(
18
  /* translators: %s: block name */
19
+ (0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),t.title||n),k.push((0,r.createElement)(J.Button,{key:"convert",onClick:()=>{s(l.clientId,(0,i.createBlock)("core/html",{content:o}))},variant:"link"},(0,v.__)("Keep as HTML")))),(0,r.createElement)("div",(0,m.useBlockProps)(),(0,r.createElement)(m.Warning,{actions:k},p),(0,r.createElement)(r.RawHTML,null,o))};(0,a.registerPlugin)("block-directory",{render:()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Z,null),(0,r.createElement)(he,null),(0,r.createElement)(ve,null))}),(0,s.addFilter)("blocks.registerBlockType","block-directory/fallback",((e,t)=>{return"core/missing"!==t||(e.edit=(l=e.edit,e=>{const{originalName:t}=e.attributes,{block:n,hasPermission:o}=(0,c.useSelect)((e=>{const{getDownloadableBlocks:l}=e(W),n=l("block:"+t).filter((e=>{let{name:l}=e;return t===l}));return{hasPermission:e(X.store).canUser("read","block-directory/search"),block:n.length&&n[0]}}),[t]);return o&&n?(0,r.createElement)(Ie,ee({},e,{originalBlock:n})):(0,r.createElement)(l,e)})),e;var l})),(window.wp=window.wp||{}).blockDirectory=t})();
20
  //# sourceMappingURL=index.min.js.map
build/block-directory/index.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"./build/block-directory/index.min.js","mappings":"mBACA,IAAIA,EAAsB,CCA1B,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLR,EAAwB,CAACI,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,CAACM,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClF,EAAyBT,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,wkBCLvD,MAAM,EAA+BC,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAS,MCAnD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAU,OCsG1D,GAAeC,EAAAA,EAAAA,iBAAiB,CAC/BC,mBA1FiC,WAA0B,IAAxBC,EAAwB,uDAAhB,GAAIC,EAAY,uCAC3D,OAASA,EAAOC,MACf,IAAK,4BACJ,MAAO,IACHF,EACH,CAAEC,EAAOE,aAAe,CACvBC,cAAc,IAGjB,IAAK,8BACJ,MAAO,IACHJ,EACH,CAAEC,EAAOE,aAAe,CACvBE,QAASJ,EAAOF,mBAChBK,cAAc,IAIlB,OAAOJ,GAyEPM,gBA9D8B,WAM1B,IALJN,EAKI,uDALI,CACPO,oBAAqB,GACrBC,aAAc,IAEfP,EACI,uCACJ,OAASA,EAAOC,MACf,IAAK,2BACJ,MAAO,IACHF,EACHO,oBAAqB,IACjBP,EAAMO,oBACTN,EAAOQ,OAGV,IAAK,8BACJ,MAAO,IACHT,EACHO,oBAAqBP,EAAMO,oBAAoBG,QAC5CC,GAAeA,EAAUC,OAASX,EAAOQ,KAAKG,QAGnD,IAAK,uBACJ,MAAO,IACHZ,EACHQ,aAAc,IACVR,EAAMQ,aACT,CAAEP,EAAOY,SAAWZ,EAAOO,eAI/B,OAAOR,GA+BPc,aApB2B,WAA0B,IAAxBd,EAAwB,uDAAhB,GAAIC,EAAY,uCACrD,OAASA,EAAOC,MACf,IAAK,mBACJ,MAAO,IACHF,EACH,CAAEC,EAAOY,SAAW,CACnBE,QAASd,EAAOc,QAChBC,QAASf,EAAOe,UAGnB,IAAK,qBACJ,MAAQ,CAAEf,EAAOY,SAAWA,KAAYI,GAAcjB,EACtD,OAAOiB,EAET,OAAOjB,KCnGF,EAA+BH,OAAW,GAAe,YCShD,SAASqB,EAAcP,GAAyB,IAAdQ,EAAc,uDAAL,GACzD,IAAOA,EAAOC,OACb,OAAO,EAER,GAAKD,EAAOE,MAAM,QAAE,KAAET,GAAJ,SAAgBA,IAASD,EAAUC,QACpD,OAAO,EAER,IAAM,IAAIU,EAAI,EAAGA,EAAIH,EAAOC,OAAQE,IACnC,GAAKJ,EAAcP,EAAWQ,EAAQG,GAAIC,aACzC,OAAO,EAIT,OAAO,ECHD,SAASC,EAAgCxB,EAAOG,GAAc,QACpE,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCC,oBAAhD,SAWM,SAASqB,EAAuBzB,EAAOG,GAAc,QAC3D,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCE,eAAhD,QAA2D,GAWrD,SAASqB,EAAwB1B,GACvC,OAAOA,EAAMM,gBAAgBC,oBAWvB,MAAMoB,GAAmBC,EAAAA,EAAAA,yBAC7BC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QAAUC,GACpCO,EAAcP,EAAWmB,QAafG,GAAsBL,EAAAA,EAAAA,yBAChCC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QACxBC,IAAiBO,EAAcP,EAAWmB,QAaxC,SAAStB,EAAcR,EAAOa,GACpC,OAAOb,EAAMM,gBAAgBE,aAAcK,KAAa,EAUlD,SAASqB,EAAiBlC,GAChC,OAAOA,EAAMc,aAWP,SAASqB,EAAwBnC,EAAOa,GAC9C,OAAOb,EAAMc,aAAcD,GCrH5B,MAAM,EAA+BhB,OAAe,OCA9C,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAY,S,aCA5D,MAAM,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAO,ICe1CuC,EAAcC,GACnB,IAAIC,SAAS,CAAEC,EAASC,KAK9B,MAAMC,EAAUC,SAASC,cAAeN,EAAGO,UAE3C,CAAE,KAAM,MAAO,MAAO,OAAQ,QAASC,SAAWC,IAC5CT,EAAIS,KACRL,EAASK,GAAST,EAAIS,OAKnBT,EAAGU,WACPN,EAAQO,YAAaN,SAASO,eAAgBZ,EAAGU,YAGlDN,EAAQS,OAAS,IAAMX,GAAS,GAChCE,EAAQU,QAAU,IAAMX,EAAQ,IAAIY,MAAO,yBAE3CV,SAASW,KAAKL,YAAaP,IAI1B,SAAWA,EAAQG,SAASU,eAC1B,WAAab,EAAQG,SAASU,gBAAmBb,EAAQc,MAE3DhB,OCrCY,SAASiB,EAAcC,GACrC,IAAOA,EACN,OAAO,EAER,MAAMC,EAAOD,EAAME,MAAO,cAAiBF,EAAME,MAAMC,KACvD,SAAKF,IAAQA,EAAKtC,SACVsC,EAAM,GAAIG,KCkBZ,SAASC,EAAyB3D,GACxC,MAAO,CAAED,KAAM,4BAA6BC,YAAAA,GAYtC,SAAS4D,EAA2BhE,EAAoBI,GAC9D,MAAO,CACND,KAAM,8BACNH,mBAAAA,EACAI,YAAAA,GAWK,MAAM6D,EACVP,GACFQ,MAAAA,IAAoC,IAA5B,SAAEC,EAAF,SAAYC,GAAgB,EACnC,MAAM,GAAEC,EAAF,KAAMxD,GAAS6C,EACrB,IAAIY,GAAU,EACdF,EAASG,iBAAkBF,GAC3B,IACCD,EAASI,gBAAiBH,GAAI,GAG9B,MAAMI,EAAMhB,EAAcC,GAC1B,IAAIE,EAAQ,GACPa,QACEC,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,YASjBjB,SANuBc,GAAAA,CAAU,CAChCC,OAAQ,OACRG,KAAM,gBACNF,KAAM,CAAEG,KAAMV,EAAIQ,OAAQ,aAGVG,OAGlBZ,EAASa,sBAAuB,IAC5BvB,EACHE,MAAO,IAAKF,EAAME,SAAUA,KAI7B,MAAMsB,EAAiB,CACtB,cACA,QACA,WACA,SACA,OACA,cACA,WACA,aACA,mBACA,eACA,WACA,SACA,UACA,cAsBD,SApBMR,GAAAA,CAAU,CACfI,MAAMK,EAAAA,EAAAA,cAAe,sBAAsBtE,IAAS,CACnDuE,QAASF,MAITG,OAAO,SACPC,MAAQC,IACDA,IAGPC,EAAAA,EAAAA,+CAA+C,CAC9C,CAAE3E,IAAQ4E,EAAAA,EAAAA,MAAMF,EAAUL,cFrEzBhB,iBAQN,MAAMqB,QAAiBb,GAAAA,CAAU,CAChCD,IAAK9B,SAAS+C,SAAS5B,KACvB6B,OAAO,IAGFf,QAAaW,EAASK,OAEtBC,GAAM,IAAI/F,OAAOgG,WAAYC,gBAAiBnB,EAAM,aAEpDoB,EAAYC,MAAMC,KACvBL,EAAIM,iBAAkB,kCACrBxF,QAAUyF,GAAWA,EAAM/B,KAAQ1B,SAAS0D,eAAgBD,EAAM/B,MAMpE,IAAM,MAAMiC,KAAYN,QACjB3D,EAAWiE,GE+CVC,IACmBpC,EACvBrC,OAAQ0E,EAAAA,OACRC,gBACsBnF,MAAQC,GAAOA,EAAEV,OAASA,IACjD,MAAM,IAAIwC,OACTqD,EAAAA,EAAAA,IAAI,qDAINvC,EAASC,SAAUuC,EAAAA,OAAeC,kBACjCC,EAAAA,EAAAA;CAECH,EAAAA,EAAAA,IAAI,iCACJhD,EAAMoD,OAEP,CACCC,OAAO,EACP5G,KAAM,aAGRmE,GAAU,EACT,MAAQ0C,GACT,IAAIhG,EAAUgG,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,sBAG/BzF,EAAU+F,aAAiB3D,MAG/B,MAAM4D,EAAiB,CACtBC,eAAeR,EAAAA,EAAAA,IACd,4DAEDS,iCAAiCT,EAAAA,EAAAA,IAChC,mEAIGO,EAAgBD,EAAMI,QAC1BnG,GAAU,EACVD,EAAUiG,EAAgBD,EAAMI,OAGjChD,EAASiD,eAAgBhD,EAAIrD,EAASC,GACtCkD,EAASC,SAAUuC,EAAAA,OAAeW,kBAAmBtG,EAAS,CAC7D+F,OAAO,EACPQ,eAAe,IAIjB,OADAnD,EAASI,gBAAiBH,GAAI,GACvBC,GAQIkD,EACV9D,GACFQ,MAAAA,IAAoC,IAA5B,SAAEC,EAAF,SAAYC,GAAgB,EACnC,IACC,MAAMK,EAAMhB,EAAcC,SACpBgB,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,oBAEXH,GAAAA,CAAU,CACfC,OAAQ,SACRF,IAAAA,IAEDL,EAASqD,yBAA0B/D,GAClC,MAAQsD,GACT7C,EACEC,SAAUuC,EAAAA,OACVW,kBACAN,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,yBAanB,SAASzB,EAAuBvE,GACtC,MAAO,CACNP,KAAM,2BACNO,KAAAA,GAYK,SAAS+G,EAA0B/G,GACzC,MAAO,CACNP,KAAM,8BACNO,KAAAA,GAYK,SAAS8D,EAAiB1D,EAASL,GACzC,MAAO,CACNN,KAAM,uBACNW,QAAAA,EACAL,aAAAA,GAaK,SAAS4G,EAAgBvG,EAASE,GAA2B,IAAlBC,EAAkB,wDACnE,MAAO,CACNd,KAAM,mBACNW,QAAAA,EACAE,QAAAA,EACAC,QAAAA,GAWK,SAASsD,EAAkBzD,GACjC,MAAO,CACNX,KAAM,qBACNW,QAAAA,GC1PK,IAAI4G,EAAW,WAQlB,OAPAA,EAAWxI,OAAOyI,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGtG,EAAI,EAAGuG,EAAIC,UAAU1G,OAAQE,EAAIuG,EAAGvG,IAE5C,IAAK,IAAIyG,KADTH,EAAIE,UAAUxG,GACOrC,OAAOM,UAAUC,eAAeC,KAAKmI,EAAGG,KAAIJ,EAAEI,GAAKH,EAAEG,IAE9E,OAAOJ,IAEKK,MAAMC,KAAMH,YCczB,SAASI,EAAUC,GACxB,OAAOA,EAAI7E,cDqDgBrE,OAAOmJ,OAsGXnJ,OAAOmJ,OEvMhC,IAAMC,EAAuB,CAAC,qBAAsB,wBAG9CC,EAAuB,eAgC7B,SAASC,EAAQC,EAAeC,EAAuB7I,GACrD,OAAI6I,aAAcC,OAAeF,EAAMD,QAAQE,EAAI7I,GAC5C6I,EAAGE,QAAO,SAACH,EAAOC,GAAO,OAAAD,EAAMD,QAAQE,EAAI7I,KAAQ4I,GC3CrD,SAASI,EAAoBJ,EAAeK,GACjD,IAAMC,EAAYN,EAAMO,OAAO,GACzBC,EAAaR,EAAMS,OAAO,GAAG3F,cACnC,OAAIuF,EAAQ,GAAKC,GAAa,KAAOA,GAAa,IACzC,IAAIA,EAAYE,EAElB,GAAGF,EAAUI,cAAgBF,EAO/B,SAASG,EAAWX,EAAeY,GACxC,YADwC,IAAAA,IAAAA,EAAA,IDCnC,SAAgBZ,EAAeY,QAAA,IAAAA,IAAAA,EAAA,IAiBpC,IAfE,MAIEA,EAAO,YAJTC,OAAW,IAAG,EAAAhB,EAAoB,EAClC,EAGEe,EAAO,YAHTE,OAAW,IAAG,EAAAhB,EAAoB,EAClC,EAEEc,EAAO,UAFTG,OAAS,IAAG,EAAArB,EAAS,EACrB,EACEkB,EAAO,UADTI,OAAS,IAAG,MAAG,EAGbC,EAASlB,EACXA,EAAQC,EAAOa,EAAa,UAC5BC,EACA,MAEEI,EAAQ,EACRC,EAAMF,EAAOrI,OAGe,OAAzBqI,EAAOV,OAAOW,IAAiBA,IACtC,KAAkC,OAA3BD,EAAOV,OAAOY,EAAM,IAAaA,IAGxC,OAAOF,EAAOG,MAAMF,EAAOC,GAAKE,MAAM,MAAMC,IAAIP,GAAWQ,KAAKP,GCrBzDQ,CAAOxB,EAAO,GACnBgB,UAAW,GACXD,UAAWX,GACRQ,ICZA,SAASa,EAAmBzB,EAAeK,GAChD,OAAc,IAAVA,EAAoBL,EAAMlF,cACvBsF,EAAoBJ,EAAOK,GCI7B,MAAMpH,EACVtB,GACF8D,MAAAA,IAA0B,IAAlB,SAAEE,GAAgB,EACzB,GAAOhE,EAIP,IACCgE,EAAUL,EAAyB3D,IAanCgE,EAAUJ,SAZYU,GAAAA,CAAU,CAC/BI,KAAO,qCAAqC1E,OAEtB2J,KAAOL,GAC7BxK,OAAOiL,YACNjL,OAAOkL,QAASV,GAASK,KAAK,QAAI/K,EAAKa,GAAT,QAAsB,EDV/B4I,ECWTzJ,ODXwB,IAAAqK,IAAAA,EAAA,IAChCD,EAAWX,EAAO,GACvBe,UAAWU,GACRb,KCSDxJ,GDZC,IAAmB4I,EAAeY,QCiBOjJ,IAC5C,SCZSiK,EAAc,CAC1BC,QAD0B,EAE1BC,UAF0B,EAG1BC,QAH0B,EAI1BC,UAASA,GAUGC,GAAQC,EAAAA,EAAAA,kBAvBF,uBAuBgCN,GC1BpC,SAASO,IACvB,MAAM,mBAAEpD,IAAuBqD,EAAAA,EAAAA,aAAaC,GAEtCC,GAAyBC,EAAAA,EAAAA,YAAalJ,IAC3C,MAAM,iBAAEmJ,EAAF,aAAoBC,GAAiBpJ,EAAQqJ,EAAAA,OACnD,OAAOD,MAAoBD,MACzB,IAEGG,GAAmBJ,EAAAA,EAAAA,YACtBlJ,GAAYA,EAAQgJ,GAAsB5I,uBAC5C,IAYD,OATAmJ,EAAAA,EAAAA,YAAW,KACLN,GAA0BK,EAAiB/J,QAC/C+J,EAAiBtI,SAAWlC,IAC3B4G,EAAoB5G,IACpB0K,EAAAA,EAAAA,qBAAqB1K,EAAUC,WAG/B,CAAEkK,IAEE,MDMRQ,EAAAA,EAAAA,UAAUb,GEzCV,MAAM,EAA+B5K,OAAW,GAAc,WCAxD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAY,SCA7C,SAAS0L,KAetB,OAdAA,GAAWtM,OAAOyI,QAAU,SAAU8D,GACpC,IAAK,IAAIlK,EAAI,EAAGA,EAAIwG,UAAU1G,OAAQE,IAAK,CACzC,IAAImK,EAAS3D,UAAUxG,GAEvB,IAAK,IAAIvC,KAAO0M,EACVxM,OAAOM,UAAUC,eAAeC,KAAKgM,EAAQ1M,KAC/CyM,EAAOzM,GAAO0M,EAAO1M,IAK3B,OAAOyM,IAGOxD,MAAMC,KAAMH,WCf9B,MAAM,GAA+BjI,OAAW,GAAgB,aCwBhE,GARA,YAA+C,IAAhC,KAAE6L,EAAF,KAAQC,EAAO,MAAOC,GAAU,EAC9C,OAAOC,EAAAA,EAAAA,cAAcH,EAAM,CAC1BI,MAAOH,EACPI,OAAQJ,KACLC,KCpBC,GAA+B/L,OAAW,GAAc,WCW9D,IALC,mBAAC,GAAAmM,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,GAAAC,KAAD,CAAMxN,EAAE,qVCIV,IALC,mBAAC,GAAAqN,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,GAAAC,KAAD,CAAMxN,EAAE,4dCQV,IATC,mBAAC,GAAAqN,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,GAAAC,KAAD,CACCC,SAAS,UACTzN,EAAE,+jBACF0N,SAAS,aCuCZ,GA3CA,YAA6B,IAAb,OAAEC,GAAW,EAC5B,MAAMC,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAE7BI,EAAgBF,KAAKG,MAAOL,GAC5BM,EAAgBJ,KAAKK,KAAMP,EAASI,GACpCI,EAAiB,GAAMJ,EAAgBE,GAE7C,OACC,2BACC,cAAahG,EAAAA,EAAAA;;CAEZH,EAAAA,EAAAA,IAAI,qBACJ8F,IAGCvG,MAAMC,KAAM,CAAE7E,OAAQsL,IAAkB5C,KAAK,CAAEiD,EAAGzL,KACnD,mBAAC,GAAD,CACCvC,IAAO,cAAcuC,IACrB0L,UAAU,2CACVtB,KAAOuB,GACPtB,KAAO,OAGP3F,MAAMC,KAAM,CAAE7E,OAAQwL,IAAkB9C,KAAK,CAAEiD,EAAGzL,KACnD,mBAAC,GAAD,CACCvC,IAAO,cAAcuC,IACrB0L,UAAU,gDACVtB,KAAOwB,GACPvB,KAAO,OAGP3F,MAAMC,KAAM,CAAE7E,OAAQ0L,IAAmBhD,KAAK,CAAEiD,EAAGzL,KACpD,mBAAC,GAAD,CACCvC,IAAO,eAAeuC,IACtB0L,UAAU,4CACVtB,KAAOyB,GACPxB,KAAO,SC/BZ,GAN4B,QAAE,OAAEW,GAAJ,SAC3B,2BAAMU,UAAU,kCACf,mBAAC,GAAD,CAAOV,OAASA,MCOlB,GATA,YAA2C,IAAX,KAAEZ,GAAS,EAC1C,MAAMsB,EAAY,0CAClB,OAA8D,OAAvDtB,EAAK0B,MAAO,uCAClB,0BAAKJ,UAAYA,EAAYzJ,IAAMmI,EAAO2B,IAAI,MAE9C,mBAAC,EAAAC,UAAD,CAAWN,UAAYA,EAAYtB,KAAOA,EAAO6B,YAAU,KCwB7D,GAvBuC,IAAiB,IAAf,MAAE9J,GAAa,EACvD,MAAM+J,GAAczC,EAAAA,EAAAA,YACjBlJ,GACDA,EAAQgJ,GAAsB1I,uBAAwBsB,EAAMW,KAC7D,CAAEX,IAGH,OAAO+J,GAKN,0BAAKR,UAAU,8CACd,0BAAKA,UAAU,sDACZQ,EAAYzM,QACZyM,EAAYxM,QACX,KAAMyF,EAAAA,EAAAA,IAAI,2BACV,OATE,MCKT,SAASgH,GAAT,KAGE,IAFD,MAAE5G,EAAF,OAASyF,EAAT,YAAiBoB,GAEhB,GADD,UAAEC,EAAF,YAAaC,EAAb,aAA0BpN,GACzB,EACD,MAAM+L,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAEnC,OAAOsB,GAAeD,GAEd/G,EAAAA,EAAAA,SAAS,wBAAwBiH,EAAAA,GAAAA,gBAAgBhH,IAGpD+G,GAEGhH,EAAAA,EAAAA,SAAS,WAAWiH,EAAAA,GAAAA,gBAAgBhH,IAGvCrG,GAEGoG,EAAAA,EAAAA,SAAS,kBAAkBiH,EAAAA,GAAAA,gBAAgBhH,IAI9C6G,EAAc,GAEX9G,EAAAA,EAAAA,SAAS,eAAeiH,EAAAA,GAAAA,gBAAgBhH,KAGzCD,EAAAA,EAAAA;;CAENkH,EAAAA,EAAAA,IACC,6CACA,8CACAJ,IAEDG,EAAAA,GAAAA,gBAAgBhH,GAChB0F,EACAmB,GAoGF,SAhGA,YAAmE,IAA/B,UAAEK,EAAF,KAAatN,EAAb,QAAmBuN,GAAY,EAClE,MAAM,OAAEC,EAAF,YAAUC,EAAV,KAAuBxC,EAAvB,OAA6BY,EAA7B,MAAqCzF,GAAUpG,EAE/CmN,KAAiBO,EAAAA,EAAAA,cAAc1N,EAAKG,OAEpC,UAAE+M,EAAF,aAAanN,EAAb,cAA2B4N,IAAkBrD,EAAAA,EAAAA,YAChDlJ,IACD,MAAM,uBAAEM,EAAwB3B,aAAc6N,GAC7CxM,EAAQgJ,GACHyD,EAASnM,EAAwB1B,EAAK2D,IACtCmK,EAAWD,GAAUA,EAAOtN,QAClC,MAAO,CACN2M,YAAcW,EACd9N,aAAc6N,EAAmB5N,EAAK2D,IACtCgK,eAAiBG,KAGnB,CAAE9N,IAGH,IAAI+N,EAAa,GAOjB,OANKZ,EACJY,GAAa/H,EAAAA,EAAAA,IAAI,cACNjG,IACXgO,GAAa/H,EAAAA,EAAAA,IAAI,iBAIjB,mBAAC,0BAAD,IACCgI,2BAAyB,EACzBC,KAAK,SACLC,GAAKC,EAAAA,QACAb,EAJN,CAKCf,UAAU,+CACVgB,QAAYa,IACXA,EAAMC,iBACNd,KAEDe,OAASvO,EACTwO,SAAWxO,IAAkB4N,EAC7Ba,MAAQxB,GAA2BhN,EAAM,CACxCkN,UAAAA,EACAC,YAAAA,EACApN,aAAAA,IAED0O,aAAc,EACdC,gBAAgB,gBAEhB,0BAAKnC,UAAU,uDACd,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO7E,MAAQA,IAC3CrG,GACD,2BAAMwM,UAAU,0DACf,mBAAC,EAAAoC,QAAD,QAGD,mBAAC,GAAD,CAAc9C,OAASA,MAGzB,2BAAMU,UAAU,0DACf,2BAAMA,UAAU,wDACbqC,EAAAA,EAAAA,2BACDzI,EAAAA,EAAAA;;CAECH,EAAAA,EAAAA,IAAI,8BACJoH,EAAAA,GAAAA,gBAAgBhH,GAChBoH,GAED,CACCqB,MACC,2BAAMtC,UAAU,4DAKlBW,GACD,mBAAC,GAAD,CAAyBlK,MAAQhD,KAEjC,oCACC,2BAAMuM,UAAU,sDACVwB,IAEFX,EAAAA,GAAAA,gBAAgBK,IAElBE,KACGR,GAAepN,KAClB,mBAAC,EAAA+O,eAAD,MACG9I,EAAAA,EAAAA,IAAI,sBCrIT+I,GAAO,OA8Cb,GA5CA,YAAuE,IAAtC,MAAEC,EAAF,QAASC,EAAUF,GAAnB,SAAyBG,GAAa,EACtE,MAAM5B,GAAY6B,EAAAA,EAAAA,gCACZ,iBAAE5L,IAAqB4G,EAAAA,EAAAA,aAAaC,GAE1C,OAAO4E,EAAMrO,QAKZ,mBAAC,sBAAD,MACM2M,EADN,CAECW,KAAK,UACL1B,UAAU,2CACV,cAAavG,EAAAA,EAAAA,IAAI,kCAEfgJ,EAAM3F,KAAOrJ,IAEb,mBAAC,GAAD,CACC1B,IAAM0B,EAAK2D,GACX2J,UAAYA,EACZC,QAAU,MAIJG,EAAAA,EAAAA,cAAc1N,EAAKG,MACvB+O,EAAUlP,GAEVuD,EAAkBvD,GAAO4E,MAAQhB,IAC3BA,GACJsL,EAAUlP,MAIbiP,EAAS,OAEVA,QAAUA,EACVjP,KAAOA,OA/BJ,MCxBH,GAA+BZ,OAAW,GAAQ,KCsDxD,GA/CA,YAII,IAJsC,SACzCgQ,EADyC,kBAEzCC,EAFyC,eAGzCC,GACG,EACH,MAAMC,EAAQF,EAAkB1O,OAehC,OAdAgK,EAAAA,EAAAA,YAAW,MACVtE,EAAAA,GAAAA,QACCF,EAAAA,EAAAA;;CAECkH,EAAAA,EAAAA,IACC,+CACA,iDACAkC,GAEDA,MAGA,CAAEA,KAGJ,oCACKD,IACH,wBAAG/C,UAAU,wDACVvG,EAAAA,EAAAA,IAAI,sDAIR,0BAAKuG,UAAU,qDAEf,0BAAKA,UAAU,8CACd,0BAAKA,UAAU,sDACd,yBAAIA,UAAU,qDACXvG,EAAAA,EAAAA,IAAI,0BAEP,wBAAGuG,UAAU,2DACVvG,EAAAA,EAAAA,IACD,wDAIDoJ,KCrCN,IALC,mBAAC,GAAA7D,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,GAAAC,KAAD,CAAMxN,EAAE,oLCuBV,GAvBA,WACC,OACC,oCACC,0BAAKqO,UAAU,sCACd,mBAAC,GAAD,CACCA,UAAU,yCACVtB,KAAOuE,MAER,6BAAKxJ,EAAAA,EAAAA,IAAI,wBAEV,0BAAKuG,UAAU,gCACd,mBAAC,EAAAkD,IAAD,MACGzJ,EAAAA,EAAAA,IAAI,2CACN,+BACA,mBAAC,EAAA0J,aAAD,CAActM,KAAK,kDAChB4C,EAAAA,EAAAA,IAAI,oBADP,SCkDL,IAAe2J,EAAAA,EAAAA,SAAS,EACvBC,EAAAA,EAAAA,aAAY,CAAExO,EAAF,KAAoD,IAA1C,YAAE1B,EAAF,aAAemQ,EAAe,MAAY,EAC/D,MAAM,sBAAE7O,EAAF,+BAAyBD,GAC9BK,EAAQgJ,IACH,mBAAE0F,GAAuB1O,EAAQE,EAAAA,OAEjCyO,EAAgB3O,EAAQ4O,EAAAA,OAAYC,QACzC,OACA,0BAcD,MAAO,CACNZ,kBANyBU,EALlB/O,EAMiBtB,GANaO,QAAU+C,GAC9C8M,EAAoB9M,EAAO6M,GAAc,KAMxC,GAKFE,cAAAA,EACAG,UALiBnP,EAAgCrB,QApBpD,EArDA,YAQI,IAR8B,kBACjC2P,EADiC,SAEjCH,EAFiC,QAGjCD,EAHiC,eAIjCK,EAJiC,cAKjCS,EALiC,UAMjCG,EANiC,SAOjCC,GACG,EACH,YAA8B,IAAlBJ,GAAiCG,GAAaC,GAExD,mCACGJ,IAAmBT,IACpB,oCACC,wBAAG/C,UAAU,wDACVvG,EAAAA,EAAAA,IACD,sDAGF,0BAAKuG,UAAU,sDAGjB,0BAAKA,UAAU,iEACd,mBAAC,EAAAoC,QAAD,SAMC,IAAUoB,EACPT,EAIA,MAHC,mBAAC,GAAD,MAMCD,EAAkB1O,QAC3B,mBAAC,GAAD,CACC0O,kBAAoBA,EACpBC,eAAiBA,IAEjB,mBAAC,GAAD,CACCN,MAAQK,EACRH,SAAWA,EACXD,QAAUA,MAIVK,IAAkB,mBAAC,GAAD,SCftB,GApCA,WACC,MAAQc,EAAsBC,IAAmBC,EAAAA,EAAAA,UAAU,IACrDC,GAA0BC,EAAAA,EAAAA,UAAUH,EAAgB,KAE1D,OACC,mBAAC,EAAAI,gCAAD,MACG,IAMK,IANH,SACHvB,EADG,QAEHD,EAFG,YAGHvP,EAHG,SAIHgR,EAJG,aAKHb,GACM,EAKN,OAJKO,IAAyB1Q,GAC7B6Q,EAAyB7Q,GAGnB0Q,GAKN,mBAAC,GAAD,CACClB,SAAWA,EACXD,QAAUA,EACVY,aAAeA,EACfnQ,YAAc0Q,EACdd,eAAiBoB,EACjBP,SAAWzQ,IAAgB0Q,IAVrB,SClCN,GAA+BhR,OAAW,GAAY,SCU7C,SAASuR,GAAT,GAAkC,IAAZ,MAAE3B,GAAU,EAChD,OAAOA,EAAMrO,QAKZ,yBAAI4L,UAAU,gCACXyC,EAAM3F,KAAK,QAAE,KAAE4B,EAAF,GAAQtH,EAAR,MAAYyC,EAAZ,OAAmBoH,GAArB,SACZ,yBAAIlP,IAAMqF,EAAK4I,UAAU,uCACxB,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO7E,MAAQA,KAE7C,0BAAKmG,UAAU,+CACd,0BAAKA,UAAU,4CACZnG,IAEH,0BAAKmG,UAAU,8CACZpG,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,SACJwH,UAjBC,KCEM,SAASoD,KACvB,MAAMC,GAAgBvG,EAAAA,EAAAA,YACnBlJ,GAAYA,EAAQgJ,GAAsBlJ,oBAC5C,IAGD,OAAO2P,EAAclQ,QAKpB,mBAAC,GAAAmQ,sBAAD,CACC7F,KAAOuE,GACPpJ,OAAQD,EAAAA,EAAAA;CAEPkH,EAAAA,EAAAA,IACC,kBACA,mBACAwD,EAAclQ,QAEfkQ,EAAclQ,QAEfoQ,aAAc,IAEd,wBAAGxE,UAAU,6CACVc,EAAAA,EAAAA,IACD,mDACA,qDACAwD,EAAclQ,UAGhB,mBAACgQ,GAAD,CAAa3B,MAAQ6B,KAxBf,KCPM,SAASG,GAAT,GAA0D,IAAlC,WAAEC,EAAF,MAAcjO,EAAd,SAAqBkO,GAAa,EACxE,MAAMC,GAAoB7G,EAAAA,EAAAA,YACvBlJ,GAAYA,EAAQgJ,GAAsBrK,aAAciD,EAAMW,KAChE,CAAEX,EAAMW,MAEH,iBAAEJ,IAAqB4G,EAAAA,EAAAA,aAAaC,IACpC,aAAEgH,IAAiBjH,EAAAA,EAAAA,aAAa7I,EAAAA,OAEtC,OACC,mBAAC,EAAA6M,OAAD,CACCZ,QAAU,IACThK,EAAkBP,GAAQ4B,MAAQhB,IACjC,GAAKA,EAAU,CACd,MAAM1D,GAAYwN,EAAAA,EAAAA,cAAc1K,EAAM7C,OAC9BkR,IAAkBpM,EAAAA,EAAAA,OACzBgM,EAAWK,iBAEPD,GAAiBnR,GACrBkR,EACCF,GACAK,EAAAA,EAAAA,aACCrR,EAAUC,KACVkR,EAAcJ,WACdI,EAAcvQ,kBAOpByN,SAAW4C,EACX7C,OAAS6C,EACTK,QAAQ,YAENrL,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,cACJhD,EAAMoD,QC9BV,MA6BMqL,GAAkB,IAAmC,IAAjC,cAAEJ,KAAkBlG,GAAa,EAC1D,MAAM,aAAEuG,EAAF,2BAAgBC,GAA+BxG,EAAM8F,YACrD,aAAEG,IAAiBjH,EAAAA,EAAAA,aAAa7I,EAAAA,OAUhCsQ,IAAgBD,EAChBE,GAAenE,EAAAA,EAAAA,cAAc,aAEnC,IAAIoE,GAAc3L,EAAAA,EAAAA;;CAEjBH,EAAAA,EAAAA,IACC,+GAEDqL,EAAcjL,OAASsL,GAExB,MAAM5H,EAAU,EACf,mBAACkH,GAAD,CACC1S,IAAI,UACJ0E,MAAQqO,EACRJ,WAAa9F,EAAM8F,WACnBC,SAAW/F,EAAM+F,YAmBnB,OAfKU,GAAcC,IAClBC,GAAc3L,EAAAA,EAAAA;;CAEbH,EAAAA,EAAAA,IACC,mJAEDqL,EAAcjL,OAASsL,GAExB5H,EAAQiI,MACP,mBAAC,EAAA5D,OAAD,CAAQ7P,IAAI,UAAUiP,QArCF,KACrB6D,EACCjG,EAAM+F,UACNK,EAAAA,EAAAA,aAAa,YAAa,CACzBS,QAASL,MAiCsCH,QAAQ,SACrDxL,EAAAA,EAAAA,IAAI,oBAMR,0BAAUiM,EAAAA,EAAAA,kBACT,mBAAC,EAAAC,QAAD,CAASpI,QAAUA,GAAYgI,IAC/B,mBAAC,EAAAK,QAAD,KAAWR,MCrFdS,EAAAA,EAAAA,gBAAgB,kBAAmB,CAClCC,OAAM,KAEJ,oCACC,mBAACnI,EAAD,OACA,mBAAC,GAAD,OACA,mBAAC0G,GAAD,UAMJ0B,EAAAA,EAAAA,WACC,2BACA,4BACA,CAAEC,EAAUpS,KACX,MAAc,iBAATA,IAGLoS,EAASC,MDZiBC,ECYSF,EAASC,KDZOrH,IACpD,MAAM,aAAEuG,GAAiBvG,EAAM8F,YAGzB,MAAEjO,EAAF,cAAS+M,IAAkBzF,EAAAA,EAAAA,YAC9BlJ,IACD,MAAM,sBAAEJ,GAA0BI,EAAQgJ,GACpC1J,EAASM,EACd,SAAW0Q,GACVzR,QAAQ,QAAE,KAAEE,GAAJ,SAAgBuR,IAAiBvR,KAC3C,MAAO,CACN4P,cAAe3O,EAAQ4O,EAAAA,OAAYC,QAClC,OACA,0BAEDjN,MAAOtC,EAAOC,QAAUD,EAAQ,MAGlC,CAAEgR,IAIH,OAAO3B,GAAmB/M,GAInB,mBAACyO,GAAD,MAAsBtG,EAAtB,CAA8BkG,cAAgBrO,MAH7C,mBAACyP,EAAuBtH,MCbvBoH,EDVkBE,IAAAA,M","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/compat get default export","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/runtime/make namespace object","webpack://wp/external window [\"wp\",\"element\"]","webpack://wp/external window [\"wp\",\"plugins\"]","webpack://wp/external window [\"wp\",\"hooks\"]","webpack://wp/external window [\"wp\",\"blocks\"]","webpack://wp/external window [\"wp\",\"data\"]","webpack://wp/external window [\"wp\",\"editor\"]","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/reducer.js","webpack://wp/external window [\"wp\",\"blockEditor\"]","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/has-block-type.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/selectors.js","webpack://wp/external window \"lodash\"","webpack://wp/external window [\"wp\",\"i18n\"]","webpack://wp/external window [\"wp\",\"apiFetch\"]","webpack://wp/external window [\"wp\",\"notices\"]","webpack://wp/external window [\"wp\",\"url\"]","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/load-assets.js","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/get-plugin-url.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/actions.js","webpack://wp/./node_modules/tslib/tslib.es6.js","webpack://wp/./node_modules/lower-case/src/index.ts","webpack://wp/./node_modules/no-case/src/index.ts","webpack://wp/./node_modules/pascal-case/src/index.ts","webpack://wp/./node_modules/camel-case/src/index.ts","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/resolvers.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/index.js","webpack://wp/./packages/block-directory/build-module/components/auto-block-uninstaller/@wordpress/block-directory/src/components/auto-block-uninstaller/index.js","webpack://wp/external window [\"wp\",\"components\"]","webpack://wp/external window [\"wp\",\"compose\"]","webpack://wp/external window [\"wp\",\"coreData\"]","webpack://wp/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://wp/external window [\"wp\",\"htmlEntities\"]","webpack://wp/./packages/icons/build-module/icon/@wordpress/icons/src/icon/index.js","webpack://wp/external window [\"wp\",\"primitives\"]","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-filled.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-half.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-empty.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/stars.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-icon/@wordpress/block-directory/src/components/downloadable-block-icon/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-notice/@wordpress/block-directory/src/components/downloadable-block-notice/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-list-item/@wordpress/block-directory/src/components/downloadable-block-list-item/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-list/@wordpress/block-directory/src/components/downloadable-blocks-list/index.js","webpack://wp/external window [\"wp\",\"a11y\"]","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/inserter-panel.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/block-default.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/no-results.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/@wordpress/block-directory/src/plugins/inserter-menu-downloadable-blocks-panel/index.js","webpack://wp/external window [\"wp\",\"editPost\"]","webpack://wp/./packages/block-directory/build-module/components/compact-list/@wordpress/block-directory/src/components/compact-list/index.js","webpack://wp/./packages/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/@wordpress/block-directory/src/plugins/installed-blocks-pre-publish-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/install-button.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/index.js","webpack://wp/./packages/block-directory/build-module/plugins/@wordpress/block-directory/src/plugins/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"plugins\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editor\"];","/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning an array of downloadable blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const downloadableBlocks = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'FETCH_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tisRequesting: true,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'RECEIVE_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tresults: action.downloadableBlocks,\n\t\t\t\t\tisRequesting: false,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer managing the installation and deletion of blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const blockManagement = (\n\tstate = {\n\t\tinstalledBlockTypes: [],\n\t\tisInstalling: {},\n\t},\n\taction\n) => {\n\tswitch ( action.type ) {\n\t\tcase 'ADD_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: [\n\t\t\t\t\t...state.installedBlockTypes,\n\t\t\t\t\taction.item,\n\t\t\t\t],\n\t\t\t};\n\t\tcase 'REMOVE_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: state.installedBlockTypes.filter(\n\t\t\t\t\t( blockType ) => blockType.name !== action.item.name\n\t\t\t\t),\n\t\t\t};\n\t\tcase 'SET_INSTALLING_BLOCK':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisInstalling: {\n\t\t\t\t\t...state.isInstalling,\n\t\t\t\t\t[ action.blockId ]: action.isInstalling,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer returning an object of error notices.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const errorNotices = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'SET_ERROR_NOTICE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.blockId ]: {\n\t\t\t\t\tmessage: action.message,\n\t\t\t\t\tisFatal: action.isFatal,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'CLEAR_ERROR_NOTICE':\n\t\t\tconst { [ action.blockId ]: blockId, ...restState } = state;\n\t\t\treturn restState;\n\t}\n\treturn state;\n};\n\nexport default combineReducers( {\n\tdownloadableBlocks,\n\tblockManagement,\n\terrorNotices,\n} );\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * Check if a block list contains a specific block type. Recursively searches\n * through `innerBlocks` if they exist.\n *\n * @param {Object} blockType A block object to search for.\n * @param {Object[]} blocks The list of blocks to look through.\n *\n * @return {boolean} Whether the blockType is found.\n */\nexport default function hasBlockType( blockType, blocks = [] ) {\n\tif ( ! blocks.length ) {\n\t\treturn false;\n\t}\n\tif ( blocks.some( ( { name } ) => name === blockType.name ) ) {\n\t\treturn true;\n\t}\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( hasBlockType( blockType, blocks[ i ].innerBlocks ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport hasBlockType from './utils/has-block-type';\n\n/**\n * Returns true if application is requesting for downloadable blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {boolean} Whether a request is in progress for the blocks list.\n */\nexport function isRequestingDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.isRequesting ?? false;\n}\n\n/**\n * Returns the available uninstalled blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {Array} Downloadable blocks.\n */\nexport function getDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.results ?? [];\n}\n\n/**\n * Returns the block types that have been installed on the server in this\n * session.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items\n */\nexport function getInstalledBlockTypes( state ) {\n\treturn state.blockManagement.installedBlockTypes;\n}\n\n/**\n * Returns block types that have been installed on the server and used in the\n * current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getNewBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter( ( blockType ) =>\n\t\t\thasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns the block types that have been installed on the server but are not\n * used in the current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getUnusedBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter(\n\t\t\t( blockType ) => ! hasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if a block plugin install is in progress.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId Id of the block.\n *\n * @return {boolean} Whether this block is currently being installed.\n */\nexport function isInstalling( state, blockId ) {\n\treturn state.blockManagement.isInstalling[ blockId ] || false;\n}\n\n/**\n * Returns all block error notices.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Object with error notices.\n */\nexport function getErrorNotices( state ) {\n\treturn state.errorNotices;\n}\n\n/**\n * Returns the error notice for a given block.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {string|boolean} The error text, or false if no error.\n */\nexport function getErrorNoticeForBlock( state, blockId ) {\n\treturn state.errorNotices[ blockId ];\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"lodash\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"apiFetch\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"notices\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Load an asset for a block.\n *\n * This function returns a Promise that will resolve once the asset is loaded,\n * or in the case of Stylesheets and Inline JavaScript, will resolve immediately.\n *\n * @param {HTMLElement} el A HTML Element asset to inject.\n *\n * @return {Promise} Promise which will resolve when the asset is loaded.\n */\nexport const loadAsset = ( el ) => {\n\treturn new Promise( ( resolve, reject ) => {\n\t\t/*\n\t\t * Reconstruct the passed element, this is required as inserting the Node directly\n\t\t * won't always fire the required onload events, even if the asset wasn't already loaded.\n\t\t */\n\t\tconst newNode = document.createElement( el.nodeName );\n\n\t\t[ 'id', 'rel', 'src', 'href', 'type' ].forEach( ( attr ) => {\n\t\t\tif ( el[ attr ] ) {\n\t\t\t\tnewNode[ attr ] = el[ attr ];\n\t\t\t}\n\t\t} );\n\n\t\t// Append inline <script> contents.\n\t\tif ( el.innerHTML ) {\n\t\t\tnewNode.appendChild( document.createTextNode( el.innerHTML ) );\n\t\t}\n\n\t\tnewNode.onload = () => resolve( true );\n\t\tnewNode.onerror = () => reject( new Error( 'Error loading asset.' ) );\n\n\t\tdocument.body.appendChild( newNode );\n\n\t\t// Resolve Stylesheets and Inline JavaScript immediately.\n\t\tif (\n\t\t\t'link' === newNode.nodeName.toLowerCase() ||\n\t\t\t( 'script' === newNode.nodeName.toLowerCase() && ! newNode.src )\n\t\t) {\n\t\t\tresolve();\n\t\t}\n\t} );\n};\n\n/**\n * Load the asset files for a block\n */\nexport async function loadAssets() {\n\t/*\n\t * Fetch the current URL (post-new.php, or post.php?post=1&action=edit) and compare the\n\t * JavaScript and CSS assets loaded between the pages. This imports the required assets\n\t * for the block into the current page while not requiring that we know them up-front.\n\t * In the future this can be improved by reliance upon block.json and/or a script-loader\n\t * dependency API.\n\t */\n\tconst response = await apiFetch( {\n\t\turl: document.location.href,\n\t\tparse: false,\n\t} );\n\n\tconst data = await response.text();\n\n\tconst doc = new window.DOMParser().parseFromString( data, 'text/html' );\n\n\tconst newAssets = Array.from(\n\t\tdoc.querySelectorAll( 'link[rel=\"stylesheet\"],script' )\n\t).filter( ( asset ) => asset.id && ! document.getElementById( asset.id ) );\n\n\t/*\n\t * Load each asset in order, as they may depend upon an earlier loaded script.\n\t * Stylesheets and Inline Scripts will resolve immediately upon insertion.\n\t */\n\tfor ( const newAsset of newAssets ) {\n\t\tawait loadAsset( newAsset );\n\t}\n}\n","/**\n * Get the plugin's direct API link out of a block-directory response.\n *\n * @param {Object} block The block object\n *\n * @return {string} The plugin URL, if exists.\n */\nexport default function getPluginUrl( block ) {\n\tif ( ! block ) {\n\t\treturn false;\n\t}\n\tconst link = block.links[ 'wp:plugin' ] || block.links.self;\n\tif ( link && link.length ) {\n\t\treturn link[ 0 ].href;\n\t}\n\treturn false;\n}\n","/**\n * External dependencies\n */\nimport { pick } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tstore as blocksStore,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n} from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { loadAssets } from './load-assets';\nimport getPluginUrl from './utils/get-plugin-url';\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been requested and are loading.\n *\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function fetchDownloadableBlocks( filterValue ) {\n\treturn { type: 'FETCH_DOWNLOADABLE_BLOCKS', filterValue };\n}\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been updated.\n *\n * @param {Array} downloadableBlocks Downloadable blocks.\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function receiveDownloadableBlocks( downloadableBlocks, filterValue ) {\n\treturn {\n\t\ttype: 'RECEIVE_DOWNLOADABLE_BLOCKS',\n\t\tdownloadableBlocks,\n\t\tfilterValue,\n\t};\n}\n\n/**\n * Action triggered to install a block plugin.\n *\n * @param {Object} block The block item returned by search.\n *\n * @return {boolean} Whether the block was successfully installed & loaded.\n */\nexport const installBlockType =\n\t( block ) =>\n\tasync ( { registry, dispatch } ) => {\n\t\tconst { id, name } = block;\n\t\tlet success = false;\n\t\tdispatch.clearErrorNotice( id );\n\t\ttry {\n\t\t\tdispatch.setIsInstalling( id, true );\n\n\t\t\t// If we have a wp:plugin link, the plugin is installed but inactive.\n\t\t\tconst url = getPluginUrl( block );\n\t\t\tlet links = {};\n\t\t\tif ( url ) {\n\t\t\t\tawait apiFetch( {\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\turl,\n\t\t\t\t\tdata: { status: 'active' },\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tconst response = await apiFetch( {\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tpath: 'wp/v2/plugins',\n\t\t\t\t\tdata: { slug: id, status: 'active' },\n\t\t\t\t} );\n\t\t\t\t// Add the `self` link for newly-installed blocks.\n\t\t\t\tlinks = response._links;\n\t\t\t}\n\n\t\t\tdispatch.addInstalledBlockType( {\n\t\t\t\t...block,\n\t\t\t\tlinks: { ...block.links, ...links },\n\t\t\t} );\n\n\t\t\t// Ensures that the block metadata is propagated to the editor when registered on the server.\n\t\t\tconst metadataFields = [\n\t\t\t\t'api_version',\n\t\t\t\t'title',\n\t\t\t\t'category',\n\t\t\t\t'parent',\n\t\t\t\t'icon',\n\t\t\t\t'description',\n\t\t\t\t'keywords',\n\t\t\t\t'attributes',\n\t\t\t\t'provides_context',\n\t\t\t\t'uses_context',\n\t\t\t\t'supports',\n\t\t\t\t'styles',\n\t\t\t\t'example',\n\t\t\t\t'variations',\n\t\t\t];\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: addQueryArgs( `/wp/v2/block-types/${ name }`, {\n\t\t\t\t\t_fields: metadataFields,\n\t\t\t\t} ),\n\t\t\t} )\n\t\t\t\t// Ignore when the block is not registered on the server.\n\t\t\t\t.catch( () => {} )\n\t\t\t\t.then( ( response ) => {\n\t\t\t\t\tif ( ! response ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tunstable__bootstrapServerSideBlockDefinitions( {\n\t\t\t\t\t\t[ name ]: pick( response, metadataFields ),\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\tawait loadAssets();\n\t\t\tconst registeredBlocks = registry\n\t\t\t\t.select( blocksStore )\n\t\t\t\t.getBlockTypes();\n\t\t\tif ( ! registeredBlocks.some( ( i ) => i.name === name ) ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t__( 'Error registering block. Try reloading the page.' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tregistry.dispatch( noticesStore ).createInfoNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s is the block title.\n\t\t\t\t\t__( 'Block %s installed and added.' ),\n\t\t\t\t\tblock.title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tspeak: true,\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\tsuccess = true;\n\t\t} catch ( error ) {\n\t\t\tlet message = error.message || __( 'An error occurred.' );\n\n\t\t\t// Errors we throw are fatal.\n\t\t\tlet isFatal = error instanceof Error;\n\n\t\t\t// Specific API errors that are fatal.\n\t\t\tconst fatalAPIErrors = {\n\t\t\t\tfolder_exists: __(\n\t\t\t\t\t'This block is already installed. Try reloading the page.'\n\t\t\t\t),\n\t\t\t\tunable_to_connect_to_filesystem: __(\n\t\t\t\t\t'Error installing block. You can reload the page and try again.'\n\t\t\t\t),\n\t\t\t};\n\n\t\t\tif ( fatalAPIErrors[ error.code ] ) {\n\t\t\t\tisFatal = true;\n\t\t\t\tmessage = fatalAPIErrors[ error.code ];\n\t\t\t}\n\n\t\t\tdispatch.setErrorNotice( id, message, isFatal );\n\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( message, {\n\t\t\t\tspeak: true,\n\t\t\t\tisDismissible: true,\n\t\t\t} );\n\t\t}\n\t\tdispatch.setIsInstalling( id, false );\n\t\treturn success;\n\t};\n\n/**\n * Action triggered to uninstall a block plugin.\n *\n * @param {Object} block The blockType object.\n */\nexport const uninstallBlockType =\n\t( block ) =>\n\tasync ( { registry, dispatch } ) => {\n\t\ttry {\n\t\t\tconst url = getPluginUrl( block );\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'PUT',\n\t\t\t\turl,\n\t\t\t\tdata: { status: 'inactive' },\n\t\t\t} );\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\turl,\n\t\t\t} );\n\t\t\tdispatch.removeInstalledBlockType( block );\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\terror.message || __( 'An error occurred.' )\n\t\t\t\t);\n\t\t}\n\t};\n\n/**\n * Returns an action object used to add a block type to the \"newly installed\"\n * tracking list.\n *\n * @param {Object} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function addInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'ADD_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to remove a block type from the \"newly installed\"\n * tracking list.\n *\n * @param {string} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function removeInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'REMOVE_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to indicate install in progress.\n *\n * @param {string} blockId\n * @param {boolean} isInstalling\n *\n * @return {Object} Action object.\n */\nexport function setIsInstalling( blockId, isInstalling ) {\n\treturn {\n\t\ttype: 'SET_INSTALLING_BLOCK',\n\t\tblockId,\n\t\tisInstalling,\n\t};\n}\n\n/**\n * Sets an error notice to be displayed to the user for a given block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n * @param {string} message The message shown in the notice.\n * @param {boolean} isFatal Whether the user can recover from the error.\n *\n * @return {Object} Action object.\n */\nexport function setErrorNotice( blockId, message, isFatal = false ) {\n\treturn {\n\t\ttype: 'SET_ERROR_NOTICE',\n\t\tblockId,\n\t\tmessage,\n\t\tisFatal,\n\t};\n}\n\n/**\n * Sets the error notice to empty for specific block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {Object} Action object.\n */\nexport function clearErrorNotice( blockId ) {\n\treturn {\n\t\ttype: 'CLEAR_ERROR_NOTICE',\n\t\tblockId,\n\t};\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","/**\n * Locale character mapping rules.\n */\ninterface Locale {\n regexp: RegExp;\n map: Record<string, string>;\n}\n\n/**\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n */\nconst SUPPORTED_LOCALE: Record<string, Locale> = {\n tr: {\n regexp: /\\u0130|\\u0049|\\u0049\\u0307/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n az: {\n regexp: /\\u0130/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n lt: {\n regexp: /\\u0049|\\u004A|\\u012E|\\u00CC|\\u00CD|\\u0128/g,\n map: {\n I: \"\\u0069\\u0307\",\n J: \"\\u006A\\u0307\",\n Į: \"\\u012F\\u0307\",\n Ì: \"\\u0069\\u0307\\u0300\",\n Í: \"\\u0069\\u0307\\u0301\",\n Ĩ: \"\\u0069\\u0307\\u0303\",\n },\n },\n};\n\n/**\n * Localized lower case.\n */\nexport function localeLowerCase(str: string, locale: string) {\n const lang = SUPPORTED_LOCALE[locale.toLowerCase()];\n if (lang) return lowerCase(str.replace(lang.regexp, (m) => lang.map[m]));\n return lowerCase(str);\n}\n\n/**\n * Lower case as a function.\n */\nexport function lowerCase(str: string) {\n return str.toLowerCase();\n}\n","import { lowerCase } from \"lower-case\";\n\nexport interface Options {\n splitRegexp?: RegExp | RegExp[];\n stripRegexp?: RegExp | RegExp[];\n delimiter?: string;\n transform?: (part: string, index: number, parts: string[]) => string;\n}\n\n// Support camel case (\"camelCase\" -> \"camel Case\" and \"CAMELCase\" -> \"CAMEL Case\").\nconst DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];\n\n// Remove all non-word characters.\nconst DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n\n/**\n * Normalize the string into something other libraries can manipulate easier.\n */\nexport function noCase(input: string, options: Options = {}) {\n const {\n splitRegexp = DEFAULT_SPLIT_REGEXP,\n stripRegexp = DEFAULT_STRIP_REGEXP,\n transform = lowerCase,\n delimiter = \" \",\n } = options;\n\n let result = replace(\n replace(input, splitRegexp, \"$1\\0$2\"),\n stripRegexp,\n \"\\0\"\n );\n let start = 0;\n let end = result.length;\n\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\") start++;\n while (result.charAt(end - 1) === \"\\0\") end--;\n\n // Transform each token independently.\n return result.slice(start, end).split(\"\\0\").map(transform).join(delimiter);\n}\n\n/**\n * Replace `re` in the input string with the replacement value.\n */\nfunction replace(input: string, re: RegExp | RegExp[], value: string) {\n if (re instanceof RegExp) return input.replace(re, value);\n return re.reduce((input, re) => input.replace(re, value), input);\n}\n","import { noCase, Options } from \"no-case\";\n\nexport { Options };\n\nexport function pascalCaseTransform(input: string, index: number) {\n const firstChar = input.charAt(0);\n const lowerChars = input.substr(1).toLowerCase();\n if (index > 0 && firstChar >= \"0\" && firstChar <= \"9\") {\n return `_${firstChar}${lowerChars}`;\n }\n return `${firstChar.toUpperCase()}${lowerChars}`;\n}\n\nexport function pascalCaseTransformMerge(input: string) {\n return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();\n}\n\nexport function pascalCase(input: string, options: Options = {}) {\n return noCase(input, {\n delimiter: \"\",\n transform: pascalCaseTransform,\n ...options,\n });\n}\n","import {\n pascalCase,\n pascalCaseTransform,\n pascalCaseTransformMerge,\n Options,\n} from \"pascal-case\";\n\nexport { Options };\n\nexport function camelCaseTransform(input: string, index: number) {\n if (index === 0) return input.toLowerCase();\n return pascalCaseTransform(input, index);\n}\n\nexport function camelCaseTransformMerge(input: string, index: number) {\n if (index === 0) return input.toLowerCase();\n return pascalCaseTransformMerge(input);\n}\n\nexport function camelCase(input: string, options: Options = {}) {\n return pascalCase(input, {\n transform: camelCaseTransform,\n ...options,\n });\n}\n","/**\n * External dependencies\n */\nimport { camelCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport { fetchDownloadableBlocks, receiveDownloadableBlocks } from './actions';\n\nexport const getDownloadableBlocks =\n\t( filterValue ) =>\n\tasync ( { dispatch } ) => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispatch( fetchDownloadableBlocks( filterValue ) );\n\t\t\tconst results = await apiFetch( {\n\t\t\t\tpath: `wp/v2/block-directory/search?term=${ filterValue }`,\n\t\t\t} );\n\t\t\tconst blocks = results.map( ( result ) =>\n\t\t\t\tObject.fromEntries(\n\t\t\t\t\tObject.entries( result ).map( ( [ key, value ] ) => [\n\t\t\t\t\t\tcamelCase( key ),\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t] )\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tdispatch( receiveDownloadableBlocks( blocks, filterValue ) );\n\t\t} catch {}\n\t};\n","/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as resolvers from './resolvers';\n\n/**\n * Module Constants\n */\nconst STORE_NAME = 'core/block-directory';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n\tresolvers,\n};\n\n/**\n * Store definition for the block directory namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\n\nregister( store );\n","/**\n * WordPress dependencies\n */\nimport { unregisterBlockType } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function AutoBlockUninstaller() {\n\tconst { uninstallBlockType } = useDispatch( blockDirectoryStore );\n\n\tconst shouldRemoveBlockTypes = useSelect( ( select ) => {\n\t\tconst { isAutosavingPost, isSavingPost } = select( editorStore );\n\t\treturn isSavingPost() && ! isAutosavingPost();\n\t}, [] );\n\n\tconst unusedBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getUnusedBlockTypes(),\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldRemoveBlockTypes && unusedBlockTypes.length ) {\n\t\t\tunusedBlockTypes.forEach( ( blockType ) => {\n\t\t\t\tuninstallBlockType( blockType );\n\t\t\t\tunregisterBlockType( blockType.name );\n\t\t\t} );\n\t\t}\n\t}, [ shouldRemoveBlockTypes ] );\n\n\treturn null;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"compose\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"htmlEntities\"];","/**\n * WordPress dependencies\n */\nimport { cloneElement } from '@wordpress/element';\n\n/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */\n\n/**\n * Return an SVG icon.\n *\n * @param {IconProps} props icon is the SVG component to render\n * size is a number specifiying the icon size in pixels\n * Other props will be passed to wrapped SVG component\n *\n * @return {JSX.Element} Icon component\n */\nfunction Icon( { icon, size = 24, ...props } ) {\n\treturn cloneElement( icon, {\n\t\twidth: size,\n\t\theight: size,\n\t\t...props,\n\t} );\n}\n\nexport default Icon;\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starFilled = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z\" />\n\t</SVG>\n);\n\nexport default starFilled;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starHalf = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z\" />\n\t</SVG>\n);\n\nexport default starHalf;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starEmpty = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path\n\t\t\tfillRule=\"evenodd\"\n\t\t\td=\"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z\"\n\t\t\tclipRule=\"evenodd\"\n\t\t/>\n\t</SVG>\n);\n\nexport default starEmpty;\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Icon, starEmpty, starFilled, starHalf } from '@wordpress/icons';\n\nfunction Stars( { rating } ) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tconst fullStarCount = Math.floor( rating );\n\tconst halfStarCount = Math.ceil( rating - fullStarCount );\n\tconst emptyStarCount = 5 - ( fullStarCount + halfStarCount );\n\n\treturn (\n\t\t<span\n\t\t\taria-label={ sprintf(\n\t\t\t\t/* translators: %s: number of stars. */\n\t\t\t\t__( '%s out of 5 stars' ),\n\t\t\t\tstars\n\t\t\t) }\n\t\t>\n\t\t\t{ Array.from( { length: fullStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `full_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-full\"\n\t\t\t\t\ticon={ starFilled }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ Array.from( { length: halfStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `half_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-half-full\"\n\t\t\t\t\ticon={ starHalf }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ Array.from( { length: emptyStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `empty_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-empty\"\n\t\t\t\t\ticon={ starEmpty }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</span>\n\t);\n}\n\nexport default Stars;\n","/**\n * Internal dependencies\n */\nimport Stars from './stars';\n\nexport const BlockRatings = ( { rating } ) => (\n\t<span className=\"block-directory-block-ratings\">\n\t\t<Stars rating={ rating } />\n\t</span>\n);\n\nexport default BlockRatings;\n","/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\n\nfunction DownloadableBlockIcon( { icon } ) {\n\tconst className = 'block-directory-downloadable-block-icon';\n\treturn icon.match( /\\.(jpeg|jpg|gif|png|svg)(?:\\?.*)?$/ ) !== null ? (\n\t\t<img className={ className } src={ icon } alt=\"\" />\n\t) : (\n\t\t<BlockIcon className={ className } icon={ icon } showColors />\n\t);\n}\n\nexport default DownloadableBlockIcon;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport const DownloadableBlockNotice = ( { block } ) => {\n\tconst errorNotice = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockDirectoryStore ).getErrorNoticeForBlock( block.id ),\n\t\t[ block ]\n\t);\n\n\tif ( ! errorNotice ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"block-directory-downloadable-block-notice\">\n\t\t\t<div className=\"block-directory-downloadable-block-notice__content\">\n\t\t\t\t{ errorNotice.message }\n\t\t\t\t{ errorNotice.isFatal\n\t\t\t\t\t? ' ' + __( 'Try reloading the page.' )\n\t\t\t\t\t: null }\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default DownloadableBlockNotice;\n","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tSpinner,\n\tVisuallyHidden,\n\t__unstableCompositeItem as CompositeItem,\n} from '@wordpress/components';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockRatings from '../block-ratings';\nimport DownloadableBlockIcon from '../downloadable-block-icon';\nimport DownloadableBlockNotice from '../downloadable-block-notice';\nimport { store as blockDirectoryStore } from '../../store';\n\n// Return the appropriate block item label, given the block data and status.\nfunction getDownloadableBlockLabel(\n\t{ title, rating, ratingCount },\n\t{ hasNotice, isInstalled, isInstalling }\n) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tif ( ! isInstalled && hasNotice ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Retry installing %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalled ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Add %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalling ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Installing %s.', decodeEntities( title ) );\n\t}\n\n\t// No ratings yet, just use the title.\n\tif ( ratingCount < 1 ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Install %s.', decodeEntities( title ) );\n\t}\n\n\treturn sprintf(\n\t\t/* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */\n\t\t_n(\n\t\t\t'Install %1$s. %2$s stars with %3$s review.',\n\t\t\t'Install %1$s. %2$s stars with %3$s reviews.',\n\t\t\tratingCount\n\t\t),\n\t\tdecodeEntities( title ),\n\t\tstars,\n\t\tratingCount\n\t);\n}\n\nfunction DownloadableBlockListItem( { composite, item, onClick } ) {\n\tconst { author, description, icon, rating, title } = item;\n\t// getBlockType returns a block object if this block exists, or null if not.\n\tconst isInstalled = !! getBlockType( item.name );\n\n\tconst { hasNotice, isInstalling, isInstallable } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getErrorNoticeForBlock, isInstalling: isBlockInstalling } =\n\t\t\t\tselect( blockDirectoryStore );\n\t\t\tconst notice = getErrorNoticeForBlock( item.id );\n\t\t\tconst hasFatal = notice && notice.isFatal;\n\t\t\treturn {\n\t\t\t\thasNotice: !! notice,\n\t\t\t\tisInstalling: isBlockInstalling( item.id ),\n\t\t\t\tisInstallable: ! hasFatal,\n\t\t\t};\n\t\t},\n\t\t[ item ]\n\t);\n\n\tlet statusText = '';\n\tif ( isInstalled ) {\n\t\tstatusText = __( 'Installed!' );\n\t} else if ( isInstalling ) {\n\t\tstatusText = __( 'Installing…' );\n\t}\n\n\treturn (\n\t\t<CompositeItem\n\t\t\t__experimentalIsFocusable\n\t\t\trole=\"option\"\n\t\t\tas={ Button }\n\t\t\t{ ...composite }\n\t\t\tclassName=\"block-directory-downloadable-block-list-item\"\n\t\t\tonClick={ ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick();\n\t\t\t} }\n\t\t\tisBusy={ isInstalling }\n\t\t\tdisabled={ isInstalling || ! isInstallable }\n\t\t\tlabel={ getDownloadableBlockLabel( item, {\n\t\t\t\thasNotice,\n\t\t\t\tisInstalled,\n\t\t\t\tisInstalling,\n\t\t\t} ) }\n\t\t\tshowTooltip={ true }\n\t\t\ttooltipPosition=\"top center\"\n\t\t>\n\t\t\t<div className=\"block-directory-downloadable-block-list-item__icon\">\n\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\t\t\t\t{ isInstalling ? (\n\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__spinner\">\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockRatings rating={ rating } />\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<span className=\"block-directory-downloadable-block-list-item__details\">\n\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__title\">\n\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %1$s: block title, %2$s: author name. */\n\t\t\t\t\t\t\t__( '%1$s <span>by %2$s</span>' ),\n\t\t\t\t\t\t\tdecodeEntities( title ),\n\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__author\" />\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t\t{ hasNotice ? (\n\t\t\t\t\t<DownloadableBlockNotice block={ item } />\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__desc\">\n\t\t\t\t\t\t\t{ !! statusText\n\t\t\t\t\t\t\t\t? statusText\n\t\t\t\t\t\t\t\t: decodeEntities( description ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{ isInstallable &&\n\t\t\t\t\t\t\t! ( isInstalled || isInstalling ) && (\n\t\t\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t\t\t{ __( 'Install block' ) }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</CompositeItem>\n\t);\n}\n\nexport default DownloadableBlockListItem;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n} from '@wordpress/components';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockListItem from '../downloadable-block-list-item';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst noop = () => {};\n\nfunction DownloadableBlocksList( { items, onHover = noop, onSelect } ) {\n\tconst composite = useCompositeState();\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-directory-downloadable-blocks-list\"\n\t\t\taria-label={ __( 'Blocks available for install' ) }\n\t\t>\n\t\t\t{ items.map( ( item ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlockListItem\n\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t// Check if the block is registered (`getBlockType`\n\t\t\t\t\t\t\t// will return an object). If so, insert the block.\n\t\t\t\t\t\t\t// This prevents installing existing plugins.\n\t\t\t\t\t\t\tif ( getBlockType( item.name ) ) {\n\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tinstallBlockType( item ).then( ( success ) => {\n\t\t\t\t\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\titem={ item }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Composite>\n\t);\n}\n\nexport default DownloadableBlocksList;\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"a11y\"];","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\nfunction DownloadableBlocksInserterPanel( {\n\tchildren,\n\tdownloadableItems,\n\thasLocalBlocks,\n} ) {\n\tconst count = downloadableItems.length;\n\tuseEffect( () => {\n\t\tspeak(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %d: number of available blocks. */\n\t\t\t\t_n(\n\t\t\t\t\t'%d additional block is available to install.',\n\t\t\t\t\t'%d additional blocks are available to install.',\n\t\t\t\t\tcount\n\t\t\t\t),\n\t\t\t\tcount\n\t\t\t)\n\t\t);\n\t}, [ count ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! hasLocalBlocks && (\n\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t{ __( 'No results available from your installed blocks.' ) }\n\t\t\t\t</p>\n\t\t\t) }\n\n\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\n\t\t\t<div className=\"block-directory-downloadable-blocks-panel\">\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel__header\">\n\t\t\t\t\t<h2 className=\"block-directory-downloadable-blocks-panel__title\">\n\t\t\t\t\t\t{ __( 'Available to install' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__description\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Select a block to install and add it to your post.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksInserterPanel;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst blockDefault = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z\" />\n\t</SVG>\n);\n\nexport default blockDefault;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, blockDefault } from '@wordpress/icons';\nimport { Tip, ExternalLink } from '@wordpress/components';\n\nfunction DownloadableBlocksNoResults() {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"block-editor-inserter__no-results\">\n\t\t\t\t<Icon\n\t\t\t\t\tclassName=\"block-editor-inserter__no-results-icon\"\n\t\t\t\t\ticon={ blockDefault }\n\t\t\t\t/>\n\t\t\t\t<p>{ __( 'No results found.' ) }</p>\n\t\t\t</div>\n\t\t\t<div className=\"block-editor-inserter__tips\">\n\t\t\t\t<Tip>\n\t\t\t\t\t{ __( 'Interested in creating your own block?' ) }\n\t\t\t\t\t<br />\n\t\t\t\t\t<ExternalLink href=\"https://developer.wordpress.org/block-editor/\">\n\t\t\t\t\t\t{ __( 'Get started here' ) }.\n\t\t\t\t\t</ExternalLink>\n\t\t\t\t</Tip>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksNoResults;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Spinner } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksList from '../downloadable-blocks-list';\nimport DownloadableBlocksInserterPanel from './inserter-panel';\nimport DownloadableBlocksNoResults from './no-results';\nimport { store as blockDirectoryStore } from '../../store';\n\nfunction DownloadableBlocksPanel( {\n\tdownloadableItems,\n\tonSelect,\n\tonHover,\n\thasLocalBlocks,\n\thasPermission,\n\tisLoading,\n\tisTyping,\n} ) {\n\tif ( typeof hasPermission === 'undefined' || isLoading || isTyping ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ hasPermission && ! hasLocalBlocks && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'No results available from your installed blocks.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel has-blocks-loading\">\n\t\t\t\t\t<Spinner />\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( false === hasPermission ) {\n\t\tif ( ! hasLocalBlocks ) {\n\t\t\treturn <DownloadableBlocksNoResults />;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\treturn !! downloadableItems.length ? (\n\t\t<DownloadableBlocksInserterPanel\n\t\t\tdownloadableItems={ downloadableItems }\n\t\t\thasLocalBlocks={ hasLocalBlocks }\n\t\t>\n\t\t\t<DownloadableBlocksList\n\t\t\t\titems={ downloadableItems }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tonHover={ onHover }\n\t\t\t/>\n\t\t</DownloadableBlocksInserterPanel>\n\t) : (\n\t\t! hasLocalBlocks && <DownloadableBlocksNoResults />\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select, { filterValue, rootClientId = null } ) => {\n\t\tconst { getDownloadableBlocks, isRequestingDownloadableBlocks } =\n\t\t\tselect( blockDirectoryStore );\n\t\tconst { canInsertBlockType } = select( blockEditorStore );\n\n\t\tconst hasPermission = select( coreStore ).canUser(\n\t\t\t'read',\n\t\t\t'block-directory/search'\n\t\t);\n\n\t\tfunction getInstallableBlocks( term ) {\n\t\t\treturn getDownloadableBlocks( term ).filter( ( block ) =>\n\t\t\t\tcanInsertBlockType( block, rootClientId, true )\n\t\t\t);\n\t\t}\n\n\t\tconst downloadableItems = hasPermission\n\t\t\t? getInstallableBlocks( filterValue )\n\t\t\t: [];\n\t\tconst isLoading = isRequestingDownloadableBlocks( filterValue );\n\n\t\treturn {\n\t\t\tdownloadableItems,\n\t\t\thasPermission,\n\t\t\tisLoading,\n\t\t};\n\t} ),\n] )( DownloadableBlocksPanel );\n","/**\n * External dependencies\n */\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __unstableInserterMenuExtension } from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksPanel from '../../components/downloadable-blocks-panel';\n\nfunction InserterMenuDownloadableBlocksPanel() {\n\tconst [ debouncedFilterValue, setFilterValue ] = useState( '' );\n\tconst debouncedSetFilterValue = debounce( setFilterValue, 400 );\n\n\treturn (\n\t\t<__unstableInserterMenuExtension>\n\t\t\t{ ( {\n\t\t\t\tonSelect,\n\t\t\t\tonHover,\n\t\t\t\tfilterValue,\n\t\t\t\thasItems,\n\t\t\t\trootClientId,\n\t\t\t} ) => {\n\t\t\t\tif ( debouncedFilterValue !== filterValue ) {\n\t\t\t\t\tdebouncedSetFilterValue( filterValue );\n\t\t\t\t}\n\n\t\t\t\tif ( ! debouncedFilterValue ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlocksPanel\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tfilterValue={ debouncedFilterValue }\n\t\t\t\t\t\thasLocalBlocks={ hasItems }\n\t\t\t\t\t\tisTyping={ filterValue !== debouncedFilterValue }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</__unstableInserterMenuExtension>\n\t);\n}\n\nexport default InserterMenuDownloadableBlocksPanel;\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editPost\"];","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockIcon from '../downloadable-block-icon';\n\nexport default function CompactList( { items } ) {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul className=\"block-directory-compact-list\">\n\t\t\t{ items.map( ( { icon, id, title, author } ) => (\n\t\t\t\t<li key={ id } className=\"block-directory-compact-list__item\">\n\t\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\n\t\t\t\t\t<div className=\"block-directory-compact-list__item-details\">\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-title\">\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-author\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Name of the block author. */\n\t\t\t\t\t\t\t\t__( 'By %s' ),\n\t\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { PluginPrePublishPanel } from '@wordpress/edit-post';\nimport { useSelect } from '@wordpress/data';\nimport { blockDefault } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport CompactList from '../../components/compact-list';\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstalledBlocksPrePublishPanel() {\n\tconst newBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getNewBlockTypes(),\n\t\t[]\n\t);\n\n\tif ( ! newBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PluginPrePublishPanel\n\t\t\ticon={ blockDefault }\n\t\t\ttitle={ sprintf(\n\t\t\t\t// translators: %d: number of blocks (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Added: %d block',\n\t\t\t\t\t'Added: %d blocks',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t),\n\t\t\t\tnewBlockTypes.length\n\t\t\t) }\n\t\t\tinitialOpen={ true }\n\t\t>\n\t\t\t<p className=\"installed-blocks-pre-publish-panel__copy\">\n\t\t\t\t{ _n(\n\t\t\t\t\t'The following block has been added to your site.',\n\t\t\t\t\t'The following blocks have been added to your site.',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<CompactList items={ newBlockTypes } />\n\t\t</PluginPrePublishPanel>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t\t\t__( 'Install %s' ),\n\t\t\t\tblock.title\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType } from '@wordpress/blocks';\nimport { RawHTML } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport InstallButton from './install-button';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst getInstallMissing = ( OriginalComponent ) => ( props ) => {\n\tconst { originalName } = props.attributes;\n\t// Disable reason: This is a valid component, but it's mistaken for a callback.\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst { block, hasPermission } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getDownloadableBlocks } = select( blockDirectoryStore );\n\t\t\tconst blocks = getDownloadableBlocks(\n\t\t\t\t'block:' + originalName\n\t\t\t).filter( ( { name } ) => originalName === name );\n\t\t\treturn {\n\t\t\t\thasPermission: select( coreStore ).canUser(\n\t\t\t\t\t'read',\n\t\t\t\t\t'block-directory/search'\n\t\t\t\t),\n\t\t\t\tblock: blocks.length && blocks[ 0 ],\n\t\t\t};\n\t\t},\n\t\t[ originalName ]\n\t);\n\n\t// The user can't install blocks, or the block isn't available for download.\n\tif ( ! hasPermission || ! block ) {\n\t\treturn <OriginalComponent { ...props } />;\n\t}\n\n\treturn <ModifiedWarning { ...props } originalBlock={ block } />;\n};\n\nconst ModifiedWarning = ( { originalBlock, ...props } ) => {\n\tconst { originalName, originalUndelimitedContent } = props.attributes;\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst convertToHTML = () => {\n\t\treplaceBlock(\n\t\t\tprops.clientId,\n\t\t\tcreateBlock( 'core/html', {\n\t\t\t\tcontent: originalUndelimitedContent,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst hasContent = !! originalUndelimitedContent;\n\tconst hasHTMLBlock = getBlockType( 'core/html' );\n\n\tlet messageHTML = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__(\n\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'\n\t\t),\n\t\toriginalBlock.title || originalName\n\t);\n\tconst actions = [\n\t\t<InstallButton\n\t\t\tkey=\"install\"\n\t\t\tblock={ originalBlock }\n\t\t\tattributes={ props.attributes }\n\t\t\tclientId={ props.clientId }\n\t\t/>,\n\t];\n\n\tif ( hasContent && hasHTMLBlock ) {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'\n\t\t\t),\n\t\t\toriginalBlock.title || originalName\n\t\t);\n\t\tactions.push(\n\t\t\t<Button key=\"convert\" onClick={ convertToHTML } variant=\"link\">\n\t\t\t\t{ __( 'Keep as HTML' ) }\n\t\t\t</Button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div { ...useBlockProps() }>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ originalUndelimitedContent }</RawHTML>\n\t\t</div>\n\t);\n};\n\nexport default getInstallMissing;\n","/**\n * WordPress dependencies\n */\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport AutoBlockUninstaller from '../components/auto-block-uninstaller';\nimport InserterMenuDownloadableBlocksPanel from './inserter-menu-downloadable-blocks-panel';\nimport InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel';\nimport getInstallMissing from './get-install-missing';\n\nregisterPlugin( 'block-directory', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<AutoBlockUninstaller />\n\t\t\t\t<InserterMenuDownloadableBlocksPanel />\n\t\t\t\t<InstalledBlocksPrePublishPanel />\n\t\t\t</>\n\t\t);\n\t},\n} );\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-directory/fallback',\n\t( settings, name ) => {\n\t\tif ( name !== 'core/missing' ) {\n\t\t\treturn settings;\n\t\t}\n\t\tsettings.edit = getInstallMissing( settings.edit );\n\n\t\treturn settings;\n\t}\n);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","combineReducers","downloadableBlocks","state","action","type","filterValue","isRequesting","results","blockManagement","installedBlockTypes","isInstalling","item","filter","blockType","name","blockId","errorNotices","message","isFatal","restState","hasBlockType","blocks","length","some","i","innerBlocks","isRequestingDownloadableBlocks","getDownloadableBlocks","getInstalledBlockTypes","getNewBlockTypes","createRegistrySelector","select","usedBlockTree","blockEditorStore","getBlocks","getUnusedBlockTypes","getErrorNotices","getErrorNoticeForBlock","loadAsset","el","Promise","resolve","reject","newNode","document","createElement","nodeName","forEach","attr","innerHTML","appendChild","createTextNode","onload","onerror","Error","body","toLowerCase","src","getPluginUrl","block","link","links","self","href","fetchDownloadableBlocks","receiveDownloadableBlocks","installBlockType","async","registry","dispatch","id","success","clearErrorNotice","setIsInstalling","url","apiFetch","method","data","status","path","slug","_links","addInstalledBlockType","metadataFields","addQueryArgs","_fields","catch","then","response","unstable__bootstrapServerSideBlockDefinitions","pick","location","parse","text","doc","DOMParser","parseFromString","newAssets","Array","from","querySelectorAll","asset","getElementById","newAsset","loadAssets","blocksStore","getBlockTypes","__","noticesStore","createInfoNotice","sprintf","title","speak","error","fatalAPIErrors","folder_exists","unable_to_connect_to_filesystem","code","setErrorNotice","createErrorNotice","isDismissible","uninstallBlockType","removeInstalledBlockType","__assign","assign","t","s","n","arguments","p","apply","this","lowerCase","str","create","DEFAULT_SPLIT_REGEXP","DEFAULT_STRIP_REGEXP","replace","input","re","RegExp","reduce","pascalCaseTransform","index","firstChar","charAt","lowerChars","substr","toUpperCase","pascalCase","options","splitRegexp","stripRegexp","transform","delimiter","result","start","end","slice","split","map","join","noCase","camelCaseTransform","fromEntries","entries","storeConfig","reducer","selectors","actions","resolvers","store","createReduxStore","AutoBlockUninstaller","useDispatch","blockDirectoryStore","shouldRemoveBlockTypes","useSelect","isAutosavingPost","isSavingPost","editorStore","unusedBlockTypes","useEffect","unregisterBlockType","register","_extends","target","source","icon","size","props","cloneElement","width","height","SVG","xmlns","viewBox","Path","fillRule","clipRule","rating","stars","Math","round","fullStarCount","floor","halfStarCount","ceil","emptyStarCount","_","className","starFilled","starHalf","starEmpty","match","alt","BlockIcon","showColors","errorNotice","getDownloadableBlockLabel","ratingCount","hasNotice","isInstalled","decodeEntities","_n","composite","onClick","author","description","getBlockType","isInstallable","isBlockInstalling","notice","hasFatal","statusText","__experimentalIsFocusable","role","as","Button","event","preventDefault","isBusy","disabled","label","showTooltip","tooltipPosition","Spinner","createInterpolateElement","span","VisuallyHidden","noop","items","onHover","onSelect","useCompositeState","children","downloadableItems","hasLocalBlocks","count","blockDefault","Tip","ExternalLink","compose","withSelect","rootClientId","canInsertBlockType","hasPermission","coreStore","canUser","isLoading","isTyping","debouncedFilterValue","setFilterValue","useState","debouncedSetFilterValue","debounce","__unstableInserterMenuExtension","hasItems","CompactList","InstalledBlocksPrePublishPanel","newBlockTypes","PluginPrePublishPanel","initialOpen","InstallButton","attributes","clientId","isInstallingBlock","replaceBlock","originalBlock","originalContent","createBlock","variant","ModifiedWarning","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","messageHTML","push","content","useBlockProps","Warning","RawHTML","registerPlugin","render","addFilter","settings","edit","OriginalComponent"],"sourceRoot":""}
1
+ {"version":3,"file":"./build/block-directory/index.min.js","mappings":"mBACA,IAAIA,EAAsB,CCA1B,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLR,EAAwB,CAACI,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,CAACM,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClF,EAAyBT,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,wkBCLvD,MAAM,EAA+BC,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAS,MCAnD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAU,OCsG1D,GAAeC,EAAAA,EAAAA,iBAAiB,CAC/BC,mBA1FiC,WAA0B,IAAxBC,EAAwB,uDAAhB,GAAIC,EAAY,uCAC3D,OAASA,EAAOC,MACf,IAAK,4BACJ,MAAO,IACHF,EACH,CAAEC,EAAOE,aAAe,CACvBC,cAAc,IAGjB,IAAK,8BACJ,MAAO,IACHJ,EACH,CAAEC,EAAOE,aAAe,CACvBE,QAASJ,EAAOF,mBAChBK,cAAc,IAIlB,OAAOJ,GAyEPM,gBA9D8B,WAM1B,IALJN,EAKI,uDALI,CACPO,oBAAqB,GACrBC,aAAc,IAEfP,EACI,uCACJ,OAASA,EAAOC,MACf,IAAK,2BACJ,MAAO,IACHF,EACHO,oBAAqB,IACjBP,EAAMO,oBACTN,EAAOQ,OAGV,IAAK,8BACJ,MAAO,IACHT,EACHO,oBAAqBP,EAAMO,oBAAoBG,QAC5CC,GAAeA,EAAUC,OAASX,EAAOQ,KAAKG,QAGnD,IAAK,uBACJ,MAAO,IACHZ,EACHQ,aAAc,IACVR,EAAMQ,aACT,CAAEP,EAAOY,SAAWZ,EAAOO,eAI/B,OAAOR,GA+BPc,aApB2B,WAA0B,IAAxBd,EAAwB,uDAAhB,GAAIC,EAAY,uCACrD,OAASA,EAAOC,MACf,IAAK,mBACJ,MAAO,IACHF,EACH,CAAEC,EAAOY,SAAW,CACnBE,QAASd,EAAOc,QAChBC,QAASf,EAAOe,UAGnB,IAAK,qBACJ,MAAQ,CAAEf,EAAOY,SAAWA,KAAYI,GAAcjB,EACtD,OAAOiB,EAET,OAAOjB,KCnGF,EAA+BH,OAAW,GAAe,YCShD,SAASqB,EAAcP,GAAyB,IAAdQ,EAAc,uDAAL,GACzD,IAAOA,EAAOC,OACb,OAAO,EAER,GAAKD,EAAOE,MAAM,QAAE,KAAET,GAAJ,SAAgBA,IAASD,EAAUC,QACpD,OAAO,EAER,IAAM,IAAIU,EAAI,EAAGA,EAAIH,EAAOC,OAAQE,IACnC,GAAKJ,EAAcP,EAAWQ,EAAQG,GAAIC,aACzC,OAAO,EAIT,OAAO,ECHD,SAASC,EAAgCxB,EAAOG,GAAc,QACpE,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCC,oBAAhD,SAWM,SAASqB,EAAuBzB,EAAOG,GAAc,QAC3D,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCE,eAAhD,QAA2D,GAWrD,SAASqB,EAAwB1B,GACvC,OAAOA,EAAMM,gBAAgBC,oBAWvB,MAAMoB,GAAmBC,EAAAA,EAAAA,yBAC7BC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QAAUC,GACpCO,EAAcP,EAAWmB,QAafG,GAAsBL,EAAAA,EAAAA,yBAChCC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QACxBC,IAAiBO,EAAcP,EAAWmB,QAaxC,SAAStB,EAAcR,EAAOa,GACpC,OAAOb,EAAMM,gBAAgBE,aAAcK,KAAa,EAUlD,SAASqB,EAAiBlC,GAChC,OAAOA,EAAMc,aAWP,SAASqB,EAAwBnC,EAAOa,GAC9C,OAAOb,EAAMc,aAAcD,GCrH5B,MAAM,EAA+BhB,OAAe,OCA9C,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAY,S,aCA5D,MAAM,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAO,ICe1CuC,EAAcC,GACnB,IAAIC,SAAS,CAAEC,EAASC,KAK9B,MAAMC,EAAUC,SAASC,cAAeN,EAAGO,UAE3C,CAAE,KAAM,MAAO,MAAO,OAAQ,QAASC,SAAWC,IAC5CT,EAAIS,KACRL,EAASK,GAAST,EAAIS,OAKnBT,EAAGU,WACPN,EAAQO,YAAaN,SAASO,eAAgBZ,EAAGU,YAGlDN,EAAQS,OAAS,IAAMX,GAAS,GAChCE,EAAQU,QAAU,IAAMX,EAAQ,IAAIY,MAAO,yBAE3CV,SAASW,KAAKL,YAAaP,IAI1B,SAAWA,EAAQG,SAASU,eAC1B,WAAab,EAAQG,SAASU,gBAAmBb,EAAQc,MAE3DhB,OCrCY,SAASiB,EAAcC,GACrC,IAAOA,EACN,OAAO,EAER,MAAMC,EAAOD,EAAME,MAAO,cAAiBF,EAAME,MAAMC,KACvD,SAAKF,IAAQA,EAAKtC,SACVsC,EAAM,GAAIG,KCkBZ,SAASC,EAAyB3D,GACxC,MAAO,CAAED,KAAM,4BAA6BC,YAAAA,GAYtC,SAAS4D,EAA2BhE,EAAoBI,GAC9D,MAAO,CACND,KAAM,8BACNH,mBAAAA,EACAI,YAAAA,GAWK,MAAM6D,EACVP,GACFQ,MAAAA,IAAoC,IAA5B,SAAEC,EAAF,SAAYC,GAAgB,EACnC,MAAM,GAAEC,EAAF,KAAMxD,GAAS6C,EACrB,IAAIY,GAAU,EACdF,EAASG,iBAAkBF,GAC3B,IACCD,EAASI,gBAAiBH,GAAI,GAG9B,MAAMI,EAAMhB,EAAcC,GAC1B,IAAIE,EAAQ,GACPa,QACEC,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,YASjBjB,SANuBc,GAAAA,CAAU,CAChCC,OAAQ,OACRG,KAAM,gBACNF,KAAM,CAAEG,KAAMV,EAAIQ,OAAQ,aAGVG,OAGlBZ,EAASa,sBAAuB,IAC5BvB,EACHE,MAAO,IAAKF,EAAME,SAAUA,KAI7B,MAAMsB,EAAiB,CACtB,cACA,QACA,WACA,SACA,OACA,cACA,WACA,aACA,mBACA,eACA,WACA,SACA,UACA,cAsBD,SApBMR,GAAAA,CAAU,CACfI,MAAMK,EAAAA,EAAAA,cAAe,sBAAsBtE,IAAS,CACnDuE,QAASF,MAITG,OAAO,SACPC,MAAQC,IACDA,IAGPC,EAAAA,EAAAA,+CAA+C,CAC9C,CAAE3E,IAAQ4E,EAAAA,EAAAA,MAAMF,EAAUL,cFrEzBhB,iBAQN,MAAMqB,QAAiBb,GAAAA,CAAU,CAChCD,IAAK9B,SAAS+C,SAAS5B,KACvB6B,OAAO,IAGFf,QAAaW,EAASK,OAEtBC,GAAM,IAAI/F,OAAOgG,WAAYC,gBAAiBnB,EAAM,aAEpDoB,EAAYC,MAAMC,KACvBL,EAAIM,iBAAkB,kCACrBxF,QAAUyF,GAAWA,EAAM/B,KAAQ1B,SAAS0D,eAAgBD,EAAM/B,MAMpE,IAAM,MAAMiC,KAAYN,QACjB3D,EAAWiE,GE+CVC,IACmBpC,EACvBrC,OAAQ0E,EAAAA,OACRC,gBACsBnF,MAAQC,GAAOA,EAAEV,OAASA,IACjD,MAAM,IAAIwC,OACTqD,EAAAA,EAAAA,IAAI,qDAINvC,EAASC,SAAUuC,EAAAA,OAAeC,kBACjCC,EAAAA,EAAAA;CAECH,EAAAA,EAAAA,IAAI,iCACJhD,EAAMoD,OAEP,CACCC,OAAO,EACP5G,KAAM,aAGRmE,GAAU,EACT,MAAQ0C,GACT,IAAIhG,EAAUgG,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,sBAG/BzF,EAAU+F,aAAiB3D,MAG/B,MAAM4D,EAAiB,CACtBC,eAAeR,EAAAA,EAAAA,IACd,4DAEDS,iCAAiCT,EAAAA,EAAAA,IAChC,mEAIGO,EAAgBD,EAAMI,QAC1BnG,GAAU,EACVD,EAAUiG,EAAgBD,EAAMI,OAGjChD,EAASiD,eAAgBhD,EAAIrD,EAASC,GACtCkD,EAASC,SAAUuC,EAAAA,OAAeW,kBAAmBtG,EAAS,CAC7D+F,OAAO,EACPQ,eAAe,IAIjB,OADAnD,EAASI,gBAAiBH,GAAI,GACvBC,GAQIkD,EACV9D,GACFQ,MAAAA,IAAoC,IAA5B,SAAEC,EAAF,SAAYC,GAAgB,EACnC,IACC,MAAMK,EAAMhB,EAAcC,SACpBgB,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,oBAEXH,GAAAA,CAAU,CACfC,OAAQ,SACRF,IAAAA,IAEDL,EAASqD,yBAA0B/D,GAClC,MAAQsD,GACT7C,EACEC,SAAUuC,EAAAA,OACVW,kBACAN,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,yBAanB,SAASzB,EAAuBvE,GACtC,MAAO,CACNP,KAAM,2BACNO,KAAAA,GAYK,SAAS+G,EAA0B/G,GACzC,MAAO,CACNP,KAAM,8BACNO,KAAAA,GAYK,SAAS8D,EAAiB1D,EAASL,GACzC,MAAO,CACNN,KAAM,uBACNW,QAAAA,EACAL,aAAAA,GAaK,SAAS4G,EAAgBvG,EAASE,GAA2B,IAAlBC,EAAkB,wDACnE,MAAO,CACNd,KAAM,mBACNW,QAAAA,EACAE,QAAAA,EACAC,QAAAA,GAWK,SAASsD,EAAkBzD,GACjC,MAAO,CACNX,KAAM,qBACNW,QAAAA,GC1PK,IAAI4G,EAAW,WAQlB,OAPAA,EAAWxI,OAAOyI,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGtG,EAAI,EAAGuG,EAAIC,UAAU1G,OAAQE,EAAIuG,EAAGvG,IAE5C,IAAK,IAAIyG,KADTH,EAAIE,UAAUxG,GACOrC,OAAOM,UAAUC,eAAeC,KAAKmI,EAAGG,KAAIJ,EAAEI,GAAKH,EAAEG,IAE9E,OAAOJ,IAEKK,MAAMC,KAAMH,YCczB,SAASI,EAAUC,GACxB,OAAOA,EAAI7E,cDqDgBrE,OAAOmJ,OAsGXnJ,OAAOmJ,OEvMhC,IAAMC,EAAuB,CAAC,qBAAsB,wBAG9CC,EAAuB,eAgC7B,SAASC,EAAQC,EAAeC,EAAuB7I,GACrD,OAAI6I,aAAcC,OAAeF,EAAMD,QAAQE,EAAI7I,GAC5C6I,EAAGE,QAAO,SAACH,EAAOC,GAAO,OAAAD,EAAMD,QAAQE,EAAI7I,KAAQ4I,GC3CrD,SAASI,EAAoBJ,EAAeK,GACjD,IAAMC,EAAYN,EAAMO,OAAO,GACzBC,EAAaR,EAAMS,OAAO,GAAG3F,cACnC,OAAIuF,EAAQ,GAAKC,GAAa,KAAOA,GAAa,IACzC,IAAIA,EAAYE,EAElB,GAAGF,EAAUI,cAAgBF,EAO/B,SAASG,EAAWX,EAAeY,GACxC,YADwC,IAAAA,IAAAA,EAAA,IDCnC,SAAgBZ,EAAeY,QAAA,IAAAA,IAAAA,EAAA,IAiBpC,IAfE,MAIEA,EAAO,YAJTC,OAAW,IAAG,EAAAhB,EAAoB,EAClC,EAGEe,EAAO,YAHTE,OAAW,IAAG,EAAAhB,EAAoB,EAClC,EAEEc,EAAO,UAFTG,OAAS,IAAG,EAAArB,EAAS,EACrB,EACEkB,EAAO,UADTI,OAAS,IAAG,MAAG,EAGbC,EAASlB,EACXA,EAAQC,EAAOa,EAAa,UAC5BC,EACA,MAEEI,EAAQ,EACRC,EAAMF,EAAOrI,OAGe,OAAzBqI,EAAOV,OAAOW,IAAiBA,IACtC,KAAkC,OAA3BD,EAAOV,OAAOY,EAAM,IAAaA,IAGxC,OAAOF,EAAOG,MAAMF,EAAOC,GAAKE,MAAM,MAAMC,IAAIP,GAAWQ,KAAKP,GCrBzDQ,CAAOxB,EAAO,GACnBgB,UAAW,GACXD,UAAWX,GACRQ,ICZA,SAASa,EAAmBzB,EAAeK,GAChD,OAAc,IAAVA,EAAoBL,EAAMlF,cACvBsF,EAAoBJ,EAAOK,GCI7B,MAAMpH,EACVtB,GACF8D,MAAAA,IAA0B,IAAlB,SAAEE,GAAgB,EACzB,GAAOhE,EAIP,IACCgE,EAAUL,EAAyB3D,IAanCgE,EAAUJ,SAZYU,GAAAA,CAAU,CAC/BI,KAAO,qCAAqC1E,OAEtB2J,KAAOL,GAC7BxK,OAAOiL,YACNjL,OAAOkL,QAASV,GAASK,KAAK,QAAI/K,EAAKa,GAAT,QAAsB,EDV/B4I,ECWTzJ,ODXwB,IAAAqK,IAAAA,EAAA,IAChCD,EAAWX,EAAO,GACvBe,UAAWU,GACRb,KCSDxJ,GDZC,IAAmB4I,EAAeY,QCiBOjJ,IAC5C,SCZSiK,EAAc,CAC1BC,QAD0B,EAE1BC,UAF0B,EAG1BC,QAH0B,EAI1BC,UAASA,GAUGC,GAAQC,EAAAA,EAAAA,kBAvBF,uBAuBgCN,GC1BpC,SAASO,IACvB,MAAM,mBAAEpD,IAAuBqD,EAAAA,EAAAA,aAAaC,GAEtCC,GAAyBC,EAAAA,EAAAA,YAAalJ,IAC3C,MAAM,iBAAEmJ,EAAF,aAAoBC,GAAiBpJ,EAAQqJ,EAAAA,OACnD,OAAOD,MAAoBD,MACzB,IAEGG,GAAmBJ,EAAAA,EAAAA,YACtBlJ,GAAYA,EAAQgJ,GAAsB5I,uBAC5C,IAYD,OATAmJ,EAAAA,EAAAA,YAAW,KACLN,GAA0BK,EAAiB/J,QAC/C+J,EAAiBtI,SAAWlC,IAC3B4G,EAAoB5G,IACpB0K,EAAAA,EAAAA,qBAAqB1K,EAAUC,WAG/B,CAAEkK,IAEE,MDMRQ,EAAAA,EAAAA,UAAUb,GEzCV,MAAM,EAA+B5K,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAc,WCAxD,EAA+BA,OAAW,GAAY,SCA7C,SAAS0L,KAetB,OAdAA,GAAWtM,OAAOyI,QAAU,SAAU8D,GACpC,IAAK,IAAIlK,EAAI,EAAGA,EAAIwG,UAAU1G,OAAQE,IAAK,CACzC,IAAImK,EAAS3D,UAAUxG,GAEvB,IAAK,IAAIvC,KAAO0M,EACVxM,OAAOM,UAAUC,eAAeC,KAAKgM,EAAQ1M,KAC/CyM,EAAOzM,GAAO0M,EAAO1M,IAK3B,OAAOyM,IAGOxD,MAAMC,KAAMH,WCf9B,MAAM,GAA+BjI,OAAW,GAAgB,aCwBhE,GARA,YAA+C,IAAhC,KAAE6L,EAAF,KAAQC,EAAO,MAAOC,GAAU,EAC9C,OAAOC,EAAAA,EAAAA,cAAcH,EAAM,CAC1BI,MAAOH,EACPI,OAAQJ,KACLC,KCpBC,GAA+B/L,OAAW,GAAc,WCW9D,IALC,mBAAC,GAAAmM,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,GAAAC,KAAD,CAAMxN,EAAE,qVCIV,IALC,mBAAC,GAAAqN,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,GAAAC,KAAD,CAAMxN,EAAE,4dCQV,IATC,mBAAC,GAAAqN,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,GAAAC,KAAD,CACCC,SAAS,UACTzN,EAAE,+jBACF0N,SAAS,aCuCZ,GA3CA,YAA6B,IAAb,OAAEC,GAAW,EAC5B,MAAMC,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAE7BI,EAAgBF,KAAKG,MAAOL,GAC5BM,EAAgBJ,KAAKK,KAAMP,EAASI,GACpCI,EAAiB,GAAMJ,EAAgBE,GAE7C,OACC,2BACC,cAAahG,EAAAA,EAAAA;;CAEZH,EAAAA,EAAAA,IAAI,qBACJ8F,IAGCvG,MAAMC,KAAM,CAAE7E,OAAQsL,IAAkB5C,KAAK,CAAEiD,EAAGzL,KACnD,mBAAC,GAAD,CACCvC,IAAO,cAAcuC,IACrB0L,UAAU,2CACVtB,KAAOuB,GACPtB,KAAO,OAGP3F,MAAMC,KAAM,CAAE7E,OAAQwL,IAAkB9C,KAAK,CAAEiD,EAAGzL,KACnD,mBAAC,GAAD,CACCvC,IAAO,cAAcuC,IACrB0L,UAAU,gDACVtB,KAAOwB,GACPvB,KAAO,OAGP3F,MAAMC,KAAM,CAAE7E,OAAQ0L,IAAmBhD,KAAK,CAAEiD,EAAGzL,KACpD,mBAAC,GAAD,CACCvC,IAAO,eAAeuC,IACtB0L,UAAU,4CACVtB,KAAOyB,GACPxB,KAAO,SC/BZ,GAN4B,QAAE,OAAEW,GAAJ,SAC3B,2BAAMU,UAAU,kCACf,mBAAC,GAAD,CAAOV,OAASA,MCOlB,GATA,YAA2C,IAAX,KAAEZ,GAAS,EAC1C,MAAMsB,EAAY,0CAClB,OAA8D,OAAvDtB,EAAK0B,MAAO,uCAClB,0BAAKJ,UAAYA,EAAYzJ,IAAMmI,EAAO2B,IAAI,MAE9C,mBAAC,EAAAC,UAAD,CAAWN,UAAYA,EAAYtB,KAAOA,EAAO6B,YAAU,KCwB7D,GAvBuC,IAAiB,IAAf,MAAE9J,GAAa,EACvD,MAAM+J,GAAczC,EAAAA,EAAAA,YACjBlJ,GACDA,EAAQgJ,GAAsB1I,uBAAwBsB,EAAMW,KAC7D,CAAEX,IAGH,OAAO+J,GAKN,0BAAKR,UAAU,8CACd,0BAAKA,UAAU,sDACZQ,EAAYzM,QACZyM,EAAYxM,QACX,KAAMyF,EAAAA,EAAAA,IAAI,2BACV,OATE,MCKT,SAASgH,GAAT,KAGE,IAFD,MAAE5G,EAAF,OAASyF,EAAT,YAAiBoB,GAEhB,GADD,UAAEC,EAAF,YAAaC,EAAb,aAA0BpN,GACzB,EACD,MAAM+L,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAEnC,OAAOsB,GAAeD,GAEd/G,EAAAA,EAAAA,SAAS,wBAAwBiH,EAAAA,GAAAA,gBAAgBhH,IAGpD+G,GAEGhH,EAAAA,EAAAA,SAAS,WAAWiH,EAAAA,GAAAA,gBAAgBhH,IAGvCrG,GAEGoG,EAAAA,EAAAA,SAAS,kBAAkBiH,EAAAA,GAAAA,gBAAgBhH,IAI9C6G,EAAc,GAEX9G,EAAAA,EAAAA,SAAS,eAAeiH,EAAAA,GAAAA,gBAAgBhH,KAGzCD,EAAAA,EAAAA;;CAENkH,EAAAA,EAAAA,IACC,6CACA,8CACAJ,IAEDG,EAAAA,GAAAA,gBAAgBhH,GAChB0F,EACAmB,GAoGF,SAhGA,YAAmE,IAA/B,UAAEK,EAAF,KAAatN,EAAb,QAAmBuN,GAAY,EAClE,MAAM,OAAEC,EAAF,YAAUC,EAAV,KAAuBxC,EAAvB,OAA6BY,EAA7B,MAAqCzF,GAAUpG,EAE/CmN,KAAiBO,EAAAA,EAAAA,cAAc1N,EAAKG,OAEpC,UAAE+M,EAAF,aAAanN,EAAb,cAA2B4N,IAAkBrD,EAAAA,EAAAA,YAChDlJ,IACD,MAAM,uBAAEM,EAAwB3B,aAAc6N,GAC7CxM,EAAQgJ,GACHyD,EAASnM,EAAwB1B,EAAK2D,IACtCmK,EAAWD,GAAUA,EAAOtN,QAClC,MAAO,CACN2M,YAAcW,EACd9N,aAAc6N,EAAmB5N,EAAK2D,IACtCgK,eAAiBG,KAGnB,CAAE9N,IAGH,IAAI+N,EAAa,GAOjB,OANKZ,EACJY,GAAa/H,EAAAA,EAAAA,IAAI,cACNjG,IACXgO,GAAa/H,EAAAA,EAAAA,IAAI,iBAIjB,mBAAC,0BAAD,IACCgI,2BAAyB,EACzBC,KAAK,SACLC,GAAKC,EAAAA,QACAb,EAJN,CAKCf,UAAU,+CACVgB,QAAYa,IACXA,EAAMC,iBACNd,KAEDe,OAASvO,EACTwO,SAAWxO,IAAkB4N,EAC7Ba,MAAQxB,GAA2BhN,EAAM,CACxCkN,UAAAA,EACAC,YAAAA,EACApN,aAAAA,IAED0O,aAAc,EACdC,gBAAgB,gBAEhB,0BAAKnC,UAAU,uDACd,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO7E,MAAQA,IAC3CrG,GACD,2BAAMwM,UAAU,0DACf,mBAAC,EAAAoC,QAAD,QAGD,mBAAC,GAAD,CAAc9C,OAASA,MAGzB,2BAAMU,UAAU,0DACf,2BAAMA,UAAU,wDACbqC,EAAAA,EAAAA,2BACDzI,EAAAA,EAAAA;;CAECH,EAAAA,EAAAA,IAAI,8BACJoH,EAAAA,GAAAA,gBAAgBhH,GAChBoH,GAED,CACCqB,MACC,2BAAMtC,UAAU,4DAKlBW,GACD,mBAAC,GAAD,CAAyBlK,MAAQhD,KAEjC,oCACC,2BAAMuM,UAAU,sDACVwB,IAEFX,EAAAA,GAAAA,gBAAgBK,IAElBE,KACGR,GAAepN,KAClB,mBAAC,EAAA+O,eAAD,MACG9I,EAAAA,EAAAA,IAAI,sBCrIT+I,GAAO,OA8Cb,GA5CA,YAAuE,IAAtC,MAAEC,EAAF,QAASC,EAAUF,GAAnB,SAAyBG,GAAa,EACtE,MAAM5B,GAAY6B,EAAAA,EAAAA,gCACZ,iBAAE5L,IAAqB4G,EAAAA,EAAAA,aAAaC,GAE1C,OAAO4E,EAAMrO,QAKZ,mBAAC,sBAAD,MACM2M,EADN,CAECW,KAAK,UACL1B,UAAU,2CACV,cAAavG,EAAAA,EAAAA,IAAI,kCAEfgJ,EAAM3F,KAAOrJ,IAEb,mBAAC,GAAD,CACC1B,IAAM0B,EAAK2D,GACX2J,UAAYA,EACZC,QAAU,MAIJG,EAAAA,EAAAA,cAAc1N,EAAKG,MACvB+O,EAAUlP,GAEVuD,EAAkBvD,GAAO4E,MAAQhB,IAC3BA,GACJsL,EAAUlP,MAIbiP,EAAS,OAEVA,QAAUA,EACVjP,KAAOA,OA/BJ,MCxBH,GAA+BZ,OAAW,GAAQ,KCsDxD,GA/CA,YAII,IAJsC,SACzCgQ,EADyC,kBAEzCC,EAFyC,eAGzCC,GACG,EACH,MAAMC,EAAQF,EAAkB1O,OAehC,OAdAgK,EAAAA,EAAAA,YAAW,MACVtE,EAAAA,GAAAA,QACCF,EAAAA,EAAAA;;CAECkH,EAAAA,EAAAA,IACC,+CACA,iDACAkC,GAEDA,MAGA,CAAEA,KAGJ,oCACKD,IACH,wBAAG/C,UAAU,wDACVvG,EAAAA,EAAAA,IAAI,sDAIR,0BAAKuG,UAAU,qDAEf,0BAAKA,UAAU,8CACd,0BAAKA,UAAU,sDACd,yBAAIA,UAAU,qDACXvG,EAAAA,EAAAA,IAAI,0BAEP,wBAAGuG,UAAU,2DACVvG,EAAAA,EAAAA,IACD,wDAIDoJ,KCrCN,IALC,mBAAC,GAAA7D,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,GAAAC,KAAD,CAAMxN,EAAE,oLCuBV,GAvBA,WACC,OACC,oCACC,0BAAKqO,UAAU,sCACd,mBAAC,GAAD,CACCA,UAAU,yCACVtB,KAAOuE,MAER,6BAAKxJ,EAAAA,EAAAA,IAAI,wBAEV,0BAAKuG,UAAU,gCACd,mBAAC,EAAAkD,IAAD,MACGzJ,EAAAA,EAAAA,IAAI,2CACN,+BACA,mBAAC,EAAA0J,aAAD,CAActM,KAAK,kDAChB4C,EAAAA,EAAAA,IAAI,oBADP,SCkDL,IAAe2J,EAAAA,EAAAA,SAAS,EACvBC,EAAAA,EAAAA,aAAY,CAAExO,EAAF,KAAoD,IAA1C,YAAE1B,EAAF,aAAemQ,EAAe,MAAY,EAC/D,MAAM,sBAAE7O,EAAF,+BAAyBD,GAC9BK,EAAQgJ,IACH,mBAAE0F,GAAuB1O,EAAQE,EAAAA,OAEjCyO,EAAgB3O,EAAQ4O,EAAAA,OAAYC,QACzC,OACA,0BAcD,MAAO,CACNZ,kBANyBU,EALlB/O,EAMiBtB,GANaO,QAAU+C,GAC9C8M,EAAoB9M,EAAO6M,GAAc,KAMxC,GAKFE,cAAAA,EACAG,UALiBnP,EAAgCrB,QApBpD,EArDA,YAQI,IAR8B,kBACjC2P,EADiC,SAEjCH,EAFiC,QAGjCD,EAHiC,eAIjCK,EAJiC,cAKjCS,EALiC,UAMjCG,EANiC,SAOjCC,GACG,EACH,YAA8B,IAAlBJ,GAAiCG,GAAaC,GAExD,mCACGJ,IAAmBT,IACpB,oCACC,wBAAG/C,UAAU,wDACVvG,EAAAA,EAAAA,IACD,sDAGF,0BAAKuG,UAAU,sDAGjB,0BAAKA,UAAU,iEACd,mBAAC,EAAAoC,QAAD,SAMC,IAAUoB,EACPT,EAIA,MAHC,mBAAC,GAAD,MAMCD,EAAkB1O,QAC3B,mBAAC,GAAD,CACC0O,kBAAoBA,EACpBC,eAAiBA,IAEjB,mBAAC,GAAD,CACCN,MAAQK,EACRH,SAAWA,EACXD,QAAUA,MAIVK,IAAkB,mBAAC,GAAD,SCnBtB,GApCA,WACC,MAAQc,EAAsBC,IAAmBC,EAAAA,EAAAA,UAAU,IACrDC,GAA0BC,EAAAA,EAAAA,UAAUH,EAAgB,KAE1D,OACC,mBAAC,EAAAI,gCAAD,MACG,IAMK,IANH,SACHvB,EADG,QAEHD,EAFG,YAGHvP,EAHG,SAIHgR,EAJG,aAKHb,GACM,EAKN,OAJKO,IAAyB1Q,GAC7B6Q,EAAyB7Q,GAGnB0Q,GAKN,mBAAC,GAAD,CACClB,SAAWA,EACXD,QAAUA,EACVY,aAAeA,EACfnQ,YAAc0Q,EACdd,eAAiBoB,EACjBP,SAAWzQ,IAAgB0Q,IAVrB,SC9BN,GAA+BhR,OAAW,GAAY,SCU7C,SAASuR,GAAT,GAAkC,IAAZ,MAAE3B,GAAU,EAChD,OAAOA,EAAMrO,QAKZ,yBAAI4L,UAAU,gCACXyC,EAAM3F,KAAK,QAAE,KAAE4B,EAAF,GAAQtH,EAAR,MAAYyC,EAAZ,OAAmBoH,GAArB,SACZ,yBAAIlP,IAAMqF,EAAK4I,UAAU,uCACxB,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO7E,MAAQA,KAE7C,0BAAKmG,UAAU,+CACd,0BAAKA,UAAU,4CACZnG,IAEH,0BAAKmG,UAAU,8CACZpG,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,SACJwH,UAjBC,KCEM,SAASoD,KACvB,MAAMC,GAAgBvG,EAAAA,EAAAA,YACnBlJ,GAAYA,EAAQgJ,GAAsBlJ,oBAC5C,IAGD,OAAO2P,EAAclQ,QAKpB,mBAAC,GAAAmQ,sBAAD,CACC7F,KAAOuE,GACPpJ,OAAQD,EAAAA,EAAAA;CAEPkH,EAAAA,EAAAA,IACC,kBACA,mBACAwD,EAAclQ,QAEfkQ,EAAclQ,QAEfoQ,aAAc,IAEd,wBAAGxE,UAAU,6CACVc,EAAAA,EAAAA,IACD,mDACA,qDACAwD,EAAclQ,UAGhB,mBAACgQ,GAAD,CAAa3B,MAAQ6B,KAxBf,KCPM,SAASG,GAAT,GAA0D,IAAlC,WAAEC,EAAF,MAAcjO,EAAd,SAAqBkO,GAAa,EACxE,MAAMC,GAAoB7G,EAAAA,EAAAA,YACvBlJ,GAAYA,EAAQgJ,GAAsBrK,aAAciD,EAAMW,KAChE,CAAEX,EAAMW,MAEH,iBAAEJ,IAAqB4G,EAAAA,EAAAA,aAAaC,IACpC,aAAEgH,IAAiBjH,EAAAA,EAAAA,aAAa7I,EAAAA,OAEtC,OACC,mBAAC,EAAA6M,OAAD,CACCZ,QAAU,IACThK,EAAkBP,GAAQ4B,MAAQhB,IACjC,GAAKA,EAAU,CACd,MAAM1D,GAAYwN,EAAAA,EAAAA,cAAc1K,EAAM7C,OAC9BkR,IAAkBpM,EAAAA,EAAAA,OACzBgM,EAAWK,iBAEPD,GAAiBnR,GACrBkR,EACCF,GACAK,EAAAA,EAAAA,aACCrR,EAAUC,KACVkR,EAAcJ,WACdI,EAAcvQ,kBAOpByN,SAAW4C,EACX7C,OAAS6C,EACTK,QAAQ,YAENrL,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,cACJhD,EAAMoD,QC9BV,MA6BMqL,GAAkB,IAAmC,IAAjC,cAAEJ,KAAkBlG,GAAa,EAC1D,MAAM,aAAEuG,EAAF,2BAAgBC,EAAhB,SAA4CT,GACjD/F,EAAM8F,YACD,aAAEG,IAAiBjH,EAAAA,EAAAA,aAAa7I,EAAAA,OAUhCsQ,IAAgBD,EAChBE,GAAevH,EAAAA,EAAAA,YAClBlJ,IACD,MAAM,mBAAE0O,EAAF,qBAAsBgC,GAC3B1Q,EAAQE,EAAAA,OAET,OAAOwO,EACN,YACAgC,EAAsBZ,MAGxB,CAAEA,IAGH,IAAIa,GAAc5L,EAAAA,EAAAA;;CAEjBH,EAAAA,EAAAA,IACC,+GAEDqL,EAAcjL,OAASsL,GAExB,MAAM5H,EAAU,EACf,mBAACkH,GAAD,CACC1S,IAAI,UACJ0E,MAAQqO,EACRJ,WAAa9F,EAAM8F,WACnBC,SAAW/F,EAAM+F,YAmBnB,OAfKU,GAAcC,IAClBE,GAAc5L,EAAAA,EAAAA;;CAEbH,EAAAA,EAAAA,IACC,mJAEDqL,EAAcjL,OAASsL,GAExB5H,EAAQkI,MACP,mBAAC,EAAA7D,OAAD,CAAQ7P,IAAI,UAAUiP,QAhDF,KACrB6D,EACCjG,EAAM+F,UACNK,EAAAA,EAAAA,aAAa,YAAa,CACzBU,QAASN,MA4CsCH,QAAQ,SACrDxL,EAAAA,EAAAA,IAAI,oBAMR,0BAAUkM,EAAAA,EAAAA,kBACT,mBAAC,EAAAC,QAAD,CAASrI,QAAUA,GAAYiI,IAC/B,mBAAC,EAAAK,QAAD,KAAWT,MCjGdU,EAAAA,EAAAA,gBAAgB,kBAAmB,CAClCC,OAAM,KAEJ,oCACC,mBAACpI,EAAD,OACA,mBAAC,GAAD,OACA,mBAAC0G,GAAD,UAMJ2B,EAAAA,EAAAA,WACC,2BACA,4BACA,CAAEC,EAAUrS,KACX,MAAc,iBAATA,IAGLqS,EAASC,MDZiBC,ECYSF,EAASC,KDZOtH,IACpD,MAAM,aAAEuG,GAAiBvG,EAAM8F,YAGzB,MAAEjO,EAAF,cAAS+M,IAAkBzF,EAAAA,EAAAA,YAC9BlJ,IACD,MAAM,sBAAEJ,GAA0BI,EAAQgJ,GACpC1J,EAASM,EACd,SAAW0Q,GACVzR,QAAQ,QAAE,KAAEE,GAAJ,SAAgBuR,IAAiBvR,KAC3C,MAAO,CACN4P,cAAe3O,EAAQ4O,EAAAA,OAAYC,QAClC,OACA,0BAEDjN,MAAOtC,EAAOC,QAAUD,EAAQ,MAGlC,CAAEgR,IAIH,OAAO3B,GAAmB/M,GAInB,mBAACyO,GAAD,MAAsBtG,EAAtB,CAA8BkG,cAAgBrO,MAH7C,mBAAC0P,EAAuBvH,MCbvBqH,EDVkBE,IAAAA,M","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/compat get default export","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/runtime/make namespace object","webpack://wp/external window [\"wp\",\"element\"]","webpack://wp/external window [\"wp\",\"plugins\"]","webpack://wp/external window [\"wp\",\"hooks\"]","webpack://wp/external window [\"wp\",\"blocks\"]","webpack://wp/external window [\"wp\",\"data\"]","webpack://wp/external window [\"wp\",\"editor\"]","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/reducer.js","webpack://wp/external window [\"wp\",\"blockEditor\"]","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/has-block-type.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/selectors.js","webpack://wp/external window \"lodash\"","webpack://wp/external window [\"wp\",\"i18n\"]","webpack://wp/external window [\"wp\",\"apiFetch\"]","webpack://wp/external window [\"wp\",\"notices\"]","webpack://wp/external window [\"wp\",\"url\"]","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/load-assets.js","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/get-plugin-url.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/actions.js","webpack://wp/./node_modules/tslib/tslib.es6.js","webpack://wp/./node_modules/lower-case/src/index.ts","webpack://wp/./node_modules/no-case/src/index.ts","webpack://wp/./node_modules/pascal-case/src/index.ts","webpack://wp/./node_modules/camel-case/src/index.ts","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/resolvers.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/index.js","webpack://wp/./packages/block-directory/build-module/components/auto-block-uninstaller/@wordpress/block-directory/src/components/auto-block-uninstaller/index.js","webpack://wp/external window [\"wp\",\"compose\"]","webpack://wp/external window [\"wp\",\"components\"]","webpack://wp/external window [\"wp\",\"coreData\"]","webpack://wp/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://wp/external window [\"wp\",\"htmlEntities\"]","webpack://wp/./packages/icons/build-module/icon/@wordpress/icons/src/icon/index.js","webpack://wp/external window [\"wp\",\"primitives\"]","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-filled.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-half.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-empty.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/stars.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-icon/@wordpress/block-directory/src/components/downloadable-block-icon/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-notice/@wordpress/block-directory/src/components/downloadable-block-notice/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-list-item/@wordpress/block-directory/src/components/downloadable-block-list-item/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-list/@wordpress/block-directory/src/components/downloadable-blocks-list/index.js","webpack://wp/external window [\"wp\",\"a11y\"]","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/inserter-panel.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/block-default.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/no-results.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/@wordpress/block-directory/src/plugins/inserter-menu-downloadable-blocks-panel/index.js","webpack://wp/external window [\"wp\",\"editPost\"]","webpack://wp/./packages/block-directory/build-module/components/compact-list/@wordpress/block-directory/src/components/compact-list/index.js","webpack://wp/./packages/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/@wordpress/block-directory/src/plugins/installed-blocks-pre-publish-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/install-button.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/index.js","webpack://wp/./packages/block-directory/build-module/plugins/@wordpress/block-directory/src/plugins/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"plugins\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editor\"];","/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning an array of downloadable blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const downloadableBlocks = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'FETCH_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tisRequesting: true,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'RECEIVE_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tresults: action.downloadableBlocks,\n\t\t\t\t\tisRequesting: false,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer managing the installation and deletion of blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const blockManagement = (\n\tstate = {\n\t\tinstalledBlockTypes: [],\n\t\tisInstalling: {},\n\t},\n\taction\n) => {\n\tswitch ( action.type ) {\n\t\tcase 'ADD_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: [\n\t\t\t\t\t...state.installedBlockTypes,\n\t\t\t\t\taction.item,\n\t\t\t\t],\n\t\t\t};\n\t\tcase 'REMOVE_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: state.installedBlockTypes.filter(\n\t\t\t\t\t( blockType ) => blockType.name !== action.item.name\n\t\t\t\t),\n\t\t\t};\n\t\tcase 'SET_INSTALLING_BLOCK':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisInstalling: {\n\t\t\t\t\t...state.isInstalling,\n\t\t\t\t\t[ action.blockId ]: action.isInstalling,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer returning an object of error notices.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const errorNotices = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'SET_ERROR_NOTICE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.blockId ]: {\n\t\t\t\t\tmessage: action.message,\n\t\t\t\t\tisFatal: action.isFatal,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'CLEAR_ERROR_NOTICE':\n\t\t\tconst { [ action.blockId ]: blockId, ...restState } = state;\n\t\t\treturn restState;\n\t}\n\treturn state;\n};\n\nexport default combineReducers( {\n\tdownloadableBlocks,\n\tblockManagement,\n\terrorNotices,\n} );\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * Check if a block list contains a specific block type. Recursively searches\n * through `innerBlocks` if they exist.\n *\n * @param {Object} blockType A block object to search for.\n * @param {Object[]} blocks The list of blocks to look through.\n *\n * @return {boolean} Whether the blockType is found.\n */\nexport default function hasBlockType( blockType, blocks = [] ) {\n\tif ( ! blocks.length ) {\n\t\treturn false;\n\t}\n\tif ( blocks.some( ( { name } ) => name === blockType.name ) ) {\n\t\treturn true;\n\t}\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( hasBlockType( blockType, blocks[ i ].innerBlocks ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport hasBlockType from './utils/has-block-type';\n\n/**\n * Returns true if application is requesting for downloadable blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {boolean} Whether a request is in progress for the blocks list.\n */\nexport function isRequestingDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.isRequesting ?? false;\n}\n\n/**\n * Returns the available uninstalled blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {Array} Downloadable blocks.\n */\nexport function getDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.results ?? [];\n}\n\n/**\n * Returns the block types that have been installed on the server in this\n * session.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items\n */\nexport function getInstalledBlockTypes( state ) {\n\treturn state.blockManagement.installedBlockTypes;\n}\n\n/**\n * Returns block types that have been installed on the server and used in the\n * current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getNewBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter( ( blockType ) =>\n\t\t\thasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns the block types that have been installed on the server but are not\n * used in the current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getUnusedBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter(\n\t\t\t( blockType ) => ! hasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if a block plugin install is in progress.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId Id of the block.\n *\n * @return {boolean} Whether this block is currently being installed.\n */\nexport function isInstalling( state, blockId ) {\n\treturn state.blockManagement.isInstalling[ blockId ] || false;\n}\n\n/**\n * Returns all block error notices.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Object with error notices.\n */\nexport function getErrorNotices( state ) {\n\treturn state.errorNotices;\n}\n\n/**\n * Returns the error notice for a given block.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {string|boolean} The error text, or false if no error.\n */\nexport function getErrorNoticeForBlock( state, blockId ) {\n\treturn state.errorNotices[ blockId ];\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"lodash\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"apiFetch\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"notices\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Load an asset for a block.\n *\n * This function returns a Promise that will resolve once the asset is loaded,\n * or in the case of Stylesheets and Inline JavaScript, will resolve immediately.\n *\n * @param {HTMLElement} el A HTML Element asset to inject.\n *\n * @return {Promise} Promise which will resolve when the asset is loaded.\n */\nexport const loadAsset = ( el ) => {\n\treturn new Promise( ( resolve, reject ) => {\n\t\t/*\n\t\t * Reconstruct the passed element, this is required as inserting the Node directly\n\t\t * won't always fire the required onload events, even if the asset wasn't already loaded.\n\t\t */\n\t\tconst newNode = document.createElement( el.nodeName );\n\n\t\t[ 'id', 'rel', 'src', 'href', 'type' ].forEach( ( attr ) => {\n\t\t\tif ( el[ attr ] ) {\n\t\t\t\tnewNode[ attr ] = el[ attr ];\n\t\t\t}\n\t\t} );\n\n\t\t// Append inline <script> contents.\n\t\tif ( el.innerHTML ) {\n\t\t\tnewNode.appendChild( document.createTextNode( el.innerHTML ) );\n\t\t}\n\n\t\tnewNode.onload = () => resolve( true );\n\t\tnewNode.onerror = () => reject( new Error( 'Error loading asset.' ) );\n\n\t\tdocument.body.appendChild( newNode );\n\n\t\t// Resolve Stylesheets and Inline JavaScript immediately.\n\t\tif (\n\t\t\t'link' === newNode.nodeName.toLowerCase() ||\n\t\t\t( 'script' === newNode.nodeName.toLowerCase() && ! newNode.src )\n\t\t) {\n\t\t\tresolve();\n\t\t}\n\t} );\n};\n\n/**\n * Load the asset files for a block\n */\nexport async function loadAssets() {\n\t/*\n\t * Fetch the current URL (post-new.php, or post.php?post=1&action=edit) and compare the\n\t * JavaScript and CSS assets loaded between the pages. This imports the required assets\n\t * for the block into the current page while not requiring that we know them up-front.\n\t * In the future this can be improved by reliance upon block.json and/or a script-loader\n\t * dependency API.\n\t */\n\tconst response = await apiFetch( {\n\t\turl: document.location.href,\n\t\tparse: false,\n\t} );\n\n\tconst data = await response.text();\n\n\tconst doc = new window.DOMParser().parseFromString( data, 'text/html' );\n\n\tconst newAssets = Array.from(\n\t\tdoc.querySelectorAll( 'link[rel=\"stylesheet\"],script' )\n\t).filter( ( asset ) => asset.id && ! document.getElementById( asset.id ) );\n\n\t/*\n\t * Load each asset in order, as they may depend upon an earlier loaded script.\n\t * Stylesheets and Inline Scripts will resolve immediately upon insertion.\n\t */\n\tfor ( const newAsset of newAssets ) {\n\t\tawait loadAsset( newAsset );\n\t}\n}\n","/**\n * Get the plugin's direct API link out of a block-directory response.\n *\n * @param {Object} block The block object\n *\n * @return {string} The plugin URL, if exists.\n */\nexport default function getPluginUrl( block ) {\n\tif ( ! block ) {\n\t\treturn false;\n\t}\n\tconst link = block.links[ 'wp:plugin' ] || block.links.self;\n\tif ( link && link.length ) {\n\t\treturn link[ 0 ].href;\n\t}\n\treturn false;\n}\n","/**\n * External dependencies\n */\nimport { pick } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tstore as blocksStore,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n} from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { loadAssets } from './load-assets';\nimport getPluginUrl from './utils/get-plugin-url';\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been requested and are loading.\n *\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function fetchDownloadableBlocks( filterValue ) {\n\treturn { type: 'FETCH_DOWNLOADABLE_BLOCKS', filterValue };\n}\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been updated.\n *\n * @param {Array} downloadableBlocks Downloadable blocks.\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function receiveDownloadableBlocks( downloadableBlocks, filterValue ) {\n\treturn {\n\t\ttype: 'RECEIVE_DOWNLOADABLE_BLOCKS',\n\t\tdownloadableBlocks,\n\t\tfilterValue,\n\t};\n}\n\n/**\n * Action triggered to install a block plugin.\n *\n * @param {Object} block The block item returned by search.\n *\n * @return {boolean} Whether the block was successfully installed & loaded.\n */\nexport const installBlockType =\n\t( block ) =>\n\tasync ( { registry, dispatch } ) => {\n\t\tconst { id, name } = block;\n\t\tlet success = false;\n\t\tdispatch.clearErrorNotice( id );\n\t\ttry {\n\t\t\tdispatch.setIsInstalling( id, true );\n\n\t\t\t// If we have a wp:plugin link, the plugin is installed but inactive.\n\t\t\tconst url = getPluginUrl( block );\n\t\t\tlet links = {};\n\t\t\tif ( url ) {\n\t\t\t\tawait apiFetch( {\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\turl,\n\t\t\t\t\tdata: { status: 'active' },\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tconst response = await apiFetch( {\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tpath: 'wp/v2/plugins',\n\t\t\t\t\tdata: { slug: id, status: 'active' },\n\t\t\t\t} );\n\t\t\t\t// Add the `self` link for newly-installed blocks.\n\t\t\t\tlinks = response._links;\n\t\t\t}\n\n\t\t\tdispatch.addInstalledBlockType( {\n\t\t\t\t...block,\n\t\t\t\tlinks: { ...block.links, ...links },\n\t\t\t} );\n\n\t\t\t// Ensures that the block metadata is propagated to the editor when registered on the server.\n\t\t\tconst metadataFields = [\n\t\t\t\t'api_version',\n\t\t\t\t'title',\n\t\t\t\t'category',\n\t\t\t\t'parent',\n\t\t\t\t'icon',\n\t\t\t\t'description',\n\t\t\t\t'keywords',\n\t\t\t\t'attributes',\n\t\t\t\t'provides_context',\n\t\t\t\t'uses_context',\n\t\t\t\t'supports',\n\t\t\t\t'styles',\n\t\t\t\t'example',\n\t\t\t\t'variations',\n\t\t\t];\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: addQueryArgs( `/wp/v2/block-types/${ name }`, {\n\t\t\t\t\t_fields: metadataFields,\n\t\t\t\t} ),\n\t\t\t} )\n\t\t\t\t// Ignore when the block is not registered on the server.\n\t\t\t\t.catch( () => {} )\n\t\t\t\t.then( ( response ) => {\n\t\t\t\t\tif ( ! response ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tunstable__bootstrapServerSideBlockDefinitions( {\n\t\t\t\t\t\t[ name ]: pick( response, metadataFields ),\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\tawait loadAssets();\n\t\t\tconst registeredBlocks = registry\n\t\t\t\t.select( blocksStore )\n\t\t\t\t.getBlockTypes();\n\t\t\tif ( ! registeredBlocks.some( ( i ) => i.name === name ) ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t__( 'Error registering block. Try reloading the page.' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tregistry.dispatch( noticesStore ).createInfoNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s is the block title.\n\t\t\t\t\t__( 'Block %s installed and added.' ),\n\t\t\t\t\tblock.title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tspeak: true,\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\tsuccess = true;\n\t\t} catch ( error ) {\n\t\t\tlet message = error.message || __( 'An error occurred.' );\n\n\t\t\t// Errors we throw are fatal.\n\t\t\tlet isFatal = error instanceof Error;\n\n\t\t\t// Specific API errors that are fatal.\n\t\t\tconst fatalAPIErrors = {\n\t\t\t\tfolder_exists: __(\n\t\t\t\t\t'This block is already installed. Try reloading the page.'\n\t\t\t\t),\n\t\t\t\tunable_to_connect_to_filesystem: __(\n\t\t\t\t\t'Error installing block. You can reload the page and try again.'\n\t\t\t\t),\n\t\t\t};\n\n\t\t\tif ( fatalAPIErrors[ error.code ] ) {\n\t\t\t\tisFatal = true;\n\t\t\t\tmessage = fatalAPIErrors[ error.code ];\n\t\t\t}\n\n\t\t\tdispatch.setErrorNotice( id, message, isFatal );\n\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( message, {\n\t\t\t\tspeak: true,\n\t\t\t\tisDismissible: true,\n\t\t\t} );\n\t\t}\n\t\tdispatch.setIsInstalling( id, false );\n\t\treturn success;\n\t};\n\n/**\n * Action triggered to uninstall a block plugin.\n *\n * @param {Object} block The blockType object.\n */\nexport const uninstallBlockType =\n\t( block ) =>\n\tasync ( { registry, dispatch } ) => {\n\t\ttry {\n\t\t\tconst url = getPluginUrl( block );\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'PUT',\n\t\t\t\turl,\n\t\t\t\tdata: { status: 'inactive' },\n\t\t\t} );\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\turl,\n\t\t\t} );\n\t\t\tdispatch.removeInstalledBlockType( block );\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\terror.message || __( 'An error occurred.' )\n\t\t\t\t);\n\t\t}\n\t};\n\n/**\n * Returns an action object used to add a block type to the \"newly installed\"\n * tracking list.\n *\n * @param {Object} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function addInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'ADD_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to remove a block type from the \"newly installed\"\n * tracking list.\n *\n * @param {string} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function removeInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'REMOVE_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to indicate install in progress.\n *\n * @param {string} blockId\n * @param {boolean} isInstalling\n *\n * @return {Object} Action object.\n */\nexport function setIsInstalling( blockId, isInstalling ) {\n\treturn {\n\t\ttype: 'SET_INSTALLING_BLOCK',\n\t\tblockId,\n\t\tisInstalling,\n\t};\n}\n\n/**\n * Sets an error notice to be displayed to the user for a given block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n * @param {string} message The message shown in the notice.\n * @param {boolean} isFatal Whether the user can recover from the error.\n *\n * @return {Object} Action object.\n */\nexport function setErrorNotice( blockId, message, isFatal = false ) {\n\treturn {\n\t\ttype: 'SET_ERROR_NOTICE',\n\t\tblockId,\n\t\tmessage,\n\t\tisFatal,\n\t};\n}\n\n/**\n * Sets the error notice to empty for specific block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {Object} Action object.\n */\nexport function clearErrorNotice( blockId ) {\n\treturn {\n\t\ttype: 'CLEAR_ERROR_NOTICE',\n\t\tblockId,\n\t};\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","/**\n * Locale character mapping rules.\n */\ninterface Locale {\n regexp: RegExp;\n map: Record<string, string>;\n}\n\n/**\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n */\nconst SUPPORTED_LOCALE: Record<string, Locale> = {\n tr: {\n regexp: /\\u0130|\\u0049|\\u0049\\u0307/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n az: {\n regexp: /\\u0130/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n lt: {\n regexp: /\\u0049|\\u004A|\\u012E|\\u00CC|\\u00CD|\\u0128/g,\n map: {\n I: \"\\u0069\\u0307\",\n J: \"\\u006A\\u0307\",\n Į: \"\\u012F\\u0307\",\n Ì: \"\\u0069\\u0307\\u0300\",\n Í: \"\\u0069\\u0307\\u0301\",\n Ĩ: \"\\u0069\\u0307\\u0303\",\n },\n },\n};\n\n/**\n * Localized lower case.\n */\nexport function localeLowerCase(str: string, locale: string) {\n const lang = SUPPORTED_LOCALE[locale.toLowerCase()];\n if (lang) return lowerCase(str.replace(lang.regexp, (m) => lang.map[m]));\n return lowerCase(str);\n}\n\n/**\n * Lower case as a function.\n */\nexport function lowerCase(str: string) {\n return str.toLowerCase();\n}\n","import { lowerCase } from \"lower-case\";\n\nexport interface Options {\n splitRegexp?: RegExp | RegExp[];\n stripRegexp?: RegExp | RegExp[];\n delimiter?: string;\n transform?: (part: string, index: number, parts: string[]) => string;\n}\n\n// Support camel case (\"camelCase\" -> \"camel Case\" and \"CAMELCase\" -> \"CAMEL Case\").\nconst DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];\n\n// Remove all non-word characters.\nconst DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n\n/**\n * Normalize the string into something other libraries can manipulate easier.\n */\nexport function noCase(input: string, options: Options = {}) {\n const {\n splitRegexp = DEFAULT_SPLIT_REGEXP,\n stripRegexp = DEFAULT_STRIP_REGEXP,\n transform = lowerCase,\n delimiter = \" \",\n } = options;\n\n let result = replace(\n replace(input, splitRegexp, \"$1\\0$2\"),\n stripRegexp,\n \"\\0\"\n );\n let start = 0;\n let end = result.length;\n\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\") start++;\n while (result.charAt(end - 1) === \"\\0\") end--;\n\n // Transform each token independently.\n return result.slice(start, end).split(\"\\0\").map(transform).join(delimiter);\n}\n\n/**\n * Replace `re` in the input string with the replacement value.\n */\nfunction replace(input: string, re: RegExp | RegExp[], value: string) {\n if (re instanceof RegExp) return input.replace(re, value);\n return re.reduce((input, re) => input.replace(re, value), input);\n}\n","import { noCase, Options } from \"no-case\";\n\nexport { Options };\n\nexport function pascalCaseTransform(input: string, index: number) {\n const firstChar = input.charAt(0);\n const lowerChars = input.substr(1).toLowerCase();\n if (index > 0 && firstChar >= \"0\" && firstChar <= \"9\") {\n return `_${firstChar}${lowerChars}`;\n }\n return `${firstChar.toUpperCase()}${lowerChars}`;\n}\n\nexport function pascalCaseTransformMerge(input: string) {\n return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();\n}\n\nexport function pascalCase(input: string, options: Options = {}) {\n return noCase(input, {\n delimiter: \"\",\n transform: pascalCaseTransform,\n ...options,\n });\n}\n","import {\n pascalCase,\n pascalCaseTransform,\n pascalCaseTransformMerge,\n Options,\n} from \"pascal-case\";\n\nexport { Options };\n\nexport function camelCaseTransform(input: string, index: number) {\n if (index === 0) return input.toLowerCase();\n return pascalCaseTransform(input, index);\n}\n\nexport function camelCaseTransformMerge(input: string, index: number) {\n if (index === 0) return input.toLowerCase();\n return pascalCaseTransformMerge(input);\n}\n\nexport function camelCase(input: string, options: Options = {}) {\n return pascalCase(input, {\n transform: camelCaseTransform,\n ...options,\n });\n}\n","/**\n * External dependencies\n */\nimport { camelCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport { fetchDownloadableBlocks, receiveDownloadableBlocks } from './actions';\n\nexport const getDownloadableBlocks =\n\t( filterValue ) =>\n\tasync ( { dispatch } ) => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispatch( fetchDownloadableBlocks( filterValue ) );\n\t\t\tconst results = await apiFetch( {\n\t\t\t\tpath: `wp/v2/block-directory/search?term=${ filterValue }`,\n\t\t\t} );\n\t\t\tconst blocks = results.map( ( result ) =>\n\t\t\t\tObject.fromEntries(\n\t\t\t\t\tObject.entries( result ).map( ( [ key, value ] ) => [\n\t\t\t\t\t\tcamelCase( key ),\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t] )\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tdispatch( receiveDownloadableBlocks( blocks, filterValue ) );\n\t\t} catch {}\n\t};\n","/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as resolvers from './resolvers';\n\n/**\n * Module Constants\n */\nconst STORE_NAME = 'core/block-directory';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n\tresolvers,\n};\n\n/**\n * Store definition for the block directory namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\n\nregister( store );\n","/**\n * WordPress dependencies\n */\nimport { unregisterBlockType } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function AutoBlockUninstaller() {\n\tconst { uninstallBlockType } = useDispatch( blockDirectoryStore );\n\n\tconst shouldRemoveBlockTypes = useSelect( ( select ) => {\n\t\tconst { isAutosavingPost, isSavingPost } = select( editorStore );\n\t\treturn isSavingPost() && ! isAutosavingPost();\n\t}, [] );\n\n\tconst unusedBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getUnusedBlockTypes(),\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldRemoveBlockTypes && unusedBlockTypes.length ) {\n\t\t\tunusedBlockTypes.forEach( ( blockType ) => {\n\t\t\t\tuninstallBlockType( blockType );\n\t\t\t\tunregisterBlockType( blockType.name );\n\t\t\t} );\n\t\t}\n\t}, [ shouldRemoveBlockTypes ] );\n\n\treturn null;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"compose\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"htmlEntities\"];","/**\n * WordPress dependencies\n */\nimport { cloneElement } from '@wordpress/element';\n\n/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */\n\n/**\n * Return an SVG icon.\n *\n * @param {IconProps} props icon is the SVG component to render\n * size is a number specifiying the icon size in pixels\n * Other props will be passed to wrapped SVG component\n *\n * @return {JSX.Element} Icon component\n */\nfunction Icon( { icon, size = 24, ...props } ) {\n\treturn cloneElement( icon, {\n\t\twidth: size,\n\t\theight: size,\n\t\t...props,\n\t} );\n}\n\nexport default Icon;\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starFilled = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z\" />\n\t</SVG>\n);\n\nexport default starFilled;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starHalf = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z\" />\n\t</SVG>\n);\n\nexport default starHalf;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starEmpty = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path\n\t\t\tfillRule=\"evenodd\"\n\t\t\td=\"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z\"\n\t\t\tclipRule=\"evenodd\"\n\t\t/>\n\t</SVG>\n);\n\nexport default starEmpty;\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Icon, starEmpty, starFilled, starHalf } from '@wordpress/icons';\n\nfunction Stars( { rating } ) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tconst fullStarCount = Math.floor( rating );\n\tconst halfStarCount = Math.ceil( rating - fullStarCount );\n\tconst emptyStarCount = 5 - ( fullStarCount + halfStarCount );\n\n\treturn (\n\t\t<span\n\t\t\taria-label={ sprintf(\n\t\t\t\t/* translators: %s: number of stars. */\n\t\t\t\t__( '%s out of 5 stars' ),\n\t\t\t\tstars\n\t\t\t) }\n\t\t>\n\t\t\t{ Array.from( { length: fullStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `full_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-full\"\n\t\t\t\t\ticon={ starFilled }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ Array.from( { length: halfStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `half_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-half-full\"\n\t\t\t\t\ticon={ starHalf }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ Array.from( { length: emptyStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `empty_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-empty\"\n\t\t\t\t\ticon={ starEmpty }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</span>\n\t);\n}\n\nexport default Stars;\n","/**\n * Internal dependencies\n */\nimport Stars from './stars';\n\nexport const BlockRatings = ( { rating } ) => (\n\t<span className=\"block-directory-block-ratings\">\n\t\t<Stars rating={ rating } />\n\t</span>\n);\n\nexport default BlockRatings;\n","/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\n\nfunction DownloadableBlockIcon( { icon } ) {\n\tconst className = 'block-directory-downloadable-block-icon';\n\treturn icon.match( /\\.(jpeg|jpg|gif|png|svg)(?:\\?.*)?$/ ) !== null ? (\n\t\t<img className={ className } src={ icon } alt=\"\" />\n\t) : (\n\t\t<BlockIcon className={ className } icon={ icon } showColors />\n\t);\n}\n\nexport default DownloadableBlockIcon;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport const DownloadableBlockNotice = ( { block } ) => {\n\tconst errorNotice = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockDirectoryStore ).getErrorNoticeForBlock( block.id ),\n\t\t[ block ]\n\t);\n\n\tif ( ! errorNotice ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"block-directory-downloadable-block-notice\">\n\t\t\t<div className=\"block-directory-downloadable-block-notice__content\">\n\t\t\t\t{ errorNotice.message }\n\t\t\t\t{ errorNotice.isFatal\n\t\t\t\t\t? ' ' + __( 'Try reloading the page.' )\n\t\t\t\t\t: null }\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default DownloadableBlockNotice;\n","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tSpinner,\n\tVisuallyHidden,\n\t__unstableCompositeItem as CompositeItem,\n} from '@wordpress/components';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockRatings from '../block-ratings';\nimport DownloadableBlockIcon from '../downloadable-block-icon';\nimport DownloadableBlockNotice from '../downloadable-block-notice';\nimport { store as blockDirectoryStore } from '../../store';\n\n// Return the appropriate block item label, given the block data and status.\nfunction getDownloadableBlockLabel(\n\t{ title, rating, ratingCount },\n\t{ hasNotice, isInstalled, isInstalling }\n) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tif ( ! isInstalled && hasNotice ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Retry installing %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalled ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Add %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalling ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Installing %s.', decodeEntities( title ) );\n\t}\n\n\t// No ratings yet, just use the title.\n\tif ( ratingCount < 1 ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Install %s.', decodeEntities( title ) );\n\t}\n\n\treturn sprintf(\n\t\t/* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */\n\t\t_n(\n\t\t\t'Install %1$s. %2$s stars with %3$s review.',\n\t\t\t'Install %1$s. %2$s stars with %3$s reviews.',\n\t\t\tratingCount\n\t\t),\n\t\tdecodeEntities( title ),\n\t\tstars,\n\t\tratingCount\n\t);\n}\n\nfunction DownloadableBlockListItem( { composite, item, onClick } ) {\n\tconst { author, description, icon, rating, title } = item;\n\t// getBlockType returns a block object if this block exists, or null if not.\n\tconst isInstalled = !! getBlockType( item.name );\n\n\tconst { hasNotice, isInstalling, isInstallable } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getErrorNoticeForBlock, isInstalling: isBlockInstalling } =\n\t\t\t\tselect( blockDirectoryStore );\n\t\t\tconst notice = getErrorNoticeForBlock( item.id );\n\t\t\tconst hasFatal = notice && notice.isFatal;\n\t\t\treturn {\n\t\t\t\thasNotice: !! notice,\n\t\t\t\tisInstalling: isBlockInstalling( item.id ),\n\t\t\t\tisInstallable: ! hasFatal,\n\t\t\t};\n\t\t},\n\t\t[ item ]\n\t);\n\n\tlet statusText = '';\n\tif ( isInstalled ) {\n\t\tstatusText = __( 'Installed!' );\n\t} else if ( isInstalling ) {\n\t\tstatusText = __( 'Installing…' );\n\t}\n\n\treturn (\n\t\t<CompositeItem\n\t\t\t__experimentalIsFocusable\n\t\t\trole=\"option\"\n\t\t\tas={ Button }\n\t\t\t{ ...composite }\n\t\t\tclassName=\"block-directory-downloadable-block-list-item\"\n\t\t\tonClick={ ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick();\n\t\t\t} }\n\t\t\tisBusy={ isInstalling }\n\t\t\tdisabled={ isInstalling || ! isInstallable }\n\t\t\tlabel={ getDownloadableBlockLabel( item, {\n\t\t\t\thasNotice,\n\t\t\t\tisInstalled,\n\t\t\t\tisInstalling,\n\t\t\t} ) }\n\t\t\tshowTooltip={ true }\n\t\t\ttooltipPosition=\"top center\"\n\t\t>\n\t\t\t<div className=\"block-directory-downloadable-block-list-item__icon\">\n\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\t\t\t\t{ isInstalling ? (\n\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__spinner\">\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockRatings rating={ rating } />\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<span className=\"block-directory-downloadable-block-list-item__details\">\n\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__title\">\n\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %1$s: block title, %2$s: author name. */\n\t\t\t\t\t\t\t__( '%1$s <span>by %2$s</span>' ),\n\t\t\t\t\t\t\tdecodeEntities( title ),\n\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__author\" />\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t\t{ hasNotice ? (\n\t\t\t\t\t<DownloadableBlockNotice block={ item } />\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__desc\">\n\t\t\t\t\t\t\t{ !! statusText\n\t\t\t\t\t\t\t\t? statusText\n\t\t\t\t\t\t\t\t: decodeEntities( description ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{ isInstallable &&\n\t\t\t\t\t\t\t! ( isInstalled || isInstalling ) && (\n\t\t\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t\t\t{ __( 'Install block' ) }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</CompositeItem>\n\t);\n}\n\nexport default DownloadableBlockListItem;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n} from '@wordpress/components';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockListItem from '../downloadable-block-list-item';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst noop = () => {};\n\nfunction DownloadableBlocksList( { items, onHover = noop, onSelect } ) {\n\tconst composite = useCompositeState();\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-directory-downloadable-blocks-list\"\n\t\t\taria-label={ __( 'Blocks available for install' ) }\n\t\t>\n\t\t\t{ items.map( ( item ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlockListItem\n\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t// Check if the block is registered (`getBlockType`\n\t\t\t\t\t\t\t// will return an object). If so, insert the block.\n\t\t\t\t\t\t\t// This prevents installing existing plugins.\n\t\t\t\t\t\t\tif ( getBlockType( item.name ) ) {\n\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tinstallBlockType( item ).then( ( success ) => {\n\t\t\t\t\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\titem={ item }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Composite>\n\t);\n}\n\nexport default DownloadableBlocksList;\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"a11y\"];","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\nfunction DownloadableBlocksInserterPanel( {\n\tchildren,\n\tdownloadableItems,\n\thasLocalBlocks,\n} ) {\n\tconst count = downloadableItems.length;\n\tuseEffect( () => {\n\t\tspeak(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %d: number of available blocks. */\n\t\t\t\t_n(\n\t\t\t\t\t'%d additional block is available to install.',\n\t\t\t\t\t'%d additional blocks are available to install.',\n\t\t\t\t\tcount\n\t\t\t\t),\n\t\t\t\tcount\n\t\t\t)\n\t\t);\n\t}, [ count ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! hasLocalBlocks && (\n\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t{ __( 'No results available from your installed blocks.' ) }\n\t\t\t\t</p>\n\t\t\t) }\n\n\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\n\t\t\t<div className=\"block-directory-downloadable-blocks-panel\">\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel__header\">\n\t\t\t\t\t<h2 className=\"block-directory-downloadable-blocks-panel__title\">\n\t\t\t\t\t\t{ __( 'Available to install' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__description\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Select a block to install and add it to your post.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksInserterPanel;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst blockDefault = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z\" />\n\t</SVG>\n);\n\nexport default blockDefault;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, blockDefault } from '@wordpress/icons';\nimport { Tip, ExternalLink } from '@wordpress/components';\n\nfunction DownloadableBlocksNoResults() {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"block-editor-inserter__no-results\">\n\t\t\t\t<Icon\n\t\t\t\t\tclassName=\"block-editor-inserter__no-results-icon\"\n\t\t\t\t\ticon={ blockDefault }\n\t\t\t\t/>\n\t\t\t\t<p>{ __( 'No results found.' ) }</p>\n\t\t\t</div>\n\t\t\t<div className=\"block-editor-inserter__tips\">\n\t\t\t\t<Tip>\n\t\t\t\t\t{ __( 'Interested in creating your own block?' ) }\n\t\t\t\t\t<br />\n\t\t\t\t\t<ExternalLink href=\"https://developer.wordpress.org/block-editor/\">\n\t\t\t\t\t\t{ __( 'Get started here' ) }.\n\t\t\t\t\t</ExternalLink>\n\t\t\t\t</Tip>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksNoResults;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Spinner } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksList from '../downloadable-blocks-list';\nimport DownloadableBlocksInserterPanel from './inserter-panel';\nimport DownloadableBlocksNoResults from './no-results';\nimport { store as blockDirectoryStore } from '../../store';\n\nfunction DownloadableBlocksPanel( {\n\tdownloadableItems,\n\tonSelect,\n\tonHover,\n\thasLocalBlocks,\n\thasPermission,\n\tisLoading,\n\tisTyping,\n} ) {\n\tif ( typeof hasPermission === 'undefined' || isLoading || isTyping ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ hasPermission && ! hasLocalBlocks && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'No results available from your installed blocks.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel has-blocks-loading\">\n\t\t\t\t\t<Spinner />\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( false === hasPermission ) {\n\t\tif ( ! hasLocalBlocks ) {\n\t\t\treturn <DownloadableBlocksNoResults />;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\treturn !! downloadableItems.length ? (\n\t\t<DownloadableBlocksInserterPanel\n\t\t\tdownloadableItems={ downloadableItems }\n\t\t\thasLocalBlocks={ hasLocalBlocks }\n\t\t>\n\t\t\t<DownloadableBlocksList\n\t\t\t\titems={ downloadableItems }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tonHover={ onHover }\n\t\t\t/>\n\t\t</DownloadableBlocksInserterPanel>\n\t) : (\n\t\t! hasLocalBlocks && <DownloadableBlocksNoResults />\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select, { filterValue, rootClientId = null } ) => {\n\t\tconst { getDownloadableBlocks, isRequestingDownloadableBlocks } =\n\t\t\tselect( blockDirectoryStore );\n\t\tconst { canInsertBlockType } = select( blockEditorStore );\n\n\t\tconst hasPermission = select( coreStore ).canUser(\n\t\t\t'read',\n\t\t\t'block-directory/search'\n\t\t);\n\n\t\tfunction getInstallableBlocks( term ) {\n\t\t\treturn getDownloadableBlocks( term ).filter( ( block ) =>\n\t\t\t\tcanInsertBlockType( block, rootClientId, true )\n\t\t\t);\n\t\t}\n\n\t\tconst downloadableItems = hasPermission\n\t\t\t? getInstallableBlocks( filterValue )\n\t\t\t: [];\n\t\tconst isLoading = isRequestingDownloadableBlocks( filterValue );\n\n\t\treturn {\n\t\t\tdownloadableItems,\n\t\t\thasPermission,\n\t\t\tisLoading,\n\t\t};\n\t} ),\n] )( DownloadableBlocksPanel );\n","/**\n * WordPress dependencies\n */\nimport { __unstableInserterMenuExtension } from '@wordpress/block-editor';\nimport { debounce } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksPanel from '../../components/downloadable-blocks-panel';\n\nfunction InserterMenuDownloadableBlocksPanel() {\n\tconst [ debouncedFilterValue, setFilterValue ] = useState( '' );\n\tconst debouncedSetFilterValue = debounce( setFilterValue, 400 );\n\n\treturn (\n\t\t<__unstableInserterMenuExtension>\n\t\t\t{ ( {\n\t\t\t\tonSelect,\n\t\t\t\tonHover,\n\t\t\t\tfilterValue,\n\t\t\t\thasItems,\n\t\t\t\trootClientId,\n\t\t\t} ) => {\n\t\t\t\tif ( debouncedFilterValue !== filterValue ) {\n\t\t\t\t\tdebouncedSetFilterValue( filterValue );\n\t\t\t\t}\n\n\t\t\t\tif ( ! debouncedFilterValue ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlocksPanel\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tfilterValue={ debouncedFilterValue }\n\t\t\t\t\t\thasLocalBlocks={ hasItems }\n\t\t\t\t\t\tisTyping={ filterValue !== debouncedFilterValue }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</__unstableInserterMenuExtension>\n\t);\n}\n\nexport default InserterMenuDownloadableBlocksPanel;\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editPost\"];","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockIcon from '../downloadable-block-icon';\n\nexport default function CompactList( { items } ) {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul className=\"block-directory-compact-list\">\n\t\t\t{ items.map( ( { icon, id, title, author } ) => (\n\t\t\t\t<li key={ id } className=\"block-directory-compact-list__item\">\n\t\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\n\t\t\t\t\t<div className=\"block-directory-compact-list__item-details\">\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-title\">\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-author\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Name of the block author. */\n\t\t\t\t\t\t\t\t__( 'By %s' ),\n\t\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { PluginPrePublishPanel } from '@wordpress/edit-post';\nimport { useSelect } from '@wordpress/data';\nimport { blockDefault } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport CompactList from '../../components/compact-list';\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstalledBlocksPrePublishPanel() {\n\tconst newBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getNewBlockTypes(),\n\t\t[]\n\t);\n\n\tif ( ! newBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PluginPrePublishPanel\n\t\t\ticon={ blockDefault }\n\t\t\ttitle={ sprintf(\n\t\t\t\t// translators: %d: number of blocks (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Added: %d block',\n\t\t\t\t\t'Added: %d blocks',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t),\n\t\t\t\tnewBlockTypes.length\n\t\t\t) }\n\t\t\tinitialOpen={ true }\n\t\t>\n\t\t\t<p className=\"installed-blocks-pre-publish-panel__copy\">\n\t\t\t\t{ _n(\n\t\t\t\t\t'The following block has been added to your site.',\n\t\t\t\t\t'The following blocks have been added to your site.',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<CompactList items={ newBlockTypes } />\n\t\t</PluginPrePublishPanel>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t\t\t__( 'Install %s' ),\n\t\t\t\tblock.title\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock } from '@wordpress/blocks';\nimport { RawHTML } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport InstallButton from './install-button';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst getInstallMissing = ( OriginalComponent ) => ( props ) => {\n\tconst { originalName } = props.attributes;\n\t// Disable reason: This is a valid component, but it's mistaken for a callback.\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst { block, hasPermission } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getDownloadableBlocks } = select( blockDirectoryStore );\n\t\t\tconst blocks = getDownloadableBlocks(\n\t\t\t\t'block:' + originalName\n\t\t\t).filter( ( { name } ) => originalName === name );\n\t\t\treturn {\n\t\t\t\thasPermission: select( coreStore ).canUser(\n\t\t\t\t\t'read',\n\t\t\t\t\t'block-directory/search'\n\t\t\t\t),\n\t\t\t\tblock: blocks.length && blocks[ 0 ],\n\t\t\t};\n\t\t},\n\t\t[ originalName ]\n\t);\n\n\t// The user can't install blocks, or the block isn't available for download.\n\tif ( ! hasPermission || ! block ) {\n\t\treturn <OriginalComponent { ...props } />;\n\t}\n\n\treturn <ModifiedWarning { ...props } originalBlock={ block } />;\n};\n\nconst ModifiedWarning = ( { originalBlock, ...props } ) => {\n\tconst { originalName, originalUndelimitedContent, clientId } =\n\t\tprops.attributes;\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst convertToHTML = () => {\n\t\treplaceBlock(\n\t\t\tprops.clientId,\n\t\t\tcreateBlock( 'core/html', {\n\t\t\t\tcontent: originalUndelimitedContent,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst hasContent = !! originalUndelimitedContent;\n\tconst hasHTMLBlock = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canInsertBlockType, getBlockRootClientId } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn canInsertBlockType(\n\t\t\t\t'core/html',\n\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tlet messageHTML = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__(\n\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'\n\t\t),\n\t\toriginalBlock.title || originalName\n\t);\n\tconst actions = [\n\t\t<InstallButton\n\t\t\tkey=\"install\"\n\t\t\tblock={ originalBlock }\n\t\t\tattributes={ props.attributes }\n\t\t\tclientId={ props.clientId }\n\t\t/>,\n\t];\n\n\tif ( hasContent && hasHTMLBlock ) {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'\n\t\t\t),\n\t\t\toriginalBlock.title || originalName\n\t\t);\n\t\tactions.push(\n\t\t\t<Button key=\"convert\" onClick={ convertToHTML } variant=\"link\">\n\t\t\t\t{ __( 'Keep as HTML' ) }\n\t\t\t</Button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div { ...useBlockProps() }>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ originalUndelimitedContent }</RawHTML>\n\t\t</div>\n\t);\n};\n\nexport default getInstallMissing;\n","/**\n * WordPress dependencies\n */\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport AutoBlockUninstaller from '../components/auto-block-uninstaller';\nimport InserterMenuDownloadableBlocksPanel from './inserter-menu-downloadable-blocks-panel';\nimport InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel';\nimport getInstallMissing from './get-install-missing';\n\nregisterPlugin( 'block-directory', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<AutoBlockUninstaller />\n\t\t\t\t<InserterMenuDownloadableBlocksPanel />\n\t\t\t\t<InstalledBlocksPrePublishPanel />\n\t\t\t</>\n\t\t);\n\t},\n} );\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-directory/fallback',\n\t( settings, name ) => {\n\t\tif ( name !== 'core/missing' ) {\n\t\t\treturn settings;\n\t\t}\n\t\tsettings.edit = getInstallMissing( settings.edit );\n\n\t\treturn settings;\n\t}\n);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","combineReducers","downloadableBlocks","state","action","type","filterValue","isRequesting","results","blockManagement","installedBlockTypes","isInstalling","item","filter","blockType","name","blockId","errorNotices","message","isFatal","restState","hasBlockType","blocks","length","some","i","innerBlocks","isRequestingDownloadableBlocks","getDownloadableBlocks","getInstalledBlockTypes","getNewBlockTypes","createRegistrySelector","select","usedBlockTree","blockEditorStore","getBlocks","getUnusedBlockTypes","getErrorNotices","getErrorNoticeForBlock","loadAsset","el","Promise","resolve","reject","newNode","document","createElement","nodeName","forEach","attr","innerHTML","appendChild","createTextNode","onload","onerror","Error","body","toLowerCase","src","getPluginUrl","block","link","links","self","href","fetchDownloadableBlocks","receiveDownloadableBlocks","installBlockType","async","registry","dispatch","id","success","clearErrorNotice","setIsInstalling","url","apiFetch","method","data","status","path","slug","_links","addInstalledBlockType","metadataFields","addQueryArgs","_fields","catch","then","response","unstable__bootstrapServerSideBlockDefinitions","pick","location","parse","text","doc","DOMParser","parseFromString","newAssets","Array","from","querySelectorAll","asset","getElementById","newAsset","loadAssets","blocksStore","getBlockTypes","__","noticesStore","createInfoNotice","sprintf","title","speak","error","fatalAPIErrors","folder_exists","unable_to_connect_to_filesystem","code","setErrorNotice","createErrorNotice","isDismissible","uninstallBlockType","removeInstalledBlockType","__assign","assign","t","s","n","arguments","p","apply","this","lowerCase","str","create","DEFAULT_SPLIT_REGEXP","DEFAULT_STRIP_REGEXP","replace","input","re","RegExp","reduce","pascalCaseTransform","index","firstChar","charAt","lowerChars","substr","toUpperCase","pascalCase","options","splitRegexp","stripRegexp","transform","delimiter","result","start","end","slice","split","map","join","noCase","camelCaseTransform","fromEntries","entries","storeConfig","reducer","selectors","actions","resolvers","store","createReduxStore","AutoBlockUninstaller","useDispatch","blockDirectoryStore","shouldRemoveBlockTypes","useSelect","isAutosavingPost","isSavingPost","editorStore","unusedBlockTypes","useEffect","unregisterBlockType","register","_extends","target","source","icon","size","props","cloneElement","width","height","SVG","xmlns","viewBox","Path","fillRule","clipRule","rating","stars","Math","round","fullStarCount","floor","halfStarCount","ceil","emptyStarCount","_","className","starFilled","starHalf","starEmpty","match","alt","BlockIcon","showColors","errorNotice","getDownloadableBlockLabel","ratingCount","hasNotice","isInstalled","decodeEntities","_n","composite","onClick","author","description","getBlockType","isInstallable","isBlockInstalling","notice","hasFatal","statusText","__experimentalIsFocusable","role","as","Button","event","preventDefault","isBusy","disabled","label","showTooltip","tooltipPosition","Spinner","createInterpolateElement","span","VisuallyHidden","noop","items","onHover","onSelect","useCompositeState","children","downloadableItems","hasLocalBlocks","count","blockDefault","Tip","ExternalLink","compose","withSelect","rootClientId","canInsertBlockType","hasPermission","coreStore","canUser","isLoading","isTyping","debouncedFilterValue","setFilterValue","useState","debouncedSetFilterValue","debounce","__unstableInserterMenuExtension","hasItems","CompactList","InstalledBlocksPrePublishPanel","newBlockTypes","PluginPrePublishPanel","initialOpen","InstallButton","attributes","clientId","isInstallingBlock","replaceBlock","originalBlock","originalContent","createBlock","variant","ModifiedWarning","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","getBlockRootClientId","messageHTML","push","content","useBlockProps","Warning","RawHTML","registerPlugin","render","addFilter","settings","edit","OriginalComponent"],"sourceRoot":""}
build/block-editor/index.js CHANGED
@@ -3729,8 +3729,7 @@ const withBlockReset = reducer => (state, action) => {
3729
  attributes: getFlattenedBlockAttributes(action.blocks),
3730
  order: mapBlockOrder(action.blocks),
3731
  parents: mapBlockParents(action.blocks),
3732
- controlledInnerBlocks: {},
3733
- visibility: {}
3734
  };
3735
  const subTree = buildBlockTree(newState, action.blocks);
3736
  newState.tree = { ...subTree,
@@ -4208,19 +4207,6 @@ withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetCont
4208
  };
4209
  }
4210
 
4211
- return state;
4212
- },
4213
-
4214
- visibility() {
4215
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4216
- let action = arguments.length > 1 ? arguments[1] : undefined;
4217
-
4218
- if (action.type === 'SET_BLOCK_VISIBILITY') {
4219
- return { ...state,
4220
- ...action.updates
4221
- };
4222
- }
4223
-
4224
  return state;
4225
  }
4226
 
@@ -4271,6 +4257,27 @@ function draggedBlocks() {
4271
 
4272
  return state;
4273
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4274
  /**
4275
  * Internal helper reducer for selectionStart and selectionEnd. Can hold a block
4276
  * selection, represented by an object with property clientId.
@@ -4764,7 +4771,10 @@ function hasBlockMovingClientId() {
4764
  * @return {[string,Object]} Updated state.
4765
  */
4766
 
4767
- function lastBlockAttributesChange(state, action) {
 
 
 
4768
  switch (action.type) {
4769
  case 'UPDATE_BLOCK':
4770
  if (!action.updates.attributes) {
@@ -4781,7 +4791,7 @@ function lastBlockAttributesChange(state, action) {
4781
  }), {});
4782
  }
4783
 
4784
- return null;
4785
  }
4786
  /**
4787
  * Reducer returning automatic change state.
@@ -4817,8 +4827,11 @@ function automaticChangeStatus(state, action) {
4817
  case 'SET_BLOCK_VISIBILITY':
4818
  case 'START_TYPING':
4819
  case 'STOP_TYPING':
 
4820
  return state;
4821
- } // Reset the state by default (for any action not handled).
 
 
4822
 
4823
  }
4824
  /**
@@ -4928,7 +4941,8 @@ function temporarilyEditingAsBlocks() {
4928
  automaticChangeStatus,
4929
  highlightedBlock,
4930
  lastBlockInserted,
4931
- temporarilyEditingAsBlocks
 
4932
  }));
4933
 
4934
  ;// CONCATENATED MODULE: ./node_modules/rememo/es/rememo.js
@@ -6589,7 +6603,7 @@ function getTemplateLock(state, rootClientId) {
6589
  const blockListSettings = getBlockListSettings(state, rootClientId);
6590
 
6591
  if (!blockListSettings) {
6592
- return null;
6593
  }
6594
 
6595
  return blockListSettings.templateLock;
@@ -7724,9 +7738,9 @@ function wasBlockJustInserted(state, clientId, source) {
7724
  */
7725
 
7726
  function isBlockVisible(state, clientId) {
7727
- var _state$blocks$visibil, _state$blocks$visibil2;
7728
 
7729
- return (_state$blocks$visibil = (_state$blocks$visibil2 = state.blocks.visibility) === null || _state$blocks$visibil2 === void 0 ? void 0 : _state$blocks$visibil2[clientId]) !== null && _state$blocks$visibil !== void 0 ? _state$blocks$visibil : true;
7730
  }
7731
  /**
7732
  * Returns the list of all hidden blocks.
@@ -7736,8 +7750,8 @@ function isBlockVisible(state, clientId) {
7736
  */
7737
 
7738
  const __unstableGetVisibleBlocks = rememo(state => {
7739
- return new Set(Object.keys(state.blocks.visibility).filter(key => state.blocks.visibility[key]));
7740
- }, state => [state.blocks.visibility]);
7741
  const __unstableGetContentLockingParent = rememo((state, clientId) => {
7742
  let current = clientId;
7743
  let result;
@@ -10200,11 +10214,11 @@ const settings_settings = (0,external_wp_element_namespaceObject.createElement)(
10200
 
10201
  const blockedPaths = ['color', 'border', 'typography', 'spacing'];
10202
  const deprecatedFlags = {
10203
- 'color.palette': settings => settings.colors === undefined ? undefined : settings.colors,
10204
- 'color.gradients': settings => settings.gradients === undefined ? undefined : settings.gradients,
10205
  'color.custom': settings => settings.disableCustomColors === undefined ? undefined : !settings.disableCustomColors,
10206
  'color.customGradient': settings => settings.disableCustomGradients === undefined ? undefined : !settings.disableCustomGradients,
10207
- 'typography.fontSizes': settings => settings.fontSizes === undefined ? undefined : settings.fontSizes,
10208
  'typography.customFontSize': settings => settings.disableCustomFontSizes === undefined ? undefined : !settings.disableCustomFontSizes,
10209
  'typography.lineHeight': settings => settings.enableCustomLineHeight,
10210
  'spacing.units': settings => {
@@ -10279,7 +10293,7 @@ function useSetting(path) {
10279
  name: blockName,
10280
  clientId
10281
  } = useBlockEditContext();
10282
- const setting = (0,external_wp_data_namespaceObject.useSelect)(select => {
10283
  if (blockedPaths.includes(path)) {
10284
  // eslint-disable-next-line no-console
10285
  console.warn('Top level useSetting paths are disabled. Please use a subpath to query the information needed.');
@@ -10288,23 +10302,28 @@ function useSetting(path) {
10288
 
10289
  let result;
10290
  const normalizedPath = removeCustomPrefixes(path); // 1. Take settings from the block instance or its ancestors.
 
10291
 
10292
- const candidates = [...select(store).getBlockParents(clientId), clientId // The current block is added last, so it overwrites any ancestor.
10293
- ];
10294
- candidates.forEach(candidateClientId => {
 
 
10295
  const candidateBlockName = select(store).getBlockName(candidateClientId);
10296
 
10297
  if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(candidateBlockName, '__experimentalSettings', false)) {
10298
  var _get;
10299
 
10300
  const candidateAtts = select(store).getBlockAttributes(candidateClientId);
10301
- const candidateResult = (_get = (0,external_lodash_namespaceObject.get)(candidateAtts, `settings.blocks.${blockName}.${normalizedPath}`)) !== null && _get !== void 0 ? _get : (0,external_lodash_namespaceObject.get)(candidateAtts, `settings.${normalizedPath}`);
10302
 
10303
- if (candidateResult !== undefined) {
10304
- result = candidateResult;
 
10305
  }
10306
  }
10307
- }); // 2. Fall back to the settings from the block editor store (__experimentalFeatures).
 
10308
 
10309
  const settings = select(store).getSettings();
10310
 
@@ -10340,7 +10359,6 @@ function useSetting(path) {
10340
 
10341
  return normalizedPath === 'typography.dropCap' ? true : undefined;
10342
  }, [blockName, clientId, path]);
10343
- return setting;
10344
  }
10345
 
10346
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/spacing-sizes-control/spacing-input-control.js
@@ -10727,16 +10745,15 @@ function LinkedButton(_ref) {
10727
  isLinked,
10728
  onClick
10729
  } = _ref;
10730
- const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)('Unlink Sides') : (0,external_wp_i18n_namespaceObject.__)('Link Sides');
10731
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
10732
  text: label
10733
  }, (0,external_wp_element_namespaceObject.createElement)("span", {
10734
  className: "component-spacing-sizes-control__linked-button"
10735
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
10736
- variant: isLinked ? 'primary' : 'secondary',
10737
  isSmall: true,
10738
  icon: isLinked ? library_link : link_off,
10739
- iconSize: 16,
10740
  "aria-label": label,
10741
  onClick: onClick
10742
  })));
@@ -11242,6 +11259,7 @@ function usePopoverScroll(scrollableRef) {
11242
 
11243
 
11244
 
 
11245
 
11246
  function BlockPopover(_ref, ref) {
11247
  let {
@@ -11268,21 +11286,69 @@ function BlockPopover(_ref, ref) {
11268
  height: selectedElement.offsetHeight
11269
  };
11270
  }, [selectedElement, lastSelectedElement, __unstableRefreshSize]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11271
 
11272
  if (!selectedElement || bottomClientId && !lastSelectedElement) {
11273
  return null;
11274
  }
11275
 
11276
- const anchorRef = {
11277
- top: selectedElement,
11278
- bottom: lastSelectedElement
11279
- };
11280
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
11281
  ref: mergedRefs,
11282
  animate: false,
11283
  position: "top right left",
11284
  focusOnMount: false,
11285
- anchorRef: anchorRef // Render in the old slot if needed for backward compatibility,
11286
  // otherwise render in place (not in the default popover slot).
11287
  ,
11288
  __unstableSlotName: __unstablePopoverSlot || null,
@@ -19788,6 +19854,7 @@ function useBlockProps() {
19788
  enableAnimation
19789
  } = (0,external_wp_data_namespaceObject.useSelect)(select => {
19790
  const {
 
19791
  getBlockIndex,
19792
  getBlockMode,
19793
  getBlockName,
@@ -19798,16 +19865,21 @@ function useBlockProps() {
19798
  isAncestorMultiSelected,
19799
  isFirstMultiSelectedBlock
19800
  } = select(store);
 
 
 
19801
  const isSelected = isBlockSelected(clientId);
19802
  const isPartOfMultiSelection = isBlockMultiSelected(clientId) || isAncestorMultiSelected(clientId);
19803
  const blockName = getBlockName(clientId);
19804
  const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
 
 
19805
  return {
19806
  index: getBlockIndex(clientId),
19807
  mode: getBlockMode(clientId),
19808
  name: blockName,
19809
  blockApiVersion: (blockType === null || blockType === void 0 ? void 0 : blockType.apiVersion) || 1,
19810
- blockTitle: blockType === null || blockType === void 0 ? void 0 : blockType.title,
19811
  isPartOfSelection: isSelected || isPartOfMultiSelection,
19812
  adjustScrolling: isSelected || isFirstMultiSelectedBlock(clientId),
19813
  enableAnimation: !isTyping() && getGlobalBlockCount() <= BLOCK_ANIMATION_THRESHOLD
@@ -21155,7 +21227,13 @@ function getClosestTabbable(target, isReverse, containerElement, onlyVertical) {
21155
  }
21156
 
21157
  function isTabCandidate(node) {
21158
- // Not a candidate if the node is not tabbable.
 
 
 
 
 
 
21159
  if (!external_wp_dom_namespaceObject.focus.tabbable.isTabbableIndex(node)) {
21160
  return false;
21161
  } // Skip focusable elements such as links within content editable nodes.
@@ -23945,6 +24023,7 @@ function PresetDuotoneFilter(_ref4) {
23945
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-preview/auto.js
23946
 
23947
 
 
23948
  /**
23949
  * WordPress dependencies
23950
  */
@@ -23965,15 +24044,13 @@ function PresetDuotoneFilter(_ref4) {
23965
  let MemoizedBlockList;
23966
  const MAX_HEIGHT = 2000;
23967
 
23968
- function AutoBlockPreview(_ref) {
23969
  let {
23970
  viewportWidth,
 
23971
  __experimentalPadding,
23972
  __experimentalMinHeight
23973
  } = _ref;
23974
- const [containerResizeListener, {
23975
- width: containerWidth
23976
- }] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
23977
  const [contentResizeListener, {
23978
  height: contentHeight
23979
  }] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
@@ -24010,9 +24087,7 @@ function AutoBlockPreview(_ref) {
24010
 
24011
  MemoizedBlockList = MemoizedBlockList || (0,external_wp_compose_namespaceObject.pure)(BlockList);
24012
  const scale = containerWidth / viewportWidth;
24013
- return (0,external_wp_element_namespaceObject.createElement)("div", {
24014
- className: "block-editor-block-preview__container"
24015
- }, containerResizeListener, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, {
24016
  className: "block-editor-block-preview__content",
24017
  style: {
24018
  transform: `scale(${scale})`,
@@ -24059,10 +24134,25 @@ function AutoBlockPreview(_ref) {
24059
  key: preset.slug
24060
  })), (0,external_wp_element_namespaceObject.createElement)(MemoizedBlockList, {
24061
  renderAppender: false
24062
- }))));
24063
  }
24064
 
24065
- /* harmony default export */ const auto = (AutoBlockPreview);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24066
 
24067
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-preview/index.js
24068
 
@@ -24115,7 +24205,7 @@ function BlockPreview(_ref) {
24115
  settings: settings
24116
  }, __experimentalLive ? (0,external_wp_element_namespaceObject.createElement)(LiveBlockPreview, {
24117
  onClick: __experimentalOnClick
24118
- }) : (0,external_wp_element_namespaceObject.createElement)(auto, {
24119
  viewportWidth: viewportWidth,
24120
  __experimentalPadding: __experimentalPadding,
24121
  __experimentalMinHeight: __experimentalMinHeight
@@ -27190,6 +27280,7 @@ function BlockListAppender(_ref) {
27190
 
27191
 
27192
 
 
27193
  const InsertionPointOpenRef = (0,external_wp_element_namespaceObject.createContext)();
27194
 
27195
  function BlockPopoverInbetween(_ref) {
@@ -27202,7 +27293,8 @@ function BlockPopoverInbetween(_ref) {
27202
  ...props
27203
  } = _ref;
27204
  // This is a temporary hack to get the inbetween inserter to recompute properly.
27205
- const [positionRecompute, forceRecompute] = (0,external_wp_element_namespaceObject.useReducer)(s => s + 1, 0);
 
27206
  const {
27207
  orientation,
27208
  rootClientId,
@@ -27228,7 +27320,10 @@ function BlockPopoverInbetween(_ref) {
27228
  const nextElement = useBlockElement(nextClientId);
27229
  const isVertical = orientation === 'vertical';
27230
  const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
27231
- if (!previousElement && !nextElement || !isVisible) {
 
 
 
27232
  return {};
27233
  }
27234
 
@@ -27252,72 +27347,70 @@ function BlockPopoverInbetween(_ref) {
27252
  width,
27253
  height: previousRect ? previousRect.height : nextRect.height
27254
  };
27255
- }, [previousElement, nextElement, isVertical, positionRecompute, isVisible]);
27256
- const getAnchorRect = (0,external_wp_element_namespaceObject.useCallback)(() => {
27257
- if (!previousElement && !nextElement || !isVisible) {
27258
- return {};
 
 
 
27259
  }
27260
 
27261
  const {
27262
  ownerDocument
27263
  } = previousElement || nextElement;
27264
- const previousRect = previousElement ? previousElement.getBoundingClientRect() : null;
27265
- const nextRect = nextElement ? nextElement.getBoundingClientRect() : null;
27266
 
27267
- if (isVertical) {
27268
- if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
27269
- return {
27270
- top: previousRect ? previousRect.bottom : nextRect.top,
27271
- left: previousRect ? previousRect.right : nextRect.right,
27272
- right: previousRect ? previousRect.right : nextRect.right,
27273
- bottom: previousRect ? previousRect.bottom : nextRect.top,
27274
- height: 0,
27275
- width: 0,
27276
- ownerDocument
27277
- };
27278
- }
27279
 
27280
- return {
27281
- top: previousRect ? previousRect.bottom : nextRect.top,
27282
- left: previousRect ? previousRect.left : nextRect.left,
27283
- right: previousRect ? previousRect.left : nextRect.left,
27284
- bottom: previousRect ? previousRect.bottom : nextRect.top,
27285
- height: 0,
27286
- width: 0,
27287
- ownerDocument
27288
- };
27289
- }
27290
 
27291
- if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
27292
- return {
27293
- top: previousRect ? previousRect.top : nextRect.top,
27294
- left: previousRect ? previousRect.left : nextRect.right,
27295
- right: previousRect ? previousRect.left : nextRect.right,
27296
- bottom: previousRect ? previousRect.top : nextRect.top,
27297
- height: 0,
27298
- width: 0,
27299
- ownerDocument
27300
- };
27301
- }
 
 
 
 
 
 
 
 
 
 
27302
 
27303
- return {
27304
- top: previousRect ? previousRect.top : nextRect.top,
27305
- left: previousRect ? previousRect.right : nextRect.left,
27306
- right: previousRect ? previousRect.right : nextRect.left,
27307
- bottom: previousRect ? previousRect.left : nextRect.right,
27308
- height: 0,
27309
- width: 0,
27310
- ownerDocument
27311
  };
27312
- }, [previousElement, nextElement, positionRecompute, isVisible]);
27313
  const popoverScrollRef = use_popover_scroll(__unstableContentRef); // This is only needed for a smooth transition when moving blocks.
 
 
 
 
 
 
 
27314
 
27315
  (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
27316
  if (!previousElement) {
27317
  return;
27318
  }
27319
 
27320
- const observer = new window.MutationObserver(forceRecompute);
27321
  observer.observe(previousElement, {
27322
  attributes: true
27323
  });
@@ -27330,7 +27423,7 @@ function BlockPopoverInbetween(_ref) {
27330
  return;
27331
  }
27332
 
27333
- const observer = new window.MutationObserver(forceRecompute);
27334
  observer.observe(nextElement, {
27335
  attributes: true
27336
  });
@@ -27343,9 +27436,9 @@ function BlockPopoverInbetween(_ref) {
27343
  return;
27344
  }
27345
 
27346
- previousElement.ownerDocument.defaultView.addEventListener('resize', forceRecompute);
27347
  return () => {
27348
- previousElement.ownerDocument.defaultView.removeEventListener('resize', forceRecompute);
27349
  };
27350
  }, [previousElement]); // If there's either a previous or a next element, show the inbetween popover.
27351
  // Note that drag and drop uses the inbetween popover to show the drop indicator
@@ -27366,7 +27459,7 @@ function BlockPopoverInbetween(_ref) {
27366
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
27367
  ref: popoverScrollRef,
27368
  animate: false,
27369
- getAnchorRect: getAnchorRect,
27370
  focusOnMount: false // Render in the old slot if needed for backward compatibility,
27371
  // otherwise render in place (not in the default popover slot).
27372
  ,
@@ -27543,14 +27636,16 @@ function InsertionPointPopover(_ref) {
27543
  opacity: 1,
27544
  borderRadius: '2px',
27545
  transition: {
27546
- delay: isInserterShown ? 0.4 : 0
 
27547
  }
27548
  },
27549
  hover: { ...(!isVertical ? horizontalLine.hover : verticalLine.hover),
27550
  opacity: 1,
27551
  borderRadius: '2px',
27552
  transition: {
27553
- delay: 0.4
 
27554
  }
27555
  }
27556
  };
@@ -27561,7 +27656,7 @@ function InsertionPointPopover(_ref) {
27561
  rest: {
27562
  scale: 1,
27563
  transition: {
27564
- delay: 0.2
27565
  }
27566
  }
27567
  };
@@ -27644,6 +27739,9 @@ function useInBetweenInserter() {
27644
  showInsertionPoint,
27645
  hideInsertionPoint
27646
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
 
 
 
27647
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
27648
  if (isInBetweenInserterDisabled) {
27649
  return;
@@ -27661,6 +27759,8 @@ function useInBetweenInserter() {
27661
  }
27662
 
27663
  if (!event.target.classList.contains('block-editor-block-list__layout')) {
 
 
27664
  if (isBlockInsertionPointVisible()) {
27665
  hideInsertionPoint();
27666
  }
@@ -27720,6 +27820,8 @@ function useInBetweenInserter() {
27720
  const elementRect = element.getBoundingClientRect();
27721
 
27722
  if (orientation === 'horizontal' && (event.clientY > elementRect.bottom || event.clientY < elementRect.top) || orientation === 'vertical' && (event.clientX > elementRect.right || event.clientX < elementRect.left)) {
 
 
27723
  if (isBlockInsertionPointVisible()) {
27724
  hideInsertionPoint();
27725
  }
@@ -27731,6 +27833,8 @@ function useInBetweenInserter() {
27731
  // the list (preserves the original behaviour).
27732
 
27733
  if (index === 0) {
 
 
27734
  if (isBlockInsertionPointVisible()) {
27735
  hideInsertionPoint();
27736
  }
@@ -27738,7 +27842,7 @@ function useInBetweenInserter() {
27738
  return;
27739
  }
27740
 
27741
- showInsertionPoint(rootClientId, index, {
27742
  __unstableWithInserter: true
27743
  });
27744
  }
@@ -31894,7 +31998,9 @@ const stack = (0,external_wp_element_namespaceObject.createElement)(external_wp_
31894
 
31895
 
31896
  const layouts = {
31897
- group: undefined,
 
 
31898
  row: {
31899
  type: 'flex',
31900
  flexWrap: 'nowrap'
@@ -31931,10 +32037,13 @@ function BlockGroupToolbar() {
31931
  };
31932
  }, [clientIds, groupingBlockName]);
31933
 
31934
- const onConvertToGroup = function () {
31935
- let layout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'group';
31936
  const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocksSelection, groupingBlockName);
31937
 
 
 
 
 
31938
  if (newBlocks && newBlocks.length > 0) {
31939
  // Because the block is not in the store yet we can't use
31940
  // updateBlockAttributes so need to manually update attributes.
@@ -32736,6 +32845,7 @@ const default_block_appender_DefaultBlockAppender = _ref => {
32736
 
32737
  /** @typedef {import('../../selectors').WPDirectInsertBlock } WPDirectInsertBlock */
32738
 
 
32739
  /**
32740
  * This hook is a side effect which updates the block-editor store when changes
32741
  * happen to inner block settings. The given props are transformed into a
@@ -32763,6 +32873,7 @@ function useNestedSettingsUpdate(clientId, allowedBlocks, __experimentalDefaultB
32763
  const {
32764
  updateBlockListSettings
32765
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
 
32766
  const {
32767
  blockListSettings,
32768
  parentLock
@@ -32806,9 +32917,31 @@ function useNestedSettingsUpdate(clientId, allowedBlocks, __experimentalDefaultB
32806
  }
32807
 
32808
  if (!external_wp_isShallowEqual_default()(blockListSettings, newSettings)) {
32809
- updateBlockListSettings(clientId, newSettings);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32810
  }
32811
- }, [clientId, blockListSettings, _allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, parentLock, captureToolbars, orientation, updateBlockListSettings, layout]);
32812
  }
32813
 
32814
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inner-blocks/use-inner-block-template-sync.js
@@ -32855,28 +32988,39 @@ function useInnerBlockTemplateSync(clientId, template, templateLock, templateIns
32855
  const {
32856
  replaceInnerBlocks
32857
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
32858
- const innerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlocks(clientId), [clientId]); // Maintain a reference to the previous value so we can do a deep equality check.
 
 
 
32859
 
32860
  const existingTemplate = (0,external_wp_element_namespaceObject.useRef)(null);
32861
  (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
32862
- // Only synchronize innerBlocks with template if innerBlocks are empty
32863
- // or a locking "all" or "contentOnly" exists directly on the block.
32864
- if (innerBlocks.length === 0 || templateLock === 'all' || templateLock === 'contentOnly') {
 
 
 
 
 
 
32865
  const hasTemplateChanged = !(0,external_lodash_namespaceObject.isEqual)(template, existingTemplate.current);
32866
 
32867
- if (hasTemplateChanged) {
32868
- existingTemplate.current = template;
32869
- const nextBlocks = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(innerBlocks, template);
32870
 
32871
- if (!(0,external_lodash_namespaceObject.isEqual)(nextBlocks, innerBlocks)) {
32872
- replaceInnerBlocks(clientId, nextBlocks, innerBlocks.length === 0 && templateInsertUpdatesSelection && nextBlocks.length !== 0, // This ensures the "initialPosition" doesn't change when applying the template
32873
- // If we're supposed to focus the block, we'll focus the first inner block
32874
- // otherwise, we won't apply any auto-focus.
32875
- // This ensures for instance that the focus stays in the inserter when inserting the "buttons" block.
32876
- getSelectedBlocksInitialCaretPosition());
32877
- }
 
 
32878
  }
32879
- }
32880
  }, [innerBlocks, template, templateLock, clientId]);
32881
  }
32882
 
@@ -33390,7 +33534,13 @@ function UncontrolledInnerBlocks(props) {
33390
  useNestedSettingsUpdate(clientId, allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, __experimentalLayout);
33391
  useInnerBlockTemplateSync(clientId, template, templateLock, templateInsertUpdatesSelection);
33392
  const context = (0,external_wp_data_namespaceObject.useSelect)(select => {
33393
- const block = select(store).getBlock(clientId);
 
 
 
 
 
 
33394
  const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name);
33395
 
33396
  if (!blockType || !blockType.providesContext) {
@@ -33541,6 +33691,7 @@ ForwardedInnerBlocks.Content = () => useInnerBlocksProps.save().children;
33541
 
33542
  const elementContext = (0,external_wp_element_namespaceObject.createContext)();
33543
  const IntersectionObserver = (0,external_wp_element_namespaceObject.createContext)();
 
33544
 
33545
  function Root(_ref) {
33546
  let {
@@ -33568,9 +33719,20 @@ function Root(_ref) {
33568
  editorMode: __unstableGetEditorMode()
33569
  };
33570
  }, []);
 
33571
  const {
33572
  setBlockVisibility
33573
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
 
 
 
 
 
 
 
 
 
 
33574
  const intersectionObserver = (0,external_wp_element_namespaceObject.useMemo)(() => {
33575
  const {
33576
  IntersectionObserver: Observer
@@ -33581,14 +33743,16 @@ function Root(_ref) {
33581
  }
33582
 
33583
  return new Observer(entries => {
33584
- const updates = {};
 
 
33585
 
33586
  for (const entry of entries) {
33587
  const clientId = entry.target.getAttribute('data-block');
33588
- updates[clientId] = entry.isIntersecting;
33589
  }
33590
 
33591
- setBlockVisibility(updates);
33592
  });
33593
  }, []);
33594
  const innerBlocksProps = useInnerBlocksProps({
@@ -33614,14 +33778,14 @@ function BlockList(settings) {
33614
  }
33615
  BlockList.__unstableElementContext = elementContext;
33616
 
33617
- function Items(_ref2) {
33618
  let {
33619
  placeholder,
33620
  rootClientId,
33621
  renderAppender,
33622
  __experimentalAppenderTagName,
33623
  __experimentalLayout: layout = defaultLayout
33624
- } = _ref2;
33625
  const {
33626
  order,
33627
  selectedBlocks,
@@ -33926,18 +34090,17 @@ function linked_button_LinkedButton(_ref) {
33926
  isLinked,
33927
  ...props
33928
  } = _ref;
33929
- const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)('Unlink Radii') : (0,external_wp_i18n_namespaceObject.__)('Link Radii');
 
33930
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
33931
  text: label
33932
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({}, props, {
33933
  className: "component-border-radius-control__linked-button",
33934
- isPrimary: isLinked,
33935
- isSecondary: !isLinked,
33936
  isSmall: true,
33937
  icon: isLinked ? library_link : link_off,
33938
- iconSize: 16,
33939
  "aria-label": label
33940
- })));
33941
  }
33942
 
33943
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-radius-control/index.js
@@ -37185,6 +37348,21 @@ function font_size_addTransforms(result, source, index, results) {
37185
  (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/font-size/with-font-size-inline-styles', withFontSizeInlineStyles);
37186
  (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/font-size/addTransforms', font_size_addTransforms);
37187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37188
  ;// CONCATENATED MODULE: ./packages/icons/build-module/library/format-underline.js
37189
 
37190
 
@@ -37218,7 +37396,6 @@ const formatStrikethrough = (0,external_wp_element_namespaceObject.createElement
37218
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/text-decoration-control/index.js
37219
 
37220
 
37221
-
37222
  /**
37223
  * External dependencies
37224
  */
@@ -37231,6 +37408,10 @@ const formatStrikethrough = (0,external_wp_element_namespaceObject.createElement
37231
 
37232
 
37233
  const TEXT_DECORATIONS = [{
 
 
 
 
37234
  name: (0,external_wp_i18n_namespaceObject.__)('Underline'),
37235
  value: 'underline',
37236
  icon: format_underline
@@ -37254,23 +37435,25 @@ function TextDecorationControl(_ref) {
37254
  let {
37255
  value,
37256
  onChange,
37257
- className,
37258
- ...props
37259
  } = _ref;
37260
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, _extends({}, props, {
37261
- className: classnames_default()('block-editor-text-decoration-control', className),
37262
- __experimentalIsBorderless: true,
37263
- label: (0,external_wp_i18n_namespaceObject.__)('Decoration'),
37264
- value: value,
37265
- onChange: onChange
37266
- }), TEXT_DECORATIONS.map(textDecoration => {
37267
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, {
37268
  key: textDecoration.value,
37269
- value: textDecoration.value,
37270
  icon: textDecoration.icon,
37271
- label: textDecoration.name
 
 
 
 
37272
  });
37273
- }));
37274
  }
37275
 
37276
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/text-decoration.js
@@ -37430,7 +37613,6 @@ const formatCapitalize = (0,external_wp_element_namespaceObject.createElement)(e
37430
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/text-transform-control/index.js
37431
 
37432
 
37433
-
37434
  /**
37435
  * External dependencies
37436
  */
@@ -37441,7 +37623,12 @@ const formatCapitalize = (0,external_wp_element_namespaceObject.createElement)(e
37441
 
37442
 
37443
 
 
37444
  const TEXT_TRANSFORMS = [{
 
 
 
 
37445
  name: (0,external_wp_i18n_namespaceObject.__)('Uppercase'),
37446
  value: 'uppercase',
37447
  icon: format_uppercase
@@ -37457,33 +37644,37 @@ const TEXT_TRANSFORMS = [{
37457
  /**
37458
  * Control to facilitate text transform selections.
37459
  *
37460
- * @param {Object} props Component props.
37461
- * @param {string} props.value Currently selected text transform.
37462
- * @param {Function} props.onChange Handles change in text transform selection.
 
37463
  *
37464
  * @return {WPElement} Text transform control.
37465
  */
37466
 
37467
  function TextTransformControl(_ref) {
37468
  let {
 
37469
  value,
37470
- onChange,
37471
- ...props
37472
  } = _ref;
37473
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, _extends({}, props, {
37474
- className: "block-editor-text-transform-control",
37475
- __experimentalIsBorderless: true,
37476
- label: (0,external_wp_i18n_namespaceObject.__)('Letter case'),
37477
- value: value,
37478
- onChange: onChange
37479
- }), TEXT_TRANSFORMS.map(textTransform => {
37480
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, {
37481
  key: textTransform.value,
37482
- value: textTransform.value,
37483
  icon: textTransform.icon,
37484
- label: textTransform.name
 
 
 
 
37485
  });
37486
- }));
37487
  }
37488
 
37489
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/text-transform.js
@@ -37864,7 +38055,15 @@ function TypographyPanel(props) {
37864
  isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.lineHeight,
37865
  resetAllFilter: createResetAllFilter('lineHeight'),
37866
  panelId: clientId
37867
- }, (0,external_wp_element_namespaceObject.createElement)(LineHeightEdit, props)), !isTextDecorationDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
 
 
 
 
 
 
 
 
37868
  className: "single-column",
37869
  hasValue: () => hasTextDecorationValue(props),
37870
  label: (0,external_wp_i18n_namespaceObject.__)('Decoration'),
@@ -37873,7 +38072,6 @@ function TypographyPanel(props) {
37873
  resetAllFilter: createResetAllFilter('textDecoration'),
37874
  panelId: clientId
37875
  }, (0,external_wp_element_namespaceObject.createElement)(TextDecorationEdit, props)), !isTextTransformDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
37876
- className: "single-column",
37877
  hasValue: () => hasTextTransformValue(props)
37878
  /* translators: Ensure translation is distinct from "Font size" */
37879
  ,
@@ -37882,15 +38080,7 @@ function TypographyPanel(props) {
37882
  isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.textTransform,
37883
  resetAllFilter: createResetAllFilter('textTransform'),
37884
  panelId: clientId
37885
- }, (0,external_wp_element_namespaceObject.createElement)(TextTransformEdit, props)), !isLetterSpacingDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
37886
- className: "single-column",
37887
- hasValue: () => hasLetterSpacingValue(props),
37888
- label: (0,external_wp_i18n_namespaceObject.__)('Letter spacing'),
37889
- onDeselect: () => resetLetterSpacing(props),
37890
- isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.letterSpacing,
37891
- resetAllFilter: createResetAllFilter('letterSpacing'),
37892
- panelId: clientId
37893
- }, (0,external_wp_element_namespaceObject.createElement)(LetterSpacingEdit, props)));
37894
  }
37895
  const hasTypographySupport = blockName => {
37896
  return TYPOGRAPHY_SUPPORT_KEYS.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, key));
@@ -40144,10 +40334,10 @@ function useCompleters(_ref) {
40144
  name
40145
  } = useBlockEditContext();
40146
  return (0,external_wp_element_namespaceObject.useMemo)(() => {
40147
- let filteredCompleters = completers;
40148
 
40149
  if (name === (0,external_wp_blocks_namespaceObject.getDefaultBlockName)() || (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, '__experimentalSlashInserter', false)) {
40150
- filteredCompleters = filteredCompleters.concat([autocompleters_block, autocompleters_link]);
40151
  }
40152
 
40153
  if ((0,external_wp_hooks_namespaceObject.hasFilter)('editor.Autocomplete.completers')) {
@@ -41348,37 +41538,39 @@ function ListViewDropIndicator(_ref) {
41348
  width: targetElement.offsetWidth - indent
41349
  };
41350
  }, [getDropIndicatorIndent, targetElement]);
41351
- const getAnchorRect = (0,external_wp_element_namespaceObject.useCallback)(() => {
41352
- if (!targetElement) {
41353
- return {};
41354
- }
41355
 
41356
- const ownerDocument = targetElement.ownerDocument;
41357
- const rect = targetElement.getBoundingClientRect();
41358
- const indent = getDropIndicatorIndent();
41359
- const anchorRect = {
41360
- left: rect.left + indent,
41361
- right: rect.right,
41362
- width: 0,
41363
- height: 0,
41364
- ownerDocument
41365
- };
41366
-
41367
- if (dropPosition === 'top') {
41368
- return { ...anchorRect,
41369
- top: rect.top,
41370
- bottom: rect.top
41371
- };
41372
  }
41373
 
41374
- if (dropPosition === 'bottom' || dropPosition === 'inside') {
41375
- return { ...anchorRect,
41376
- top: rect.bottom,
41377
- bottom: rect.bottom
41378
- };
41379
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41380
 
41381
- return {};
41382
  }, [targetElement, dropPosition, getDropIndicatorIndent]);
41383
 
41384
  if (!targetElement) {
@@ -41387,7 +41579,7 @@ function ListViewDropIndicator(_ref) {
41387
 
41388
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
41389
  animate: false,
41390
- getAnchorRect: getAnchorRect,
41391
  focusOnMount: false,
41392
  className: "block-editor-list-view-drop-indicator"
41393
  }, (0,external_wp_element_namespaceObject.createElement)("div", {
@@ -41993,7 +42185,8 @@ function ListView(_ref, ref) {
41993
  ref: treeGridRef,
41994
  onCollapseRow: collapseRow,
41995
  onExpandRow: expandRow,
41996
- onFocusRow: focusRow
 
41997
  }, (0,external_wp_element_namespaceObject.createElement)(ListViewContext.Provider, {
41998
  value: contextValue
41999
  }, (0,external_wp_element_namespaceObject.createElement)(branch, {
@@ -42139,7 +42332,6 @@ function BlockStylesPreviewPanel(_ref) {
42139
  * External dependencies
42140
  */
42141
 
42142
-
42143
  /**
42144
  * WordPress dependencies
42145
  */
@@ -42212,7 +42404,7 @@ function BlockStyles(_ref3) {
42212
  return null;
42213
  }
42214
 
42215
- const debouncedSetHoveredStyle = (0,external_lodash_namespaceObject.debounce)(setHoveredStyle, 250);
42216
 
42217
  const onSelectStylePreview = style => {
42218
  onSelect(style);
@@ -44927,7 +45119,6 @@ var lib_default = /*#__PURE__*/__webpack_require__.n(dom_scroll_into_view_lib);
44927
  */
44928
 
44929
 
44930
-
44931
  /**
44932
  * WordPress dependencies
44933
  */
@@ -44966,7 +45157,7 @@ class URLInput extends external_wp_element_namespaceObject.Component {
44966
  this.bindSuggestionNode = this.bindSuggestionNode.bind(this);
44967
  this.autocompleteRef = props.autocompleteRef || (0,external_wp_element_namespaceObject.createRef)();
44968
  this.inputRef = (0,external_wp_element_namespaceObject.createRef)();
44969
- this.updateSuggestions = (0,external_lodash_namespaceObject.debounce)(this.updateSuggestions.bind(this), 200);
44970
  this.suggestionNodes = [];
44971
  this.isUpdatingSuggestions = false;
44972
  this.state = {
@@ -47730,6 +47921,7 @@ const FormatToolbar = () => {
47730
 
47731
 
47732
 
 
47733
  /**
47734
  * Internal dependencies
47735
  */
@@ -47738,51 +47930,55 @@ const FormatToolbar = () => {
47738
 
47739
 
47740
 
 
47741
  function InlineSelectionToolbar(_ref) {
47742
  let {
47743
  value,
47744
- anchorRef,
47745
  activeFormats
47746
  } = _ref;
47747
  const lastFormat = activeFormats[activeFormats.length - 1];
47748
  const lastFormatType = lastFormat === null || lastFormat === void 0 ? void 0 : lastFormat.type;
47749
  const settings = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_richText_namespaceObject.store).getFormatType(lastFormatType), [lastFormatType]);
47750
- const selectionRef = (0,external_wp_richText_namespaceObject.useAnchorRef)({
47751
- ref: anchorRef,
47752
  value,
47753
  settings
47754
  });
47755
  return (0,external_wp_element_namespaceObject.createElement)(InlineToolbar, {
47756
- anchorRef: selectionRef
47757
  });
47758
  }
47759
 
47760
  function InlineToolbar(_ref2) {
47761
  let {
47762
- anchorRef
47763
  } = _ref2;
47764
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
47765
  position: "top center",
47766
  focusOnMount: false,
47767
- anchorRef: anchorRef,
47768
  className: "block-editor-rich-text__inline-format-toolbar",
47769
  __unstableSlotName: "block-toolbar"
47770
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
47771
  className: "block-editor-rich-text__inline-format-toolbar-group"
 
 
 
47772
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(format_toolbar, null))));
47773
  }
47774
 
47775
  const FormatToolbarContainer = _ref3 => {
47776
  let {
47777
  inline,
47778
- anchorRef,
47779
  value
47780
  } = _ref3;
47781
  const hasInlineToolbar = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().hasInlineToolbar, []);
47782
 
47783
  if (inline) {
47784
  return (0,external_wp_element_namespaceObject.createElement)(InlineToolbar, {
47785
- anchorRef: anchorRef
47786
  });
47787
  }
47788
 
@@ -47794,7 +47990,7 @@ const FormatToolbarContainer = _ref3 => {
47794
  }
47795
 
47796
  return (0,external_wp_element_namespaceObject.createElement)(InlineSelectionToolbar, {
47797
- anchorRef: anchorRef,
47798
  value: value,
47799
  activeFormats: activeFormats
47800
  });
@@ -49226,6 +49422,12 @@ function RichTextWrapper(_ref, forwardedRef) {
49226
  let adjustedOnChange = originalOnChange; // Handle deprecated format.
49227
 
49228
  if (Array.isArray(originalValue)) {
 
 
 
 
 
 
49229
  adjustedValue = external_wp_blocks_namespaceObject.children.toHTML(originalValue);
49230
 
49231
  adjustedOnChange = newValue => originalOnChange(external_wp_blocks_namespaceObject.children.fromDOM((0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, newValue).childNodes));
@@ -49367,7 +49569,9 @@ function RichTextWrapper(_ref, forwardedRef) {
49367
  }
49368
 
49369
  function onFocus() {
49370
- anchorRef.current.focus();
 
 
49371
  }
49372
 
49373
  const TagName = tagName;
@@ -49389,7 +49593,7 @@ function RichTextWrapper(_ref, forwardedRef) {
49389
  forwardedRef: anchorRef
49390
  })))), isSelected && hasFormats && (0,external_wp_element_namespaceObject.createElement)(format_toolbar_container, {
49391
  inline: inlineToolbar,
49392
- anchorRef: anchorRef,
49393
  value: value
49394
  }), (0,external_wp_element_namespaceObject.createElement)(TagName // Overridable props.
49395
  , _extends({
@@ -49452,6 +49656,12 @@ ForwardedRichTextContainer.Content = _ref3 => {
49452
 
49453
  // Handle deprecated `children` and `node` sources.
49454
  if (Array.isArray(value)) {
 
 
 
 
 
 
49455
  value = external_wp_blocks_namespaceObject.children.toHTML(value);
49456
  }
49457
 
@@ -50057,8 +50267,10 @@ const ImageURLInputUI = _ref => {
50057
  linkClass,
50058
  rel
50059
  } = _ref;
50060
- const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false);
50061
- const buttonRef = (0,external_wp_element_namespaceObject.useRef)(null);
 
 
50062
  const openLinkUI = (0,external_wp_element_namespaceObject.useCallback)(() => {
50063
  setIsOpen(true);
50064
  });
@@ -50233,9 +50445,9 @@ const ImageURLInputUI = _ref => {
50233
  label: url ? (0,external_wp_i18n_namespaceObject.__)('Edit link') : (0,external_wp_i18n_namespaceObject.__)('Insert link'),
50234
  "aria-expanded": isOpen,
50235
  onClick: openLinkUI,
50236
- ref: buttonRef
50237
  }), isOpen && (0,external_wp_element_namespaceObject.createElement)(url_popover, {
50238
- anchorRef: buttonRef,
50239
  onFocusOutside: onFocusOutside(),
50240
  onClose: closeLinkUI,
50241
  renderSettings: () => advancedOptions,
@@ -50921,6 +51133,19 @@ function ZoomOutModeInserters(_ref) {
50921
 
50922
 
50923
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50924
  /**
50925
  * Renders block tools (the block toolbar, select/navigation mode toolbar, the
50926
  * insertion point and a slot for the inline rich text toolbar). Must be wrapped
@@ -50931,6 +51156,7 @@ function ZoomOutModeInserters(_ref) {
50931
  * @param {Object} $0.__unstableContentRef Ref holding the content scroll container.
50932
  */
50933
 
 
50934
  function BlockTools(_ref) {
50935
  let {
50936
  children,
@@ -50940,17 +51166,9 @@ function BlockTools(_ref) {
50940
  const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
50941
  const {
50942
  hasFixedToolbar,
50943
- isZoomOutMode
50944
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
50945
- const {
50946
- __unstableGetEditorMode,
50947
- getSettings
50948
- } = select(store);
50949
- return {
50950
- isZoomOutMode: __unstableGetEditorMode() === 'zoom-out',
50951
- hasFixedToolbar: getSettings().hasFixedToolbar
50952
- };
50953
- }, []);
50954
  const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)();
50955
  const {
50956
  getSelectedBlockClientIds,
@@ -51032,7 +51250,7 @@ function BlockTools(_ref) {
51032
  onKeyDown: onKeyDown
51033
  }), (0,external_wp_element_namespaceObject.createElement)(insertion_point_InsertionPointOpenRef.Provider, {
51034
  value: (0,external_wp_element_namespaceObject.useRef)(false)
51035
- }, !isZoomOutMode && (0,external_wp_element_namespaceObject.createElement)(InsertionPoint, {
51036
  __unstableContentRef: __unstableContentRef
51037
  }), !isZoomOutMode && (hasFixedToolbar || !isLargeViewport) && (0,external_wp_element_namespaceObject.createElement)(block_contextual_toolbar, {
51038
  isFixed: true
3729
  attributes: getFlattenedBlockAttributes(action.blocks),
3730
  order: mapBlockOrder(action.blocks),
3731
  parents: mapBlockParents(action.blocks),
3732
+ controlledInnerBlocks: {}
 
3733
  };
3734
  const subTree = buildBlockTree(newState, action.blocks);
3735
  newState.tree = { ...subTree,
4207
  };
4208
  }
4209
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4210
  return state;
4211
  }
4212
 
4257
 
4258
  return state;
4259
  }
4260
+ /**
4261
+ * Reducer tracking the visible blocks.
4262
+ *
4263
+ * @param {Record<string,boolean>} state Current state.
4264
+ * @param {Object} action Dispatched action.
4265
+ *
4266
+ * @return {Record<string,boolean>} Block visibility.
4267
+ */
4268
+
4269
+ function blockVisibility() {
4270
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4271
+ let action = arguments.length > 1 ? arguments[1] : undefined;
4272
+
4273
+ if (action.type === 'SET_BLOCK_VISIBILITY') {
4274
+ return { ...state,
4275
+ ...action.updates
4276
+ };
4277
+ }
4278
+
4279
+ return state;
4280
+ }
4281
  /**
4282
  * Internal helper reducer for selectionStart and selectionEnd. Can hold a block
4283
  * selection, represented by an object with property clientId.
4771
  * @return {[string,Object]} Updated state.
4772
  */
4773
 
4774
+ function lastBlockAttributesChange() {
4775
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
4776
+ let action = arguments.length > 1 ? arguments[1] : undefined;
4777
+
4778
  switch (action.type) {
4779
  case 'UPDATE_BLOCK':
4780
  if (!action.updates.attributes) {
4791
  }), {});
4792
  }
4793
 
4794
+ return state;
4795
  }
4796
  /**
4797
  * Reducer returning automatic change state.
4827
  case 'SET_BLOCK_VISIBILITY':
4828
  case 'START_TYPING':
4829
  case 'STOP_TYPING':
4830
+ case 'UPDATE_BLOCK_LIST_SETTINGS':
4831
  return state;
4832
+ } // TODO: This is a source of bug, as each time there's a change in timing,
4833
+ // or a new action is added, this could break.
4834
+ // Reset the state by default (for any action not handled).
4835
 
4836
  }
4837
  /**
4941
  automaticChangeStatus,
4942
  highlightedBlock,
4943
  lastBlockInserted,
4944
+ temporarilyEditingAsBlocks,
4945
+ blockVisibility
4946
  }));
4947
 
4948
  ;// CONCATENATED MODULE: ./node_modules/rememo/es/rememo.js
6603
  const blockListSettings = getBlockListSettings(state, rootClientId);
6604
 
6605
  if (!blockListSettings) {
6606
+ return undefined;
6607
  }
6608
 
6609
  return blockListSettings.templateLock;
7738
  */
7739
 
7740
  function isBlockVisible(state, clientId) {
7741
+ var _state$blockVisibilit, _state$blockVisibilit2;
7742
 
7743
+ return (_state$blockVisibilit = (_state$blockVisibilit2 = state.blockVisibility) === null || _state$blockVisibilit2 === void 0 ? void 0 : _state$blockVisibilit2[clientId]) !== null && _state$blockVisibilit !== void 0 ? _state$blockVisibilit : true;
7744
  }
7745
  /**
7746
  * Returns the list of all hidden blocks.
7750
  */
7751
 
7752
  const __unstableGetVisibleBlocks = rememo(state => {
7753
+ return new Set(Object.keys(state.blockVisibility).filter(key => state.blockVisibility[key]));
7754
+ }, state => [state.blockVisibility]);
7755
  const __unstableGetContentLockingParent = rememo((state, clientId) => {
7756
  let current = clientId;
7757
  let result;
10214
 
10215
  const blockedPaths = ['color', 'border', 'typography', 'spacing'];
10216
  const deprecatedFlags = {
10217
+ 'color.palette': settings => settings.colors,
10218
+ 'color.gradients': settings => settings.gradients,
10219
  'color.custom': settings => settings.disableCustomColors === undefined ? undefined : !settings.disableCustomColors,
10220
  'color.customGradient': settings => settings.disableCustomGradients === undefined ? undefined : !settings.disableCustomGradients,
10221
+ 'typography.fontSizes': settings => settings.fontSizes,
10222
  'typography.customFontSize': settings => settings.disableCustomFontSizes === undefined ? undefined : !settings.disableCustomFontSizes,
10223
  'typography.lineHeight': settings => settings.enableCustomLineHeight,
10224
  'spacing.units': settings => {
10293
  name: blockName,
10294
  clientId
10295
  } = useBlockEditContext();
10296
+ return (0,external_wp_data_namespaceObject.useSelect)(select => {
10297
  if (blockedPaths.includes(path)) {
10298
  // eslint-disable-next-line no-console
10299
  console.warn('Top level useSetting paths are disabled. Please use a subpath to query the information needed.');
10302
 
10303
  let result;
10304
  const normalizedPath = removeCustomPrefixes(path); // 1. Take settings from the block instance or its ancestors.
10305
+ // Start from the current block and work our way up the ancestors.
10306
 
10307
+ const candidates = [clientId, ...select(store).getBlockParents(clientId,
10308
+ /* ascending */
10309
+ true)];
10310
+
10311
+ for (const candidateClientId of candidates) {
10312
  const candidateBlockName = select(store).getBlockName(candidateClientId);
10313
 
10314
  if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(candidateBlockName, '__experimentalSettings', false)) {
10315
  var _get;
10316
 
10317
  const candidateAtts = select(store).getBlockAttributes(candidateClientId);
10318
+ result = (_get = (0,external_lodash_namespaceObject.get)(candidateAtts, `settings.blocks.${blockName}.${normalizedPath}`)) !== null && _get !== void 0 ? _get : (0,external_lodash_namespaceObject.get)(candidateAtts, `settings.${normalizedPath}`);
10319
 
10320
+ if (result !== undefined) {
10321
+ // Stop the search for more distant ancestors and move on.
10322
+ break;
10323
  }
10324
  }
10325
+ } // 2. Fall back to the settings from the block editor store (__experimentalFeatures).
10326
+
10327
 
10328
  const settings = select(store).getSettings();
10329
 
10359
 
10360
  return normalizedPath === 'typography.dropCap' ? true : undefined;
10361
  }, [blockName, clientId, path]);
 
10362
  }
10363
 
10364
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/spacing-sizes-control/spacing-input-control.js
10745
  isLinked,
10746
  onClick
10747
  } = _ref;
10748
+ const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)('Unlink sides') : (0,external_wp_i18n_namespaceObject.__)('Link sides');
10749
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
10750
  text: label
10751
  }, (0,external_wp_element_namespaceObject.createElement)("span", {
10752
  className: "component-spacing-sizes-control__linked-button"
10753
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
 
10754
  isSmall: true,
10755
  icon: isLinked ? library_link : link_off,
10756
+ iconSize: 24,
10757
  "aria-label": label,
10758
  onClick: onClick
10759
  })));
11259
 
11260
 
11261
 
11262
+ const MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;
11263
 
11264
  function BlockPopover(_ref, ref) {
11265
  let {
11286
  height: selectedElement.offsetHeight
11287
  };
11288
  }, [selectedElement, lastSelectedElement, __unstableRefreshSize]);
11289
+ const [popoverAnchorRecomputeCounter, forceRecomputePopoverAnchor] = (0,external_wp_element_namespaceObject.useReducer)( // Module is there to make sure that the counter doesn't overflow.
11290
+ s => (s + 1) % MAX_POPOVER_RECOMPUTE_COUNTER, 0); // When blocks are moved up/down, they are animated to their new position by
11291
+ // updating the `transform` property manually (i.e. without using CSS
11292
+ // transitions or animations). The animation, which can also scroll the block
11293
+ // editor, can sometimes cause the position of the Popover to get out of sync.
11294
+ // A MutationObserver is therefore used to make sure that changes to the
11295
+ // selectedElement's attribute (i.e. `transform`) can be tracked and used to
11296
+ // trigger the Popover to rerender.
11297
+
11298
+ (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
11299
+ if (!selectedElement) {
11300
+ return;
11301
+ }
11302
+
11303
+ const observer = new window.MutationObserver(forceRecomputePopoverAnchor);
11304
+ observer.observe(selectedElement, {
11305
+ attributes: true
11306
+ });
11307
+ return () => {
11308
+ observer.disconnect();
11309
+ };
11310
+ }, [selectedElement]);
11311
+ const popoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => {
11312
+ if ( // popoverAnchorRecomputeCounter is by definition always equal or greater
11313
+ // than 0. This check is only there to satisfy the correctness of the
11314
+ // exhaustive-deps rule for the `useMemo` hook.
11315
+ popoverAnchorRecomputeCounter < 0 || !selectedElement || bottomClientId && !lastSelectedElement) {
11316
+ return undefined;
11317
+ }
11318
+
11319
+ return {
11320
+ getBoundingClientRect() {
11321
+ var _lastSelectedBCR$left, _lastSelectedBCR$top, _lastSelectedBCR$righ, _lastSelectedBCR$bott;
11322
+
11323
+ const selectedBCR = selectedElement.getBoundingClientRect();
11324
+ const lastSelectedBCR = lastSelectedElement === null || lastSelectedElement === void 0 ? void 0 : lastSelectedElement.getBoundingClientRect(); // Get the biggest rectangle that encompasses completely the currently
11325
+ // selected element and the last selected element:
11326
+ // - for top/left coordinates, use the smaller numbers
11327
+ // - for the bottom/right coordinates, use the largest numbers
11328
+
11329
+ const left = Math.min(selectedBCR.left, (_lastSelectedBCR$left = lastSelectedBCR === null || lastSelectedBCR === void 0 ? void 0 : lastSelectedBCR.left) !== null && _lastSelectedBCR$left !== void 0 ? _lastSelectedBCR$left : Infinity);
11330
+ const top = Math.min(selectedBCR.top, (_lastSelectedBCR$top = lastSelectedBCR === null || lastSelectedBCR === void 0 ? void 0 : lastSelectedBCR.top) !== null && _lastSelectedBCR$top !== void 0 ? _lastSelectedBCR$top : Infinity);
11331
+ const right = Math.max(selectedBCR.right, (_lastSelectedBCR$righ = lastSelectedBCR.right) !== null && _lastSelectedBCR$righ !== void 0 ? _lastSelectedBCR$righ : -Infinity);
11332
+ const bottom = Math.max(selectedBCR.bottom, (_lastSelectedBCR$bott = lastSelectedBCR.bottom) !== null && _lastSelectedBCR$bott !== void 0 ? _lastSelectedBCR$bott : -Infinity);
11333
+ const width = right - left;
11334
+ const height = bottom - top;
11335
+ return new window.DOMRect(left, top, width, height);
11336
+ },
11337
+
11338
+ ownerDocument: selectedElement.ownerDocument
11339
+ };
11340
+ }, [bottomClientId, lastSelectedElement, selectedElement, popoverAnchorRecomputeCounter]);
11341
 
11342
  if (!selectedElement || bottomClientId && !lastSelectedElement) {
11343
  return null;
11344
  }
11345
 
 
 
 
 
11346
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
11347
  ref: mergedRefs,
11348
  animate: false,
11349
  position: "top right left",
11350
  focusOnMount: false,
11351
+ anchor: popoverAnchor // Render in the old slot if needed for backward compatibility,
11352
  // otherwise render in place (not in the default popover slot).
11353
  ,
11354
  __unstableSlotName: __unstablePopoverSlot || null,
19854
  enableAnimation
19855
  } = (0,external_wp_data_namespaceObject.useSelect)(select => {
19856
  const {
19857
+ getBlockAttributes,
19858
  getBlockIndex,
19859
  getBlockMode,
19860
  getBlockName,
19865
  isAncestorMultiSelected,
19866
  isFirstMultiSelectedBlock
19867
  } = select(store);
19868
+ const {
19869
+ getActiveBlockVariation
19870
+ } = select(external_wp_blocks_namespaceObject.store);
19871
  const isSelected = isBlockSelected(clientId);
19872
  const isPartOfMultiSelection = isBlockMultiSelected(clientId) || isAncestorMultiSelected(clientId);
19873
  const blockName = getBlockName(clientId);
19874
  const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
19875
+ const attributes = getBlockAttributes(clientId);
19876
+ const match = getActiveBlockVariation(blockName, attributes);
19877
  return {
19878
  index: getBlockIndex(clientId),
19879
  mode: getBlockMode(clientId),
19880
  name: blockName,
19881
  blockApiVersion: (blockType === null || blockType === void 0 ? void 0 : blockType.apiVersion) || 1,
19882
+ blockTitle: (match === null || match === void 0 ? void 0 : match.title) || (blockType === null || blockType === void 0 ? void 0 : blockType.title),
19883
  isPartOfSelection: isSelected || isPartOfMultiSelection,
19884
  adjustScrolling: isSelected || isFirstMultiSelectedBlock(clientId),
19885
  enableAnimation: !isTyping() && getGlobalBlockCount() <= BLOCK_ANIMATION_THRESHOLD
21227
  }
21228
 
21229
  function isTabCandidate(node) {
21230
+ // Skip if there's only one child that is content editable (and thus a
21231
+ // better candidate).
21232
+ if (node.children.length === 1 && isInSameBlock(node, node.firstElementChild) && node.firstElementChild.getAttribute('contenteditable') === 'true') {
21233
+ return;
21234
+ } // Not a candidate if the node is not tabbable.
21235
+
21236
+
21237
  if (!external_wp_dom_namespaceObject.focus.tabbable.isTabbableIndex(node)) {
21238
  return false;
21239
  } // Skip focusable elements such as links within content editable nodes.
24023
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-preview/auto.js
24024
 
24025
 
24026
+
24027
  /**
24028
  * WordPress dependencies
24029
  */
24044
  let MemoizedBlockList;
24045
  const MAX_HEIGHT = 2000;
24046
 
24047
+ function ScaledBlockPreview(_ref) {
24048
  let {
24049
  viewportWidth,
24050
+ containerWidth,
24051
  __experimentalPadding,
24052
  __experimentalMinHeight
24053
  } = _ref;
 
 
 
24054
  const [contentResizeListener, {
24055
  height: contentHeight
24056
  }] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
24087
 
24088
  MemoizedBlockList = MemoizedBlockList || (0,external_wp_compose_namespaceObject.pure)(BlockList);
24089
  const scale = containerWidth / viewportWidth;
24090
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, {
 
 
24091
  className: "block-editor-block-preview__content",
24092
  style: {
24093
  transform: `scale(${scale})`,
24134
  key: preset.slug
24135
  })), (0,external_wp_element_namespaceObject.createElement)(MemoizedBlockList, {
24136
  renderAppender: false
24137
+ })));
24138
  }
24139
 
24140
+ function AutoBlockPreview(props) {
24141
+ const [containerResizeListener, {
24142
+ width: containerWidth
24143
+ }] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
24144
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", {
24145
+ style: {
24146
+ position: 'relative',
24147
+ width: '100%',
24148
+ height: 0
24149
+ }
24150
+ }, containerResizeListener), (0,external_wp_element_namespaceObject.createElement)("div", {
24151
+ className: "block-editor-block-preview__container"
24152
+ }, !!containerWidth && (0,external_wp_element_namespaceObject.createElement)(ScaledBlockPreview, _extends({}, props, {
24153
+ containerWidth: containerWidth
24154
+ }))));
24155
+ }
24156
 
24157
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-preview/index.js
24158
 
24205
  settings: settings
24206
  }, __experimentalLive ? (0,external_wp_element_namespaceObject.createElement)(LiveBlockPreview, {
24207
  onClick: __experimentalOnClick
24208
+ }) : (0,external_wp_element_namespaceObject.createElement)(AutoBlockPreview, {
24209
  viewportWidth: viewportWidth,
24210
  __experimentalPadding: __experimentalPadding,
24211
  __experimentalMinHeight: __experimentalMinHeight
27280
 
27281
 
27282
 
27283
+ const inbetween_MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;
27284
  const InsertionPointOpenRef = (0,external_wp_element_namespaceObject.createContext)();
27285
 
27286
  function BlockPopoverInbetween(_ref) {
27293
  ...props
27294
  } = _ref;
27295
  // This is a temporary hack to get the inbetween inserter to recompute properly.
27296
+ const [popoverRecomputeCounter, forcePopoverRecompute] = (0,external_wp_element_namespaceObject.useReducer)( // Module is there to make sure that the counter doesn't overflow.
27297
+ s => (s + 1) % inbetween_MAX_POPOVER_RECOMPUTE_COUNTER, 0);
27298
  const {
27299
  orientation,
27300
  rootClientId,
27320
  const nextElement = useBlockElement(nextClientId);
27321
  const isVertical = orientation === 'vertical';
27322
  const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
27323
+ if ( // popoverRecomputeCounter is by definition always equal or greater than 0.
27324
+ // This check is only there to satisfy the correctness of the
27325
+ // exhaustive-deps rule for the `useMemo` hook.
27326
+ popoverRecomputeCounter < 0 || !previousElement && !nextElement || !isVisible) {
27327
  return {};
27328
  }
27329
 
27347
  width,
27348
  height: previousRect ? previousRect.height : nextRect.height
27349
  };
27350
+ }, [previousElement, nextElement, isVertical, popoverRecomputeCounter, isVisible]);
27351
+ const popoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => {
27352
+ if ( // popoverRecomputeCounter is by definition always equal or greater than 0.
27353
+ // This check is only there to satisfy the correctness of the
27354
+ // exhaustive-deps rule for the `useMemo` hook.
27355
+ popoverRecomputeCounter < 0 || !previousElement && !nextElement || !isVisible) {
27356
+ return undefined;
27357
  }
27358
 
27359
  const {
27360
  ownerDocument
27361
  } = previousElement || nextElement;
27362
+ return {
27363
+ ownerDocument,
27364
 
27365
+ getBoundingClientRect() {
27366
+ const previousRect = previousElement ? previousElement.getBoundingClientRect() : null;
27367
+ const nextRect = nextElement ? nextElement.getBoundingClientRect() : null;
27368
+ let left = 0;
27369
+ let top = 0;
 
 
 
 
 
 
 
27370
 
27371
+ if (isVertical) {
27372
+ // vertical
27373
+ top = previousRect ? previousRect.bottom : nextRect.top;
 
 
 
 
 
 
 
27374
 
27375
+ if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
27376
+ // vertical, rtl
27377
+ left = previousRect ? previousRect.right : nextRect.right;
27378
+ } else {
27379
+ // vertical, ltr
27380
+ left = previousRect ? previousRect.left : nextRect.left;
27381
+ }
27382
+ } else {
27383
+ top = previousRect ? previousRect.top : nextRect.top;
27384
+
27385
+ if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
27386
+ // non vertical, rtl
27387
+ left = previousRect ? previousRect.left : nextRect.right;
27388
+ } else {
27389
+ // non vertical, ltr
27390
+ left = previousRect ? previousRect.right : nextRect.left;
27391
+ }
27392
+ }
27393
+
27394
+ return new window.DOMRect(left, top, 0, 0);
27395
+ }
27396
 
 
 
 
 
 
 
 
 
27397
  };
27398
+ }, [previousElement, nextElement, popoverRecomputeCounter, isVertical, isVisible]);
27399
  const popoverScrollRef = use_popover_scroll(__unstableContentRef); // This is only needed for a smooth transition when moving blocks.
27400
+ // When blocks are moved up/down, their position can be set by
27401
+ // updating the `transform` property manually (i.e. without using CSS
27402
+ // transitions or animations). The animation, which can also scroll the block
27403
+ // editor, can sometimes cause the position of the Popover to get out of sync.
27404
+ // A MutationObserver is therefore used to make sure that changes to the
27405
+ // selectedElement's attribute (i.e. `transform`) can be tracked and used to
27406
+ // trigger the Popover to rerender.
27407
 
27408
  (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
27409
  if (!previousElement) {
27410
  return;
27411
  }
27412
 
27413
+ const observer = new window.MutationObserver(forcePopoverRecompute);
27414
  observer.observe(previousElement, {
27415
  attributes: true
27416
  });
27423
  return;
27424
  }
27425
 
27426
+ const observer = new window.MutationObserver(forcePopoverRecompute);
27427
  observer.observe(nextElement, {
27428
  attributes: true
27429
  });
27436
  return;
27437
  }
27438
 
27439
+ previousElement.ownerDocument.defaultView.addEventListener('resize', forcePopoverRecompute);
27440
  return () => {
27441
+ previousElement.ownerDocument.defaultView.removeEventListener('resize', forcePopoverRecompute);
27442
  };
27443
  }, [previousElement]); // If there's either a previous or a next element, show the inbetween popover.
27444
  // Note that drag and drop uses the inbetween popover to show the drop indicator
27459
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
27460
  ref: popoverScrollRef,
27461
  animate: false,
27462
+ anchor: popoverAnchor,
27463
  focusOnMount: false // Render in the old slot if needed for backward compatibility,
27464
  // otherwise render in place (not in the default popover slot).
27465
  ,
27636
  opacity: 1,
27637
  borderRadius: '2px',
27638
  transition: {
27639
+ delay: isInserterShown ? 0.1 : 0,
27640
+ type: 'tween'
27641
  }
27642
  },
27643
  hover: { ...(!isVertical ? horizontalLine.hover : verticalLine.hover),
27644
  opacity: 1,
27645
  borderRadius: '2px',
27646
  transition: {
27647
+ delay: 0.1,
27648
+ type: 'tween'
27649
  }
27650
  }
27651
  };
27656
  rest: {
27657
  scale: 1,
27658
  transition: {
27659
+ type: 'tween'
27660
  }
27661
  }
27662
  };
27739
  showInsertionPoint,
27740
  hideInsertionPoint
27741
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
27742
+ const delayedShowInsertionPoint = (0,external_wp_compose_namespaceObject.useDebounce)(showInsertionPoint, 500, {
27743
+ trailing: true
27744
+ });
27745
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
27746
  if (isInBetweenInserterDisabled) {
27747
  return;
27759
  }
27760
 
27761
  if (!event.target.classList.contains('block-editor-block-list__layout')) {
27762
+ delayedShowInsertionPoint.cancel();
27763
+
27764
  if (isBlockInsertionPointVisible()) {
27765
  hideInsertionPoint();
27766
  }
27820
  const elementRect = element.getBoundingClientRect();
27821
 
27822
  if (orientation === 'horizontal' && (event.clientY > elementRect.bottom || event.clientY < elementRect.top) || orientation === 'vertical' && (event.clientX > elementRect.right || event.clientX < elementRect.left)) {
27823
+ delayedShowInsertionPoint.cancel();
27824
+
27825
  if (isBlockInsertionPointVisible()) {
27826
  hideInsertionPoint();
27827
  }
27833
  // the list (preserves the original behaviour).
27834
 
27835
  if (index === 0) {
27836
+ delayedShowInsertionPoint.cancel();
27837
+
27838
  if (isBlockInsertionPointVisible()) {
27839
  hideInsertionPoint();
27840
  }
27842
  return;
27843
  }
27844
 
27845
+ delayedShowInsertionPoint(rootClientId, index, {
27846
  __unstableWithInserter: true
27847
  });
27848
  }
31998
 
31999
 
32000
  const layouts = {
32001
+ group: {
32002
+ type: 'constrained'
32003
+ },
32004
  row: {
32005
  type: 'flex',
32006
  flexWrap: 'nowrap'
32037
  };
32038
  }, [clientIds, groupingBlockName]);
32039
 
32040
+ const onConvertToGroup = layout => {
 
32041
  const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocksSelection, groupingBlockName);
32042
 
32043
+ if (typeof layout !== 'string') {
32044
+ layout = 'group';
32045
+ }
32046
+
32047
  if (newBlocks && newBlocks.length > 0) {
32048
  // Because the block is not in the store yet we can't use
32049
  // updateBlockAttributes so need to manually update attributes.
32845
 
32846
  /** @typedef {import('../../selectors').WPDirectInsertBlock } WPDirectInsertBlock */
32847
 
32848
+ const pendingSettingsUpdates = new WeakMap();
32849
  /**
32850
  * This hook is a side effect which updates the block-editor store when changes
32851
  * happen to inner block settings. The given props are transformed into a
32873
  const {
32874
  updateBlockListSettings
32875
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
32876
+ const registry = (0,external_wp_data_namespaceObject.useRegistry)();
32877
  const {
32878
  blockListSettings,
32879
  parentLock
32917
  }
32918
 
32919
  if (!external_wp_isShallowEqual_default()(blockListSettings, newSettings)) {
32920
+ // Batch updates to block list settings to avoid triggering cascading renders
32921
+ // for each container block included in a tree and optimize initial render.
32922
+ // To avoid triggering updateBlockListSettings for each container block
32923
+ // causing X re-renderings for X container blocks,
32924
+ // we batch all the updatedBlockListSettings in a single "data" batch
32925
+ // which results in a single re-render.
32926
+ if (!pendingSettingsUpdates.get(registry)) {
32927
+ pendingSettingsUpdates.set(registry, []);
32928
+ }
32929
+
32930
+ pendingSettingsUpdates.get(registry).push([clientId, newSettings]);
32931
+ window.queueMicrotask(() => {
32932
+ var _pendingSettingsUpdat;
32933
+
32934
+ if ((_pendingSettingsUpdat = pendingSettingsUpdates.get(registry)) !== null && _pendingSettingsUpdat !== void 0 && _pendingSettingsUpdat.length) {
32935
+ registry.batch(() => {
32936
+ pendingSettingsUpdates.get(registry).forEach(args => {
32937
+ updateBlockListSettings(...args);
32938
+ });
32939
+ pendingSettingsUpdates.set(registry, []);
32940
+ });
32941
+ }
32942
+ });
32943
  }
32944
+ }, [clientId, blockListSettings, _allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, parentLock, captureToolbars, orientation, updateBlockListSettings, layout, registry]);
32945
  }
32946
 
32947
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inner-blocks/use-inner-block-template-sync.js
32988
  const {
32989
  replaceInnerBlocks
32990
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
32991
+ const innerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlocks(clientId), [clientId]);
32992
+ const {
32993
+ getBlocks
32994
+ } = (0,external_wp_data_namespaceObject.useSelect)(store); // Maintain a reference to the previous value so we can do a deep equality check.
32995
 
32996
  const existingTemplate = (0,external_wp_element_namespaceObject.useRef)(null);
32997
  (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
32998
+ // There's an implicit dependency between useInnerBlockTemplateSync and useNestedSettingsUpdate
32999
+ // The former needs to happen after the latter and since the latter is using microtasks to batch updates (performance optimization),
33000
+ // we need to schedule this one in a microtask as well.
33001
+ // Exemple: If you remove queueMicrotask here, ctrl + click to insert quote block won't close the inserter.
33002
+ window.queueMicrotask(() => {
33003
+ // Only synchronize innerBlocks with template if innerBlocks are empty
33004
+ // or a locking "all" or "contentOnly" exists directly on the block.
33005
+ const currentInnerBlocks = getBlocks(clientId);
33006
+ const shouldApplyTemplate = currentInnerBlocks.length === 0 || templateLock === 'all' || templateLock === 'contentOnly';
33007
  const hasTemplateChanged = !(0,external_lodash_namespaceObject.isEqual)(template, existingTemplate.current);
33008
 
33009
+ if (!shouldApplyTemplate || !hasTemplateChanged) {
33010
+ return;
33011
+ }
33012
 
33013
+ existingTemplate.current = template;
33014
+ const nextBlocks = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(currentInnerBlocks, template);
33015
+
33016
+ if (!(0,external_lodash_namespaceObject.isEqual)(nextBlocks, currentInnerBlocks)) {
33017
+ replaceInnerBlocks(clientId, nextBlocks, currentInnerBlocks.length === 0 && templateInsertUpdatesSelection && nextBlocks.length !== 0, // This ensures the "initialPosition" doesn't change when applying the template
33018
+ // If we're supposed to focus the block, we'll focus the first inner block
33019
+ // otherwise, we won't apply any auto-focus.
33020
+ // This ensures for instance that the focus stays in the inserter when inserting the "buttons" block.
33021
+ getSelectedBlocksInitialCaretPosition());
33022
  }
33023
+ });
33024
  }, [innerBlocks, template, templateLock, clientId]);
33025
  }
33026
 
33534
  useNestedSettingsUpdate(clientId, allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, __experimentalLayout);
33535
  useInnerBlockTemplateSync(clientId, template, templateLock, templateInsertUpdatesSelection);
33536
  const context = (0,external_wp_data_namespaceObject.useSelect)(select => {
33537
+ const block = select(store).getBlock(clientId); // This check is here to avoid the Redux zombie bug where a child subscription
33538
+ // is called before a parent, causing potential JS errors when the child has been removed.
33539
+
33540
+ if (!block) {
33541
+ return;
33542
+ }
33543
+
33544
  const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name);
33545
 
33546
  if (!blockType || !blockType.providesContext) {
33691
 
33692
  const elementContext = (0,external_wp_element_namespaceObject.createContext)();
33693
  const IntersectionObserver = (0,external_wp_element_namespaceObject.createContext)();
33694
+ const pendingBlockVisibilityUpdatesPerRegistry = new WeakMap();
33695
 
33696
  function Root(_ref) {
33697
  let {
33719
  editorMode: __unstableGetEditorMode()
33720
  };
33721
  }, []);
33722
+ const registry = (0,external_wp_data_namespaceObject.useRegistry)();
33723
  const {
33724
  setBlockVisibility
33725
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
33726
+ const delayedBlockVisibilityUpdates = (0,external_wp_compose_namespaceObject.useDebounce)((0,external_wp_element_namespaceObject.useCallback)(() => {
33727
+ const updates = {};
33728
+ pendingBlockVisibilityUpdatesPerRegistry.get(registry).forEach(_ref2 => {
33729
+ let [id, isIntersecting] = _ref2;
33730
+ updates[id] = isIntersecting;
33731
+ });
33732
+ setBlockVisibility(updates);
33733
+ }, [registry]), 300, {
33734
+ trailing: true
33735
+ });
33736
  const intersectionObserver = (0,external_wp_element_namespaceObject.useMemo)(() => {
33737
  const {
33738
  IntersectionObserver: Observer
33743
  }
33744
 
33745
  return new Observer(entries => {
33746
+ if (!pendingBlockVisibilityUpdatesPerRegistry.get(registry)) {
33747
+ pendingBlockVisibilityUpdatesPerRegistry.set(registry, []);
33748
+ }
33749
 
33750
  for (const entry of entries) {
33751
  const clientId = entry.target.getAttribute('data-block');
33752
+ pendingBlockVisibilityUpdatesPerRegistry.get(registry).push([clientId, entry.isIntersecting]);
33753
  }
33754
 
33755
+ delayedBlockVisibilityUpdates();
33756
  });
33757
  }, []);
33758
  const innerBlocksProps = useInnerBlocksProps({
33778
  }
33779
  BlockList.__unstableElementContext = elementContext;
33780
 
33781
+ function Items(_ref3) {
33782
  let {
33783
  placeholder,
33784
  rootClientId,
33785
  renderAppender,
33786
  __experimentalAppenderTagName,
33787
  __experimentalLayout: layout = defaultLayout
33788
+ } = _ref3;
33789
  const {
33790
  order,
33791
  selectedBlocks,
34090
  isLinked,
34091
  ...props
34092
  } = _ref;
34093
+ const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)('Unlink radii') : (0,external_wp_i18n_namespaceObject.__)('Link radii'); // TODO: Remove span after merging https://github.com/WordPress/gutenberg/pull/44198
34094
+
34095
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
34096
  text: label
34097
+ }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({}, props, {
34098
  className: "component-border-radius-control__linked-button",
 
 
34099
  isSmall: true,
34100
  icon: isLinked ? library_link : link_off,
34101
+ iconSize: 24,
34102
  "aria-label": label
34103
+ }))));
34104
  }
34105
 
34106
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-radius-control/index.js
37348
  (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/font-size/with-font-size-inline-styles', withFontSizeInlineStyles);
37349
  (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/font-size/addTransforms', font_size_addTransforms);
37350
 
37351
+ ;// CONCATENATED MODULE: ./packages/icons/build-module/library/reset.js
37352
+
37353
+
37354
+ /**
37355
+ * WordPress dependencies
37356
+ */
37357
+
37358
+ const reset_reset = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
37359
+ xmlns: "http://www.w3.org/2000/svg",
37360
+ viewBox: "0 0 24 24"
37361
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
37362
+ d: "M7 11.5h10V13H7z"
37363
+ }));
37364
+ /* harmony default export */ const library_reset = (reset_reset);
37365
+
37366
  ;// CONCATENATED MODULE: ./packages/icons/build-module/library/format-underline.js
37367
 
37368
 
37396
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/text-decoration-control/index.js
37397
 
37398
 
 
37399
  /**
37400
  * External dependencies
37401
  */
37408
 
37409
 
37410
  const TEXT_DECORATIONS = [{
37411
+ name: (0,external_wp_i18n_namespaceObject.__)('None'),
37412
+ value: 'none',
37413
+ icon: library_reset
37414
+ }, {
37415
  name: (0,external_wp_i18n_namespaceObject.__)('Underline'),
37416
  value: 'underline',
37417
  icon: format_underline
37435
  let {
37436
  value,
37437
  onChange,
37438
+ className
 
37439
  } = _ref;
37440
+ return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
37441
+ className: classnames_default()('block-editor-text-decoration-control', className)
37442
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, {
37443
+ as: "legend"
37444
+ }, (0,external_wp_i18n_namespaceObject.__)('Decoration')), (0,external_wp_element_namespaceObject.createElement)("div", {
37445
+ className: "block-editor-text-decoration-control__buttons"
37446
+ }, TEXT_DECORATIONS.map(textDecoration => {
37447
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
37448
  key: textDecoration.value,
 
37449
  icon: textDecoration.icon,
37450
+ label: textDecoration.name,
37451
+ isPressed: textDecoration.value === value,
37452
+ onClick: () => {
37453
+ onChange(textDecoration.value === value ? undefined : textDecoration.value);
37454
+ }
37455
  });
37456
+ })));
37457
  }
37458
 
37459
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/text-decoration.js
37613
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/text-transform-control/index.js
37614
 
37615
 
 
37616
  /**
37617
  * External dependencies
37618
  */
37623
 
37624
 
37625
 
37626
+
37627
  const TEXT_TRANSFORMS = [{
37628
+ name: (0,external_wp_i18n_namespaceObject.__)('None'),
37629
+ value: 'none',
37630
+ icon: library_reset
37631
+ }, {
37632
  name: (0,external_wp_i18n_namespaceObject.__)('Uppercase'),
37633
  value: 'uppercase',
37634
  icon: format_uppercase
37644
  /**
37645
  * Control to facilitate text transform selections.
37646
  *
37647
+ * @param {Object} props Component props.
37648
+ * @param {string} props.className Class name to add to the control.
37649
+ * @param {string} props.value Currently selected text transform.
37650
+ * @param {Function} props.onChange Handles change in text transform selection.
37651
  *
37652
  * @return {WPElement} Text transform control.
37653
  */
37654
 
37655
  function TextTransformControl(_ref) {
37656
  let {
37657
+ className,
37658
  value,
37659
+ onChange
 
37660
  } = _ref;
37661
+ return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
37662
+ className: classnames_default()('block-editor-text-transform-control', className)
37663
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, {
37664
+ as: "legend"
37665
+ }, (0,external_wp_i18n_namespaceObject.__)('Letter case')), (0,external_wp_element_namespaceObject.createElement)("div", {
37666
+ className: "block-editor-text-transform-control__buttons"
37667
+ }, TEXT_TRANSFORMS.map(textTransform => {
37668
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
37669
  key: textTransform.value,
 
37670
  icon: textTransform.icon,
37671
+ label: textTransform.name,
37672
+ isPressed: textTransform.value === value,
37673
+ onClick: () => {
37674
+ onChange(textTransform.value === value ? undefined : textTransform.value);
37675
+ }
37676
  });
37677
+ })));
37678
  }
37679
 
37680
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/text-transform.js
38055
  isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.lineHeight,
38056
  resetAllFilter: createResetAllFilter('lineHeight'),
38057
  panelId: clientId
38058
+ }, (0,external_wp_element_namespaceObject.createElement)(LineHeightEdit, props)), !isLetterSpacingDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
38059
+ className: "single-column",
38060
+ hasValue: () => hasLetterSpacingValue(props),
38061
+ label: (0,external_wp_i18n_namespaceObject.__)('Letter spacing'),
38062
+ onDeselect: () => resetLetterSpacing(props),
38063
+ isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.letterSpacing,
38064
+ resetAllFilter: createResetAllFilter('letterSpacing'),
38065
+ panelId: clientId
38066
+ }, (0,external_wp_element_namespaceObject.createElement)(LetterSpacingEdit, props)), !isTextDecorationDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
38067
  className: "single-column",
38068
  hasValue: () => hasTextDecorationValue(props),
38069
  label: (0,external_wp_i18n_namespaceObject.__)('Decoration'),
38072
  resetAllFilter: createResetAllFilter('textDecoration'),
38073
  panelId: clientId
38074
  }, (0,external_wp_element_namespaceObject.createElement)(TextDecorationEdit, props)), !isTextTransformDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
 
38075
  hasValue: () => hasTextTransformValue(props)
38076
  /* translators: Ensure translation is distinct from "Font size" */
38077
  ,
38080
  isShownByDefault: defaultControls === null || defaultControls === void 0 ? void 0 : defaultControls.textTransform,
38081
  resetAllFilter: createResetAllFilter('textTransform'),
38082
  panelId: clientId
38083
+ }, (0,external_wp_element_namespaceObject.createElement)(TextTransformEdit, props)));
 
 
 
 
 
 
 
 
38084
  }
38085
  const hasTypographySupport = blockName => {
38086
  return TYPOGRAPHY_SUPPORT_KEYS.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, key));
40334
  name
40335
  } = useBlockEditContext();
40336
  return (0,external_wp_element_namespaceObject.useMemo)(() => {
40337
+ let filteredCompleters = [...completers, autocompleters_link];
40338
 
40339
  if (name === (0,external_wp_blocks_namespaceObject.getDefaultBlockName)() || (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, '__experimentalSlashInserter', false)) {
40340
+ filteredCompleters = [...filteredCompleters, autocompleters_block];
40341
  }
40342
 
40343
  if ((0,external_wp_hooks_namespaceObject.hasFilter)('editor.Autocomplete.completers')) {
41538
  width: targetElement.offsetWidth - indent
41539
  };
41540
  }, [getDropIndicatorIndent, targetElement]);
41541
+ const popoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => {
41542
+ const isValidDropPosition = dropPosition === 'top' || dropPosition === 'bottom' || dropPosition === 'inside';
 
 
41543
 
41544
+ if (!targetElement || !isValidDropPosition) {
41545
+ return undefined;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41546
  }
41547
 
41548
+ return {
41549
+ ownerDocument: targetElement.ownerDocument,
41550
+
41551
+ getBoundingClientRect() {
41552
+ const rect = targetElement.getBoundingClientRect();
41553
+ const indent = getDropIndicatorIndent();
41554
+ const left = rect.left + indent;
41555
+ const right = rect.right;
41556
+ let top = 0;
41557
+ let bottom = 0;
41558
+
41559
+ if (dropPosition === 'top') {
41560
+ top = rect.top;
41561
+ bottom = rect.top;
41562
+ } else {
41563
+ // `dropPosition` is either `bottom` or `inside`
41564
+ top = rect.bottom;
41565
+ bottom = rect.bottom;
41566
+ }
41567
+
41568
+ const width = right - left;
41569
+ const height = bottom - top;
41570
+ return new window.DOMRect(left, top, width, height);
41571
+ }
41572
 
41573
+ };
41574
  }, [targetElement, dropPosition, getDropIndicatorIndent]);
41575
 
41576
  if (!targetElement) {
41579
 
41580
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
41581
  animate: false,
41582
+ anchor: popoverAnchor,
41583
  focusOnMount: false,
41584
  className: "block-editor-list-view-drop-indicator"
41585
  }, (0,external_wp_element_namespaceObject.createElement)("div", {
42185
  ref: treeGridRef,
42186
  onCollapseRow: collapseRow,
42187
  onExpandRow: expandRow,
42188
+ onFocusRow: focusRow,
42189
+ applicationAriaLabel: (0,external_wp_i18n_namespaceObject.__)('Block navigation structure')
42190
  }, (0,external_wp_element_namespaceObject.createElement)(ListViewContext.Provider, {
42191
  value: contextValue
42192
  }, (0,external_wp_element_namespaceObject.createElement)(branch, {
42332
  * External dependencies
42333
  */
42334
 
 
42335
  /**
42336
  * WordPress dependencies
42337
  */
42404
  return null;
42405
  }
42406
 
42407
+ const debouncedSetHoveredStyle = (0,external_wp_compose_namespaceObject.debounce)(setHoveredStyle, 250);
42408
 
42409
  const onSelectStylePreview = style => {
42410
  onSelect(style);
45119
  */
45120
 
45121
 
 
45122
  /**
45123
  * WordPress dependencies
45124
  */
45157
  this.bindSuggestionNode = this.bindSuggestionNode.bind(this);
45158
  this.autocompleteRef = props.autocompleteRef || (0,external_wp_element_namespaceObject.createRef)();
45159
  this.inputRef = (0,external_wp_element_namespaceObject.createRef)();
45160
+ this.updateSuggestions = (0,external_wp_compose_namespaceObject.debounce)(this.updateSuggestions.bind(this), 200);
45161
  this.suggestionNodes = [];
45162
  this.isUpdatingSuggestions = false;
45163
  this.state = {
47921
 
47922
 
47923
 
47924
+
47925
  /**
47926
  * Internal dependencies
47927
  */
47930
 
47931
 
47932
 
47933
+
47934
  function InlineSelectionToolbar(_ref) {
47935
  let {
47936
  value,
47937
+ editableContentElement,
47938
  activeFormats
47939
  } = _ref;
47940
  const lastFormat = activeFormats[activeFormats.length - 1];
47941
  const lastFormatType = lastFormat === null || lastFormat === void 0 ? void 0 : lastFormat.type;
47942
  const settings = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_richText_namespaceObject.store).getFormatType(lastFormatType), [lastFormatType]);
47943
+ const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({
47944
+ editableContentElement,
47945
  value,
47946
  settings
47947
  });
47948
  return (0,external_wp_element_namespaceObject.createElement)(InlineToolbar, {
47949
+ popoverAnchor: popoverAnchor
47950
  });
47951
  }
47952
 
47953
  function InlineToolbar(_ref2) {
47954
  let {
47955
+ popoverAnchor
47956
  } = _ref2;
47957
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
47958
  position: "top center",
47959
  focusOnMount: false,
47960
+ anchor: popoverAnchor,
47961
  className: "block-editor-rich-text__inline-format-toolbar",
47962
  __unstableSlotName: "block-toolbar"
47963
+ }, (0,external_wp_element_namespaceObject.createElement)(navigable_toolbar, {
47964
  className: "block-editor-rich-text__inline-format-toolbar-group"
47965
+ /* translators: accessibility text for the inline format toolbar */
47966
+ ,
47967
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Format tools')
47968
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(format_toolbar, null))));
47969
  }
47970
 
47971
  const FormatToolbarContainer = _ref3 => {
47972
  let {
47973
  inline,
47974
+ editableContentElement,
47975
  value
47976
  } = _ref3;
47977
  const hasInlineToolbar = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().hasInlineToolbar, []);
47978
 
47979
  if (inline) {
47980
  return (0,external_wp_element_namespaceObject.createElement)(InlineToolbar, {
47981
+ popoverAnchor: editableContentElement
47982
  });
47983
  }
47984
 
47990
  }
47991
 
47992
  return (0,external_wp_element_namespaceObject.createElement)(InlineSelectionToolbar, {
47993
+ editableContentElement: editableContentElement,
47994
  value: value,
47995
  activeFormats: activeFormats
47996
  });
49422
  let adjustedOnChange = originalOnChange; // Handle deprecated format.
49423
 
49424
  if (Array.isArray(originalValue)) {
49425
+ external_wp_deprecated_default()('wp.blockEditor.RichText value prop as children type', {
49426
+ since: '6.1',
49427
+ version: '6.3',
49428
+ alternative: 'value prop as string',
49429
+ link: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/'
49430
+ });
49431
  adjustedValue = external_wp_blocks_namespaceObject.children.toHTML(originalValue);
49432
 
49433
  adjustedOnChange = newValue => originalOnChange(external_wp_blocks_namespaceObject.children.fromDOM((0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, newValue).childNodes));
49569
  }
49570
 
49571
  function onFocus() {
49572
+ var _anchorRef$current;
49573
+
49574
+ (_anchorRef$current = anchorRef.current) === null || _anchorRef$current === void 0 ? void 0 : _anchorRef$current.focus();
49575
  }
49576
 
49577
  const TagName = tagName;
49593
  forwardedRef: anchorRef
49594
  })))), isSelected && hasFormats && (0,external_wp_element_namespaceObject.createElement)(format_toolbar_container, {
49595
  inline: inlineToolbar,
49596
+ editableContentElement: anchorRef.current,
49597
  value: value
49598
  }), (0,external_wp_element_namespaceObject.createElement)(TagName // Overridable props.
49599
  , _extends({
49656
 
49657
  // Handle deprecated `children` and `node` sources.
49658
  if (Array.isArray(value)) {
49659
+ external_wp_deprecated_default()('wp.blockEditor.RichText value prop as children type', {
49660
+ since: '6.1',
49661
+ version: '6.3',
49662
+ alternative: 'value prop as string',
49663
+ link: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/'
49664
+ });
49665
  value = external_wp_blocks_namespaceObject.children.toHTML(value);
49666
  }
49667
 
50267
  linkClass,
50268
  rel
50269
  } = _ref;
50270
+ const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false); // Use internal state instead of a ref to make sure that the component
50271
+ // re-renders when the popover's anchor updates.
50272
+
50273
+ const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
50274
  const openLinkUI = (0,external_wp_element_namespaceObject.useCallback)(() => {
50275
  setIsOpen(true);
50276
  });
50445
  label: url ? (0,external_wp_i18n_namespaceObject.__)('Edit link') : (0,external_wp_i18n_namespaceObject.__)('Insert link'),
50446
  "aria-expanded": isOpen,
50447
  onClick: openLinkUI,
50448
+ ref: setPopoverAnchor
50449
  }), isOpen && (0,external_wp_element_namespaceObject.createElement)(url_popover, {
50450
+ anchor: popoverAnchor,
50451
  onFocusOutside: onFocusOutside(),
50452
  onClose: closeLinkUI,
50453
  renderSettings: () => advancedOptions,
51133
 
51134
 
51135
 
51136
+
51137
+ function block_tools_selector(select) {
51138
+ const {
51139
+ __unstableGetEditorMode,
51140
+ getSettings,
51141
+ isTyping
51142
+ } = select(store);
51143
+ return {
51144
+ isZoomOutMode: __unstableGetEditorMode() === 'zoom-out',
51145
+ hasFixedToolbar: getSettings().hasFixedToolbar,
51146
+ isTyping: isTyping()
51147
+ };
51148
+ }
51149
  /**
51150
  * Renders block tools (the block toolbar, select/navigation mode toolbar, the
51151
  * insertion point and a slot for the inline rich text toolbar). Must be wrapped
51156
  * @param {Object} $0.__unstableContentRef Ref holding the content scroll container.
51157
  */
51158
 
51159
+
51160
  function BlockTools(_ref) {
51161
  let {
51162
  children,
51166
  const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
51167
  const {
51168
  hasFixedToolbar,
51169
+ isZoomOutMode,
51170
+ isTyping
51171
+ } = (0,external_wp_data_namespaceObject.useSelect)(block_tools_selector, []);
 
 
 
 
 
 
 
 
51172
  const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)();
51173
  const {
51174
  getSelectedBlockClientIds,
51250
  onKeyDown: onKeyDown
51251
  }), (0,external_wp_element_namespaceObject.createElement)(insertion_point_InsertionPointOpenRef.Provider, {
51252
  value: (0,external_wp_element_namespaceObject.useRef)(false)
51253
+ }, !isTyping && !isZoomOutMode && (0,external_wp_element_namespaceObject.createElement)(InsertionPoint, {
51254
  __unstableContentRef: __unstableContentRef
51255
  }), !isZoomOutMode && (hasFixedToolbar || !isLargeViewport) && (0,external_wp_element_namespaceObject.createElement)(block_contextual_toolbar, {
51256
  isFixed: true
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-date', '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-style-engine', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'b2da143bf2d4dc7bc46a');
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-date', '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-style-engine', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '6c454a6a838865d241f5');
build/block-editor/index.min.js CHANGED
@@ -1,115 +1,116 @@
1
- (()=>{var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(n=function(e,t){"use strict";var n,o,l="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))}}),r=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){r=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!l.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]})),l.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",l.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),l=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})),l&&(document.documentElement.scrollTop=l)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),l="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(l<t?"hidden"===n.overflowY&&(c("scroll"),u(),l="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),l="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==l){o=l;var i=r("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=l.get(e);t&&t.destroy()}function a(e){var t=l.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function l(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)){if(n.length){var i=l.apply(null,n);i&&e.push(i)}}else if("object"===r)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?(l.default=l,e.exports=l):void 0===(n=function(){return l}.apply(t,[]))||(e.exports=n)}()},4827:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:(e,t)=>{"use strict";function n(){}function o(e,t,n,o,l){for(var r=0,i=t.length,s=0,a=0;r<i;r++){var c=t[r];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,r&&t[r-1].added){var u=t[r-1];t[r-1]=t[r],t[r]=u}}else{if(!c.added&&l){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 l(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]:{},r=n.callback;"function"==typeof n&&(r=n,n={}),this.options=n;var i=this;function s(e){return r?(setTimeout((function(){r(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 g(){for(var n=-1*u;n<=u;n+=2){var r=void 0,d=p[n-1],m=p[n+1],g=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1<a,f=m&&0<=g&&g<c;if(h||f){if(!h||f&&d.newPos<m.newPos?(r=l(m),i.pushComponent(r.components,void 0,!0)):((r=d).newPos++,i.pushComponent(r.components,!0,void 0)),g=i.extractCommon(r,t,e,n),r.newPos+1>=a&&g+1>=c)return s(o(i,r.components,t,e,i.useLongestToken));p[n]=r}else p[n]=void 0}u++}if(r)!function e(){setTimeout((function(){if(u>d)return r();g()||e()}),0)}();else for(;u<=d;){var h=g();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 l=t.length,r=n.length,i=e.newPos,s=i-o,a=0;i+1<l&&s+1<r&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:(e,t,n)=>{"use strict";var o;t.Kx=function(e,t,n){return l.diff(e,t,n)};var l=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:(e,t,n)=>{"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var l=n.allowHorizontalScroll,r=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;l=void 0===l||l;var p=o.isWindow(t),m=!(!p||!t.frameElement),g=o.offset(e),h=o.outerHeight(e),f=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:g.left-S.left-c,top:g.top-S.top-a},E={left:g.left+f-(S.left+w)+d,top:g.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:g.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:g.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:g.left+f-(v.left+_+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:g.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):r||((i=void 0===i||!!i)?o.scrollTop(t,k.top+y.top):o.scrollTop(t,k.top+E.top)),l&&(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):r||((s=void 0===s||!!s)?o.scrollLeft(t,k.left+y.left):o.scrollLeft(t,k.left+E.left)))}},5425:(e,t,n)=>{"use strict";e.exports=n(1345)},5022: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 l=e.document;"number"!=typeof(n=l.documentElement[o])&&(n=l.body[o])}return n}function l(e){return o(e)}function r(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,l=e.ownerDocument,r=l.body,i=l&&l.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||r.clientLeft||0,top:o-=i.clientTop||r.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=l(o),t.top+=r(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="",l=e.ownerDocument,r=n||l.defaultView.getComputedStyle(e,null);return r&&(o=r.getPropertyValue(t)||r[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,l=o.left,r=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=l,e.runtimeStyle.left=r}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},l=e.style,r=void 0;for(r in t)t.hasOwnProperty(r)&&(o[r]=l[r],l[r]=t[r]);for(r in n.call(e),t)t.hasOwnProperty(r)&&(l[r]=o[r])}function g(e,t,n){var o=0,l=void 0,r=void 0,i=void 0;for(r=0;r<t.length;r++)if(l=t[r])for(i=0;i<n.length;i++){var s;s="border"===l?l+n[i]+"Width":l+n[i],o+=parseFloat(c(e,s))||0}return o}function h(e){return null!=e&&e==e.window}var f={};function v(e,t,n){if(h(e))return"width"===t?f.viewportWidth(e):f.viewportHeight(e);if(9===e.nodeType)return"width"===t?f.docWidth(e):f.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],l="width"===t?e.offsetWidth:e.offsetHeight,r=(c(e),d(e)),i=0;(null==l||l<=0)&&(l=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=r?1:-1);var s=void 0!==l||r,a=l||i;if(-1===n)return s?a-g(e,["border","padding"],o):i;if(s){var u=2===n?-g(e,["border"],o):g(e,["margin"],o);return a+(1===n?0:u)}return i+g(e,p.slice(n),o)}u(["Width","Height"],(function(e){f["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],f["viewport"+e](n))},f["viewport"+e]=function(t){var n="client"+e,o=t.document,l=o.body,r=o.documentElement[n];return"CSS1Compat"===o.compatMode&&r||l&&l[n]||r}}));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 l=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==l?("number"==typeof l&&(l+="px"),void(e.style[t]=l)):c(e,t);for(var r in t)t.hasOwnProperty(r)&&k(e,r,t[r])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);f["outer"+t]=function(t,n){return t&&_(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];f[e]=function(t,o){return void 0===o?t&&_(t,e,-1):t?(c(t),d(t)&&(o+=g(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={},l=void 0,r=void 0;for(r in t)t.hasOwnProperty(r)&&(l=parseFloat(k(e,r))||0,o[r]=l+t[r]-n[r]);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 l(e);window.scrollTo(t,r(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(l(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},f)},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:(e,t,n)=>{var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var l=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),l?e.style.lineHeight=l: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 r=e.nodeName,i=document.createElement(r);i.innerHTML="&nbsp;","TEXTAREA"===r.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},5372:(e,t,n)=>{"use strict";var o=n(9567);function l(){}function r(){}r.resetWarningCache=l,e.exports=function(){function e(e,t,n,l,r,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:r,resetWarningCache:l};return n.PropTypes=n,n}},2652:(e,t,n)=>{e.exports=n(5372)()},9567:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,l=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 __)}),r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);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 l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&(n[o[l]]=e[o[l]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return l(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),l=(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",r({},a,{onChange:this.onChange,style:u?r({},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)}}),l)},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,r({},e,{innerRef:t}))}))},773:(e,t,n)=>{"use strict";var o=n(5438);t.Z=o.TextareaAutosize},4793:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),l=new RegExp(n,""),r=function(e){return e.replace(o,(function(e){return t[e]}))};e.exports=r,e.exports.has=function(e){return!!e.match(l)},e.exports.remove=r},3124: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?l(d):d,m={},g=!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&&(g=!1)},delete:function(e){delete h.parent.node[h.key],e&&(g=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key],e&&(g=!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(){g=!1}};if(!u)return h;function f(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=r(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}f();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),g?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),f(),a(h.keys,(function(t,l){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var r=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=r.node),r.isLast=l==h.keys.length-1,r.isFirst=0==l,m.post&&m.post.call(h,r),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(e).node}function l(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(r(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 l=e[o];c.call(n,l)||(n[l]={}),n=n[l]}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=l(o);return e.push(o),t.push(s),a(r(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var r=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(r(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),l=new n(t);return l[e].apply(l,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:e=>{"use strict";e.exports=window.React}},t={};function n(o){var l=t[o];if(void 0!==l)return l.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentControl:()=>qb,AlignmentToolbar:()=>Yb,Autocomplete:()=>r_,BlockAlignmentControl:()=>Pr,BlockAlignmentToolbar:()=>Lr,BlockBreadcrumb:()=>d_,BlockColorsStyleSelector:()=>h_,BlockContextProvider:()=>$r,BlockControls:()=>ko,BlockEdit:()=>Yr,BlockEditorKeyboardShortcuts:()=>pC,BlockEditorProvider:()=>Tu,BlockFormatControls:()=>_o,BlockIcon:()=>Su,BlockInspector:()=>iC,BlockList:()=>Gh,BlockMover:()=>Ym,BlockNavigationDropdown:()=>O_,BlockPreview:()=>ip,BlockSelectionClearer:()=>Lu,BlockSettingsMenu:()=>ih,BlockSettingsMenuControls:()=>th,BlockStyles:()=>G_,BlockTitle:()=>Om,BlockToolbar:()=>hh,BlockTools:()=>aC,BlockVerticalAlignmentControl:()=>ql,BlockVerticalAlignmentToolbar:()=>Yl,ButtonBlockAppender:()=>Bm,ButtonBlockerAppender:()=>wm,ColorPalette:()=>rk,ColorPaletteControl:()=>ik,ContrastChecker:()=>zf,CopyHandler:()=>Dg,DefaultBlockAppender:()=>Cm,FontSizePicker:()=>Sv,InnerBlocks:()=>zh,Inserter:()=>Em,InspectorAdvancedControls:()=>fl,InspectorControls:()=>vl,JustifyContentControl:()=>Xl,JustifyToolbar:()=>Jl,LineHeightControl:()=>iv,MediaPlaceholder:()=>Ky,MediaReplaceFlow:()=>Hy,MediaUpload:()=>Oy,MediaUploadCheck:()=>zy,MultiSelectScrollIntoView:()=>mC,NavigableToolbar:()=>Xm,ObserveTyping:()=>vC,PanelColorSettings:()=>qy,PlainText:()=>xE,RichText:()=>wE,RichTextShortcut:()=>PE,RichTextToolbarButton:()=>LE,SETTINGS_DEFAULTS:()=>v,SkipToSelectedBlock:()=>ZE,ToolSelector:()=>AE,Typewriter:()=>yC,URLInput:()=>ny,URLInputButton:()=>FE,URLPopover:()=>Wy,Warning:()=>Qr,WritingFlow:()=>ju,__experimentalBlockAlignmentMatrixControl:()=>c_,__experimentalBlockFullHeightAligmentControl:()=>s_,__experimentalBlockPatternSetup:()=>ek,__experimentalBlockPatternsList:()=>xp,__experimentalBlockVariationPicker:()=>W_,__experimentalBlockVariationTransforms:()=>ok,__experimentalBorderRadiusControl:()=>nf,__experimentalColorGradientControl:()=>Mf,__experimentalColorGradientSettingsDropdown:()=>Of,__experimentalDateFormatPicker:()=>ck,__experimentalDuotoneControl:()=>ub,__experimentalFontAppearanceControl:()=>rv,__experimentalFontFamilyControl:()=>fv,__experimentalGetBorderClassesAndStyles:()=>wb,__experimentalGetColorClassesAndStyles:()=>Ib,__experimentalGetElementClassName:()=>TC,__experimentalGetGapCSSValue:()=>Fl,__experimentalGetGradientClass:()=>Ef,__experimentalGetGradientObjectByGradientValue:()=>Sf,__experimentalGetMatchingVariation:()=>PC,__experimentalGetSpacingClassesAndStyles:()=>Nb,__experimentalImageEditingProvider:()=>Ak,__experimentalImageEditor:()=>$k,__experimentalImageSizeControl:()=>qk,__experimentalImageURLInputUI:()=>KE,__experimentalInspectorPopoverHeader:()=>BC,__experimentalLayoutStyle:()=>kr,__experimentalLetterSpacingControl:()=>jv,__experimentalLibrary:()=>uC,__experimentalLinkControl:()=>My,__experimentalLinkControlSearchInput:()=>Sy,__experimentalLinkControlSearchItem:()=>dy,__experimentalLinkControlSearchResults:()=>vy,__experimentalListView:()=>A_,__experimentalPanelColorGradientSettings:()=>hk,__experimentalPreviewOptions:()=>qE,__experimentalPublishDateTimePicker:()=>IC,__experimentalRecursionProvider:()=>CC,__experimentalResponsiveBlockControl:()=>NE,__experimentalSpacingSizesControl:()=>ll,__experimentalTextDecorationControl:()=>Rv,__experimentalTextTransformControl:()=>Gv,__experimentalUnitControl:()=>DE,__experimentalUseBlockOverlayActive:()=>pu,__experimentalUseBlockPreview:()=>sp,__experimentalUseBorderProps:()=>Bb,__experimentalUseColorProps:()=>Tb,__experimentalUseCustomSides:()=>Al,__experimentalUseGradient:()=>Bf,__experimentalUseHasRecursion:()=>SC,__experimentalUseMultipleOriginColorsAndGradients:()=>cf,__experimentalUseResizeCanvas:()=>YE,__unstableBlockNameContext:()=>gh,__unstableBlockSettingsMenuFirstItem:()=>Ug,__unstableBlockToolbarLastItem:()=>Ng,__unstableDuotoneFilter:()=>tp,__unstableDuotoneStylesheet:()=>Jd,__unstableDuotoneUnsetStylesheet:()=>ep,__unstableEditorStyles:()=>Qd,__unstableGetValuesFromColors:()=>Xd,__unstableIframe:()=>Yu,__unstableInserterMenuExtension:()=>dm,__unstablePresetDuotoneFilter:()=>np,__unstableRichTextInputEvent:()=>ME,__unstableUseBlockSelectionClearer:()=>Pu,__unstableUseClipboardHandler:()=>Ag,__unstableUseMouseMoveTypingReset:()=>hC,__unstableUseTypewriter:()=>kC,__unstableUseTypingObserver:()=>fC,createCustomColorsHOC:()=>Ob,getColorClassName:()=>sf,getColorObjectByAttributeValues:()=>lf,getColorObjectByColorValue:()=>rf,getFontSize:()=>yv,getFontSizeClass:()=>Cv,getFontSizeObjectByValue:()=>Ev,getGradientSlugByValue:()=>wf,getGradientValueBySlug:()=>Cf,getPxFromCssUnit:()=>HC,getTypographyClassesAndStyles:()=>Pb,store:()=>co,storeConfig:()=>ao,transformStyles:()=>qd,useBlockDisplayInformation:()=>Am,useBlockEditContext:()=>go,useBlockProps:()=>mu,useCachedTruthy:()=>Lb,useInnerBlocksProps:()=>Oh,useSetting:()=>Yo,withColorContext:()=>lk,withColors:()=>zb,withFontSizes:()=>Hb});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:()=>Vt,__experimentalGetAllowedBlocks:()=>_t,__experimentalGetAllowedPatterns:()=>Ct,__experimentalGetBlockListSettingsForBlocks:()=>Tt,__experimentalGetDirectInsertBlock:()=>kt,__experimentalGetGlobalBlocksByName:()=>ee,__experimentalGetLastBlockAttributeChanges:()=>Lt,__experimentalGetParsedPattern:()=>yt,__experimentalGetPatternTransformItems:()=>wt,__experimentalGetPatternsByBlockTypes:()=>St,__experimentalGetReusableBlockTitle:()=>Nt,__unstableGetBlockWithoutInnerBlocks:()=>K,__unstableGetClientIdWithClientIdsTree:()=>Y,__unstableGetClientIdsTree:()=>Z,__unstableGetContentLockingParent:()=>Wt,__unstableGetEditorMode:()=>At,__unstableGetSelectedBlocksWithPartialSelection:()=>Re,__unstableGetTemporarilyEditingAsBlocks:()=>$t,__unstableGetVisibleBlocks:()=>Ut,__unstableHasActiveBlockOverlayActive:()=>jt,__unstableIsFullySelected:()=>Ne,__unstableIsLastBlockChangeIgnored:()=>Pt,__unstableIsSelectionCollapsed:()=>Pe,__unstableIsSelectionMergeable:()=>Me,__unstableIsWithinBlockOverlay:()=>Kt,__unstableSelectionHasUnmergeableBlock:()=>Le,areInnerBlocksControlled:()=>Ft,canEditBlock:()=>ct,canInsertBlockType:()=>ot,canInsertBlocks:()=>lt,canLockBlockType:()=>ut,canMoveBlock:()=>st,canMoveBlocks:()=>at,canRemoveBlock:()=>rt,canRemoveBlocks:()=>it,didAutomaticChange:()=>Ot,getAdjacentBlockClientId:()=>fe,getBlock:()=>j,getBlockAttributes:()=>$,getBlockCount:()=>ne,getBlockHierarchyRootClientId:()=>ge,getBlockIndex:()=>De,getBlockInsertionPoint:()=>Ze,getBlockListSettings:()=>Bt,getBlockMode:()=>Ue,getBlockName:()=>U,getBlockOrder:()=>Ae,getBlockParents:()=>pe,getBlockParentsByBlockName:()=>me,getBlockRootClientId:()=>de,getBlockSelectionEnd:()=>ie,getBlockSelectionStart:()=>re,getBlockTransformItems:()=>vt,getBlocks:()=>q,getBlocksByClientId:()=>te,getClientIdsOfDescendants:()=>Q,getClientIdsWithDescendants:()=>X,getDraggedBlockClientIds:()=>je,getFirstMultiSelectedBlockClientId:()=>Ce,getGlobalBlockCount:()=>J,getInserterItems:()=>ft,getLastMultiSelectedBlockClientId:()=>Se,getLowestCommonAncestorWithSelectedBlock:()=>he,getMultiSelectedBlockClientIds:()=>ye,getMultiSelectedBlocks:()=>Ee,getMultiSelectedBlocksEndClientId:()=>Te,getMultiSelectedBlocksStartClientId:()=>xe,getNextBlockClientId:()=>be,getPreviousBlockClientId:()=>ve,getSelectedBlock:()=>ue,getSelectedBlockClientId:()=>ce,getSelectedBlockClientIds:()=>ke,getSelectedBlockCount:()=>se,getSelectedBlocksInitialCaretPosition:()=>_e,getSelectionEnd:()=>le,getSelectionStart:()=>oe,getSettings:()=>It,getTemplate:()=>Je,getTemplateLock:()=>et,hasBlockMovingClientId:()=>Dt,hasInserterItems:()=>bt,hasMultiSelection:()=>Ve,hasSelectedBlock:()=>ae,hasSelectedInnerBlock:()=>ze,isAncestorBeingDragged:()=>qe,isAncestorMultiSelected:()=>Ie,isBlockBeingDragged:()=>Ke,isBlockHighlighted:()=>zt,isBlockInsertionPointVisible:()=>Qe,isBlockMultiSelected:()=>Be,isBlockSelected:()=>Oe,isBlockValid:()=>W,isBlockVisible:()=>Gt,isBlockWithinSelection:()=>Fe,isCaretWithinFormattedText:()=>Ye,isDraggingBlocks:()=>$e,isFirstMultiSelectedBlock:()=>we,isLastBlockChangePersistent:()=>xt,isMultiSelecting:()=>He,isNavigationMode:()=>Rt,isSelectionEnabled:()=>Ge,isTyping:()=>We,isValidTemplate:()=>Xe,wasBlockJustInserted:()=>Ht});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:()=>xn,__unstableExpandSelection:()=>Nn,__unstableMarkAutomaticChange:()=>Yn,__unstableMarkLastChangeAsPersistent:()=>Kn,__unstableMarkNextChangeAsNotPersistent:()=>qn,__unstableSaveReusableBlock:()=>jn,__unstableSetEditorMode:()=>Qn,__unstableSetTemporarilyEditingAsBlocks:()=>io,__unstableSplitSelection:()=>Tn,clearSelectedBlock:()=>dn,duplicateBlocks:()=>Jn,enterFormattedText:()=>Vn,exitFormattedText:()=>Hn,flashBlock:()=>oo,hideInsertionPoint:()=>wn,insertAfterBlock:()=>to,insertBeforeBlock:()=>eo,insertBlock:()=>En,insertBlocks:()=>Cn,insertDefaultBlock:()=>Un,mergeBlocks:()=>Pn,moveBlockToPosition:()=>yn,moveBlocksDown:()=>vn,moveBlocksToPosition:()=>kn,moveBlocksUp:()=>bn,multiSelect:()=>un,receiveBlocks:()=>tn,removeBlock:()=>Mn,removeBlocks:()=>Ln,replaceBlock:()=>hn,replaceBlocks:()=>gn,replaceInnerBlocks:()=>Rn,resetBlocks:()=>Xt,resetSelection:()=>en,selectBlock:()=>ln,selectNextBlock:()=>sn,selectPreviousBlock:()=>rn,selectionChange:()=>Gn,setBlockMovingClientId:()=>Xn,setBlockVisibility:()=>ro,setHasControlledInnerBlocks:()=>lo,setNavigationMode:()=>Zn,setTemplateValidity:()=>Bn,showInsertionPoint:()=>Sn,startDraggingBlocks:()=>zn,startMultiSelect:()=>an,startTyping:()=>Dn,stopDraggingBlocks:()=>Fn,stopMultiSelect:()=>cn,stopTyping:()=>On,synchronizeTemplate:()=>In,toggleBlockHighlight:()=>no,toggleBlockMode:()=>An,toggleSelection:()=>pn,updateBlock:()=>on,updateBlockAttributes:()=>nn,updateBlockListSettings:()=>Wn,updateSettings:()=>$n,validateBlocksToTemplate:()=>Jt});const l=window.wp.blocks,r=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,r.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,l.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));const s=window.wp.element;var a=n(4403),c=n.n(a);const u=window.lodash,d=window.wp.compose,p=window.wp.data,m=window.wp.components,g={default:(0,m.createSlotFill)("BlockControls"),block:(0,m.createSlotFill)("BlockControlsBlock"),inline:(0,m.createSlotFill)("BlockFormatControls"),other:(0,m.createSlotFill)("BlockControlsOther"),parent:(0,m.createSlotFill)("BlockControlsParent")},h=window.wp.i18n,f={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,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!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 l=[...e];return l.splice(t,o),b(l,e.slice(t,t+o),n)}const k=e=>e;function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:l}=e;n[t].push(o),Object.assign(n,y(l,o))})),n}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},E(n.innerBlocks,n.clientId))),{})}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...l}=o.shift();o.push(...e),n[l.clientId]=t(l)}return n}function S(e){return C(e,(e=>(0,u.omit)(e,"attributes")))}function w(e){return C(e,(e=>e.attributes))}function B(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)(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function I(e,t){const n={},o=[...t],l=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),l.push(...e.innerBlocks)}for(const e of l)n[e.clientId]={};for(const t of l)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function x(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const l=new Set([]),r=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){r.add(n);break}l.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of l)t[e]={...t[e]};for(const n of l)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of r)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const T=(0,u.flow)(p.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,l)=>{const{name:r}=t.byClientId[l];return"core/block"===r&&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=I(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=x(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=x(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=I(o,n.blocks);o.tree=x(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const l=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||l.push(t.parents[e]);o.tree=x(o,o.tree,l,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const l of n.clientIds)void 0===t.parents[l]||""!==t.parents[l]&&!o.byClientId[t.parents[l]]||e.push(t.parents[l]);o.tree=x(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=x(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=Object.keys((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=x(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let l=0;l<o.length;l++)!t.order[o[l]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[l]]||(o===e&&(o=[...o]),o.push(...t.order[o[l]]));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,...l}=e.shift();e.push(...n),t.controlledInnerBlocks[l.clientId]&&(o[l.clientId]=!0)}}let l=t;t.order[n.rootClientId]&&(l=e(l,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let r=l;return n.blocks.length&&(r=e(r,{...n,type:"INSERT_BLOCKS",index:0}),r.order={...r.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})},r.tree={...r.tree,...(0,u.reduce)(o,((e,n,o)=>{const l=`controlled||${o}`;return t.tree[l]&&(e[l]=t.tree[l]),e}),{})}),r}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:S(n.blocks),attributes:w(n.blocks),order:y(n.blocks),parents:E(n.blocks),controlledInnerBlocks:{},visibility:{}},o=I(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,l)=>{let r=e(o,l);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===l.type||n;if(o===r&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===l.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...r,isPersistentChange:e}}return r={...r,isPersistentChange:i?!n:!B(l,t)},t=l,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===l.type,r}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const l=e(n,o);return l!==n&&(l.isIgnoredChange=t.has(o.type)),l}}),(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,...S(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),...S(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,...w(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,l)=>{var r,i;return n!==t[l]&&((t=(r=e[o])===(i=t)?{...r}:i)[l]=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),...w(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=y(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]||[],l=y(t.blocks,n),{index:r=o.length}=t;return{...e,...l,[n]:b(o,l[n],r)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:l}=t,{index:r=e[o].length}=t;if(n===o){const t=e[o].indexOf(l[0]);return{...e,[o]:_(e[o],t,r,l.length)}}return{...e,[n]:(0,u.without)(e[n],...l),[o]:b(e[o],l,r)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,l=n[0],r=e[o];if(!r.length||l===r[0])return e;const i=r.indexOf(l);return{...e,[o]:_(r,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,l=n[0],r=n[n.length-1],i=e[o];if(!i.length||r===i[i.length-1])return e;const s=i.indexOf(l);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=y(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,...E(t.blocks)};case"INSERT_BLOCKS":return{...e,...E(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),...E(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},visibility(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}});function N(){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}const P=(0,p.combineReducers)({blocks:T,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},selection:function(){var e,t,n,o;let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;switch(r.type){case"SELECTION_CHANGE":return r.clientId?{selectionStart:{clientId:r.clientId,attributeKey:r.attributeKey,offset:r.startOffset},selectionEnd:{clientId:r.clientId,attributeKey:r.attributeKey,offset:r.endOffset}}:{selectionStart:r.start||l.selectionStart,selectionEnd:r.end||l.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=r;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=r;return a===(null===(e=l.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=l.selectionEnd)||void 0===t?void 0:t.clientId)?l:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==l||null===(n=l.selectionStart)||void 0===n?void 0:n.clientId,d=null==l||null===(o=l.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return l;if(!r.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!r.blocks.some((e=>e.clientId===d)))return{...l,selectionEnd:l.selectionStart}}return{selectionStart:N(l.selectionStart,r),selectionEnd:N(l.selectionEnd,r)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,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:r}=n,i=(0,p.select)(l.store).getActiveBlockVariation(r,o);let s=null!=i&&i.name?`${r}/${i.name}`:r;const a={name:s};return"core/block"===r&&(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},editorMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"edit",t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode: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_EDITOR_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"SET_BLOCK_VISIBILITY":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},temporarilyEditingAsBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e}});var L={};function M(e){return[e]}function R(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 A(e,t){var n,o=t||M;function l(e){var t,o,l,r,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):(l=new WeakMap,s.set(o,l),s=l)}return s.has(L)||((r=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(L,r)),s.get(L)}function r(){n=new WeakMap}function i(){var t,n,r,i,s,a=arguments.length;for(i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];for((t=l(s=o.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!R(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(R(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return i.getDependants=o,i.clear=r,r(),i}const D=window.wp.primitives,O=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),z=window.wp.richText,F=window.wp.deprecated;var V=n.n(F);function H(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const G=[];function U(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:l}=n;return l?`core/social-link-${l}`:o}return n?n.name:null}function W(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function $(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function j(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const K=A(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:$(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function q(e,t){var n;const o=t&&Ft(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||G}const Y=A(((e,t)=>({clientId:t,innerBlocks:Z(e,t)})),(e=>[e.blocks.order])),Z=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Ae(e,t),(t=>Y(e,t)))}),(e=>[e.blocks.order])),Q=A(((e,t)=>{const n=[];for(const o of t)for(const t of Ae(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Ae(e))t.push(n,...Q(e,[n]));return t}),(e=>[e.blocks.order])),J=A(((e,t)=>{const n=X(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])),ee=A(((e,t)=>{if(!t)return G;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:G}),(e=>[e.blocks.order,e.blocks.byClientId])),te=A(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>j(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function ne(e,t){return Ae(e,t).length}function oe(e){return e.selection.selectionStart}function le(e){return e.selection.selectionEnd}function re(e){return e.selection.selectionStart.clientId}function ie(e){return e.selection.selectionEnd.clientId}function se(e){return ye(e).length||(e.selection.selectionStart.clientId?1:0)}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ue(e){const t=ce(e);return t?j(e,t):null}function de(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const pe=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let l=t;for(;e.blocks.parents[l];)l=e.blocks.parents[l],o.push(l);return n?o:o.reverse()}),(e=>[e.blocks.parents])),me=A((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const l=pe(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(l,(t=>({id:t,name:U(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 ge(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function he(e,t){const n=ce(e),o=[...pe(e,t),t],l=[...pe(e,n),n];let r;const i=Math.min(o.length,l.length);for(let e=0;e<i&&o[e]===l[e];e++)r=o[e];return r}function fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ce(e)),void 0===t&&(t=n<0?Ce(e):Se(e)),!t)return null;const o=de(e,t);if(null===o)return null;const{order:l}=e.blocks,r=l[o],i=r.indexOf(t),s=i+1*n;return s<0||s===r.length?null:r[s]}function ve(e,t){return fe(e,t,-1)}function be(e,t){return fe(e,t,1)}function _e(e){return e.initialPosition}const ke=A((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return G;if(t.clientId===n.clientId)return[t.clientId];const o=de(e,t.clientId);if(null===o)return G;const l=Ae(e,o),r=l.indexOf(t.clientId),i=l.indexOf(n.clientId);return r>i?l.slice(i,r+1):l.slice(r,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ye(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?G:ke(e)}const Ee=A((e=>{const t=ye(e);return t.length?t.map((t=>j(e,t))):G}),(e=>[...ke.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ce(e){return ye(e)[0]||null}function Se(e){const t=ye(e);return t[t.length-1]||null}function we(e,t){return Ce(e)===t}function Be(e,t){return-1!==ye(e).indexOf(t)}const Ie=A(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=de(e,n),o=Be(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ne(e){const t=oe(e),n=le(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Pe(e){const t=oe(e),n=le(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Le(e){return ke(e).some((t=>{const n=U(e,t);return!(0,l.getBlockType)(n).merge}))}function Me(e,t){const n=oe(e),o=le(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const r=de(e,n.clientId);if(r!==de(e,o.clientId))return!1;const i=Ae(e,r);let s,a;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,a=n):(s=n,a=o);const c=t?a.clientId:s.clientId,u=t?s.clientId:a.clientId,d=U(e,c);if(!(0,l.getBlockType)(d).merge)return!1;const p=j(e,u);if(p.name===d)return!0;const m=(0,l.switchToBlockType)(p,d);return m&&m.length}const Re=e=>{const t=oe(e),n=le(e);if(t.clientId===n.clientId)return G;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return G;const o=de(e,t.clientId);if(o!==de(e,n.clientId))return G;const r=Ae(e,o),i=r.indexOf(t.clientId),s=r.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=j(e,a.clientId),d=(0,l.getBlockType)(u.name),p=j(e,c.clientId),m=(0,l.getBlockType)(p.name),g=u.attributes[a.attributeKey],h=p.attributes[c.attributeKey],f=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,z.create)({html:g,...H(f)}),_=(0,z.create)({html:h,...H(v)});return b=(0,z.remove)(b,0,a.offset),_=(0,z.remove)(_,c.offset,_.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,z.toHTMLString)({value:b,...H(f)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,z.toHTMLString)({value:_,...H(v)})}}]};function Ae(e,t){return e.blocks.order[t||""]||G}function De(e,t){return Ae(e,de(e,t)).indexOf(t)}function Oe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Ae(e,t),(t=>Oe(e,t)||Be(e,t)||n&&ze(e,t,n)))}function Fe(e,t){if(!t)return!1;const n=ye(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function He(e){return e.isMultiSelecting}function Ge(e){return e.isSelectionEnabled}function Ue(e,t){return e.blocksMode[t]||"visual"}function We(e){return e.isTyping}function $e(e){return!!e.draggedBlocks.length}function je(e){return e.draggedBlocks}function Ke(e,t){return e.draggedBlocks.includes(t)}function qe(e,t){if(!$e(e))return!1;const n=pe(e,t);return(0,u.some)(n,(t=>Ke(e,t)))}function Ye(){return V()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Ze(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:l}}=e;if(null!==o)return o;const{clientId:r}=l;return r?(t=de(e,r)||void 0,n=De(e,l.clientId)+1):n=Ae(e).length,{rootClientId:t,index:n}}function Qe(e){return null!==e.insertionPoint}function Xe(e){return e.template.isValid}function Je(e){return e.settings.template}function et(e,t){if(!t)return e.settings.templateLock;const n=Bt(e,t);return n?n.templateLock:null}const tt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},nt=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,l.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=It(e),s=tt(i,t,!0);if(!s)return!1;const a=!!et(e,o);if(a)return!1;const c=Bt(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=tt(d,t),m=n.parent,g=U(e,o),h=tt(m,g);let f=!0;const v=n.ancestor;if(v){const t=[o,...pe(e,o)];f=(0,u.some)(t,(t=>tt(v,U(e,t))))}const b=f&&(null===p&&null===h||!0===p||!0===h);return b?(0,r.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:j.bind(null,e),getBlockParentsByBlockName:me.bind(null,e)}):b},ot=A(nt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ot(e,U(e,t),n)))}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return!0;const{lock:l}=o,r=!!et(e,n);return void 0===l||void 0===(null==l?void 0:l.remove)?!r:!(null!=l&&l.remove)}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>rt(e,t,n)))}function st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return;const{lock:l}=o,r="all"===et(e,n);return void 0===l||void 0===(null==l?void 0:l.move)?!r:!(null!=l&&l.move)}function at(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>st(e,t,n)))}function ct(e,t){const n=$(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function ut(e,t){var n;return!!(0,l.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function dt(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 pt=(e,t,n)=>!!(0,l.hasBlockSupport)(t,"inserter",!0)&&nt(e,t.name,n),mt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:l,count:r=0}=dt(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:gt(l,r)}},gt=(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}},ht=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let r=!1;(0,l.hasBlockSupport)(t.name,"multiple",!0)||(r=(0,u.some)(te(e,X(e)),{name:t.name}));const{time:i,count:s=0}=dt(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:r,frecency:gt(i,s)};if("transform"===n)return a;const c=(0,l.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},ft=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=ht(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,r=t=>{let n=O;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,r=(0,l.getBlockType)(t+o);r&&(n=r.icon)}}const r=`core/block/${t.id}`,{time:i,count:a=0}=dt(e,r)||{},c=gt(i,a);return{id:r,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,l.getBlockTypes)().filter((n=>pt(e,n,t))).map(n),a=nt(e,"core/block",t)?Mt(e).map(r):[],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 l=mt(e,n);t.push(...o.map(l))}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,Mt(e),(0,l.getBlockTypes)()])),vt=A((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=(0,u.castArray)(t),[i]=r,s=ht(e,{buildScope:"transform"}),a=(0,l.getBlockTypes)().filter((t=>pt(e,t,o))).map(s),c=Object.fromEntries(Object.entries(a).map((e=>{let[,t]=e;return[t.name,t]})));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,h.__)("Unwrap"),icon:null===(n=c[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const d=(0,l.getPossibleBlockTransformations)(r).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return(0,u.orderBy)(d,(e=>c[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,l.getBlockTypes)()])),bt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,l.getBlockTypes)(),(n=>pt(e,n,t)));if(n)return!0;const o=nt(e,"core/block",t)&&Mt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Mt(e),(0,l.getBlockTypes)()])),_t=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,l.getBlockTypes)(),(n=>pt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,l.getBlockTypes)()])),kt=A((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const l=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,r=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return l&&r?"function"==typeof r?r(j(e,o))?l:null:l:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),yt=A(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,l.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),Et=A((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=It(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return yt(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!tt(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])),Ct=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Et(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return ot(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),St=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;const o=Ct(e,n),l=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=>l.includes(e)))}))}),((e,t)=>[...Ct.getDependants(e,t)])),wt=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Ft(e,n)})))return G;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return St(e,o,n)}),((e,t)=>[...St.getDependants(e,t)]));function Bt(e,t){return e.blockListSettings[t]}function It(e){return e.settings}function xt(e){return e.blocks.isPersistentChange}const Tt=A((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])),Nt=A(((e,t)=>{var n;const o=(0,u.find)(Mt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Mt(e)]));function Pt(e){return e.blocks.isIgnoredChange}function Lt(e){return e.lastBlockAttributesChange}function Mt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:G}function Rt(e){return"navigation"===e.editorMode}function At(e){return e.editorMode}function Dt(e){return e.hasBlockMovingClientId}function Ot(e){return!!e.automaticChangeStatus}function zt(e,t){return e.highlightedBlock===t}function Ft(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Vt=A(((e,t)=>{if(!t.length)return null;const n=ce(e);if(t.includes(U(e,n)))return n;const o=ye(e),l=me(e,n||o[0],t);return l?l[l.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Ht(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}function Gt(e,t){var n,o;return null===(n=null===(o=e.blocks.visibility)||void 0===o?void 0:o[t])||void 0===n||n}const Ut=A((e=>new Set(Object.keys(e.blocks.visibility).filter((t=>e.blocks.visibility[t])))),(e=>[e.blocks.visibility])),Wt=A(((e,t)=>{let n,o=t;for(;e.blocks.parents[o];)o=e.blocks.parents[o],"contentOnly"===et(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function $t(e){return e.temporarilyEditingAsBlocks}function jt(e,t){if(!ct(e,t))return!0;const n=At(e);if("zoom-out"===n&&!de(e,t))return!0;const o=(0,l.hasBlockSupport)(U(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&Ft(e,t))&&!Oe(e,t)&&!ze(e,t,!0)}function Kt(e,t){let n=e.blocks.parents[t];for(;n;){if(jt(e,n))return!0;n=e.blocks.parents[n]}return!1}const qt=window.wp.a11y,Yt="†";function Zt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Yt)}))}const Qt=e=>Array.isArray(e)?e:[e],Xt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Jt(e))},Jt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getTemplate(),i=n.getTemplateLock(),s=!r||"all"!==i||(0,l.doBlocksMatchTemplate)(e,r);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function en(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function tn(e){return V()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function nn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Qt(e),attributes:t,uniqueByBlock:n}}function on(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function ln(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const rn=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getPreviousBlockClientId(e);l&&o.selectBlock(l,-1)},sn=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getNextBlockClientId(e);l&&o.selectBlock(l)};function an(){return{type:"START_MULTI_SELECT"}}function cn(){return{type:"STOP_MULTI_SELECT"}}const un=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:l,dispatch:r}=o;if(l.getBlockRootClientId(e)!==l.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=l.getSelectedBlockCount();(0,qt.speak)((0,h.sprintf)(
2
  /* translators: %s: number of selected blocks */
3
  (0,h._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function dn(){return{type:"CLEAR_SELECTED_BLOCK"}}function pn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function mn(e,t){var n,o;const r=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,l.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!r[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=r[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const gn=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,l=arguments.length>4?arguments[4]:void 0;return r=>{let{select:i,dispatch:s}=r;e=Qt(e),t=mn(Qt(t),i.getSettings());const a=i.getBlockRootClientId(e[0]);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:l}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function hn(e,t){return gn(e,t)}const fn=e=>(t,n)=>o=>{let{select:l,dispatch:r}=o;l.canMoveBlocks(t,n)&&r({type:e,clientIds:Qt(t),rootClientId:n})},vn=fn("MOVE_BLOCKS_DOWN"),bn=fn("MOVE_BLOCKS_UP"),kn=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 l=>{let{select:r,dispatch:i}=l;if(r.canMoveBlocks(e,t)){if(t!==n){if(!r.canRemoveBlocks(e,t))return;if(!r.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function yn(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 kn([e],t,n,o)}function En(e,t,n,o,l){return Cn([e],t,n,o,0,l)}const Cn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;null!==l&&"object"==typeof l&&(r=l,l=0,V()("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=mn(Qt(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?l:null,meta:r})}};function Sn(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 wn(){return{type:"HIDE_INSERTION_POINT"}}function Bn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const In=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),r=t.getTemplate(),i=(0,l.synchronizeBlocksWithTemplate)(o,r);n.resetBlocks(i)},xn=e=>t=>{let{registry:n,select:o,dispatch:r}=t;const i=o.getSelectionStart(),s=o.getSelectionEnd();if(i.clientId===s.clientId)return;if(!i.attributeKey||!s.attributeKey||void 0===i.offset||void 0===s.offset)return!1;const a=o.getBlockRootClientId(i.clientId);if(a!==o.getBlockRootClientId(s.clientId))return;const c=o.getBlockOrder(a);let u,d;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(u=s,d=i):(u=i,d=s);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,l.getBlockType)(m.name);if(!g.merge)return;const h=u,f=d,v=o.getBlock(h.clientId),b=(0,l.getBlockType)(v.name),_=o.getBlock(f.clientId),k=(0,l.getBlockType)(_.name),y=v.attributes[h.attributeKey],E=_.attributes[f.attributeKey],C=b.attributes[h.attributeKey],S=k.attributes[f.attributeKey];let w=(0,z.create)({html:y,...H(C)}),B=(0,z.create)({html:E,...H(S)});w=(0,z.remove)(w,h.offset,w.text.length),B=(0,z.insert)(B,Yt,0,f.offset);const I=(0,l.cloneBlock)(v,{[h.attributeKey]:(0,z.toHTMLString)({value:w,...H(C)})}),x=(0,l.cloneBlock)(_,{[f.attributeKey]:(0,z.toHTMLString)({value:B,...H(S)})}),T=e?I:x,N=v.name===_.name?[T]:(0,l.switchToBlockType)(T,g.name);if(!N||!N.length)return;let P;if(e){const e=N.pop();P=g.merge(e.attributes,x.attributes)}else{const e=N.shift();P=g.merge(I.attributes,e.attributes)}const L=Zt(P),M=P[L],R=(0,z.create)({html:M,...H(g.attributes[L])}),A=R.text.indexOf(Yt),D=(0,z.remove)(R,A,A+1),O=(0,z.toHTMLString)({value:D,...H(g.attributes[L])});P[L]=O;const F=o.getSelectedBlockClientIds(),V=[...e?N:[],{...m,attributes:{...m.attributes,...P}},...e?[]:N];n.batch((()=>{r.selectionChange(m.clientId,L,A,A),r.replaceBlocks(F,V,0,o.getSelectedBlocksInitialCaretPosition())}))},Tn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();if(o.clientId===r.clientId)return;if(!o.attributeKey||!r.attributeKey||void 0===o.offset||void 0===r.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(r.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(r.clientId)?(a=r,c=o):(a=o,c=r);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,l.getBlockType)(p.name),g=t.getBlock(d.clientId),h=(0,l.getBlockType)(g.name),f=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],_=h.attributes[d.attributeKey];let k=(0,z.create)({html:f,...H(b)}),y=(0,z.create)({html:v,...H(_)});k=(0,z.remove)(k,u.offset,k.text.length),y=(0,z.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,z.toHTMLString)({value:k,...H(b)})}},(0,l.createBlock)((0,l.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...H(_)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Nn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:l.clientId}})},Pn=(e,t)=>n=>{let{registry:o,select:r,dispatch:i}=n;const s=[e,t];i({type:"MERGE_BLOCKS",blocks:s});const[a,c]=s,u=r.getBlock(a),d=(0,l.getBlockType)(u.name);if(!d)return;const p=r.getBlock(c);if(d&&!d.merge){const e=(0,l.switchToBlockType)(p,d.name);if(1!==(null==e?void 0:e.length))return void i.selectBlock(u.clientId);const[t]=e;return t.innerBlocks.length<1?void i.selectBlock(u.clientId):void o.batch((()=>{i.insertBlocks(t.innerBlocks,void 0,a),i.removeBlock(c),i.selectBlock(t.innerBlocks[0].clientId)}))}const m=(0,l.getBlockType)(p.name),{clientId:g,attributeKey:h,offset:f}=r.getSelectionStart(),v=(g===a?d:m).attributes[h],b=(g===a||g===c)&&void 0!==h&&void 0!==f&&!!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,l.cloneBlock)(u),k=(0,l.cloneBlock)(p);if(b){const e=g===a?_:k,t=e.attributes[h],n=(0,z.insert)((0,z.create)({html:t,...H(v)}),Yt,f,f);e.attributes[h]=(0,z.toHTMLString)({value:n,...H(v)})}const y=u.name===p.name?[k]:(0,l.switchToBlockType)(k,u.name);if(!y||!y.length)return;const E=d.merge(_.attributes,y[0].attributes);if(b){const e=Zt(E),t=E[e],n=(0,z.create)({html:t,...H(d.attributes[e])}),o=n.text.indexOf(Yt),l=(0,z.remove)(n,o,o+1),r=(0,z.toHTMLString)({value:l,...H(d.attributes[e])});E[e]=r,i.selectionChange(u.clientId,e,o,o)}i.replaceBlocks([u.clientId,p.clientId],[{...u,attributes:{...u.attributes,...E}},...y.slice(1)],0)},Ln=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;e=Qt(e);const r=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,r)&&(t&&l.selectPreviousBlock(e[0]),l({type:"REMOVE_BLOCKS",clientIds:e}),l((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function Mn(e,t){return Ln([e],t)}function Rn(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 An(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Dn(){return{type:"START_TYPING"}}function On(){return{type:"STOP_TYPING"}}function zn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Fn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Vn(){return V()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Hn(){return V()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Gn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Un=(e,t,n)=>o=>{let{dispatch:r}=o;const i=(0,l.getDefaultBlockName)();if(!i)return;const s=(0,l.createBlock)(i,e);return r.insertBlock(s,n,t)};function Wn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function $n(e){return{type:"UPDATE_SETTINGS",settings:e}}function jn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Kn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function qn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Yn=()=>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"})}))},Zn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},Qn=e=>t=>{let{dispatch:n,select:o}=t;if("zoom-out"===e){const e=o.getBlockSelectionStart();e&&n.selectBlock(o.getBlockHierarchyRootClientId(e))}n({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,qt.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.")):"edit"===e?(0,qt.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,qt.speak)((0,h.__)("You are currently in zoom-out mode."))},Xn=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,qt.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."))}},Jn=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;const i=o.getBlocksByClientId(e);if(i.some((e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,l.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=Qt(e),c=o.getBlockIndex(a[a.length-1]),u=i.map((e=>(0,l.__experimentalCloneSanitizedBlock)(e)));return r.insertBlocks(u,c+1,s,t),u.length>1&&t&&r.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))}},eo=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const l=n.getBlockRootClientId(e);if(n.getTemplateLock(l))return;const r=n.getBlockIndex(e);return o.insertDefaultBlock({},l,r)},to=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const l=n.getBlockRootClientId(e);if(n.getTemplateLock(l))return;const r=n.getBlockIndex(e);return o.insertDefaultBlock({},l,r+1)};function no(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const oo=e=>async t=>{let{dispatch:n}=t;n(no(e,!0)),await new Promise((e=>setTimeout(e,150))),n(no(e,!1))};function lo(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function ro(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function io(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const so="core/block-editor",ao={reducer:P,selectors:e,actions:t},co=(0,p.createReduxStore)(so,{...ao,persist:["preferences"]});(0,p.registerStore)(so,{...ao,persist:["preferences"]});const uo={name:"",isSelected:!1},po=(0,s.createContext)(uo),{Provider:mo}=po;function go(){return(0,s.useContext)(po)}function ho(){const{isSelected:e,clientId:t,name:n}=go();return(0,p.useSelect)((o=>{if(e)return!0;const{getBlockName:l,isFirstMultiSelectedBlock:r,getMultiSelectedBlockClientIds:i}=o(co);return!!r(t)&&i().every((e=>l(e)===n))}),[t,e,n])}function fo(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:r=!1}=e;const i=function(e,t){const n=ho(),{clientId:o}=go(),r=(0,p.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e(co),{hasBlockSupport:i}=e(l.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)}),[t,o]);var i;return n?null===(i=g[e])||void 0===i?void 0:i.Fill:r?g.parent.Fill:null}(t,r);return i?(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(i,null,(e=>{const l=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(m.__experimentalToolbarContext.Provider,{value:l},"default"===t&&(0,s.createElement)(m.ToolbarGroup,{controls:n}),o)}))):null}function vo(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(m.__experimentalToolbarContext),l=g[t].Slot,r=(0,m.__experimentalUseSlot)(l.__unstableName);return Boolean(r.fills&&r.fills.length)?"default"===t?(0,s.createElement)(l,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(l,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const bo=fo;bo.Slot=vo;const _o=e=>(0,s.createElement)(fo,i({group:"inline"},e));_o.Slot=e=>(0,s.createElement)(vo,i({group:"inline"},e));const ko=bo,yo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),Eo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),Co=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),So=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),wo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Bo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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 Io(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function xo(e,t,n,o){var l,r;let i="";return null!=t&&null!==(l=t[n])&&void 0!==l&&null!==(r=l.spacingStyles)&&void 0!==r&&r.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${Io(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}function To(e){const{contentSize:t,wideSize:n}=e,o={},l=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return l.test(t)&&(
4
  // translators: %s: container size (i.e. 600px etc)
5
  o.none=(0,h.sprintf)((0,h.__)("Max %s wide"),t)),l.test(n)&&(
6
  // translators: %s: container size (i.e. 600px etc)
7
- o.wide=(0,h.sprintf)((0,h.__)("Max %s wide"),n)),o}const No=(0,s.createContext)({refs:new Map,callbacks:new Map});function Po(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(No.Provider,{value:n},t)}function Lo(e){const{refs:t,callbacks:n}=(0,s.useContext)(No),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 Mo(e){const{refs:t}=(0,s.useContext)(No),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,l]of t.entries())l===n.current&&o.current&&(e=o.current);return e}})),[])}function Ro(e){const{callbacks:t}=(0,s.useContext)(No),n=Mo(e),[o,l]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(l,e),()=>{t.delete(l)}}),[e]),n.current||o}function Ao(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function Do(e,t){if(!Ao(e))return e;const n=zo(e),o=t.find((e=>String(e.slug)===n));return null==o?void 0:o.size}function Oo(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function zo(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}const Fo={all:(0,h.__)("All sides"),top:(0,h.__)("Top"),bottom:(0,h.__)("Bottom"),left:(0,h.__)("Left"),right:(0,h.__)("Right"),mixed:(0,h.__)("Mixed"),vertical:(0,h.__)("Vertical"),horizontal:(0,h.__)("Horizontal")},Vo={top:void 0,right:void 0,bottom:void 0,left:void 0},Ho=["top","right","bottom","left"];function Go(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function Uo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ho;return Object.values(e).length>=1&&Object.values(e).length<t.length||new Set(Object.values(e)).size>1}function Wo(e){return null!=e&&!(0,u.isEmpty)(Object.values(e).filter((e=>!!e)))}const $o=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"})),jo=["color","border","typography","spacing"],Ko={"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},qo={"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 Yo(e){const{name:t,clientId:n}=go();return(0,p.useSelect)((o=>{if(jo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let r;const i=(e=>qo[e]||e)(e);[...o(co).getBlockParents(n),n].forEach((e=>{const n=o(co).getBlockName(e);if((0,l.hasBlockSupport)(n,"__experimentalSettings",!1)){var s;const n=o(co).getBlockAttributes(e),l=null!==(s=(0,u.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==s?s:(0,u.get)(n,`settings.${i}`);void 0!==l&&(r=l)}}));const s=o(co).getSettings();if(void 0===r){var a;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;r=null!==(a=(0,u.get)(s,n))&&void 0!==a?a:(0,u.get)(s,e)}var c,d;if(void 0!==r)return l.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(c=null!==(d=r.custom)&&void 0!==d?d:r.theme)&&void 0!==c?c:r.default:r;const p=Ko[i]?Ko[i](s):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e])}function Zo(e){var t;let{spacingSizes:n,value:o,side:l,onChange:r,isMixed:i=!1,type:a,minimumCustomValue:u}=e;o=function(e,t){if(Ao(e))return e;const n=t.find((t=>String(t.size)===String(e)));return null!=n&&n.slug?`var:preset|spacing|${n.slug}`:e}(o,n);let d=n;const g=n.length<=8,f=(0,p.useSelect)((e=>{const t=e(co).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[v,b]=(0,s.useState)(!f&&void 0!==o&&!Ao(o)),_=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["px","em","rem"]});let k=null;g||v||void 0===o||!(!Ao(o)||Ao(o)&&i)?i||(k=v?Do(o,n):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":zo(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(o,n)):(d=[...n,{name:i?(0,h.__)("Mixed"):// translators: A custom measurement, eg. a number followed by a unit like 12px.
8
  (0,h.sprintf)((0,h.__)("Custom (%s)"),o),slug:"custom",size:o}],k=d.length-1);const y=(0,s.useMemo)((()=>(0,m.__experimentalParseQuantityAndUnitFromRawValue)(k)),[k])[1]||_[0].value,E=e=>{var t;return void 0===o||null===(t=n[e])||void 0===t?void 0:t.name},C=parseInt(k,10),S=(e,t)=>{var o;const l=parseInt(e,10);if("selectList"===t){if(0===l)return;if(1===l)return"0"}else if(0===l)return"0";return`var:preset|spacing|${null===(o=n[e])||void 0===o?void 0:o.slug}`},w=i?(0,h.__)("Mixed"):null,B=i?(0,h.__)("Mixed"):E(k),I=d.map(((e,t)=>({key:t,name:e.name}))),x=n.map(((e,t)=>({value:t,label:void 0}))),T=(0,h.sprintf)(// translators: 1: The side of the block being modified (top, bottom, left, etc.). 2. Type of spacing being modified (Padding, margin, etc)
9
- (0,h.__)("%1$s %2$s"),Fo[l],null==a?void 0:a.toLowerCase()),N=g&&!v&&void 0!==B;return(0,s.createElement)(s.Fragment,null,"all"!==l&&(0,s.createElement)(m.__experimentalHStack,{className:"components-spacing-sizes-control__side-labels"},(0,s.createElement)(m.__experimentalText,{className:"components-spacing-sizes-control__side-label"},Fo[l]),N&&(0,s.createElement)(m.__experimentalText,{className:"components-spacing-sizes-control__hint-single"},B)),"all"===l&&N&&(0,s.createElement)(m.__experimentalText,{className:"components-spacing-sizes-control__hint-all"},B),!f&&(0,s.createElement)(m.Button,{label:v?(0,h.__)("Use size preset"):(0,h.__)("Set custom size"),icon:$o,onClick:()=>{b(!v)},isPressed:v,isSmall:!0,className:c()({"components-spacing-sizes-control__custom-toggle-all":"all"===l,"components-spacing-sizes-control__custom-toggle-single":"all"!==l}),iconSize:24}),v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.__experimentalUnitControl,{onChange:e=>r((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:k,units:_,min:u,placeholder:w,disableUnits:i,label:T,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",style:{gridColumn:"1"}}),(0,s.createElement)(m.RangeControl,{value:C,min:0,max:100,withInputField:!1,onChange:e=>{r([e,y].join(""))},className:"components-spacing-sizes-control__custom-value-range"})),g&&!v&&(0,s.createElement)(m.RangeControl,{className:"components-spacing-sizes-control__range-control",value:k,onChange:e=>r(S(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===o&&r("0")},withInputField:!1,"aria-valuenow":k,"aria-valuetext":null===(t=n[k])||void 0===t?void 0:t.name,renderTooltipContent:E,min:0,max:n.length-1,marks:x,label:T,hideLabelFromVision:!0}),!g&&!v&&(0,s.createElement)(m.CustomSelectControl,{className:"components-spacing-sizes-control__custom-select-control",value:I.find((e=>e.key===k))||"",onChange:e=>{r(S(e.selectedItem.key,"selectList"))},options:I,label:T,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0}))}function Qo(e){let{onChange:t,values:n,sides:o,spacingSizes:l,type:r,minimumCustomValue:i}=e;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Go(Object.values(e))}(n),c=Wo(n)&&Uo(n,o);return(0,s.createElement)(Zo,{value:a,onChange:e=>{const l=(0,m.__experimentalApplyValueToSides)(n,e,o);t(l)},side:"all",spacingSizes:l,isMixed:c,type:r,minimumCustomValue:i})}function Xo(e){let{values:t,sides:n,onChange:o,spacingSizes:l,type:r,minimumCustomValue:i}=e;const a=null!=n&&n.length?Ho.filter((e=>n.includes(e))):Ho,c=e=>n=>{const l={...t};l[e]=n,o(l)};return(0,s.createElement)(s.Fragment,null,a.map((e=>(0,s.createElement)(Zo,{value:t[e],label:Fo[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:c(e),spacingSizes:l,type:r,minimumCustomValue:i}))))}const Jo=["vertical","horizontal"];function el(e){let{onChange:t,values:n,sides:o,spacingSizes:l,type:r,minimumCustomValue:i}=e;const a=e=>o=>{if(!t)return;const l={...n};"vertical"===e&&(l.top=o,l.bottom=o),"horizontal"===e&&(l.left=o,l.right=o),t(l)},c=null!=o&&o.length?Jo.filter((e=>o.includes(e))):Jo;return(0,s.createElement)(s.Fragment,null,c.map((e=>{const t="vertical"===e?n.top:n.left;return(0,s.createElement)(Zo,{value:t,onChange:a(e),label:Fo[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:l,type:r,minimumCustomValue:i})})))}const tl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),nl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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 ol(e){let{isLinked:t,onClick:n}=e;const o=t?(0,h.__)("Unlink Sides"):(0,h.__)("Link Sides");return(0,s.createElement)(m.Tooltip,{text:o},(0,s.createElement)("span",{className:"component-spacing-sizes-control__linked-button"},(0,s.createElement)(m.Button,{variant:t?"primary":"secondary",isSmall:!0,icon:t?tl:nl,iconSize:16,"aria-label":o,onClick:n})))}function ll(e){let{inputProps:t,onChange:n,label:o=(0,h.__)("Spacing Control"),values:l,sides:r,splitOnAxis:a=!1,useSelect:c,minimumCustomValue:u=0}=e;const d=[{name:0,slug:"0",size:0},...Yo("spacing.spacingSizes")||[]];d.length>8&&d.unshift({name:(0,h.__)("Default"),slug:"default",size:void 0});const p=l||Vo,g=Wo(l),f=1===(null==r?void 0:r.length),[v,b]=(0,s.useState)(!g||!Uo(p,r)||f),_={...t,onChange:e=>{const t={...l,...e};n(t)},isLinked:v,sides:r,values:p,spacingSizes:d,useSelect:c,type:o,minimumCustomValue:u};return(0,s.createElement)("fieldset",{role:"region",className:"component-spacing-sizes-control"},(0,s.createElement)(m.__experimentalText,{as:"legend"},o),!f&&(0,s.createElement)(ol,{onClick:()=>{b(!v)},isLinked:v}),v&&(0,s.createElement)(Qo,i({"aria-label":o},_)),!v&&a&&(0,s.createElement)(el,_),!v&&!a&&(0,s.createElement)(Xo,_))}window.wp.warning;const rl={default:(0,m.createSlotFill)("InspectorControls"),advanced:(0,m.createSlotFill)("InspectorAdvancedControls"),border:(0,m.createSlotFill)("InspectorControlsBorder"),color:(0,m.createSlotFill)("InspectorControlsColor"),dimensions:(0,m.createSlotFill)("InspectorControlsDimensions"),typography:(0,m.createSlotFill)("InspectorControlsTypography")};function il(e){var t;let{__experimentalGroup:n="default",children:o}=e;const l=ho(),r=null===(t=rl[n])||void 0===t?void 0:t.Fill;return r?l?(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(r,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(m.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const sl=e=>e,al=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,al),sl);return(0,u.isEmpty)(t)?void 0:t};function cl(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function ul(e,t,n,o,l,r){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===r.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(r.length>1&&o.length>1){if(!o[l])return n;var a;s=null===(a=o[l])||void 0===a?void 0:a.attributes}let c=n;return Object.entries(e).forEach((e=>{let[n,o]=e;o&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:cl(c.attributes,e,t)})}))})),c}function dl(e,t,n){const o=(0,l.getBlockSupport)(e,t),r=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}function pl(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:l}=(0,p.useDispatch)(co),{getBlockAttributes:r,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,p.useSelect)(co),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}=r(n);let l={style:o};e.forEach((e=>{l={...l,...e(l)}})),l={...l,style:al(l.style)},t[n]=l})),l(n,t,!0)}),[al,r,i,c,u,l]);return(0,s.createElement)(m.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function ml(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(m.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function gl(e){var t;let{__experimentalGroup:n="default",label:o,...l}=e;const r=null===(t=rl[n])||void 0===t?void 0:t.Slot,a=(0,m.__experimentalUseSlot)(null==r?void 0:r.__unstableName);return r&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(pl,{group:n,label:o},(0,s.createElement)(ml,i({},l,{Slot:r}))):(0,s.createElement)(r,i({},l,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const hl=il;hl.Slot=gl;const fl=e=>(0,s.createElement)(il,i({},e,{__experimentalGroup:"advanced"}));fl.Slot=e=>(0,s.createElement)(gl,i({},e,{__experimentalGroup:"advanced"})),fl.slotName="InspectorAdvancedControls";const vl=hl,bl=window.wp.isShallowEqual;var _l=n.n(bl);const kl=function(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])},yl=(0,s.forwardRef)((function(e,t){let{clientId:n,bottomClientId:o,children:l,__unstableRefreshSize:r,__unstableCoverTarget:a=!1,__unstablePopoverSlot:u,__unstableContentRef:p,...g}=e;const h=Ro(n),f=Ro(null!=o?o:n),v=(0,d.useMergeRefs)([t,kl(p)]),b=(0,s.useMemo)((()=>h&&f===h?{position:"absolute",width:h.offsetWidth,height:h.offsetHeight}:{}),[h,f,r]);if(!h||o&&!f)return null;const _={top:h,bottom:f};return(0,s.createElement)(m.Popover,i({ref:v,animate:!1,position:"top right left",focusOnMount:!1,anchorRef:_,__unstableSlotName:u||null,resize:!1,flip:!1,shift:!0},g,{className:c()("block-editor-block-popover",g.className)}),a&&(0,s.createElement)("div",{style:b},l),!a&&l)}));function El(e){const t=(0,l.getBlockSupport)(e,Nl);return!!(!0===t||null!=t&&t.margin)}function Cl(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("spacing.margin"),n=!Dl(e,"margin");return!El(e)||t||n}function Sl(e){var t,n;const{name:o,attributes:{style:l},setAttributes:r}=e,i=Yo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]}),c=Al(o,"margin"),u=c&&c.some((e=>Ll.includes(e)));if(Cl(e))return null;const d=e=>{const t={...l,spacing:{...null==l?void 0:l.spacing,margin:e}};r({style:al(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(0,s.createElement)(m.__experimentalBoxControl,{values:null==l||null===(t=l.spacing)||void 0===t?void 0:t.margin,onChange:d,label:(0,h.__)("Margin"),sides:c,units:a,allowReset:!1,splitOnAxis:u}),(null==i?void 0:i.length)>0&&(0,s.createElement)(ll,{values:null==l||null===(n=l.spacing)||void 0===n?void 0:n.margin,onChange:d,label:(0,h.__)("Margin"),sides:c,units:a,allowReset:!1,splitOnAxis:!1})),native:null})}function wl(e){var t,n;let{clientId:o,attributes:l}=e;const r=null==l||null===(t=l.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,i=Yo("spacing.spacingSizes"),a=(0,s.useMemo)((()=>{const e=null!=r&&r.top?Do(null==r?void 0:r.top,i):0,t=null!=r&&r.right?Do(null==r?void 0:r.right,i):0,n=null!=r&&r.bottom?Do(null==r?void 0:r.bottom,i):0,o=null!=r&&r.left?Do(null==r?void 0:r.left,i):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:0!==e?`-${e}`:0,right:0!==t?`-${t}`:0,bottom:0!==n?`-${n}`:0,left:0!==o?`-${o}`:0}}),[r]),[c,u]=(0,s.useState)(!1),d=(0,s.useRef)(r),p=(0,s.useRef)(),m=()=>{p.current&&window.clearTimeout(p.current)};return(0,s.useEffect)((()=>(_l()(r,d.current)||(u(!0),d.current=r,m(),p.current=setTimeout((()=>{u(!1)}),400)),()=>m())),[r]),c?(0,s.createElement)(yl,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:r},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}function Bl(e){const t=(0,l.getBlockSupport)(e,Nl);return!!(!0===t||null!=t&&t.padding)}function Il(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("spacing.padding"),n=!Dl(e,"padding");return!Bl(e)||t||n}function xl(e){var t,n;const{name:o,attributes:{style:l},setAttributes:r}=e,i=Yo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]}),c=Al(o,"padding"),u=c&&c.some((e=>Ll.includes(e)));if(Il(e))return null;const d=e=>{const t={...l,spacing:{...null==l?void 0:l.spacing,padding:e}};r({style:al(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(0,s.createElement)(m.__experimentalBoxControl,{values:null==l||null===(t=l.spacing)||void 0===t?void 0:t.padding,onChange:d,label:(0,h.__)("Padding"),sides:c,units:a,allowReset:!1,splitOnAxis:u}),(null==i?void 0:i.length)>0&&(0,s.createElement)(ll,{values:null==l||null===(n=l.spacing)||void 0===n?void 0:n.padding,onChange:d,label:(0,h.__)("Padding"),sides:c,units:a,allowReset:!1,splitOnAxis:u})),native:null})}function Tl(e){var t,n;let{clientId:o,attributes:l}=e;const r=null==l||null===(t=l.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,i=(0,s.useMemo)((()=>({borderTopWidth:Ao(null==r?void 0:r.top)?Oo(null==r?void 0:r.top):null==r?void 0:r.top,borderRightWidth:Ao(null==r?void 0:r.right)?Oo(null==r?void 0:r.right):null==r?void 0:r.right,borderBottomWidth:Ao(null==r?void 0:r.bottom)?Oo(null==r?void 0:r.bottom):null==r?void 0:r.bottom,borderLeftWidth:Ao(null==r?void 0:r.left)?Oo(null==r?void 0:r.left):null==r?void 0:r.left})),[r]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(r),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(_l()(r,u.current)||(c(!0),u.current=r,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[r]),a?(0,s.createElement)(yl,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:r},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const Nl="spacing",Pl=["top","right","bottom","left"],Ll=["vertical","horizontal"];function Ml(e){const t=Vl(e),n=Il(e),o=Cl(e),r=Rl(e),i=(u=e.name,"web"===s.Platform.OS&&(Ol(u)||Bl(u)||El(u))),a=Yo("spacing.spacingSizes");var u;if(r||!i)return null;const d=(0,l.getBlockSupport)(e.name,[Nl,"__experimentalDefaultControls"]),p=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}},g=c()({"tools-panel-item-spacing":a&&a.length>0});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(vl,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:g,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:al({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:p("padding"),isShownByDefault:null==d?void 0:d.padding,panelId:e.clientId},(0,s.createElement)(xl,e)),!o&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:g,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:al({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:p("margin"),isShownByDefault:null==d?void 0:d.margin,panelId:e.clientId},(0,s.createElement)(Sl,e)),!t&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:g,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:p("blockGap"),isShownByDefault:null==d?void 0:d.blockGap,panelId:e.clientId},(0,s.createElement)(Hl,e))),!n&&(0,s.createElement)(Tl,e),!o&&(0,s.createElement)(wl,e))}const Rl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Vl(e),n=Il(e),o=Cl(e);return t&&n&&o};function Al(e,t){var n;const o=(0,l.getBlockSupport)(e,Nl);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function Dl(e,t){const n=Al(e,t);return!(n&&n.some((e=>Pl.includes(e)))&&n.some((e=>Ll.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function Ol(e){const t=(0,l.getBlockSupport)(e,Nl);return!!(!0===t||null!=t&&t.blockGap)}function zl(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function Fl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=zl(e);if(!n)return null;const o=Oo(null==n?void 0:n.top)||t,l=Oo(null==n?void 0:n.left)||t;return o===l?o:`${o} ${l}`}function Vl(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("spacing.blockGap");return!Ol(e)||t}function Hl(e){var t;const{clientId:n,attributes:{style:o},name:l,setAttributes:r}=e,i=Yo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]}),c=Al(l,"blockGap"),u=Mo(n);if(Vl(e))return null;const d=c&&c.some((e=>Ll.includes(e))),p=e=>{var t;let n=e;e&&d?n={...zl(e)}:null!=e&&e.hasOwnProperty("top")&&(n=e.top);const l={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};r({style:al(l)});const i=(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;u.current&&i&&(null===(s=u.current.parentNode)||void 0===s||s.replaceChild(u.current,u.current))},g=zl(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=d?{...g,right:null==g?void 0:g.left,bottom:null==g?void 0:g.top}:{top:null==g?void 0:g.top};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(d?(0,s.createElement)(m.__experimentalBoxControl,{label:(0,h.__)("Block spacing"),min:0,onChange:p,units:a,sides:c,values:f,allowReset:!1,splitOnAxis:d}):(0,s.createElement)(m.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:p,units:a,value:f})),(null==i?void 0:i.length)>0&&(0,s.createElement)(ll,{values:f,onChange:p,label:(0,h.__)("Block spacing"),sides:d?c:["top"],units:a,allowReset:!1,splitOnAxis:d})),native:null})}const Gl=(0,s.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(m.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Ul=(0,s.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(m.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Wl={top:{icon:(0,s.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(m.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,h._x)("Align top","Block vertical alignment setting")},center:{icon:Ul,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Gl,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},$l=["top","center","bottom"],jl={isAlternate:!0},Kl=function(e){let{value:t,onChange:n,controls:o=$l,isCollapsed:l=!0,isToolbar:r}=e;const a=Wl[t],c=Wl.top,u=r?m.ToolbarGroup:m.ToolbarDropdownMenu,d=r?{isCollapsed:l}:{popoverProps:{POPOVER_PROPS:jl}};return(0,s.createElement)(u,i({icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Wl[e],isActive:t===e,role:l?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))},ql=e=>(0,s.createElement)(Kl,i({},e,{isToolbar:!1})),Yl=e=>(0,s.createElement)(Kl,i({},e,{isToolbar:!0})),Zl={left:yo,center:Eo,right:Co,"space-between":So},Ql=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:l,popoverProps:r,isToolbar:a}=e;const c=e=>{o(e===l?void 0:e)},u=l?Zl[l]:Zl.left,d=[{name:"left",icon:yo,title:(0,h.__)("Justify items left"),isActive:"left"===l,onClick:()=>c("left")},{name:"center",icon:Eo,title:(0,h.__)("Justify items center"),isActive:"center"===l,onClick:()=>c("center")},{name:"right",icon:Co,title:(0,h.__)("Justify items right"),isActive:"right"===l,onClick:()=>c("right")},{name:"space-between",icon:So,title:(0,h.__)("Space between items"),isActive:"space-between"===l,onClick:()=>c("space-between")}],p=a?m.ToolbarGroup:m.ToolbarDropdownMenu,g=a?{isCollapsed:n}:{};return(0,s.createElement)(p,i({icon:u,popoverProps:r,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},g))},Xl=e=>(0,s.createElement)(Ql,i({},e,{isToolbar:!1})),Jl=e=>(0,s.createElement)(Ql,i({},e,{isToolbar:!0})),er={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},tr={left:"flex-start",right:"flex-end",center:"center"},nr={top:"flex-start",center:"center",bottom:"flex-end"},or=["wrap","nowrap"],lr={name:"flex",label:(0,h.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:l=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.Flex,null,(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(ir,{layout:t,onChange:n})),(0,s.createElement)(m.FlexItem,null,l&&(0,s.createElement)(ar,{layout:t,onChange:n}))),(0,s.createElement)(sr,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:l=!0}=o;return(0,s.createElement)(ko,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(ir,{layout:t,onChange:n,isToolbar:!0}),l&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(rr,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:l,style:r,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{orientation:c="horizontal"}=l,u=null!=r&&null!==(t=r.spacing)&&void 0!==t&&t.blockGap&&!dl(i,"spacing","blockGap")?Fl(null==r||null===(n=r.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=er[l.justifyContent],p=or.includes(l.flexWrap)?l.flexWrap:"wrap",m=nr[l.verticalAlignment],g=tr[l.justifyContent]||tr.left;let h="";const f=[];return p&&"wrap"!==p&&f.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&f.push(`align-items: ${m}`),d&&f.push(`justify-content: ${d}`)):(f.push("flex-direction: column"),f.push(`align-items: ${g}`)),f.length&&(h=`${Io(o)} {\n\t\t\t\t${f.join("; ")};\n\t\t\t}`),s&&u&&(h+=xo(o,a,"flex",u)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function rr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:l=nr.center}=t,r=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(ql,{onChange:r,value:l});const i=[{value:"flex-start",label:(0,h.__)("Align items top")},{value:"center",label:(0,h.__)("Align items center")},{value:"flex-end",label:(0,h.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,h.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(m.Button,{key:e,label:n,icon:t,isPressed:l===e,onClick:()=>r(e)})))))}function ir(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:l="left",orientation:r="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===r&&a.push("space-between"),o)return(0,s.createElement)(Xl,{allowedControls:a,value:l,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:yo,label:(0,h.__)("Justify items left")},{value:"center",icon:Eo,label:(0,h.__)("Justify items center")},{value:"right",icon:Co,label:(0,h.__)("Justify items right")}];return"horizontal"===r&&c.push({value:"space-between",icon:So,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)(m.Button,{key:t,label:o,icon:n,isPressed:l===t,onClick:()=>i(t)})}))))}function sr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(m.ToggleControl,{label:(0,h.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function ar(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)(m.Button,{label:(0,h.__)("Horizontal"),icon:wo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(m.Button,{label:(0,h.__)("Vertical"),icon:Bo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}const cr={name:"default",label:(0,h.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function(e){var t;let{selector:n,style:o,blockName:l,hasBlockGapSupport:r,layoutDefinitions:i}=e;const s=Fl(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap);let a="";dl(l,"spacing","blockGap")||(null!=s&&s.top?a=Fl(null==s?void 0:s.top):"string"==typeof s&&(a=Fl(s)));let c="";return r&&a&&(c+=xo(n,i,"default",a)),c},getOrientation:()=>"vertical",getAlignments(e){const t=To(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,l=[{name:"left"},{name:"center"},{name:"right"}];return n&&l.unshift({name:"full"}),o&&l.unshift({name:"wide",info:t.wide}),l.unshift({name:"none",info:t.none}),l}},ur=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},dr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),pr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),mr=window.wp.styleEngine,gr=[cr,lr,{name:"constrained",label:(0,h.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:l,justifyContent:r="center"}=t,i=[{value:"left",icon:yo,label:(0,h.__)("Justify items left")},{value:"center",icon:Eo,label:(0,h.__)("Justify items center")},{value:"right",icon:Co,label:(0,h.__)("Justify items right")}],a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("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)(m.__experimentalUnitControl,{label:(0,h.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:l||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:a}),(0,s.createElement)(ur,{icon:dr})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(m.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||l||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:a}),(0,s.createElement)(ur,{icon:pr}))),(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.")),(0,s.createElement)(m.__experimentalToggleGroupControl,{__experimentalIsBorderless:!0,label:(0,h.__)("Justification"),value:r,onChange:e=>{n({...t,justifyContent:e})}},i.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})}))))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:o,layout:l={},style:r,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{contentSize:c,wideSize:u,justifyContent:d}=l,p=Fl(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap);let m="";dl(i,"spacing","blockGap")||(null!=p&&p.top?m=Fl(null==p?void 0:p.top):"string"==typeof p&&(m=Fl(p)));const g="left"===d?"0 !important":"auto !important",h="right"===d?"0 !important":"auto !important";let f=c||u?`\n\t\t\t\t\t${Io(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: ${g};\n\t\t\t\t\t\tmargin-right: ${h};\n\t\t\t\t\t}\n\t\t\t\t\t${Io(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${Io(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return"left"===d?f+=`${Io(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${g}; }`:"right"===d&&(f+=`${Io(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${h}; }`),null!=r&&null!==(n=r.spacing)&&void 0!==n&&n.padding&&(0,mr.getCSSRules)(r).forEach((e=>{"paddingRight"===e.key?f+=`\n\t\t\t\t\t${Io(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(f+=`\n\t\t\t\t\t${Io(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),s&&m&&(f+=xo(o,a,"constrained",m)),f},getOrientation:()=>"vertical",getAlignments(e){const t=To(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,l=[{name:"left"},{name:"center"},{name:"right"}];return n&&l.unshift({name:"full"}),o&&l.unshift({name:"wide",info:t.wide}),l.unshift({name:"none",info:t.none}),l}}];function hr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return gr.find((t=>t.name===e))}const fr={type:"default"},vr=(0,s.createContext)(fr),br=vr.Provider;function _r(){return(0,s.useContext)(vr)}function kr(e){let{layout:t={},css:n,...o}=e;const l=hr(t.type),r=null!==Yo("spacing.blockGap");if(l){var i;if(n)return(0,s.createElement)("style",null,n);const e=null===(i=l.getLayoutStyle)||void 0===i?void 0:i.call(l,{hasBlockGapSupport:r,layout:t,...o});if(e)return(0,s.createElement)("style",null,e)}return null}const yr=["none","left","center","right","wide","full"],Er=["wide","full"];function Cr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,p.useSelect)((e=>{const{getSettings:t}=e(co),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=_r(),l=hr(null==o?void 0:o.type),r=l.getAlignments(o);if(n){const t=r.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==l.name&&"constrained"!==l.name)return[];const{alignments:i=yr}=o,s=e.filter((e=>(o.alignments||t||!Er.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Sr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),wr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Br=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),Ir=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),xr={none:{icon:Sr,title:(0,h._x)("None","Alignment option")},left:{icon:wr,title:(0,h.__)("Align left")},center:{icon:dr,title:(0,h.__)("Align center")},right:{icon:Br,title:(0,h.__)("Align right")},wide:{icon:pr,title:(0,h.__)("Wide width")},full:{icon:Ir,title:(0,h.__)("Full width")}},Tr={isAlternate:!0},Nr=function(e){let{value:t,onChange:n,controls:o,isToolbar:l,isCollapsed:r=!0}=e;const a=Cr(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=xr[t],p=xr.none,g=l?m.ToolbarGroup:m.ToolbarDropdownMenu,f={icon:d?d.icon:p.icon,label:(0,h.__)("Align")},v=l?{isCollapsed:r,controls:a.map((e=>{let{name:n}=e;return{...xr[n],isActive:t===n||!t&&"none"===n,role:r?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{toggleProps:{describedBy:(0,h.__)("Change alignment")},popoverProps:Tr,children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:l}=e;const{icon:r,title:i}=xr[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(m.MenuItem,{key:o,icon:r,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:l},i)}))))}};return(0,s.createElement)(g,i({},f,v))},Pr=e=>(0,s.createElement)(Nr,i({},e,{isToolbar:!1})),Lr=e=>(0,s.createElement)(Nr,i({},e,{isToolbar:!0})),Mr=["left","center","right","wide","full"],Rr=["wide","full"];function Ar(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)?Mr.filter((t=>e.includes(t))):!0===e?[...Mr]:[],!o||!0===e&&!n?(0,u.without)(t,...Rr):t}const Dr=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,s.createElement)(e,t),{name:o}=t,r=Cr(Ar((0,l.getBlockSupport)(o,"align"),(0,l.hasBlockSupport)(o,"alignWide",!0))).map((e=>{let{name:t}=e;return t})),i=(0,p.useSelect)((e=>e(co).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return!r.length||i?n:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ko,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Pr,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const r=(0,l.getBlockType)(t.name);(null==r||null===(n=r.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:r})),n)}),"withToolbarControls"),Or=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:r}=o,a=Cr(Ar((0,l.getBlockSupport)(n,"align"),(0,l.hasBlockSupport)(n,"alignWide",!0)));if(void 0===r)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===r))&&(c={...c,"data-align":r}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,r.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.align)&&void 0!==t?t:{})||(0,l.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Mr,""]}}),e})),(0,r.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Or),(0,r.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Dr),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Ar((0,l.getBlockSupport)(t,"align"),(0,l.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,r.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const zr=/[\s#]/g,Fr={type:"string",source:"attribute",attribute:"id",selector:"*"},Vr=(0,d.createHigherOrderComponent)((e=>t=>{if((0,l.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(m.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)(m.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(zr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(vl,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(vl,null,(0,s.createElement)(m.PanelBody,{title:(0,h.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,r.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.anchor)&&void 0!==t?t:{})||(0,l.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Fr}),e})),(0,r.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Vr),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,l.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Hr={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,r.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,l.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Hr}),e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,l.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Gr=(0,d.createHigherOrderComponent)((e=>t=>(0,l.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(vl,{__experimentalGroup:"advanced"},(0,s.createElement)(m.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,r.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,l.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,r.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Gr),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,l.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,r.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,l.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var r;const o=null===(r=t[n])||void 0===r?void 0:r.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,l.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,l.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,l.getBlockDefaultClassName)(t.name)),e}));const Ur=window.wp.dom,Wr=(0,s.createContext)({});function $r(e){let{value:t,children:n}=e;const o=(0,s.useContext)(Wr),l=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(Wr.Provider,{value:l,children:n})}const jr=Wr,Kr={},qr=(0,m.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,l.getBlockType)(n),r=(0,s.useContext)(jr),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(r,o.usesContext):Kr),[o,r]);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,l.hasBlockSupport)(o,"className",!0)?(0,l.getBlockDefaultClassName)(n):null,m=c()(p,t.className,e.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function Yr(e){const{name:t,isSelected:n,clientId:o}=e,l={name:t,isSelected:n,clientId:o};return(0,s.createElement)(mo,{value:(0,s.useMemo)((()=>l),Object.values(l))},(0,s.createElement)(qr,e))}const Zr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),Qr=function(e){let{className:t,actions:n,children:o,secondaryActions:l}=e;return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(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||l)&&(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))),l&&(0,s.createElement)(m.DropdownMenu,{className:"block-editor-warning__secondary",icon:Zr,label:(0,h.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(m.MenuGroup,null,l.map(((e,t)=>(0,s.createElement)(m.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))};var Xr=n(1973);function Jr(e){let{title:t,rawContent:n,renderedContent:o,action:l,actionText:r,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,Ur.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(m.Button,{variant:"secondary",tabIndex:"0",onClick:l},r)))}const ei=function(e){let{block:t,onKeep:n,onConvert:o,convertor:r,convertButtonText:i}=e;const a=(d=r(t),(0,u.castArray)(d).map((e=>(0,l.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,g=a,(0,Xr.Kx)(m,g).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,g;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(Jr,{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)(Jr,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))},ti=e=>(0,l.rawHandler)({HTML:e.originalContent}),ni=(0,d.compose)([(0,p.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(co).getBlock(n)}})),(0,p.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(co);return{convertToClassic(){o(n.clientId,(e=>(0,l.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,l.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,ti(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,l.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:r,block:i}=e;const a=!!(0,l.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),p=(0,s.useCallback)((()=>u(!1)),[]),g=(0,s.useMemo)((()=>[{
10
  // translators: Button to fix block content
11
- 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)(Qr,{actions:[(0,s.createElement)(m.Button,{key:"recover",onClick:r,variant:"primary"},(0,h.__)("Attempt Block Recovery"))],secondaryActions:g},(0,h.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(m.Modal,{title:// translators: Dialog title to fix block content
12
- (0,h.__)("Resolve Block"),onRequestClose:p,className:"block-editor-block-compare"},(0,s.createElement)(ei,{block:i,onKeep:t,onConvert:n,convertor:ti,convertButtonText:(0,h.__)("Convert to Blocks")})))})),oi=(0,s.createElement)(Qr,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed.")),li=()=>oi;class ri 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}}const ii=ri;var si=n(773);const ai=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),r=(0,p.useSelect)((e=>e(co).getBlock(t)),[t]),{updateBlock:i}=(0,p.useDispatch)(co);return(0,s.useEffect)((()=>{o((0,l.getBlockContent)(r))}),[r]),(0,s.createElement)(si.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,l.getBlockType)(r.name);if(!e)return;const s=(0,l.getBlockAttributes)(e,n,r.attributes),a=n||(0,l.getSaveContent)(e,s),[c]=n?(0,l.validateBlock)({...r,attributes:s,originalContent:a}):[!0];i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let ci=wi();const ui=e=>yi(e,ci);let di=wi();ui.write=e=>yi(e,di);let pi=wi();ui.onStart=e=>yi(e,pi);let mi=wi();ui.onFrame=e=>yi(e,mi);let gi=wi();ui.onFinish=e=>yi(e,gi);let hi=[];ui.setTimeout=(e,t)=>{let n=ui.now()+t,o=()=>{let e=hi.findIndex((e=>e.cancel==o));~e&&hi.splice(e,1),_i-=~e?1:0},l={time:n,handler:e,cancel:o};return hi.splice(fi(n),0,l),_i+=1,Ei(),l};let fi=e=>~(~hi.findIndex((t=>t.time>e))||~hi.length);ui.cancel=e=>{pi.delete(e),mi.delete(e),ci.delete(e),di.delete(e),gi.delete(e)},ui.sync=e=>{ki=!0,ui.batchedUpdates(e),ki=!1},ui.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,ui.onStart(n)}return o.handler=e,o.cancel=()=>{pi.delete(n),t=null},o};let vi="undefined"!=typeof window?window.requestAnimationFrame:()=>{};ui.use=e=>vi=e,ui.now="undefined"!=typeof performance?()=>performance.now():Date.now,ui.batchedUpdates=e=>e(),ui.catch=console.error,ui.frameLoop="always",ui.advance=()=>{"demand"!==ui.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Si()};let bi=-1,_i=0,ki=!1;function yi(e,t){ki?(t.delete(e),e(0)):(t.add(e),Ei())}function Ei(){bi<0&&(bi=0,"demand"!==ui.frameLoop&&vi(Ci))}function Ci(){~bi&&(vi(Ci),ui.batchedUpdates(Si))}function Si(){let e=bi;bi=ui.now();let t=fi(bi);t&&(Bi(hi.splice(0,t),(e=>e.handler())),_i-=t),pi.flush(),ci.flush(e?Math.min(64,bi-e):16.667),mi.flush(),di.flush(),gi.flush(),_i||(bi=-1)}function wi(){let e=new Set,t=e;return{add(n){_i+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(_i-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,_i-=t.size,Bi(t,(t=>t(n)&&e.add(t))),_i+=e.size,t=e)}}}function Bi(e,t){e.forEach((e=>{try{t(e)}catch(e){ui.catch(e)}}))}var Ii=n(9196),xi=n.n(Ii);function Ti(){}const Ni={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 Pi(e,t){if(Ni.arr(e)){if(!Ni.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 Li=(e,t)=>e.forEach(t);function Mi(e,t,n){if(Ni.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Ri=e=>Ni.und(e)?[]:Ni.arr(e)?e:[e];function Ai(e,t){if(e.size){const n=Array.from(e);e.clear(),Li(n,t)}}const Di=(e,...t)=>Ai(e,(e=>e(...t))),Oi=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let zi,Fi,Vi=null,Hi=!1,Gi=Ti;var Ui=Object.freeze({__proto__:null,get createStringInterpolator(){return zi},get to(){return Fi},get colors(){return Vi},get skipAnimation(){return Hi},get willAdvance(){return Gi},assign:e=>{e.to&&(Fi=e.to),e.now&&(ui.now=e.now),void 0!==e.colors&&(Vi=e.colors),null!=e.skipAnimation&&(Hi=e.skipAnimation),e.createStringInterpolator&&(zi=e.createStringInterpolator),e.requestAnimationFrame&&ui.use(e.requestAnimationFrame),e.batchedUpdates&&(ui.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Gi=e.willAdvance),e.frameLoop&&(ui.frameLoop=e.frameLoop)}});const Wi=new Set;let $i=[],ji=[],Ki=0;const qi={get idle(){return!Wi.size&&!$i.length},start(e){Ki>e.priority?(Wi.add(e),ui.onStart(Yi)):(Zi(e),ui(Xi))},advance:Xi,sort(e){if(Ki)ui.onFrame((()=>qi.sort(e)));else{const t=$i.indexOf(e);~t&&($i.splice(t,1),Qi(e))}},clear(){$i=[],Wi.clear()}};function Yi(){Wi.forEach(Zi),Wi.clear(),ui(Xi)}function Zi(e){$i.includes(e)||Qi(e)}function Qi(e){$i.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}($i),0,e)}function Xi(e){const t=ji;for(let n=0;n<$i.length;n++){const o=$i[n];Ki=o.priority,o.idle||(Gi(o),o.advance(e),o.idle||t.push(o))}return Ki=0,ji=$i,ji.length=0,$i=t,$i.length>0}const Ji="[-+]?\\d*\\.?\\d+",es=Ji+"%";function ts(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const ns=new RegExp("rgb"+ts(Ji,Ji,Ji)),os=new RegExp("rgba"+ts(Ji,Ji,Ji,Ji)),ls=new RegExp("hsl"+ts(Ji,es,es)),rs=new RegExp("hsla"+ts(Ji,es,es,Ji)),is=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ss=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,as=/^#([0-9a-fA-F]{6})$/,cs=/^#([0-9a-fA-F]{8})$/;function us(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 ds(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o,r=us(l,o,e+1/3),i=us(l,o,e),s=us(l,o,e-1/3);return Math.round(255*r)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function ps(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function ms(e){return(parseFloat(e)%360+360)%360/360}function gs(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function hs(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function fs(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=as.exec(e))?parseInt(t[1]+"ff",16)>>>0:Vi&&void 0!==Vi[e]?Vi[e]:(t=ns.exec(e))?(ps(t[1])<<24|ps(t[2])<<16|ps(t[3])<<8|255)>>>0:(t=os.exec(e))?(ps(t[1])<<24|ps(t[2])<<16|ps(t[3])<<8|gs(t[4]))>>>0:(t=is.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=cs.exec(e))?parseInt(t[1],16)>>>0:(t=ss.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=ls.exec(e))?(255|ds(ms(t[1]),hs(t[2]),hs(t[3])))>>>0:(t=rs.exec(e))?(ds(ms(t[1]),hs(t[2]),hs(t[3]))|gs(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 vs=(e,t,n)=>{if(Ni.fun(e))return e;if(Ni.arr(e))return vs({range:e,output:t,extrapolate:n});if(Ni.str(e.output[0]))return zi(e);const o=e,l=o.output,r=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,r);return function(e,t,n,o,l,r,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===l?o:t===n?e<=t?o:l:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=r(c),o===-1/0?c=-c:l===1/0?c+=o:c=c*(l-o)+o,c)}(e,r[t],r[t+1],l[t],l[t+1],a,i,s,o.map)}};function bs(){return(bs=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 _s=Symbol.for("FluidValue.get"),ks=Symbol.for("FluidValue.observers"),ys=e=>Boolean(e&&e[_s]),Es=e=>e&&e[_s]?e[_s]():e,Cs=e=>e[ks]||null;function Ss(e,t){let n=e[ks];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class ws{constructor(e){if(this[_s]=void 0,this[ks]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Bs(this,e)}}const Bs=(e,t)=>Ts(e,_s,t);function Is(e,t){if(e[_s]){let n=e[ks];n||Ts(e,ks,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function xs(e,t){let n=e[ks];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[ks]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Ts=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ns=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Ps=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ls=new RegExp(`(${Ns.source})(%|[a-z]+)`,"i"),Ms=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Rs=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,As=e=>{const[t,n]=Ds(e);if(!t||Oi())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&Rs.test(n)?As(n):n||e},Ds=e=>{const t=Rs.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let Os;const zs=(e,t,n,o,l)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${l})`,Fs=e=>{Os||(Os=Vi?new RegExp(`(${Object.keys(Vi).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Es(e).replace(Rs,As).replace(Ps,fs).replace(Os,fs))),n=t.map((e=>e.match(Ns).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=>vs(bs({},e,{output:t}))));return e=>{var n;const l=!Ls.test(t[0])&&(null==(n=t.find((e=>Ls.test(e))))?void 0:n.replace(Ns,""));let r=0;return t[0].replace(Ns,(()=>`${o[r++](e)}${l||""}`)).replace(Ms,zs)}},Vs="react-spring: ",Hs=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Vs}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Gs=Hs(console.warn),Us=Hs(console.warn);function Ws(e){return Ni.str(e)&&("#"==e[0]||/\d/.test(e)||!Oi()&&Rs.test(e)||e in(Vi||{}))}const $s="undefined"!=typeof window&&window.document&&window.document.createElement?Ii.useLayoutEffect:Ii.useEffect;function js(){const e=(0,Ii.useState)()[1],t=(()=>{const e=(0,Ii.useRef)(!1);return $s((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const Ks=e=>(0,Ii.useEffect)(e,qs),qs=[];function Ys(e){const t=(0,Ii.useRef)();return(0,Ii.useEffect)((()=>{t.current=e})),t.current}const Zs=Symbol.for("Animated:node"),Qs=e=>e&&e[Zs],Xs=(e,t)=>{return n=e,o=Zs,l=t,Object.defineProperty(n,o,{value:l,writable:!0,configurable:!0});var n,o,l},Js=e=>e&&e[Zs]&&e[Zs].getPayload();class ea{constructor(){this.payload=void 0,Xs(this,this)}getPayload(){return this.payload||[]}}class ta extends ea{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,Ni.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new ta(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Ni.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,Ni.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class na extends ta{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=vs({output:[e,e]})}static create(e){return new na(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Ni.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=vs({output:[this.getValue(),e]})),this._value=0,super.reset()}}const oa={dependencies:null};class la extends ea{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Mi(this.source,((n,o)=>{var l;(l=n)&&l[Zs]===l?t[o]=n.getValue(e):ys(n)?t[o]=Es(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Li(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Mi(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){oa.dependencies&&ys(e)&&oa.dependencies.add(e);const t=Js(e);t&&Li(t,(e=>this.add(e)))}}class ra extends la{constructor(e){super(e)}static create(e){return new ra(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(ia)),!0)}}function ia(e){return(Ws(e)?na:ta).create(e)}function sa(e){const t=Qs(e);return t?t.constructor:Ni.arr(e)?ra:Ws(e)?na:ta}function aa(){return(aa=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 ca=(e,t)=>{const n=!Ni.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Ii.forwardRef)(((o,l)=>{const r=(0,Ii.useRef)(null),i=n&&(0,Ii.useCallback)((e=>{r.current=function(e,t){return e&&(Ni.fun(e)?e(t):e.current=t),t}(l,e)}),[l]),[s,a]=function(e,t){const n=new Set;return oa.dependencies=n,e.style&&(e=aa({},e,{style:t.createAnimatedStyle(e.style)})),e=new la(e),oa.dependencies=null,[e,n]}(o,t),c=js(),u=()=>{const e=r.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new ua(u,a),p=(0,Ii.useRef)();$s((()=>(p.current=d,Li(a,(e=>Is(e,d))),()=>{p.current&&(Li(p.current.deps,(e=>xs(e,p.current))),ui.cancel(p.current.update))}))),(0,Ii.useEffect)(u,[]),Ks((()=>()=>{const e=p.current;Li(e.deps,(t=>xs(t,e)))}));const m=t.getComponentProps(s.getValue());return Ii.createElement(e,aa({},m,{ref:i}))}))};class ua{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&ui.write(this.update)}}const da=Symbol.for("AnimatedComponent"),pa=e=>Ni.str(e)?e:e&&Ni.str(e.displayName)?e.displayName:Ni.fun(e)&&e.name||null;function ma(){return(ma=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 ga(e,...t){return Ni.fun(e)?e(...t):e}const ha=(e,t)=>!0===e||!!(t&&e&&(Ni.fun(e)?e(t):Ri(e).includes(t))),fa=(e,t)=>Ni.obj(e)?t&&e[t]:e,va=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,ba=e=>e,_a=(e,t=ba)=>{let n=ka;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const l of n){const n=t(e[l],l);Ni.und(n)||(o[l]=n)}return o},ka=["config","onProps","onStart","onChange","onPause","onResume","onRest"],ya={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 Ea(e){const t=function(e){const t={};let n=0;if(Mi(e,((e,o)=>{ya[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Mi(e,((e,o)=>o in t||(n[o]=e))),n}return ma({},e)}function Ca(e){return e=Es(e),Ni.arr(e)?e.map(Ca):Ws(e)?Ui.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Sa(e){for(const t in e)return!0;return!1}function wa(e){return Ni.fun(e)||Ni.arr(e)&&Ni.obj(e[0])}function Ba(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Ia(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}Math.PI,Math.PI;const xa=ma({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Ta{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,xa)}}function Na(e,t){if(Ni.und(t.decay)){const n=!Ni.und(t.tension)||!Ni.und(t.friction);!n&&Ni.und(t.frequency)&&Ni.und(t.damping)&&Ni.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Pa=[];class La{constructor(){this.changed=!1,this.values=Pa,this.toValues=null,this.fromValues=Pa,this.to=void 0,this.from=void 0,this.config=new Ta,this.immediate=!1}}function Ma(e,{key:t,props:n,defaultProps:o,state:l,actions:r}){return new Promise(((i,s)=>{var a;let c,u,d=ha(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{Ni.und(n.pause)||(l.paused=ha(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=l.paused||ha(e,t)),c=ga(n.delay||0,t),e?(l.resumeQueue.add(m),r.pause()):(r.resume(),m())}function p(){l.resumeQueue.add(m),l.timeouts.delete(u),u.cancel(),c=u.time-ui.now()}function m(){c>0&&!Ui.skipAnimation?(l.delayed=!0,u=ui.setTimeout(g,c),l.pauseQueue.add(p),l.timeouts.add(u)):g()}function g(){l.delayed&&(l.delayed=!1),l.pauseQueue.delete(p),l.timeouts.delete(u),e<=(l.cancelId||0)&&(d=!0);try{r.start(ma({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Ra=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Oa(e.get()):t.every((e=>e.noop))?Aa(e.get()):Da(e.get(),t.every((e=>e.finished))),Aa=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Da=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Oa=e=>({value:e,cancelled:!0,finished:!1});function za(e,t,n,o){const{callId:l,parentId:r,onRest:i}=t,{asyncTo:s,promise:a}=n;return r||e!==s||t.reset?n.promise=(async()=>{n.asyncId=l,n.asyncTo=e;const c=_a(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=l<=(n.cancelId||0)&&Oa(o)||l!==n.asyncId&&Da(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const r=new Va,i=new Ha;return(async()=>{if(Ui.skipAnimation)throw Fa(n),i.result=Da(o,!1),d(i),i;m(r);const s=Ni.obj(e)?ma({},e):ma({},t,{to:e});s.parentId=l,Mi(c,((e,t)=>{Ni.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(r),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let h;if(Ui.skipAnimation)return Fa(n),Da(o,!1);try{let t;t=Ni.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(u),p]),h=Da(o.get(),!0,!1)}catch(e){if(e instanceof Va)h=e.result;else{if(!(e instanceof Ha))throw e;h=e.result}}finally{l==n.asyncId&&(n.asyncId=r,n.asyncTo=r?s:void 0,n.promise=r?a:void 0)}return Ni.fun(i)&&ui.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function Fa(e,t){Ai(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Va 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 Ha extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Ga=e=>e instanceof Wa;let Ua=1;class Wa extends ws{constructor(...e){super(...e),this.id=Ua++,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=Qs(this);return e&&e.getValue()}to(...e){return Ui.to(this,e)}interpolate(...e){return Gs(`${Vs}The "interpolate" function is deprecated in v9 (use "to" instead)`),Ui.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){Ss(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||qi.sort(this),Ss(this,{type:"priority",parent:this,priority:e})}}const $a=Symbol.for("SpringPhase"),ja=e=>(1&e[$a])>0,Ka=e=>(2&e[$a])>0,qa=e=>(4&e[$a])>0,Ya=(e,t)=>t?e[$a]|=3:e[$a]&=-3,Za=(e,t)=>t?e[$a]|=4:e[$a]&=-5;class Qa extends Wa{constructor(e,t){if(super(),this.key=void 0,this.animation=new La,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Ni.und(e)||!Ni.und(t)){const n=Ni.obj(e)?ma({},e):ma({},t,{from:e});Ni.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Ka(this)||this._state.asyncTo)||qa(this)}get goal(){return Es(this.animation.to)}get velocity(){const e=Qs(this);return e instanceof ta?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return ja(this)}get isAnimating(){return Ka(this)}get isPaused(){return qa(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:l,toValues:r}=o;const i=Js(o.to);!i&&ys(o.to)&&(r=Ri(Es(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==na?1:i?i[a].lastPosition:r[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,l.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],r=null!=s.v0?s.v0:s.v0=Ni.arr(l.velocity)?l.velocity[a]:l.velocity;let i;if(Ni.und(l.duration))if(l.decay){const e=!0===l.decay?.998:l.decay,o=Math.exp(-(1-e)*t);d=n+r/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,i=r*o}else{i=null==s.lastVelocity?r:s.lastVelocity;const t=l.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=l.restVelocity||t/10,a=l.clamp?0:l.bounce,p=!Ni.und(a),m=n==c?s.v0>0:n<c;let g,h=!1;const f=1,v=Math.ceil(e/f);for(let e=0;e<v&&(g=Math.abs(i)>o,g||(u=Math.abs(c-d)<=t,!u));++e)p&&(h=d==c||d>c==m,h&&(i=-i*a,d=c)),i+=(1e-6*-l.tension*(d-c)+.001*-l.friction*i)/l.mass*f,d+=i*f}else{let o=1;l.duration>0&&(this._memoizedDuration!==l.duration&&(this._memoizedDuration=l.duration,s.durationProgress>0&&(s.elapsedTime=l.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(l.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+l.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,l.round)&&(n=!0)}));const s=Qs(this),a=s.getValue();if(t){const e=Es(o.to);a===e&&!n||l.decay?n&&l.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return ui.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Ka(this)){const{to:e,config:t}=this.animation;ui.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 Ni.und(e)?(n=this.queue||[],this.queue=[]):n=[Ni.obj(e)?e:ma({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Ra(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Fa(this._state,e&&this._lastCallId),ui.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=Ni.obj(n)?n[t]:n,(null==n||wa(n))&&(n=void 0),o=Ni.obj(o)?o[t]:o,null==o&&(o=void 0);const l={to:n,from:o};return ja(this)||(e.reverse&&([n,o]=[o,n]),o=Es(o),Ni.und(o)?Qs(this)||this._set(n):this._set(o)),l}_update(e,t){let n=ma({},e);const{key:o,defaultProps:l}=this;n.default&&Object.assign(l,_a(n,((e,t)=>/^on/.test(t)?fa(e,o):e))),lc(this,n,"onProps"),rc(this,"onProps",n,this);const r=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 Ma(++this._lastCallId,{key:o,props:n,defaultProps:l,state:i,actions:{pause:()=>{qa(this)||(Za(this,!0),Di(i.pauseQueue),rc(this,"onPause",Da(this,Xa(this,this.animation.to)),this))},resume:()=>{qa(this)&&(Za(this,!1),Ka(this)&&this._resume(),Di(i.resumeQueue),rc(this,"onResume",Da(this,Xa(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=Ja(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Oa(this));const o=!Ni.und(e.to),l=!Ni.und(e.from);if(o||l){if(!(t.callId>this._lastToId))return n(Oa(this));this._lastToId=t.callId}const{key:r,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!l||o||t.default&&!Ni.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Pi(d,c);p&&(s.from=d),d=Es(d);const m=!Pi(u,a);m&&this._focus(u);const g=wa(t.to),{config:h}=s,{decay:f,velocity:v}=h;(o||l)&&(h.velocity=0),t.config&&!g&&function(e,t,n){n&&(Na(n=ma({},n),t),t=ma({},n,t)),Na(e,t),Object.assign(e,t);for(const t in xa)null==e[t]&&(e[t]=xa[t]);let{mass:o,frequency:l,damping:r}=e;Ni.und(l)||(l<.01&&(l=.01),r<0&&(r=0),e.tension=Math.pow(2*Math.PI/l,2)*o,e.friction=4*Math.PI*r*o/l)}(h,ga(t.config,r),t.config!==i.config?ga(i.config,r):void 0);let b=Qs(this);if(!b||Ni.und(u))return n(Da(this,!0));const _=Ni.und(t.reset)?l&&!t.default:!Ni.und(d)&&ha(t.reset,r),k=_?d:this.get(),y=Ca(u),E=Ni.num(y)||Ni.arr(y)||Ws(y),C=!g&&(!E||ha(i.immediate||t.immediate,r));if(m){const e=sa(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=ys(u),B=!1;if(!w){const e=_||!ja(this)&&p;(m||e)&&(B=Pi(Ca(k),y),w=!B),(Pi(s.immediate,C)||C)&&Pi(h.decay,f)&&Pi(h.velocity,v)||(w=!0)}if(B&&Ka(this)&&(s.changed&&!_?w=!0:w||this._stop(a)),!g&&((w||ys(a))&&(s.values=b.getPayload(),s.toValues=ys(u)?null:S==na?[1]:Ri(y)),s.immediate!=C&&(s.immediate=C,C||_||this._set(a)),w)){const{onRest:e}=s;Li(oc,(e=>lc(this,t,e)));const o=Da(this,Xa(this,a));Di(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&ui.batchedUpdates((()=>{s.changed=!_,null==e||e(o,this),_?ga(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}_&&this._set(k),g?n(za(t.to,t,this._state,this)):w?this._start():Ka(this)&&!m?this._pendingCalls.add(n):n(Aa(k))}_focus(e){const t=this.animation;e!==t.to&&(Cs(this)&&this._detach(),t.to=e,Cs(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;ys(t)&&(Is(t,this),Ga(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;ys(e)&&xs(e,this)}_set(e,t=!0){const n=Es(e);if(!Ni.und(n)){const e=Qs(this);if(!e||!Pi(n,e.getValue())){const o=sa(n);e&&e.constructor==o?e.setValue(n):Xs(this,o.create(n)),e&&ui.batchedUpdates((()=>{this._onChange(n,t)}))}}return Qs(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,rc(this,"onStart",Da(this,Xa(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),ga(this.animation.onChange,e,this)),ga(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Qs(this).reset(Es(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Ka(this)||(Ya(this,!0),qa(this)||this._resume())}_resume(){Ui.skipAnimation?this.finish():qi.start(this)}_stop(e,t){if(Ka(this)){Ya(this,!1);const n=this.animation;Li(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ss(this,{type:"idle",parent:this});const o=t?Oa(this.get()):Da(this.get(),Xa(this,null!=e?e:n.to));Di(this._pendingCalls,o),n.changed&&(n.changed=!1,rc(this,"onRest",o,this))}}}function Xa(e,t){const n=Ca(t);return Pi(Ca(e.get()),n)}function Ja(e,t=e.loop,n=e.to){let o=ga(t);if(o){const l=!0!==o&&Ea(o),r=(l||e).reverse,i=!l||l.reset;return ec(ma({},e,{loop:t,default:!1,pause:void 0,to:!r||wa(n)?n:void 0,from:i?e.from:void 0,reset:i},l))}}function ec(e){const{to:t,from:n}=e=Ea(e),o=new Set;return Ni.obj(t)&&nc(t,o),Ni.obj(n)&&nc(n,o),e.keys=o.size?Array.from(o):null,e}function tc(e){const t=ec(e);return Ni.und(t.default)&&(t.default=_a(t)),t}function nc(e,t){Mi(e,((e,n)=>null!=e&&t.add(n)))}const oc=["onStart","onRest","onChange","onPause","onResume"];function lc(e,t,n){e.animation[n]=t[n]!==va(t,n)?fa(t[n],e.key):void 0}function rc(e,t,...n){var o,l,r,i;null==(o=(l=e.animation)[t])||o.call(l,...n),null==(r=(i=e.defaultProps)[t])||r.call(i,...n)}const ic=["onStart","onChange","onRest"];let sc=1;class ac{constructor(e,t){this.id=sc++,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(ma({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}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];Ni.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(ec(e)),this}start(e){let{queue:t}=this;return e?t=Ri(e).map(ec):this.queue=[],this._flush?this._flush(this,t):(hc(this,t),cc(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Li(Ri(t),(t=>n[t].stop(!!e)))}else Fa(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Ni.und(e))this.start({pause:!0});else{const t=this.springs;Li(Ri(e),(e=>t[e].pause()))}return this}resume(e){if(Ni.und(e))this.start({pause:!1});else{const t=this.springs;Li(Ri(e),(e=>t[e].resume()))}return this}each(e){Mi(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,l=this._changed.size>0;(o&&!this._started||l&&!this._started)&&(this._started=!0,Ai(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const r=!o&&this._started,i=l||r&&n.size?this.get():null;l&&t.size&&Ai(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),r&&(this._started=!1,Ai(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)}ui.onFrame(this._onFrame)}}function cc(e,t){return Promise.all(t.map((t=>uc(e,t)))).then((t=>Ra(e,t)))}async function uc(e,t,n){const{keys:o,to:l,from:r,loop:i,onRest:s,onResolve:a}=t,c=Ni.obj(t.default)&&t.default;i&&(t.loop=!1),!1===l&&(t.to=null),!1===r&&(t.from=null);const u=Ni.arr(l)||Ni.fun(l)?l:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Li(ic,(n=>{const o=t[n];if(Ni.fun(o)){const l=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=l.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):l.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,Di(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===va(t,"cancel");(u||m&&d.asyncId)&&p.push(Ma(++e._lastAsyncId,{props:t,state:d,actions:{pause:Ti,resume:Ti,start(t,n){m?(Fa(d,e._lastAsyncId),n(Oa(e))):(t.onRest=s,n(za(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=Ra(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){const n=Ja(t,i,l);if(n)return hc(e,[n]),uc(e,n,!0)}return a&&ui.batchedUpdates((()=>a(g,e,e.item))),g}function dc(e,t){const n=ma({},e.springs);return t&&Li(Ri(t),(e=>{Ni.und(e.keys)&&(e=ec(e)),Ni.obj(e.to)||(e=ma({},e,{to:void 0})),gc(n,e,(e=>mc(e)))})),pc(e,n),n}function pc(e,t){Mi(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Is(t,e))}))}function mc(e,t){const n=new Qa;return n.key=e,t&&Is(n,t),n}function gc(e,t,n){t.keys&&Li(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function hc(e,t){Li(t,(t=>{gc(e.springs,t,(t=>mc(t,e)))}))}const fc=["children"],vc=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,l={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(l[n]=e[n]);return l}(e,fc);const o=(0,Ii.useContext)(bc),l=n.pause||!!o.pause,r=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Ii.useState)((()=>({inputs:t,result:e()}))),o=(0,Ii.useRef)(),l=o.current;let r=l;return r?Boolean(t&&r.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,r.inputs))||(r={inputs:t,result:e()}):r=n,(0,Ii.useEffect)((()=>{o.current=r,l==n&&(n.inputs=n.result=void 0)}),[r]),r.result}((()=>({pause:l,immediate:r})),[l,r]);const{Provider:i}=bc;return Ii.createElement(i,{value:n},t)},bc=(_c=vc,kc={},Object.assign(_c,Ii.createContext(kc)),_c.Provider._context=_c,_c.Consumer._context=_c,_c);var _c,kc;vc.Provider=bc.Provider,vc.Consumer=bc.Consumer;const yc=()=>{const e=[],t=function(t){Us(`${Vs}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 Li(e,((e,l)=>{if(Ni.und(t))o.push(e.start());else{const r=n(t,e,l);r&&o.push(e.start(r))}})),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 Li(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Li(e,(e=>e.resume(...arguments))),this},t.set=function(t){Li(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Li(e,((e,o)=>{if(Ni.und(t))n.push(e.start());else{const l=this._getProps(t,e,o);l&&n.push(e.start(l))}})),n},t.stop=function(){return Li(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Li(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Ni.fun(e)?e(n,t):e};return t._getProps=n,t};function Ec(e,t,n){const o=Ni.fun(t)&&t;o&&!n&&(n=[]);const l=(0,Ii.useMemo)((()=>o||3==arguments.length?yc():void 0),[]),r=(0,Ii.useRef)(0),i=js(),s=(0,Ii.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=dc(e,t);return r.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?cc(e,t):new Promise((o=>{pc(e,n),s.queue.push((()=>{o(cc(e,t))})),i()}))}})),[]),a=(0,Ii.useRef)([...s.ctrls]),c=[],u=Ys(e)||0;function d(e,n){for(let l=e;l<n;l++){const e=a.current[l]||(a.current[l]=new ac(null,s.flush)),n=o?o(l,e):t[l];n&&(c[l]=tc(n))}}(0,Ii.useMemo)((()=>{Li(a.current.slice(e,u),(e=>{Ba(e,l),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Ii.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>dc(e,c[t]))),m=(0,Ii.useContext)(vc),g=Ys(m),h=m!==g&&Sa(m);$s((()=>{r.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Li(e,(e=>e()))),Li(a.current,((e,t)=>{null==l||l.add(e),h&&e.start({default:m});const n=c[t];n&&(Ia(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ks((()=>()=>{Li(s.ctrls,(e=>e.stop(!0)))}));const f=p.map((e=>ma({},e)));return l?[f,l]:f}let Cc;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Cc||(Cc={}));class Sc extends Wa{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=vs(...t);const n=this._get(),o=sa(n);Xs(this,o.create(n))}advance(e){const t=this._get();Pi(t,this.get())||(Qs(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Bc(this._active)&&Ic(this)}_get(){const e=Ni.arr(this.source)?this.source.map(Es):Ri(Es(this.source));return this.calc(...e)}_start(){this.idle&&!Bc(this._active)&&(this.idle=!1,Li(Js(this),(e=>{e.done=!1})),Ui.skipAnimation?(ui.batchedUpdates((()=>this.advance())),Ic(this)):qi.start(this))}_attach(){let e=1;Li(Ri(this.source),(t=>{ys(t)&&Is(t,this),Ga(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Li(Ri(this.source),(e=>{ys(e)&&xs(e,this)})),this._active.clear(),Ic(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=Ri(this.source).reduce(((e,t)=>Math.max(e,(Ga(t)?t.priority:0)+1)),0))}}function wc(e){return!1!==e.idle}function Bc(e){return!e.size||Array.from(e).every(wc)}function Ic(e){e.idle||(e.idle=!0,Li(Js(e),(e=>{e.done=!0})),Ss(e,{type:"idle",parent:e}))}Ui.assign({createStringInterpolator:Fs,to:(e,t)=>new Sc(e,t)}),qi.advance;const xc=window.ReactDOM;function Tc(e,t){if(null==e)return{};var n,o,l={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(l[n]=e[n]);return l}const Nc=["style","children","scrollTop","scrollLeft"],Pc=/^--/;function Lc(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Pc.test(e)||Rc.hasOwnProperty(e)&&Rc[e]?(""+t).trim():t+"px"}const Mc={};let Rc={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 Ac=["Webkit","Ms","Moz","O"];Rc=Object.keys(Rc).reduce(((e,t)=>(Ac.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Rc);const Dc=["x","y","z"],Oc=/^(matrix|translate|scale|rotate|skew)/,zc=/^(translate)/,Fc=/^(rotate|skew)/,Vc=(e,t)=>Ni.num(e)&&0!==e?e+t:e,Hc=(e,t)=>Ni.arr(e)?e.every((e=>Hc(e,t))):Ni.num(e)?e===t:parseFloat(e)===t;class Gc extends la{constructor(e){let{x:t,y:n,z:o}=e,l=Tc(e,Dc);const r=[],i=[];(t||n||o)&&(r.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Vc(e,"px"))).join(",")})`,Hc(e,0)]))),Mi(l,((e,t)=>{if("transform"===t)r.push([e||""]),i.push((e=>[e,""===e]));else if(Oc.test(t)){if(delete l[t],Ni.und(e))return;const n=zc.test(t)?"px":Fc.test(t)?"deg":"";r.push(Ri(e)),i.push("rotate3d"===t?([e,t,o,l])=>[`rotate3d(${e},${t},${o},${Vc(l,n)})`,Hc(l,0)]:e=>[`${t}(${e.map((e=>Vc(e,n))).join(",")})`,Hc(e,t.startsWith("scale")?1:0)])}})),r.length&&(l.transform=new Uc(r,i)),super(l)}}class Uc extends ws{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 Li(this.inputs,((n,o)=>{const l=Es(n[0]),[r,i]=this.transforms[o](Ni.arr(l)?l:n.map(Es));e+=" "+r,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Li(this.inputs,(e=>Li(e,(e=>ys(e)&&Is(e,this)))))}observerRemoved(e){0==e&&Li(this.inputs,(e=>Li(e,(e=>ys(e)&&xs(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Ss(this,e)}}const Wc=["scrollTop","scrollLeft"];Ui.assign({batchedUpdates:xc.unstable_batchedUpdates,createStringInterpolator:Fs,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 $c=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new la(e)),getComponentProps:o=(e=>e)}={})=>{const l={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},r=e=>{const t=pa(e)||"Anonymous";return(e=Ni.str(e)?r[e]||(r[e]=ca(e,l)):e[da]||(e[da]=ca(e,l))).displayName=`Animated(${t})`,e};return Mi(e,((t,n)=>{Ni.arr(e)&&(n=pa(t)),r[n]=r(t)})),{animated:r}})(["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:l,children:r,scrollTop:i,scrollLeft:s}=o,a=Tc(o,Nc),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Mc[t]||(Mc[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(let t in l)if(l.hasOwnProperty(t)){const n=Lc(t,l[t]);Pc.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 Gc(e),getComponentProps:e=>Tc(e,Wc)}).animated,jc=e=>e+1,Kc=e=>({top:e.offsetTop,left:e.offsetLeft}),qc=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:l}=e;const r=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(jc,0),[u,p]=(0,s.useReducer)(jc,0),[m,g]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>r.current?Kc(r.current):null),[l]),f=(0,s.useMemo)((()=>{if(!n||!r.current)return()=>{};const e=(0,Ur.getScrollContainer)(r.current);if(!e)return()=>{};const t=r.current.getBoundingClientRect();return()=>{const n=r.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[l,n]);return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void f();r.current.style.transform=void 0;const e=Kc(r.current);c(),g({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[l]),function(e,t){const n=Ni.fun(e),[[o],l]=Ec(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:function(e){let{value:n}=e;if(!r.current)return;let{x:o,y:l}=n;o=Math.round(o),l=Math.round(l);const i=0===o&&0===l;r.current.style.transformOrigin="center center",r.current.style.transform=i?void 0:`translate3d(${o}px,${l}px,0)`,r.current.style.zIndex=t?"1":"",f()}}),r},Yc=".block-editor-block-list__block",Zc=".block-list-appender",Qc=".block-editor-button-block-appender";function Xc(e,t){return t.closest([Yc,Zc,Qc].join(","))===e}function Jc(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Yc);return t?t.id.slice("block-".length):void 0}function eu(e){const t=(0,s.useRef)(),n=function(e){return(0,p.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:l}=t(co);if(l(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:l}=(0,p.useSelect)(co);return(0,s.useEffect)((()=>{if(!o(e)||l())return;if(null==n)return;if(!t.current)return;const{ownerDocument:r}=t.current;if(Xc(t.current,r.activeElement))return;const i=Ur.focus.tabbable.find(t.current).filter((e=>(0,Ur.isTextField)(e))),s=-1===n,a=i[s?i.length-1:0]||t.current;if(Xc(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=Ur.focus.tabbable.findNext(t.current);if(e&&Xc(t.current,e)&&(0,Ur.isFormElement)(e))return void e.focus()}(0,Ur.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function tu(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function nu(){const e=(0,p.useSelect)((e=>{const{getSettings:t}=e(co);return t().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",tu),t.addEventListener("mouseover",tu),()=>{t.removeEventListener("mouseout",tu),t.removeEventListener("mouseover",tu),t.classList.remove("is-hovered")}}),[e])}function ou(e){return(0,p.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:r,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__unstableIsFullySelected:p,__unstableSelectionHasUnmergeableBlock:m}=t(co),{outlineMode:g}=a(),h=n(e),f=r(e),v=s(e),b=u(e,!0),_=i(e);return c()({"is-selected":f,"is-highlighted":o(e),"is-multi-selected":_,"is-partially-selected":_&&!p()&&!m(),"is-reusable":(0,l.isReusableBlock)((0,l.getBlockType)(v)),"is-dragging":h,"has-child-selected":b,"remove-outline":f&&g&&d()})}),[e])}function lu(e){return(0,p.useSelect)((t=>{const n=t(co).getBlockName(e),o=(0,l.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,l.getBlockDefaultClassName)(n)}),[e])}function ru(e){return(0,p.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(co),r=o(e);if(null==r||!r.className)return;const i=(0,l.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?r.className:void 0}),[e])}function iu(e){return(0,p.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:l,getBlockRootClientId:r,isBlockSelected:i}=t(co);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(l(s),r(e))}):void 0}),[e])}function su(e){const{isBlockSelected:t}=(0,p.useSelect)(co),{selectBlock:n,selectionChange:o}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((l=>{function r(r){l.parentElement.closest('[contenteditable="true"]')||(t(e)?r.target.isContentEditable||o(e):Xc(l,r.target)&&n(e))}return l.addEventListener("focusin",r),()=>{l.removeEventListener("focusin",r)}}),[t,n])}const au=window.wp.keycodes;function cu(e){const t=(0,p.useSelect)((t=>t(co).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,p.useSelect)(co),{insertDefaultBlock:l,removeBlock:r}=(0,p.useDispatch)(co);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!==au.ENTER&&s!==au.BACKSPACE&&s!==au.DELETE||a!==i||(0,Ur.isTextField)(a)||(t.preventDefault(),s===au.ENTER?l({},n(e),o(e)+1):r(e))}function a(e){e.preventDefault()}}),[e,t,n,o,l,r])}function uu(e){const{isNavigationMode:t,isBlockSelected:n}=(0,p.useSelect)(co),{setNavigationMode:o,selectBlock:l}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((r=>{function i(r){t()&&!r.defaultPrevented&&(r.preventDefault(),n(e)?o(!1):l(e))}return r.addEventListener("mousedown",i),()=>{r.addEventListener("mousedown",i)}}),[e,t,n,o])}function du(){const e=(0,s.useContext)(Vh);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function pu(e){return(0,p.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(co);return n(e)}),[e])}function mu(){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:r={},isAligned:i}=(0,s.useContext)(gu),{index:a,mode:u,name:m,blockApiVersion:g,blockTitle:f,isPartOfSelection:v,adjustScrolling:b,enableAnimation:_}=(0,p.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:r,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(co),p=a(n),m=c(n)||u(n),g=r(n),h=(0,l.getBlockType)(g);return{index:t(n),mode:o(n),name:g,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=pu(n),y=(0,h.sprintf)((0,h.__)("Block: %s"),f),E="html"!==u||t?"":"-visual",C=(0,d.useMergeRefs)([e.ref,eu(n),Lo(n),su(n),cu(n),uu(n),nu(),du(),qc({isSelected:v,adjustScrolling:b,enableAnimation:_,triggerAnimationOnChange:a}),(0,d.useDisabled)({isDisabled:!k})]),S=go();return g<2&&n===S.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...r,...e,ref:C,id:`block-${n}${E}`,role:"document","aria-label":y,"data-block":n,"data-type":m,"data-title":f,className:c()(c()("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":k}),o,e.className,r.className,ou(n),lu(n),ru(n),iu(n)),style:{...r.style,...e.style}}}mu.save=l.__unstableGetBlockProps;const gu=(0,s.createContext)();function hu(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",mu(o,{__unstableIsHtml:n}),t)}const fu=(0,p.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:l,getBlockMode:r,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(co),d=a(n),p=l(n),m=s(o),g=c(n,o),h=u(n,o),{name:f,attributes:v,isValid:b}=d||{};return{mode:r(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:h,block:d,name:f,attributes:v,isValid:b,isSelected:p}})),vu=(0,p.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:r,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(co);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(co),l=n(),{clientId:i}=t,s=l.length?l:[i];r(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:l}=t,{getBlockIndex:r}=o(co),s=r(n);i(e,s+1,l)},onMerge(e){const{clientId:n,rootClientId:r}=t,{getPreviousBlockClientId:i,getNextBlockClientId:c,getBlock:u}=o(co);if(e){const e=c(n);e&&s(n,e)}else{const e=i(n);if(e)s(e,n);else if(r){const e=(0,l.switchToBlockType)(u(r),"*");e&&e.length&&a(r,e,0)}}},onReplace(e,n,o){e.length&&!(0,l.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}})),bu=(0,d.compose)(d.pure,fu,vu,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,m.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:r,canRemove:i,clientId:a,isSelected:u,isSelectionEnabled:d,className:m,name:g,isValid:h,attributes:f,wrapperProps:v,setAttributes:b,onReplace:_,onInsertBlocksAfter:k,onMerge:y,toggleSelection:E}=e;const{themeSupportsLayout:C,hasContentLockedParent:S,isContentBlock:w,isContentLocking:B,isTemporarilyEditingAsBlocks:I}=(0,p.useSelect)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(co),i=!!n(a);return{themeSupportsLayout:t().supportsLayout,isContentBlock:e(l.store).__experimentalHasContentRoleAttribute(g),hasContentLockedParent:i,isContentLocking:"contentOnly"===o(a)&&!i,isTemporarilyEditingAsBlocks:r()===a}}),[g,a]),{removeBlock:x}=(0,p.useDispatch)(co),T=(0,s.useCallback)((()=>x(a)),[a]);let N=(0,s.createElement)(Yr,{name:g,isSelected:u,attributes:f,setAttributes:b,insertBlocksAfter:r?void 0:k,onReplace:i?_:void 0,onRemove:i?T:void 0,mergeBlocks:i?y:void 0,clientId:a,isSelectionEnabled:d,toggleSelection:E});const P=(0,l.getBlockType)(g);S&&!w&&(v={...v,tabIndex:-1}),null!=P&&P.getEditWrapperProps&&(v=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=c()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(v,P.getEditWrapperProps(f)));const L=v&&!!v["data-align"]&&!C;let M;if(L&&(N=(0,s.createElement)("div",{className:"wp-block","data-align":v["data-align"]},N)),h)M="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},N),(0,s.createElement)(hu,{isHtml:!0},(0,s.createElement)(ai,{clientId:a}))):(null==P?void 0:P.apiVersion)>1?N:(0,s.createElement)(hu,v,N);else{const e=n?(0,l.serializeRawBlock)(n):(0,l.getSaveContent)(P,f);M=(0,s.createElement)(hu,{className:"has-warning"},(0,s.createElement)(ni,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,Ur.safeHTML)(e)))}const{"data-align":R,...A}=null!==(t=v)&&void 0!==t?t:{},D={clientId:a,className:c()({"is-content-locked":B,"is-content-locked-temporarily-editing-as-blocks":I,"is-content-block":S&&w},R&&C&&`align${R}`,m),wrapperProps:A,isAligned:L},O=(0,s.useMemo)((()=>D),Object.values(D));return(0,s.createElement)(gu.Provider,{value:O},(0,s.createElement)(ii,{fallback:(0,s.createElement)(hu,{className:"has-warning"},(0,s.createElement)(li,null))},M))})),_u=window.wp.htmlEntities,ku=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),yu=[(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.")],Eu=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*yu.length));return(0,s.createElement)(m.Tip,null,yu[e])},Cu=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Su=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:l}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:Cu});const r=(0,s.createElement)(m.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",l,{"has-colors":o})},r)})),wu=function(e){let{title:t,icon:n,description:o,blockType:l}=e;return l&&(V()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=l)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(Su,{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)))},Bu=(0,d.createHigherOrderComponent)((e=>(0,p.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...l}=t;if(!n)return(0,s.createElement)(e,i({registry:o},l));const[r,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,p.createRegistry)({},o);e.registerStore(so,ao),a(e)}),[o]),r?(0,s.createElement)(p.RegistryProvider,{value:r},(0,s.createElement)(e,i({registry:r},l))):null}))),"withRegistryProvider"),Iu=()=>{};function xu(e){let{clientId:t=null,value:n,selection:o,onChange:r=Iu,onInput:i=Iu}=e;const a=(0,p.useRegistry)(),{resetBlocks:c,resetSelection:u,replaceInnerBlocks:d,setHasControlledInnerBlocks:m,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(co),{getBlockName:h,getBlocks:f}=a.select(co),v=(0,p.useSelect)((e=>!t||e(co).areInnerBlocksControlled(t)),[t]),b=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),k=()=>{n&&(g(),t?a.batch((()=>{m(t,!0);const e=n.map((e=>(0,l.cloneBlock)(e)));_.current&&(b.current.incoming=e),g(),d(t,e)})):(_.current&&(b.current.incoming=n),c(n)))},y=(0,s.useRef)(i),E=(0,s.useRef)(r);(0,s.useEffect)((()=>{y.current=i,E.current=r}),[i,r]),(0,s.useEffect)((()=>{b.current.outgoing.includes(n)?b.current.outgoing[b.current.outgoing.length-1]===n&&(b.current.outgoing=[]):f(t)!==n&&(b.current.outgoing=[],k(),o&&u(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{v||(b.current.outgoing=[],k())}),[v]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:l,__unstableIsLastBlockChangeIgnored:r,areInnerBlocksControlled:i}=a.select(co);let s=f(t),c=l(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(t))return;if(t&&!i(t))return;const a=l(),d=f(t),p=d!==s;if(s=d,p&&(b.current.incoming||r()))return b.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,b.current.outgoing.push(s),(c?E.current:y.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}const Tu=Bu((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,p.useDispatch)(co);return(0,s.useEffect)((()=>{o(n)}),[n]),xu(e),(0,s.createElement)(Po,null,t)}));function Nu(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(m.Disabled,null,(0,s.createElement)(Gh,null)))}function Pu(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,p.useSelect)(co),{clearSelectedBlock:n}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((o=>{function l(l){(e()||t())&&l.target===o&&n()}return o.addEventListener("mousedown",l),()=>{o.removeEventListener("mousedown",l)}}),[e,t,n])}function Lu(e){return(0,s.createElement)("div",i({ref:Pu()},e))}function Mu(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:l,getSelectedBlocksInitialCaretPosition:r,__unstableIsFullySelected:i}=e(co);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:l(),initialPosition:r(),isFullSelection:i()}}function Ru(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:l,isFullSelection:r}=(0,p.useSelect)(Mu,[]);return(0,d.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:s}=i;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||r&&(l.contentEditable=!0,l.focus(),s.getSelection().removeAllRanges())}),[o,t,n,l,e,r])}function Au(e,t,n,o){let l,r=Ur.focus.focusable.find(n);return t&&r.reverse(),r=r.slice(r.indexOf(e)+1),o&&(l=e.getBoundingClientRect()),r.find((function(e){if(!Ur.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=l.right||t.right<=l.left)return!1}return!0}))}function Du(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:l}=(0,p.useSelect)(co),{selectBlock:r}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u}=a,d=c===au.UP,p=c===au.DOWN,m=c===au.LEFT,g=c===au.RIGHT,h=d||m,f=m||g,v=d||p,b=f||v,_=a.shiftKey,k=_||a.ctrlKey||a.altKey||a.metaKey,y=v?Ur.isVerticalEdge:Ur.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(o()){if(!l())return;if(a.defaultPrevented)return;if(!b)return;if(_)return;return a.preventDefault(),void(h?r(e()):r(t(),-1))}if(v?s||(s=(0,Ur.computeCaretRect)(C)):s=null,a.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===au.UP||t===au.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"===o?["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type")):"TEXTAREA"!==o}(u,c,k))return;const S=(0,Ur.isRTL)(u)?!h:h,{keepCaretInsideBlock:w}=n();if(_)(function(e,t){const n=Au(e,t,i);return n&&Jc(n)})(u,h)&&y(u,h)&&(i.contentEditable=!0,i.focus());else if(v&&(0,Ur.isVerticalEdge)(u,h)&&!w){const e=Au(u,h,i,!0);e&&((0,Ur.placeCaretAtVerticalEdge)(e,h,s),a.preventDefault())}else if(f&&C.getSelection().isCollapsed&&(0,Ur.isHorizontalEdge)(u,S)&&!w){const e=Au(u,S,i);(0,Ur.placeCaretAtHorizontalEdge)(e,h),a.preventDefault()}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}const Ou=window.wp.keyboardShortcuts;function zu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,p.useSelect)(co),{multiSelect:o,selectBlock:l}=(0,p.useDispatch)(co),r=(0,Ou.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((i=>{function s(s){if(!r("core/block-editor/select-all",s))return;const a=t();if(a.length<2&&!(0,Ur.isEntirelySelected)(s.target))return;s.preventDefault();const[c]=a,u=n(c),d=e(u);a.length!==d.length?o(d[0],d[d.length-1]):u&&(i.ownerDocument.defaultView.getSelection().removeAllRanges(),l(u))}return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}}),[])}function Fu(e,t){e.contentEditable=t,t&&e.focus()}function Vu(){const{startMultiSelect:e,stopMultiSelect:t}=(0,p.useDispatch)(co),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:l}=(0,p.useSelect)(co);return(0,d.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:s}=i;let a,c;function u(){t(),s.removeEventListener("mouseup",u),c=s.requestAnimationFrame((()=>{if(o())return;Fu(r,!1);const e=s.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);a.contains(t)&&a.focus()}}))}function d(t){let{buttons:o,target:c}=t;l()||1===o&&c.getAttribute("contenteditable")&&n()&&(a=i.activeElement,e(),s.addEventListener("mouseup",u),Fu(r,!0))}return r.addEventListener("mouseout",d),()=>{r.removeEventListener("mouseout",d),s.removeEventListener("mouseup",u),s.cancelAnimationFrame(c)}}),[e,t,n,o])}function Hu(e,t){e.contentEditable=t,t&&e.focus()}function Gu(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,p.useDispatch)(co),{getBlockParents:o,getBlockSelectionStart:l}=(0,p.useSelect)(co);return(0,d.useRefEffect)((n=>{const{ownerDocument:r}=n,{defaultView:i}=r;function s(r){const s=i.getSelection();if(!s.rangeCount)return;const a=r.shiftKey&&"mouseup"===r.type;if(s.isCollapsed&&!a)return void Hu(n,!1);let c=Jc(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(s)),u=Jc(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(s));if(a){const e=l(),t=Jc(r.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],l=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[l],n[l])}else Hu(n,!1)}function a(){r.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){r.removeEventListener("selectionchange",s),i.removeEventListener("mouseup",s)}function u(){c(),a()}return a(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function Uu(){const{selectBlock:e}=(0,p.useDispatch)(co),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,p.useSelect)(co);return(0,d.useRefEffect)((l=>{function r(r){if(!t()||0!==r.button)return;const i=n(),s=Jc(r.target);r.shiftKey?i!==s&&(l.contentEditable=!0,l.focus()):o()&&e(s)}return l.addEventListener("mousedown",r),()=>{l.removeEventListener("mousedown",r)}}),[e,t,n,o])}function Wu(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,p.useSelect)(co),{replaceBlocks:r,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===au.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?r(t(),(0,l.createBlock)((0,l.getDefaultBlockName)())):i()):d.keyCode===au.BACKSPACE||d.keyCode===au.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===au.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===au.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function $u(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:l,getSelectedBlockClientId:r,getBlockCount:i}=(0,p.useSelect)(co),{setNavigationMode:a}=(0,p.useDispatch)(co),c=(0,p.useSelect)((e=>e(co).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function m(t){if(u.current)u.current=null;else if(l())e.current.focus();else if(r())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Ur.focus.tabbable[n](t.target).focus()}}const g=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:m}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:m}),f=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===au.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==au.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!l()&&!r())return void(e.target===s&&a(!0));if(((0,Ur.isFormElement)(e.target)||e.target.getAttribute("data-block")===r())&&(0,Ur.isFormElement)(Ur.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 l;if(o.keyCode!==au.TAB)return;if("region"===(null===(l=o.target)||void 0===l?void 0:l.getAttribute("role")))return;if(e.current===o.target)return;const r=o.shiftKey?"findPrevious":"findNext",i=Ur.focus.tabbable[r](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[g,(0,d.useMergeRefs)([e,f]),h]}(),o=(0,p.useSelect)((e=>e(co).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,Wu(),Vu(),Gu(),Uu(),Ru(),zu(),Du(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}const ju=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[l,r,a]=$u();return(0,s.createElement)(s.Fragment,null,l,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([r,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)})),Ku="editor-styles-wrapper";function qu(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}const Yu=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:l,tabIndex:r=0,assets:a,isZoomedOut:u,...p}=e;const[,g]=(0,s.useReducer)((()=>({}))),[f,v]=(0,s.useState)(),[b,_]=(0,s.useState)([]),k=qu(null==a?void 0:a.styles),y=qu(null==a?void 0:a.scripts),E=Pu(),[C,S,w]=$u(),[B,{height:I}]=(0,d.useResizeObserver)(),x=(0,d.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:l}=e,{readyState:r,documentElement:i}=o;return t=o,("interactive"===r||"complete"===r)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,l=window[o],r={};for(const t in e)r[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();r.clientX+=e.left,r.clientY+=e.top}const i=new l(e.type,r);!n.dispatchEvent(i)&&e.preventDefault()}const l=["dragover"];for(const t of l)e.addEventListener(t,o)}(o),v(o),E(i),_(Array.from(l.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=l.dir,i.removeChild(o.head),i.removeChild(o.body),t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1),!0)}return e.addEventListener("load",o),()=>{var l,r;e.removeEventListener("load",o),null===(l=t)||void 0===l||l.removeEventListener("dragover",n),null===(r=t)||void 0===r||r.removeEventListener("drop",n)}}),[]),T=(0,d.useRefEffect)((e=>{y.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,l)=>{const r=e.ownerDocument.createElement("script");r.id=n,o?(r.src=o,r.onload=()=>t(),r.onerror=()=>l()):t(),e.appendChild(r)}))}(e,n)))),Promise.resolve()).finally((()=>{g()}))}),[]),N=(0,d.useMergeRefs)([n,E,S]),P=(0,d.useRefEffect)((e=>{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&&function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:l}=t;return o?e(l):n&&(n.includes(`.${Ku}`)||n.includes(".wp-block"))}))}(o)&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return l=(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:l,media:r,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:l,media:r,key:o})})),l),(0,s.createElement)(s.Fragment,null,r>=0&&C,(0,s.createElement)("iframe",i({},p,{ref:(0,d.useMergeRefs)([t,x]),tabIndex:r,srcDoc:"<!doctype html>",title:(0,h.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:T},l,(0,s.createElement)("style",null,`html { transition: background 5s; ${u?"background: #2f2f2f; transition: background 0s;":""} }`)),(0,s.createElement)("body",{ref:N,className:c()("block-editor-iframe__body",Ku,...b,{"is-zoomed-out":u}),style:u?{marginBottom:`-${.55*I-100}px`}:{}},B,(0,s.createElement)("div",{style:{display:"none"},ref:P}),(0,s.createElement)(m.__experimentalStyleProvider,{document:f},o))),f.documentElement)),r>=0&&w)}));var Zu={grad:.9,turn:360,rad:360/(2*Math.PI)},Qu=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Xu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Ju=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},ed=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},td=function(e){return{r:Ju(e.r,0,255),g:Ju(e.g,0,255),b:Ju(e.b,0,255),a:Ju(e.a)}},nd=function(e){return{r:Xu(e.r),g:Xu(e.g),b:Xu(e.b),a:Xu(e.a,3)}},od=/^#([0-9a-f]{3,8})$/i,ld=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},rd=function(e){var t=e.r,n=e.g,o=e.b,l=e.a,r=Math.max(t,n,o),i=r-Math.min(t,n,o),s=i?r===t?(n-o)/i:r===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:r?i/r*100:0,v:r/255*100,a:l}},id=function(e){var t=e.h,n=e.s,o=e.v,l=e.a;t=t/360*6,n/=100,o/=100;var r=Math.floor(t),i=o*(1-n),s=o*(1-(t-r)*n),a=o*(1-(1-t+r)*n),c=r%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:l}},sd=function(e){return{h:ed(e.h),s:Ju(e.s,0,100),l:Ju(e.l,0,100),a:Ju(e.a)}},ad=function(e){return{h:Xu(e.h),s:Xu(e.s),l:Xu(e.l),a:Xu(e.a,3)}},cd=function(e){return id((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},ud=function(e){return{h:(t=rd(e)).h,s:(l=(200-(n=t.s))*(o=t.v)/100)>0&&l<200?n*o/100/(l<=100?l:200-l)*100:0,l:l/2,a:t.a};var t,n,o,l},dd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,pd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,md=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hd={string:[[function(e){var t=od.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?Xu(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?Xu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=md.exec(e)||gd.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:td({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=dd.exec(e)||pd.exec(e);if(!t)return null;var n,o,l=sd({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Zu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return cd(l)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,l=e.a,r=void 0===l?1:l;return Qu(t)&&Qu(n)&&Qu(o)?td({r:Number(t),g:Number(n),b:Number(o),a:Number(r)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,l=e.a,r=void 0===l?1:l;if(!Qu(t)||!Qu(n)||!Qu(o))return null;var i=sd({h:Number(t),s:Number(n),l:Number(o),a:Number(r)});return cd(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,l=e.a,r=void 0===l?1:l;if(!Qu(t)||!Qu(n)||!Qu(o))return null;var i=function(e){return{h:ed(e.h),s:Ju(e.s,0,100),v:Ju(e.v,0,100),a:Ju(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(r)});return id(i)},"hsv"]]},fd=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]},vd=function(e,t){var n=ud(e);return{h:n.h,s:Ju(n.s+100*t,0,100),l:n.l,a:n.a}},bd=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},_d=function(e,t){var n=ud(e);return{h:n.h,s:n.s,l:Ju(n.l+100*t,0,100),a:n.a}},kd=function(){function e(e){this.parsed=function(e){return"string"==typeof e?fd(e.trim(),hd.string):"object"==typeof e&&null!==e?fd(e,hd.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 Xu(bd(this.rgba),2)},e.prototype.isDark=function(){return bd(this.rgba)<.5},e.prototype.isLight=function(){return bd(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=nd(this.rgba)).r,n=e.g,o=e.b,r=(l=e.a)<1?ld(Xu(255*l)):"","#"+ld(t)+ld(n)+ld(o)+r;var e,t,n,o,l,r},e.prototype.toRgb=function(){return nd(this.rgba)},e.prototype.toRgbString=function(){return t=(e=nd(this.rgba)).r,n=e.g,o=e.b,(l=e.a)<1?"rgba("+t+", "+n+", "+o+", "+l+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,l},e.prototype.toHsl=function(){return ad(ud(this.rgba))},e.prototype.toHslString=function(){return t=(e=ad(ud(this.rgba))).h,n=e.s,o=e.l,(l=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+l+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,l},e.prototype.toHsv=function(){return e=rd(this.rgba),{h:Xu(e.h),s:Xu(e.s),v:Xu(e.v),a:Xu(e.a,3)};var e},e.prototype.invert=function(){return yd({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),yd(vd(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),yd(vd(this.rgba,-e))},e.prototype.grayscale=function(){return yd(vd(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),yd(_d(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),yd(_d(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?yd({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Xu(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=ud(this.rgba);return"number"==typeof e?yd({h:e,s:t.s,l:t.l,a:t.a}):Xu(t.h)},e.prototype.isEqual=function(e){return this.toHex()===yd(e).toHex()},e}(),yd=function(e){return e instanceof kd?e:new kd(e)},Ed=[],Cd=function(e){e.forEach((function(e){Ed.indexOf(e)<0&&(e(kd,hd),Ed.push(e))}))};function Sd(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 l in n)o[n[l]]=l;var r={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var l,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(!r.length)for(var d in n)r[d]=new e(n[d]).toRgb();for(var p in n){var m=(l=a,i=r[p],Math.pow(l.r-i.r,2)+Math.pow(l.g-i.g,2)+Math.pow(l.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),l="transparent"===o?"#0000":n[o];return l?new e(l).toRgb():null},"name"])}var wd=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Bd=function(e){return.2126*wd(e.r)+.7152*wd(e.g)+.0722*wd(e.b)};function Id(e){e.prototype.luminance=function(){return e=Bd(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,l,r,i,s,a,c=t instanceof e?t:new e(t);return r=this.rgba,i=c.toRgb(),n=(s=Bd(r))>(a=Bd(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===l&&(l=Math.pow(10,o)),Math.floor(l*n)/l+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(r=(n=t).size)?"normal":r,"AAA"===(l=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===l&&"large"===i?3:4.5);var n,o,l,r,i}}var xd=n(3124),Td=n.n(xd);const Nd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Pd(e,t){t=t||{};let n=1,o=1;function l(e){const t=e.match(/\n/g);t&&(n+=t.length);const l=e.lastIndexOf("\n");o=~l?e.length-l:o+e.length}function r(){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(l){const r=new Error(t.source+":"+n+":"+o+": "+l);if(r.reason=l,r.filename=t.source,r.line=n,r.column=o,r.source=e,!t.silent)throw r;s.push(r)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return l(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function g(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){const t=r();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,l(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function f(){const e=p(/^([^{]+)/);if(e)return Ld(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=r();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=Ld(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Nd,""),value:n?Ld(n[0]).replace(Nd,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(e));return u()?e:a("missing '}'")}function _(){let e;const t=[],n=r();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=r(),o=p(t);if(!o)return;const l={type:e};return l[e]=o[1].trim(),n(l)}}function S(){if("@"===e[0])return function(){const e=r();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 l,i=g();for(;l=_();)i.push(l),i=i.concat(g());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=r(),t=p(/^@media *([^{]+)/);if(!t)return;const n=Ld(t[1]);if(!c())return a("@media missing '{'");const o=g().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=r(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Ld(t[1]),media:Ld(t[2])})}()||function(){const e=r(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Ld(t[1]);if(!c())return a("@supports missing '{'");const o=g().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||k()||y()||E()||function(){const e=r(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Ld(t[1]),o=Ld(t[2]);if(!c())return a("@document missing '{'");const l=g().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:l}):a("@document missing '}'")}()||function(){const e=r();if(!p(/^@page */))return;const t=f()||[];if(!c())return a("@page missing '{'");let n,o=g();for(;n=v();)o.push(n),o=o.concat(g());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=r();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=g().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=r();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=r(),t=f();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Md(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Ld(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Md(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){Md(e,o)})):n&&"object"==typeof n&&Md(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Rd=n(8575),Ad=n.n(Rd);const Dd=Od;function Od(e){this.options=e||{}}Od.prototype.emit=function(e){return e},Od.prototype.visit=function(e){return this[e.type](e)},Od.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,l=e.length;o<l;o++)n+=this.visit(e[o]),t&&o<l-1&&(n+=this.emit(t));return n};const zd=Fd;function Fd(e){Dd.call(this,e)}Ad()(Fd,Dd),Fd.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Fd.prototype.comment=function(e){return this.emit("",e.position)},Fd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Fd.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Fd.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("}")},Fd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Fd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Fd.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Fd.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Fd.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Fd.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("}")},Fd.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Fd.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Fd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Fd.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("}"):""},Fd.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};const Vd=Hd;function Hd(e){e=e||{},Dd.call(this,e),this.indentation=e.indent}Ad()(Hd,Dd),Hd.prototype.compile=function(e){return this.stylesheet(e)},Hd.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Hd.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Hd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Hd.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}")},Hd.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}")},Hd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Hd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Hd.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}")},Hd.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)+"}")},Hd.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")},Hd.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}")},Hd.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}")},Hd.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}")},Hd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Hd.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()+"}"):""},Hd.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Hd.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};const Gd=function(e,t){try{const l=Pd(e);return n=Td().map(l,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new zd(o):new Vd(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function Ud(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 Wd(e,t){return new URL(e,t).toString()}const $d=e=>t=>{if("declaration"===t.type){const r=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]};Ud(e)&&o.push(e)}return o}(t.value).map((l=e,e=>({...e,newUrl:"url("+e.before+e.quote+Wd(e.value,l)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=r,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,l;return t},jd=/^(body|html|:root).*$/,Kd=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(jd)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},qd=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 l=[];return t&&l.push(Kd(t)),o&&l.push($d(o)),l.length?Gd(n,(0,d.compose)(l)):n}))},Yd=".editor-styles-wrapper";function Zd(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,l=t.querySelector(Yd);let r;if(l)r=n.getComputedStyle(l,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),r=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=yd(r);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function Qd(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>qd(t,Yd)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Zd(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}function Xd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=yd(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 Jd(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)("style",null,o)}function ep(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,s.createElement)("style",null,n)}function tp(e){let{id:t,colors:n}=e;const o=Xd(n);return(0,s.createElement)(m.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:t},(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"}))))}function np(e){let{preset:t}=e;return(0,s.createElement)(tp,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let op;Cd([Sd,Id]);const lp=2e3,rp=function(e){let{viewportWidth:t,__experimentalPadding:n,__experimentalMinHeight:o}=e;const[l,{width:r}]=(0,d.useResizeObserver)(),[i,{height:a}]=(0,d.useResizeObserver)(),{styles:c,assets:u,duotone:g}=(0,p.useSelect)((e=>{var t,n;const o=e(co).getSettings();return{styles:o.styles,assets:o.__unstableResolvedAssets,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),h=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]),f=(0,s.useMemo)((()=>{var e,t;return[...null!==(e=null==g?void 0:g.default)&&void 0!==e?e:[],...null!==(t=null==g?void 0:g.theme)&&void 0!==t?t:[]]}),[g]);op=op||(0,d.pure)(Gh);const v=r/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},l,(0,s.createElement)(m.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${v})`,height:a*v,maxHeight:a>lp?lp*v:void 0,minHeight:o}},(0,s.createElement)(Yu,{head:(0,s.createElement)(Qd,{styles:h}),assets:u,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:a,pointerEvents:"none",maxHeight:lp,minHeight:0!==v&&v<1&&o?o/v:o}},i,f.map((e=>(0,s.createElement)(np,{preset:e,key:e.slug}))),(0,s.createElement)(op,{renderAppender:!1}))))},ip=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:l=!1,__experimentalOnClick:r,__experimentalMinHeight:i}=e;const a=(0,p.useSelect)((e=>e(co).getSettings()),[]),c=(0,s.useMemo)((()=>{const e={...a};return e.__experimentalBlockPatterns=[],e}),[a]),d=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(Tu,{value:d,settings:c},l?(0,s.createElement)(Nu,{onClick:r}):(0,s.createElement)(rp,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function sp(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const l=(0,p.useSelect)((e=>e(co).getSettings()),[]),r=(0,d.useDisabled)(),i=(0,d.useMergeRefs)([n.ref,r]),a=(0,s.useMemo)((()=>({...l,__experimentalBlockPatterns:[]})),[l]),m=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),g=(0,s.createElement)(Tu,{value:m,settings:a},(0,s.createElement)(Wh,{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?g:null}}const ap=function(e){var t;let{item:n}=e;const{name:o,title:r,icon:i,description:a,initialAttributes:c,example:u}=n,d=(0,l.isReusableBlock)(n);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},d||u?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(ip,{__experimentalPadding:16,viewportWidth:null!==(t=null==u?void 0:u.viewportWidth)&&void 0!==t?t:500,blocks:u?(0,l.getBlockFromExample)(o,{attributes:{...u.attributes,...c},innerBlocks:u.innerBlocks}):(0,l.createBlock)(o,c)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,h.__)("No Preview Available."))),!d&&(0,s.createElement)(wu,{title:r,icon:i,description:a}))},cp=(0,s.createContext)(),up=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:l,...r}=e;const a=(0,s.useContext)(cp);return(0,s.createElement)(m.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},r),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,l):"function"==typeof l?l(t):(0,s.createElement)(m.Button,t,l)}))})),dp=(0,s.createElement)(D.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function pp(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","data-testid":"block-draggable-chip"},(0,s.createElement)(m.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(m.FlexItem,null,n?(0,s.createElement)(Su,{icon:n}):(0,h.sprintf)(
13
  /* translators: %d: Number of blocks. */
14
- (0,h._n)("%d block","%d blocks",t),t)),(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(Su,{icon:dp})))))}const mp=e=>{let{isEnabled:t,blocks:n,icon:o,children:l}=e;const r={type:"inserter",blocks:n};return(0,s.createElement)(m.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:r,__experimentalDragComponent:(0,s.createElement)(pp,{count:n.length,icon:o})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return l({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))},gp=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:r,onHover:a,isDraggable:u,...d}=e;const p=(0,s.useRef)(!1),g=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},h=(0,s.useMemo)((()=>[(0,l.createBlock)(o.name,o.initialAttributes,(0,l.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,s.createElement)(mp,{isEnabled:u&&!o.disabled,blocks:h,icon:o.icon},(e=>{let{draggable:l,onDragStart:u,onDragEnd:h}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:l,onDragStart:e=>{p.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{p.current=!1,h&&h(e)}},(0,s.createElement)(up,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),r(o,(0,au.isAppleOS)()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===au.ENTER&&(e.preventDefault(),r(o,(0,au.isAppleOS)()?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:g},(0,s.createElement)(Su,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,s.createElement)(m.__experimentalTruncate,{numberOfLines:3},o.title))))}))})),hp=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,qt.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))})),fp=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(cp);return(0,s.createElement)(m.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),vp=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:r,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(hp,{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)(fp,{key:t},e.map(((e,r)=>(0,s.createElement)(gp,{key:e.id,item:e,className:(0,l.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a&&!e.isDisabled,isFirst:0===t&&0===r})))))),r)},bp=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)(m.Icon,{icon:n})),(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},o))},_p=(e,t)=>{const{categories:n,collections:o,items:r}=(0,p.useSelect)((t=>{const{getInserterItems:n}=t(co),{getCategories:o,getCollections:r}=t(l.store);return{categories:o(),collections:r(),items:n(e)}}),[e]);return[r,n,o,(0,s.useCallback)(((e,n)=>{let{name:o,initialAttributes:r,innerBlocks:i}=e;const s=(0,l.createBlock)(o,r,(0,l.createBlocksFromInnerBlocksTemplate)(i));t(s,void 0,n)}),[t])]},kp=function(e){let{children:t}=e;const n=(0,m.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(cp.Provider,{value:n},t)},yp=[],Ep=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:l}=e;const[r,i,a,c]=_p(t,n),p=(0,s.useMemo)((()=>(0,u.orderBy)(r,["frecency"],["desc"]).slice(0,6)),[r]),m=(0,s.useMemo)((()=>r.filter((e=>!e.category))),[r]),g=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(r)),[r]),f=(0,s.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=r.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[r,a]);(0,s.useEffect)((()=>()=>o(null)),[]);const v=(0,d.useAsyncList)(i),b=i.length===v.length,_=(0,s.useMemo)((()=>Object.entries(a)),[a]),k=(0,d.useAsyncList)(b?_:yp);return(0,s.createElement)(kp,null,(0,s.createElement)("div",null,l&&!!p.length&&(0,s.createElement)(bp,{title:(0,h._x)("Most used","blocks")},(0,s.createElement)(vp,{items:p,onSelect:c,onHover:o,label:(0,h._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=g[e.slug];return t&&t.length?(0,s.createElement)(bp,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(vp,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(bp,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,h.__)("Uncategorized")},(0,s.createElement)(vp,{items:m,onSelect:c,onHover:o,label:(0,h.__)("Uncategorized")})),(0,u.map)(k,(e=>{let[t,n]=e;const l=f[t];return l&&l.length?(0,s.createElement)(bp,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(vp,{items:l,onSelect:c,onHover:o,label:n.title})):null}))))},Cp=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,openPatternExplorer:l}=e;const r=(0,d.useViewportMatch)("medium","<"),i=c()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns");return(0,s.createElement)(m.Flex,{justify:"space-between",align:"start",gap:"4",className:i},(0,s.createElement)(m.FlexItem,{isBlock:!0},(0,s.createElement)(m.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})()})),!r&&(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(m.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:(0,h.__)("Explore all patterns"),onClick:()=>l()},(0,h._x)("Explore","Label for showing all block patterns"))))},Sp=window.wp.notices,wp=(e,t)=>{const{patternCategories:n,patterns:o}=(0,p.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(co);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:r}=(0,p.useDispatch)(Sp.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,l.cloneBlock)(e))),t.name),r((0,h.sprintf)(
15
  /* translators: %s: block pattern title. */
16
- (0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function Bp(e){let{isDraggable:t,pattern:n,onClick:o,composite:l}=e;const{blocks:r,viewportWidth:a}=n,c=`block-editor-block-patterns-list__item-description-${(0,d.useInstanceId)(Bp)}`;return(0,s.createElement)(mp,{isEnabled:t,blocks:r},(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)(m.__unstableCompositeItem,i({role:"option",as:"div"},l,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,r)}),(0,s.createElement)(ip,{blocks:r,viewportWidth:a}),(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,s.createElement)(m.VisuallyHidden,{id:c},n.description)))}))}function Ip(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const xp=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:l,orientation:r,label:a=(0,h.__)("Block Patterns")}=e;const c=(0,m.__unstableUseCompositeState)({orientation:r});return(0,s.createElement)(m.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,s.createElement)(Bp,{key:e.name,pattern:e,onClick:l,isDraggable:t,composite:c}):(0,s.createElement)(Ip,{key:e.name}))))};function Tp(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const l="block-editor-block-patterns-explorer__sidebar";return(0,s.createElement)("div",{className:`${l}__categories-list`},n.map((e=>{let{name:n,label:r}=e;return(0,s.createElement)(m.Button,{key:n,label:r,className:`${l}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},r)})))}function Np(e){let{filterValue:t,setFilterValue:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,s.createElement)(m.SearchControl,{onChange:n,value:t,label:(0,h.__)("Search for patterns"),placeholder:(0,h.__)("Search")}))}const Pp=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:l,setFilterValue:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,s.createElement)(Np,{filterValue:l,setFilterValue:r}),!l&&(0,s.createElement)(Tp,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},Lp=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(ur,{className:"block-editor-inserter__no-results-icon",icon:Cu}),(0,s.createElement)("p",null,(0,h.__)("No results found.")))},Mp=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:r,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,p.useSelect)(co),{destinationRootClientId:d,destinationIndex:m}=(0,p.useSelect)((e=>{const{getSelectedBlockClientId:l,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(co),c=l();let u,d=t;return void 0!==n?u=n:o?u=s(o):!r&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,r]),{replaceBlocks:g,insertBlocks:f,showInsertionPoint:v,hideInsertionPoint:b}=(0,p.useDispatch)(co),_=(0,s.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!r&&o&&(0,l.isUnmodifiedDefaultBlock)(o)?g(o.clientId,e,null,a||n?0:null,t):f(e,m,d,!0,a||n?0:null,t);const s=(0,h.sprintf)(// translators: %d: the name of the block that has been added
17
- (0,h._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,qt.speak)(s),i&&i()}),[r,c,g,f,d,m,i,a]),k=(0,s.useCallback)((e=>{e?v(d,m):b()}),[v,b,d,m]);return[d,_,k]};function Rp(e){return e.toLowerCase()}var Ap=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Dp=/[^A-Z0-9]+/gi;function Op(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?Ap:n,l=t.stripRegexp,r=void 0===l?Dp:l,i=t.transform,s=void 0===i?Rp:i,a=t.delimiter,c=void 0===a?" ":a,u=zp(zp(e,o,"$1\0$2"),r,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(s).join(c)}function zp(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}var Fp=n(4793),Vp=n.n(Fp);const Hp=e=>e.name||"",Gp=e=>e.title,Up=e=>e.description||"",Wp=e=>e.keywords||[],$p=e=>e.category,jp=()=>null;function Kp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=Vp()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}function qp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Op(e).split(" ").filter(Boolean)}const Yp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return qp(Kp(e))},Zp=(e,t)=>e.filter((e=>!Yp(t).some((t=>t.includes(e))))),Qp=(e,t,n,o)=>0===Yp(o).length?e:Xp(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}}),Xp=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=Yp(t);if(0===o.length)return e;const l=e.map((e=>[e,Jp(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return l.sort(((e,t)=>{let[,n]=e,[,o]=t;return o-n})),l.map((e=>{let[t]=e;return t}))};function Jp(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Hp,getTitle:l=Gp,getDescription:r=Up,getKeywords:i=Wp,getCategory:s=$p,getCollection:a=jp}=n,c=o(e),u=l(e),d=r(e),p=i(e),m=s(e),g=a(e),h=Kp(t),f=Kp(u);let v=0;if(h===f)v+=30;else if(f.startsWith(h))v+=20;else{const e=[c,u,d,...p,m,g].join(" "),t=qp(h);0===Zp(t,e).length&&(v+=10)}return 0!==v&&c.startsWith("core/")&&(v+=c!==e.id?1:2),v}function em(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,s.createElement)(m.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,h.sprintf)(
18
  /* translators: %d: number of patterns. %s: block pattern search query */
19
- (0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}const tm=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const l=(0,d.useDebounce)(qt.speak,500),[r,i]=Mp({shouldFocusBlock:!0}),[a,,c]=wp(i,r),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?Xp(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)(
20
  /* translators: %d: number of results. */
21
- (0,h._n)("%d result found.","%d results found.",e),e);l(n)}),[t,l]);const m=(0,d.useAsyncList)(p,{step:2}),g=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,s.createElement)(em,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(kp,null,!g&&(0,s.createElement)(Lp,null),g&&(0,s.createElement)(xp,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function nm(e){let{initialCategory:t,patternCategories:n}=e;const[o,l]=(0,s.useState)(""),[r,i]=(0,s.useState)(null==t?void 0:t.name);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,s.createElement)(Pp,{selectedCategory:r,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:l}),(0,s.createElement)(tm,{filterValue:o,selectedCategory:r,patternCategories:n}))}const om=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(m.Modal,{title:(0,h.__)("Patterns"),closeLabel:(0,h.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(nm,n))};function lm(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:l}=e;const[r,,i]=wp(n,t),a=(0,s.useCallback)((e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=l.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)))}),[l]),c=(0,s.useMemo)((()=>r.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)}))),[r,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)(xp,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}const rm=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:l}=e;const[r,i]=(0,s.useState)(!1),[a,c]=wp(),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=l||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Cp,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!r&&(0,s.createElement)(lm,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),r&&(0,s.createElement)(om,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},im=window.wp.url;function sm(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[l,,,r]=_p(o,n),i=(0,s.useMemo)((()=>l.filter((e=>{let{category:t}=e;return"reusable"===t}))),[l]);return 0===i.length?(0,s.createElement)(Lp,null):(0,s.createElement)(bp,{title:(0,h.__)("Reusable blocks")},(0,s.createElement)(vp,{items:i,onSelect:r,onHover:t,label:(0,h.__)("Reusable blocks")}))}const am=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(sm,{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,im.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,h.__)("Manage Reusable blocks"))))},{Fill:cm,Slot:um}=(0,m.createSlotFill)("__unstableInserterMenuExtension");cm.Slot=um;const dm=cm,pm=[],mm=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:l,clientId:r,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:p,showBlockDirectory:g=!1,isDraggable:f=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const _=(0,d.useDebounce)(qt.speak,500),[k,y]=Mp({onSelect:n,rootClientId:l,clientId:r,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=_p(k,y),[B,,I]=wp(y,k),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=Xp(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=p;b&&x.length>2&&(T=0);const N=(0,s.useMemo)((()=>{if(0===T)return[];const e=Qp((0,u.orderBy)(E,["frecency"],["desc"]),C,S,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,S,p]);(0,s.useEffect)((()=>{if(!t)return;const e=N.length+x.length,n=(0,h.sprintf)(
22
  /* translators: %d: number of results. */
23
- (0,h._n)("%d result found.","%d results found.",e),e);_(n)}),[t,_]);const P=(0,d.useAsyncList)(N,{step:9}),L=(0,d.useAsyncList)(P.length===N.length?x:pm),M=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),R=!!N.length&&(0,s.createElement)(bp,{title:(0,s.createElement)(m.VisuallyHidden,null,(0,h.__)("Blocks"))},(0,s.createElement)(vp,{items:P,onSelect:w,onHover:o,label:(0,h.__)("Blocks"),isDraggable:f})),A=!!x.length&&(0,s.createElement)(bp,{title:(0,s.createElement)(m.VisuallyHidden,null,(0,h.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(xp,{shownPatterns:L,blockPatterns:x,onClickPattern:I,isDraggable:f})));return(0,s.createElement)(kp,null,!g&&!M&&(0,s.createElement)(Lp,null),b?A:R,!!N.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?R:A,g&&(0,s.createElement)(dm.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:M,rootClientId:k}},(e=>e.length?e:M?null:(0,s.createElement)(Lp,null))))},gm={name:"blocks",
24
  /* translators: Blocks tab title in the block inserter. */
25
- title:(0,h.__)("Blocks")},hm={name:"patterns",
26
  /* translators: Patterns tab title in the block inserter. */
27
- title:(0,h.__)("Patterns")},fm={name:"reusable",
28
  /* translators: Reusable blocks tab title in the block inserter. */
29
- title:(0,h.__)("Reusable")},vm=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:l,prioritizePatterns:r}=e;const i=(0,s.useMemo)((()=>{const e=[];return r&&n&&e.push(hm),e.push(gm),!r&&n&&e.push(hm),o&&e.push(fm),e}),[r,gm,n,hm,o,fm]);return(0,s.createElement)(m.TabPanel,{className:"block-editor-inserter__tabs",tabs:i,onSelect:l},t)},bm=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:l,__experimentalInsertionIndex:r,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:u,__experimentalFilterValue:d="",shouldFocusBlock:g=!0,prioritizePatterns:f}=e;const[v,b]=(0,s.useState)(d),[_,k]=(0,s.useState)(null),[y,E]=(0,s.useState)(null),[C,S,w]=Mp({rootClientId:n,clientId:o,isAppender:l,insertionIndex:r,shouldFocusBlock:g}),{showPatterns:B,hasReusableBlocks:I}=(0,p.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(co);return{showPatterns:!!n(C).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[C]),x=(0,s.useCallback)(((e,t,n)=>{S(e,t,n),i()}),[S,i]),T=(0,s.useCallback)(((e,t)=>{S(e,{patternName:t}),i()}),[S,i]),N=(0,s.useCallback)((e=>{w(!!e),k(e)}),[w,k]),P=(0,s.useCallback)((e=>{E(e)}),[E]),L=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(Ep,{rootClientId:C,onInsert:x,onHover:N,showMostUsedBlocks:u})),a&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(m.VisuallyHidden,{as:"h2"},(0,h.__)("A tip for using the block editor")),(0,s.createElement)(Eu,null)))),[C,x,N,v,u,a]),M=(0,s.useMemo)((()=>(0,s.createElement)(rm,{rootClientId:C,onInsert:T,onClickCategory:P,selectedCategory:y})),[C,T,P,y]),R=(0,s.useMemo)((()=>(0,s.createElement)(am,{rootClientId:C,onInsert:x,onHover:N})),[C,x,N]),A=(0,s.useCallback)((e=>"blocks"===e.name?L:"patterns"===e.name?M:R),[L,M,R]),D=(0,s.useRef)();(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{D.current.focus()}})));const O=!v&&(B||I);return(0,s.createElement)("div",{className:"block-editor-inserter__menu"},(0,s.createElement)("div",{className:c()("block-editor-inserter__main-area",{"show-as-tabs":O})},(0,s.createElement)(m.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{_&&k(null),b(e)},value:v,label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search"),ref:D}),!!v&&(0,s.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,s.createElement)(mm,{filterValue:v,onSelect:i,onHover:N,rootClientId:n,clientId:o,isAppender:l,__experimentalInsertionIndex:r,showBlockDirectory:!0,shouldFocusBlock:g})),O&&(0,s.createElement)(vm,{showPatterns:B,showReusableBlocks:I,prioritizePatterns:f},A),!v&&!O&&(0,s.createElement)("div",{className:"block-editor-inserter__no-tab-container"},L)),a&&_&&(0,s.createElement)(ap,{item:_}))}));function _m(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:l,prioritizePatterns:r}=e;const[i,a]=(0,s.useState)(""),[u,d]=Mp({onSelect:t,rootClientId:n,clientId:o,isAppender:l}),[g]=_p(u,d),[f]=wp(d,u),{setInserterIsOpened:v,insertionIndex:b}=(0,p.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:l}=e(co),r=t(),i=n(o),s=l();return{setInserterIsOpened:r.__experimentalSetIsInserterOpened,insertionIndex:-1===i?s:i}}),[o]),_=f.length&&(!!i||r),k=_&&f.length>6||g.length>6;(0,s.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return _&&(y=r?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":k,"has-expand":v})},k&&(0,s.createElement)(m.SearchControl,{className:"block-editor-inserter__search",value:i,onChange:e=>{a(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)(mm,{filterValue:i,onSelect:t,rootClientId:n,clientId:o,isAppender:l,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:r})),v&&(0,s.createElement)(m.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{v({rootClientId:n,insertionIndex:b,filterValue:i})},"aria-label":(0,h.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,h.__)("Browse all")))}const km=e=>{let t,{onToggle:n,disabled:o,isOpen:l,blockTitle:r,hasSingleBlockType:a,toggleProps:c={},prioritizePatterns:u}=e;t=a?(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"),r):u?(0,h.__)("Add pattern"):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:d,...p}=c;return(0,s.createElement)(m.Button,i({icon:ku,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),d&&d(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&l,disabled:o},p))};class ym 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:l,hasSingleBlockType:r,directInsertBlock:i,toggleProps:s,hasItems:a,renderToggle:c=km,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:l,hasSingleBlockType:r,directInsertBlock:i,toggleProps:s,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:l,showInserterHelpPanel:r,__experimentalIsQuick:i,prioritizePatterns:a}=this.props;return i?(0,s.createElement)(_m,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:l,prioritizePatterns:a}):(0,s.createElement)(bm,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:l,showInserterHelpPanel:r,prioritizePatterns:a})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:l,onSelectOrClose:r}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,s.createElement)(m.Dropdown,{className:"block-editor-inserter",contentClassName:c()("block-editor-inserter__popover",{"is-quick":l}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,h.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:r})}}const Em=(0,d.compose)([(0,p.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:r}=t;const{getBlockRootClientId:i,hasInserterItems:s,__experimentalGetAllowedBlocks:a,__experimentalGetDirectInsertBlock:c,getSettings:u}=e(co),{getBlockVariations:d}=e(l.store);r=r||i(o)||void 0;const p=a(r),m=c(r),g=u(),h=1===(null==p?void 0:p.length)&&0===(null===(n=d(p[0].name,"inserter"))||void 0===n?void 0:n.length);let f=!1;return h&&(f=p[0]),{hasItems:s(r),hasSingleBlockType:h,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:m,rootClientId:r,prioritizePatterns:g.__experimentalPreferPatternsOnRoot&&!r}})),(0,p.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:r,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u}=t;if(!s&&!c)return;const{insertBlock:d}=e(co);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:l}=o(co);if(!e||!r&&!n)return{};const i={};let s={};if(r){const e=t(r),n=t(l(r));(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,l.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,l.createBlock)(a.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:l,getBlockRootClientId:s}=o(co);if(r)return e(r);const a=t();return!i&&a&&s(a)===n?e(a)+1:l(n).length}(),n),u&&u();const m=(0,h.sprintf)(// translators: %s: the name of the block that has been added
31
- (0,h.__)("%s block added"),a.title);(0,qt.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:l}=e;return t||!n&&!o&&!l}))])(ym),Cm=(0,d.compose)((0,p.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:l}=e(co),r=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:r,isLocked:!!l(t.rootClientId),placeholder:i}})),(0,p.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(co);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:l,rootClientId:r}=e;if(t)return null;const i=(0,_u.decodeEntities)(l)||(0,h.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":r||"",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=>{au.ENTER!==e.keyCode&&au.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(Em,{rootClientId:r,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Sm(e,t){let{rootClientId:n,className:o,onFocus:l,tabIndex:r}=e;return(0,s.createElement)(Em,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:a,isOpen:u,blockTitle:d,hasSingleBlockType:p}=e;n=p?(0,h.sprintf)(// translators: %s: the name of the block when there is only one
32
- (0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const g=!p;let f=(0,s.createElement)(m.Button,{ref:t,onFocus:l,tabIndex:r,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":g?"true":void 0,"aria-expanded":g?u:void 0,disabled:a,label:n},!p&&(0,s.createElement)(m.VisuallyHidden,{as:"span"},n),(0,s.createElement)(ur,{icon:ku}));return(g||p)&&(f=(0,s.createElement)(m.Tooltip,{text:n},f)),f},isAppender:!0})}const wm=(0,s.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Sm(e,t)))),Bm=(0,s.forwardRef)(Sm),Im=function(e){let{rootClientId:t,renderAppender:n,className:o,tagName:r="div"}=e;const{hideInserter:i,canInsertDefaultBlock:a,selectedBlockClientId:u}=(0,p.useSelect)((e=>{const{canInsertBlockType:n,getTemplateLock:o,getSelectedBlockClientId:r,__unstableGetEditorMode:i}=e(co);return{hideInserter:!!o(t)||"zoom-out"===i(),canInsertDefaultBlock:n((0,l.getDefaultBlockName)(),t),selectedBlockClientId:r()}}),[t]);if(i||!1===n)return null;let d;if(n)d=(0,s.createElement)(n,null);else{if(u!==t&&(t||u))return null;d=a?(0,s.createElement)(Cm,{rootClientId:t}):(0,s.createElement)(Bm,{rootClientId:t,className:"block-list-appender__toggle"})}return(0,s.createElement)(r,{tabIndex:-1,className:c()("block-list-appender wp-block",o),contentEditable:!1,"data-block":!0},d)};(0,s.createContext)();const xm=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:l,__unstableContentRef:r,...a}=e;const[u,d]=(0,s.useReducer)((e=>e+1),0),{orientation:g,rootClientId:f,isVisible:v}=(0,p.useSelect)((e=>{var o;const{getBlockListSettings:l,getBlockRootClientId:r,isBlockVisible:i}=e(co),s=r(null!=t?t:n);return{orientation:(null===(o=l(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:i(t)&&i(n)}}),[t,n]),b=Ro(t),_=Ro(n),k="vertical"===g,y=(0,s.useMemo)((()=>{if(!b&&!_||!v)return{};const e=b?b.getBoundingClientRect():null,t=_?_.getBoundingClientRect():null;if(k)return{width:e?e.width:t.width,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:e?e.height:t.height}}),[b,_,k,u,v]),E=(0,s.useCallback)((()=>{if(!b&&!_||!v)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.right:n.right,bottom:t?t.bottom:n.top,height:0,width:0,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.left:n.left,bottom:t?t.bottom:n.top,height:0,width:0,ownerDocument:e}:(0,h.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:t?t.left:n.right,bottom:t?t.top:n.top,height:0,width:0,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:t?t.right:n.left,bottom:t?t.left:n.right,height:0,width:0,ownerDocument:e}}),[b,_,u,v]),C=kl(r);return(0,s.useLayoutEffect)((()=>{if(!b)return;const e=new window.MutationObserver(d);return e.observe(b,{attributes:!0}),()=>{e.disconnect()}}),[b]),(0,s.useLayoutEffect)((()=>{if(!_)return;const e=new window.MutationObserver(d);return e.observe(_,{attributes:!0}),()=>{e.disconnect()}}),[_]),(0,s.useLayoutEffect)((()=>{if(b)return b.ownerDocument.defaultView.addEventListener("resize",d),()=>{b.ownerDocument.defaultView.removeEventListener("resize",d)}}),[b]),(b||_)&&v?(0,s.createElement)(m.Popover,i({ref:C,animate:!1,getAnchorRect:E,focusOnMount:!1,__unstableSlotName:l||null,key:n+"--"+f},a,{className:c()("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"bottom-start"}),(0,s.createElement)("div",{className:"block-editor-block-popover__inbetween-container",style:y},o)):null},Tm=(0,s.createContext)();function Nm(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:l}=(0,p.useDispatch)(co),r=(0,s.useContext)(Tm),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:g,rootClientId:h,isInserterShown:f}=(0,p.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:l,isBlockBeingDragged:r,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(co),a=l(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;r(u);)u=i(u);for(;r(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}}),[]),v="vertical"===a,b=(0,d.useReducedMotion)(),_={start:{...v?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:f?.4:0}},hover:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},k={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.2}}},y=c()("block-editor-block-list__insertion-point","is-"+a);return(0,s.createElement)(xm,{previousClientId:u,nextClientId:g,__unstablePopoverSlot:t,__unstableContentRef:n},(0,s.createElement)(m.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&g&&o(g,-1)},onFocus:function(e){e.target!==i.current&&(r.current=!0)},className:c()(y,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||r.current||l()}},(0,s.createElement)(m.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&(0,s.createElement)(m.__unstableMotion.div,{variants:k,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Em,{position:"bottom center",clientId:g,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{r.current=e},onSelectOrClose:()=>{r.current=!1}}))))}function Pm(e){return(0,p.useSelect)((e=>e(co).isBlockInsertionPointVisible()),[])&&(0,s.createElement)(Nm,e)}function Lm(){const e=(0,s.useContext)(Tm),t=(0,p.useSelect)((e=>e(co).getSettings().hasReducedUI||"zoom-out"===e(co).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:l,isBlockInsertionPointVisible:r,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c,__unstableIsWithinBlockOverlay:u}=(0,p.useSelect)(co),{showInsertionPoint:m,hideInsertionPoint:g}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(r()&&g());let s;if(t.target.classList.contains("is-root-container")||(s=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(s))return;const d=(null===(o=n(s))||void 0===o?void 0:o.orientation)||"vertical",p=t.target.getBoundingClientRect(),h=t.clientY-p.top,f=t.clientX-p.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===d&&e.offsetTop>h||e.classList.contains("wp-block")&&"horizontal"===d&&e.offsetLeft>f));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;const b=v.id.slice("block-".length);if(!b||u(b))return;if(a().includes(b))return;const _=v.getBoundingClientRect();if("horizontal"===d&&(t.clientY>_.bottom||t.clientY<_.top)||"vertical"===d&&(t.clientX>_.right||t.clientX<_.left))return void(r()&&g());const k=l(b);0!==k?m(s,k,{__unstableWithInserter:!0}):r()&&g()}}),[e,n,o,l,r,i,m,g,a,t])}const Mm="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Rm="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Am(e){return(0,p.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(co),{getBlockType:r,getActiveBlockVariation:i}=t(l.store),s=n(e),a=r(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,anchor:null==c?void 0:c.anchor}:d}),[e])}function Dm(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:r,name:i,reusableBlockTitle:s}=(0,p.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=e(co),i=n(t);if(!i)return{};const s=(0,l.isReusableBlock)((0,l.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&r(o(t).ref)}}),[t]),a=Am(t);if(!i||!a)return null;const c=(0,l.getBlockType)(i),u=c?(0,l.__experimentalGetBlockLabel)(c,r,o):null,d=s||u,m=d&&d!==c.title?d:a.title;if(n&&n>0&&m.length>n){const e="...";return m.slice(0,n-e.length)+e}return m}function Om(e){let{clientId:t,maximumLength:n,context:o}=e;return Dm({clientId:t,maximumLength:n,context:o})}const zm=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:r,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,p.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:r,getBlockName:i}=e(co),s=r(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,l.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[g,h,f]=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)((l=>{e.current=l.clientY,n.current=(0,Ur.getScrollContainer)(l.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 l=n.current.offsetHeight,r=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>r){const e=Math.max(l-r-50,0),n=Math.max(i-r-50,0)/e;t.current=25*n}else if(o.clientY<r){const e=Math.max(r-50,0),n=Math.max(r-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,p.useDispatch)(co);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const _={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(m.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:_,onDragStart:e=>{v(n),d.current=!0,g(e),r&&r()},onDragOver:h,onDragEnd:()=>{b(),d.current=!1,f(),i&&i()},__experimentalDragComponent:(0,s.createElement)(pp,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Fm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),Vm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Hm=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),Gm=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),Um=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,h.isRTL)()?"left":"right":"down":null;const Wm=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?Fm:Vm:Hm:"down"===e?"horizontal"===t?(0,h.isRTL)()?Vm:Fm:Gm:null,$m=(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,jm=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:r,...a}=e;const u=(0,d.useInstanceId)(jm),g=Array.isArray(n)?n:[n],f=g.length,{blockType:v,isDisabled:b,rootClientId:_,isFirst:k,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,p.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:n,getBlockOrder:i,getBlock:s,getBlockListSettings:a}=e(co),c=g[0],u=n(c),d=t(c),p=t(g[g.length-1]),m=i(u),h=s(c),f=0===d,v=p===m.length-1,{orientation:b}=a(u)||{};return{blockType:h?(0,l.getBlockType)(h.name):null,isDisabled:"up"===o?f:v,rootClientId:u,firstIndex:d,isFirst:f,isLast:v,orientation:r||b}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,p.useDispatch)(co),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${u}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:Wm(o,C),label:$m(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,_),a.onClick&&a.onClick(e)},disabled:b,__experimentalIsFocusable:!0})),(0,s.createElement)(m.VisuallyHidden,{id:I},function(e,t,n,o,l,r,i){const s=n+1;if(e>1)return function(e,t,n,o,l,r){const i=t+1;if(n&&o)return(0,h.__)("All blocks are selected, and cannot be moved");if(l>0&&!o){const t=Um("down",r);if("down"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
33
  (0,h.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
34
  (0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
35
- (0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(l>0&&o){const e=Um("down",r);if("down"===e)return(0,h.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,h.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,h.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(l<0&&!n){const t=Um("up",r);if("up"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
36
  (0,h.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
37
  (0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
38
- (0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(l<0&&n){const e=Um("up",r);if("up"===e)return(0,h.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,h.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,h.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,l,r,i);if(o&&l)return(0,h.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
39
- (0,h.__)("Block %s is the only block, and cannot be moved"),t);if(r>0&&!l){const e=Um("down",i);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
40
  (0,h.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
41
  (0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===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(r>0&&l){const e=Um("down",i);if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
43
  (0,h.__)("Block %1$s is at the end of the content and can’t be moved down"),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 end 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 end of the content and can’t be moved right"),t)}if(r<0&&!o){const e=Um("up",i);if("up"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
46
  (0,h.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
47
  (0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
48
- (0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(r<0&&o){const e=Um("up",i);if("up"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
49
  (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)
50
  (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)
51
- (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(f,v&&v.title,E,k,y,"up"===o?-1:1,C)))})),Km=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(jm,i({direction:"up",ref:t},e)))),qm=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(jm,i({direction:"down",ref:t},e)))),Ym=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:l,isFirst:r,isLast:a,orientation:u}=(0,p.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:l,canMoveBlocks:r,getBlockOrder:i,getBlockRootClientId:s}=e(co),a=Array.isArray(t)?t:[t],c=a[0],u=s(c),d=o(c),p=o(a[a.length-1]),m=i(u);return{canMove:r(t,u),rootClientId:u,isFirst:0===d,isLast:p===m.length-1,orientation:null===(n=l(u))||void 0===n?void 0:n.orientation}}),[t]);if(!o||r&&a&&!l)return null;const d=(0,h.__)("Drag");return(0,s.createElement)(m.ToolbarGroup,{className:c()("block-editor-block-mover",{"is-horizontal":"horizontal"===u})},!n&&(0,s.createElement)(zm,{clientIds:t},(e=>(0,s.createElement)(m.Button,i({icon:dp,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:d,tabIndex:"-1"},e)))),(0,s.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(Km,i({clientIds:t},e)))),(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(qm,i({clientIds:t},e))))))},Zm=function(e){let{clientId:t,rootClientId:n}=e;const o=Am(t),r=(0,p.useSelect)((e=>{var o;const{getBlock:l,getBlockIndex:r,hasBlockMovingClientId:i,getBlockListSettings:s,__unstableGetEditorMode:a}=e(co),c=r(t),{name:u,attributes:d}=l(t);return{index:c,name:u,attributes:d,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation,editorMode:a()}}),[t,n]),{index:a,name:u,attributes:d,blockMovingMode:g,orientation:f,editorMode:v}=r,{setNavigationMode:b,removeBlock:_}=(0,p.useDispatch)(co),k=(0,s.useRef)(),y=(0,l.getBlockType)(u),E=(0,l.__experimentalGetAccessibleBlockLabel)(y,d,a+1,f);(0,s.useEffect)((()=>{k.current.focus(),(0,qt.speak)(E)}),[E]);const C=Ro(t),{hasBlockMovingClientId:S,getBlockIndex:w,getBlockRootClientId:B,getClientIdsOfDescendants:I,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:T,getPreviousBlockClientId:N,getNextBlockClientId:P}=(0,p.useSelect)(co),{selectBlock:L,clearSelectedBlock:M,setBlockMovingClientId:R,moveBlockToPosition:A}=(0,p.useDispatch)(co),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)(m.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(Su,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(m.FlexItem,null,"zoom-out"===v&&(0,s.createElement)(Ym,{clientIds:[t],hideDragHandle:!0}),"navigation"===v&&(0,s.createElement)(zm,{clientIds:[t]},(e=>(0,s.createElement)(m.Button,i({icon:dp,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(m.Button,{ref:k,onClick:"navigation"===v?()=>b(!1):void 0,onKeyDown:function(e){const{keyCode:n}=e,o=n===au.UP,l=n===au.DOWN,r=n===au.LEFT,i=n===au.RIGHT,s=n===au.TAB,a=n===au.ESCAPE,c=n===au.ENTER,u=n===au.SPACE,d=e.shiftKey;if(n===au.BACKSPACE||n===au.DELETE)return _(t),void e.preventDefault();const p=x(),m=T(),g=N(m||p),h=P(m||p),f=s&&d||o,v=s&&!d||l,b=r,k=i;let y;if(f)y=g;else if(v)y=h;else if(b){var E;y=null!==(E=B(p))&&void 0!==E?E:p}else if(k){var D;y=null!==(D=I([p])[0])&&void 0!==D?D:p}const O=S();if(a&&O&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&O){const e=B(O),t=B(p),n=w(O);let o=w(p);n<o&&e===t&&(o-=1),A(O,e,t,o),L(O),R(null)}if(v||f||b||k)if(y)e.preventDefault(),L(y);else if(s&&p){let t;if(v){t=C;do{t=Ur.focus.tabbable.findNext(t)}while(t&&C.contains(t));t||(t=C.ownerDocument.defaultView.frameElement,t=Ur.focus.tabbable.findNext(t))}else t=Ur.focus.tabbable.findPrevious(C);t&&(e.preventDefault(),t.focus(),M())}},label:E,showTooltip:!1,className:"block-selection-button_select-button"},(0,s.createElement)(Om,{clientId:t,maximumLength:35})))))};function Qm(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}const Xm=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:l,...r}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!Ur.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||V()("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,l){const[r]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=Ur.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,Ou.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{r&&a()}),[n,r,a]),(0,s.useEffect)((()=>{let t=0;return i&&!r&&(t=window.requestAnimationFrame((()=>{const t=Qm(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!l||!e.current)return;const n=Qm(e.current).findIndex((e=>0===e.tabIndex));l(n)}}),[i,r])}(a,n,c,o,l),c?(0,s.createElement)(m.Toolbar,i({label:r["aria-label"],ref:a},r),t):(0,s.createElement)(m.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},r),t)},{clearTimeout:Jm,setTimeout:eg}=window,tg=()=>{},ng=200;function og(e){let{ref:t,isFocused:n,debounceTimeout:o=ng,onChange:l=tg}=e;const[r,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),l(e)},u=()=>{const e=a.current;e&&Jm&&Jm(e)};return(0,s.useEffect)((()=>()=>{c(!1),u()}),[]),{showMovers:r,debouncedShowMovers:e=>{e&&e.stopPropagation(),u(),r||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),u(),a.current=eg((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function lg(e){let{ref:t,debounceTimeout:n=ng,onChange:o=tg}=e;const[l,r]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=og({ref:t,debounceTimeout:n,isFocused:l,onChange:o}),u=(0,s.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{d()&&(r(!0),a())},o=()=>{d()||(r(!1),c())};return e&&!u.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),u.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,u,r,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function rg(){const{selectBlock:e,toggleBlockHighlight:t}=(0,p.useDispatch)(co),{firstParentClientId:n,shouldHide:o,hasReducedUI:r}=(0,p.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:r}=e(co),{hasBlockSupport:i}=e(l.store),s=n(o()),a=s[s.length-1],c=t(a),u=(0,l.getBlockType)(c),d=r();return{firstParentClientId:a,shouldHide:!i(u,"__experimentalParentSelector",!0),hasReducedUI:d.hasReducedUI}}),[]),a=Am(n),c=(0,s.useRef)(),{gestures:u}=lg({ref:c,onChange(e){e&&r||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)(m.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,h.sprintf)(
52
  /* translators: %s: Name of the block's parent. */
53
- (0,h.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(Su,{icon:a.icon})}))}const ig=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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 sg(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)(m.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)(ip,{viewportWidth:500,blocks:t})))))}function ag(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:o}=e;return t.map((e=>(0,s.createElement)(cg,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:o})))}function cg(e){let{item:t,onSelect:n,setHoveredTransformItemName:o}=e;const{name:r,icon:i,title:a,isDisabled:c}=t;return(0,s.createElement)(m.MenuItem,{className:(0,l.getBlockMenuDefaultClassName)(r),onClick:e=>{e.preventDefault(),n(r)},disabled:c,onMouseLeave:()=>o(null),onMouseEnter:()=>o(r)},(0,s.createElement)(Su,{icon:i,showColors:!0}),a)}const ug=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:r}=e;const[i,a]=(0,s.useState)(),{priorityTextTransformations:c,restTransformations:u}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,s.useMemo)((()=>{const n=Object.keys(t);return e.reduce(((e,t)=>{const{name:o}=t;return n.includes(o)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]})}),[e]);return n.priorityTextTransformations.sort(((e,n)=>{let{name:o}=e,{name:l}=n;return t[o]<t[l]?-1:1})),n}(n),d=c.length&&u.length,p=!!u.length&&(0,s.createElement)(ag,{restTransformations:u,onSelect:o,setHoveredTransformItemName:a});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuGroup,{label:(0,h.__)("Transform to"),className:t},i&&(0,s.createElement)(sg,{blocks:(0,l.switchToBlockType)(r,i)}),c.map((e=>(0,s.createElement)(cg,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:a}))),!d&&p),!!d&&(0,s.createElement)(m.MenuGroup,{className:t},p))},dg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),pg=window.wp.tokenList;var mg=n.n(pg);function gg(e,t,n){const o=new(mg())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function hg(e){return(0,u.find)(e,"isDefault")}function fg(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:r,blockType:i,className:a}=(0,p.useSelect)((e=>{const{getBlock:n}=e(co),o=n(t);if(!o)return{};const r=(0,l.getBlockType)(o.name),{getBlockStyles:i}=e(l.store);return{block:o,blockType:r,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,p.useDispatch)(co),d=function(e){return e&&0!==e.length?hg(e)?e:[{name:"default",label:(0,h._x)("Default","block style"),isDefault:!0},...e]:[]}(o),m=function(e,t){for(const n of new(mg())(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),g=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,l.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,l.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(r,i);return{onSelect:e=>{const o=gg(a,m,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:m,genericPreviewBlock:g,className:a}}const vg=()=>{};function bg(e){let{clientId:t,onSwitch:n=vg}=e;const{onSelect:o,stylesToRender:l,activeStyle:r}=fg({clientId:t,onSwitch:n});return l&&0!==l.length?(0,s.createElement)(s.Fragment,null,l.map((e=>{const t=e.label||e.name;return(0,s.createElement)(m.MenuItem,{key:e.name,icon:r.name===e.name?dg:null,onClick:()=>o(e)},(0,s.createElement)(m.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function _g(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(m.MenuGroup,{label:(0,h.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(bg,{clientId:o,onSwitch:n}))}const kg=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:l,innerBlocks:r=[]}=e;if(!n.has(o)){if(l===t)return e;for(const e of r){const o=kg(e,t,n);if(o)return o}}},yg=(e,t)=>{const n=((e,t)=>{const n=(0,l.__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 Eg(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)(m.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)(Cg,{patterns:t,onSelect:n})))))}function Cg(e){let{patterns:t,onSelect:n}=e;const o=(0,m.__unstableUseCompositeState)();return(0,s.createElement)(m.__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)(Sg,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Sg(e){let{pattern:t,onSelect:n,composite:o}=e;const l="block-editor-block-switcher__preview-patterns-container",r=(0,d.useInstanceId)(Sg,`${l}-list__item-description`);return(0,s.createElement)("div",{className:`${l}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?r:void 0},(0,s.createElement)(m.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${l}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,s.createElement)(ip,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,s.createElement)("div",{className:`${l}-list__item-title`},t.title)),!!t.description&&(0,s.createElement)(m.VisuallyHidden,{id:r},t.description))}const wg=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,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,l.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const l of n){const n=kg(l,t.name,o);if(n){e=!0,o.add(n.clientId),yg(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)(m.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,s.createElement)(Eg,{patterns:a,onSelect:o}),(0,s.createElement)(m.MenuItem,{onClick:e=>{e.preventDefault(),i(!r)},icon:Fm},(0,h.__)("Patterns"))):null},Bg=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,p.useDispatch)(co),r=Am(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,patterns:g}=(0,p.useSelect)((e=>{const{getBlockRootClientId:o,getBlockTransformItems:i,__experimentalGetPatternTransformItems:s}=e(co),{getBlockStyles:a,getBlockType:c}=e(l.store),{canRemoveBlocks:d}=e(co),p=o((0,u.castArray)(t)[0]),[{name:m}]=n,g=1===n.length,h=g&&a(m);let f;var v;g?f=null==r?void 0:r.icon:f=1===new Set(n.map((e=>{let{name:t}=e;return t}))).size?null===(v=c(m))||void 0===v?void 0:v.icon:ig;return{possibleBlockTransformations:i(n,p),canRemove:d(t,p),hasBlockStyles:!(null==h||!h.length),icon:f,patterns:s(n,p)}}),[t,n,null==r?void 0:r.icon]),f=Dm({clientId:Array.isArray(t)?t[0]:t,maximumLength:35}),v=1===n.length&&(0,l.isReusableBlock)(n[0]),b=1===n.length&&(0,l.isTemplatePart)(n[0]),_=!!i.length&&a&&!b,k=!(null==g||!g.length)&&a;if(!c&&!_)return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Su,{icon:d,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},f))}));const y=f,E=1===n.length?(0,h.sprintf)(
54
  /* translators: %s: block title. */
55
  (0,h.__)("%s: Change block type or style"),f):(0,h.sprintf)(
56
  /* translators: %d: number of blocks. */
57
- (0,h._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||_||k;return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(m.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)(Su,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},f)),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:r}=e;return C&&(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},k&&(0,s.createElement)(wg,{blocks:n,patterns:g,onSelect:e=>{(e=>{o(t,e)})(e),r()}}),_&&(0,s.createElement)(ug,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{(e=>{o(t,(0,l.switchToBlockType)(n,e))})(e),r()}}),c&&(0,s.createElement)(_g,{hoveredBlock:n[0],onSwitch:r}))})))))},Ig=e=>{let{clientIds:t}=e;const n=(0,p.useSelect)((e=>e(co).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(Bg,{clientIds:t,blocks:n})},{Fill:xg,Slot:Tg}=(0,m.createSlotFill)("__unstableBlockToolbarLastItem");xg.Slot=Tg;const Ng=xg,Pg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Lg=window.wp.blob;function Mg(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;if(1!==(null===(n=t.match(e))||void 0===n?void 0:n.length))return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}function Rg(){const{getBlockName:e}=(0,p.useSelect)(co),{getBlockType:t}=(0,p.useSelect)(l.store),{createSuccessNotice:n}=(0,p.useDispatch)(Sp.store);return(0,s.useCallback)(((o,l)=>{let r="";if(1===l.length){var i;const n=l[0],s=null===(i=t(e(n)))||void 0===i?void 0:i.title;r="copy"===o?(0,h.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
58
  (0,h.__)('Copied "%s" to clipboard.'),s):(0,h.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
59
  (0,h.__)('Moved "%s" to clipboard.'),s)}else r="copy"===o?(0,h.sprintf)(// Translators: %d: Number of blocks being copied.
60
  (0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",l.length),l.length):(0,h.sprintf)(// Translators: %d: Number of blocks being cut.
61
- (0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",l.length),l.length);n(r,{type:"snackbar"})}),[])}function Ag(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:r,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a}=(0,p.useSelect)(co),{flashBlock:c,removeBlocks:u,replaceBlocks:m,__unstableDeleteSelection:g,__unstableExpandSelection:h}=(0,p.useDispatch)(co),f=Rg();return(0,d.useRefEffect)((d=>{function p(p){const v=t();if(0===v.length)return;if(!n()){const{target:e}=p,{ownerDocument:t}=e;if("copy"===p.type||"cut"===p.type?(0,Ur.documentHasUncollapsedSelection)(t):(0,Ur.documentHasSelection)(t))return}if(!d.contains(p.target.ownerDocument.activeElement))return;const b=p.defaultPrevented;p.preventDefault();const _=s(),k=i()||r(),y=!k&&!_;if("copy"===p.type||"cut"===p.type)if(1===v.length&&c(v[0]),y)h();else{let t;if(f(p.type,v),k)t=e(v);else{const[n,o]=a();t=[n,...e(v.slice(1,v.length-1)),o]}const n=p.clipboardData.getData("__unstableWrapperBlockName");n&&(t=(0,l.createBlock)(n,JSON.parse(p.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,l.serialize)(t);p.clipboardData.setData("text/plain",(E=(E=o).replace(/<br>/g,"\n"),(0,Ur.__unstableStripHTML)(E).trim().replace(/\n\n+/g,"\n\n"))),p.clipboardData.setData("text/html",o)}var E;if("cut"===p.type)k&&!y?u(v):g();else if("paste"===p.type){if(b)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 l=(0,Ur.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return l.length&&!Mg(l,o)&&(o=l.map((e=>`<img src="${(0,Lg.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(p),r=(0,l.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});m(v,r,r.length-1,-1)}}return d.ownerDocument.addEventListener("copy",p),d.ownerDocument.addEventListener("cut",p),d.ownerDocument.addEventListener("paste",p),()=>{d.ownerDocument.removeEventListener("copy",p),d.ownerDocument.removeEventListener("cut",p),d.ownerDocument.removeEventListener("paste",p)}}),[])}const Dg=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:Ag()},t)};function Og(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:r,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,p.useSelect)(co),{getDefaultBlockName:u,getGroupingBlockName:d}=(0,p.useSelect)(l.store),m=s(t),g=i(t[0]),h=m.every((e=>!!e&&(0,l.hasBlockSupport)(e.name,"multiple",!0)&&r(e.name,g))),f=r(u(),g),v=a(t,g),b=c(t,g),{removeBlocks:_,replaceBlocks:k,duplicateBlocks:y,insertAfterBlock:E,insertBeforeBlock:C,flashBlock:S,setBlockMovingClientId:w,setNavigationMode:B,selectBlock:I}=(0,p.useDispatch)(co),x=Rg();return n({canDuplicate:h,canInsertDefaultBlock:f,canMove:v,canRemove:b,rootClientId:g,blocks:m,onDuplicate:()=>y(t,o),onRemove:()=>_(t,o),onInsertBefore(){const e=Array.isArray(t)?t[0]:e;C(e)},onInsertAfter(){const e=Array.isArray(t)?t[t.length-1]:e;E(e)},onMoveTo(){B(!0),I(t[0]),w(t[0])},onGroup(){if(!m.length)return;const e=d(),n=(0,l.switchToBlockType)(m,e);n&&k(t,n)},onUngroup(){if(!m.length)return;const e=m[0].innerBlocks;e.length&&k(t,e)},onCopy(){const e=m.map((e=>{let{clientId:t}=e;return t}));1===m.length&&S(e[0]),x("copy",e)}})}const zg=()=>{},Fg=(0,d.compose)([(0,p.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:r,getSettings:i}=e(co),s=o(n),a=i().codeEditingEnabled;return{mode:r(n),blockType:s?(0,l.getBlockType)(s.name):null,isCodeEditingEnabled:a}})),(0,p.withDispatch)(((e,t)=>{let{onToggle:n=zg,clientId:o}=t;return{onToggleMode(){e(co).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:r=!1,isCodeEditingEnabled:i=!0}=e;if(!t||!(0,l.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,h.__)("Edit as HTML"):(0,h.__)("Edit visually");return(0,s.createElement)(m.MenuItem,{onClick:o},!r&&a)})),Vg=(0,d.compose)((0,p.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(co).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,p.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(co).replaceBlocks(n.clientId,(0,l.rawHandler)({HTML:(0,l.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const l=(0,h.__)("Convert to Blocks");return(0,s.createElement)(m.MenuItem,{onClick:n},!o&&l)})),{Fill:Hg,Slot:Gg}=(0,m.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Hg.Slot=Gg;const Ug=Hg;function Wg(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:r,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,p.useDispatch)(co);return n||o?(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(m.MenuItem,{onClick:()=>{(()=>{const e=(0,l.switchToBlockType)(r,i);e&&c(t,e)})(),a()}},(0,h._x)("Group","verb")),o&&(0,s.createElement)(m.MenuItem,{onClick:()=>{(()=>{const e=r[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}function $g(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}=(0,p.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:r,getSelectedBlockClientIds:i}=e(co),{getGroupingBlockName:s}=e(l.store),a=i(),c=s(),u=r(c,null!=a&&a.length?n(a[0]):void 0),d=o(a),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:a,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}}function jg(e){return(0,p.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:l,canLockBlockType:r,getBlockName:i,getBlockRootClientId:s,getTemplateLock:a}=t(co),c=s(e),u=n(e),d=o(e,c),p=l(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:r(i(e)),isContentLocked:"contentOnly"===a(e),isLocked:!u||!d||!p}}),[e])}const Kg=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"})),qg=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"}));function Yg(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function Zg(e){let{clientId:t,onClose:n}=e;const[o,r]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=jg(t),{isReusable:u,templateLock:g,hasTemplateLock:f}=(0,p.useSelect)((e=>{var n,o;const{getBlockName:r,getBlockAttributes:i}=e(co),s=r(t),a=(0,l.getBlockType)(s);return{isReusable:(0,l.isReusableBlock)(a),templateLock:null===(n=i(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==a||null===(o=a.attributes)||void 0===o||!o.templateLock)}}),[t]),[v,b]=(0,s.useState)(!!g),{updateBlockAttributes:_}=(0,p.useDispatch)(co),k=Am(t),y=(0,d.useInstanceId)(Zg,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{r({move:!a,remove:!c,...u?{edit:!i}:{}})}),[i,a,c,u]);const E=Object.values(o).every(Boolean),C=Object.values(o).some(Boolean)&&!E;return(0,s.createElement)(m.Modal,{title:(0,h.sprintf)(
62
  /* translators: %s: Name of the block. */
63
- (0,h.__)("Lock %s"),k.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,h.__)("Close"),onRequestClose:n},(0,s.createElement)("p",null,(0,h.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),_([t],{lock:o,templateLock:v?Yg(o):void 0}),n()}},(0,s.createElement)("div",{role:"group","aria-labelledby":y,className:"block-editor-block-lock-modal__options"},(0,s.createElement)(m.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,s.createElement)("span",{id:y},(0,h.__)("Lock all")),checked:E,indeterminate:C,onChange:e=>r({move:e,remove:e,...u?{edit:e}:{}})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},u&&(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(m.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Restrict editing"),(0,s.createElement)(m.Icon,{icon:o.edit?qg:Kg})),checked:!!o.edit,onChange:e=>r((t=>({...t,edit:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(m.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Disable movement"),(0,s.createElement)(m.Icon,{icon:o.move?qg:Kg})),checked:o.move,onChange:e=>r((t=>({...t,move:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(m.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Prevent removal"),(0,s.createElement)(m.Icon,{icon:o.remove?qg:Kg})),checked:o.remove,onChange:e=>r((t=>({...t,remove:e})))}))),f&&(0,s.createElement)(m.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,h.__)("Apply to all blocks inside"),checked:v,disabled:o.move&&!o.remove,onChange:()=>b(!v)})),(0,s.createElement)(m.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(m.Button,{variant:"tertiary",onClick:n},(0,h.__)("Cancel"))),(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(m.Button,{variant:"primary",type:"submit"},(0,h.__)("Apply"))))))}function Qg(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=jg(t),[l,r]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,h.__)("Unlock"):(0,h.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuItem,{icon:o?Kg:qg,onClick:r},i),l&&(0,s.createElement)(Zg,{clientId:t,onClose:r}))}const{Fill:Xg,Slot:Jg}=(0,m.createSlotFill)("BlockSettingsMenuControls");function eh(e){let{...t}=e;return(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(Xg,t))}eh.Slot=e=>{let{fillProps:t,clientIds:n=null,__unstableDisplayLocation:o}=e;const{selectedBlocks:l,selectedClientIds:r,canRemove:a}=(0,p.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:l}=e(co),r=null!==n?n:o();return{selectedBlocks:(0,u.map)(t(r).filter(Boolean),(e=>e.name)),selectedClientIds:r,canRemove:l(r)}}),[n]),{canLock:c}=jg(r[0]),d=1===r.length&&c,g=$g(),{isGroupable:h,isUngroupable:f}=g,v=(h||f)&&a;return(0,s.createElement)(Jg,{fillProps:{...t,__unstableDisplayLocation:o,selectedBlocks:l,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!v&&!d?null:(0,s.createElement)(m.MenuGroup,null,d&&(0,s.createElement)(Qg,{clientId:r[0]}),e,v&&(0,s.createElement)(Wg,i({},g,{onClose:null==t?void 0:t.onClose})))))};const th=eh,nh=()=>{},oh={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function lh(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,l.serialize)(t)),n),r=t.length>1?(0,h.__)("Copy blocks"):(0,h.__)("Copy block");return(0,s.createElement)(m.MenuItem,{ref:o},r)}const rh=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:r,...a}=e;const c=(0,u.castArray)(t),d=c.length,g=c[0],{firstParentClientId:f,hasReducedUI:v,onlyBlock:b,parentBlockType:_,previousBlockClientId:k,nextBlockClientId:y,selectedBlockClientIds:E}=(0,p.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:r,getNextBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a}=e(co),c=o(g),u=c[c.length-1],d=n(u);return{firstParentClientId:u,hasReducedUI:a().hasReducedUI,onlyBlock:1===t(),parentBlockType:(0,l.getBlockType)(d),previousBlockClientId:r(g),nextBlockClientId:i(g),selectedBlockClientIds:s()}}),[g]),C=(0,p.useSelect)((e=>{const{getShortcutRepresentation:t}=e(Ou.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")}}),[]),{selectBlock:S,toggleBlockHighlight:w}=(0,p.useDispatch)(co),B=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:nh,[n]),I=Dm({clientId:g,maximumLength:25}),x=(0,s.useCallback)(n?()=>{const e=k||y;e&&E.includes(g)&&!E.includes(e)&&n(e)}:nh,[n,k,y,E]),T=(0,h.sprintf)(
64
  /* translators: %s: block name */
65
- (0,h.__)("Remove %s"),I),N=1===d?T:(0,h.__)("Remove blocks"),P=(0,s.useRef)(),{gestures:L}=lg({ref:P,onChange(e){e&&v||w(f,e)}});return(0,s.createElement)(Og,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:l,canMove:c,canRemove:p,onDuplicate:v,onInsertAfter:k,onInsertBefore:y,onRemove:E,onCopy:w,onMoveTo:I,blocks:T}=e;return(0,s.createElement)(m.DropdownMenu,i({icon:Pg,label:(0,h.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:oh,noIcons:!0},a),(e=>{let{onClose:a}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuGroup,null,(0,s.createElement)(Ug.Slot,{fillProps:{onClose:a}}),void 0!==f&&(0,s.createElement)(m.MenuItem,i({},L,{ref:P,icon:(0,s.createElement)(Su,{icon:_.icon}),onClick:()=>S(f)}),(0,h.sprintf)(
66
  /* translators: %s: Name of the block's parent. */
67
- (0,h.__)("Select parent block (%s)"),_.title)),1===d&&(0,s.createElement)(Vg,{clientId:g}),(0,s.createElement)(lh,{blocks:T,onCopy:w}),n&&(0,s.createElement)(m.MenuItem,{onClick:(0,u.flow)(a,v,B),shortcut:C.duplicate},(0,h.__)("Duplicate")),l&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuItem,{onClick:(0,u.flow)(a,y),shortcut:C.insertBefore},(0,h.__)("Insert before")),(0,s.createElement)(m.MenuItem,{onClick:(0,u.flow)(a,k),shortcut:C.insertAfter},(0,h.__)("Insert after"))),c&&!b&&(0,s.createElement)(m.MenuItem,{onClick:(0,u.flow)(a,I)},(0,h.__)("Move to")),1===d&&(0,s.createElement)(Fg,{clientId:g,onToggle:a})),(0,s.createElement)(th.Slot,{fillProps:{onClose:a},clientIds:t,__unstableDisplayLocation:r}),"function"==typeof o?o({onClose:a}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:a}))),p&&(0,s.createElement)(m.MenuGroup,null,(0,s.createElement)(m.MenuItem,{onClick:(0,u.flow)(a,E,x),shortcut:C.remove},N)))}))}))},ih=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(rh,i({clientIds:t,toggleProps:e},n)))))};function sh(e){let{clientId:t}=e;const n=Am(t),{canEdit:o,canMove:l,canRemove:r,canLock:i}=jg(t),[a,c]=(0,s.useReducer)((e=>!e),!1);return i?o&&l&&r?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(m.ToolbarButton,{icon:qg,label:(0,h.sprintf)(
68
  /* translators: %s: block name */
69
- (0,h.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(Zg,{clientId:t,onClose:c})):null}const ah=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})),ch=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"})),uh=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"})),dh={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}},ph=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=$g(),{replaceBlocks:r}=(0,p.useDispatch)(co),{canRemove:i,variations:a}=(0,p.useSelect)((e=>{const{canRemoveBlocks:o}=e(co),{getBlockVariations:r}=e(l.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),c=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"group";const i=(0,l.switchToBlockType)(e,n);i&&i.length>0&&(i[0].attributes.layout=dh[o],r(t,i))};if(!o||!i)return null;const u=!!a.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!a.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarButton,{icon:ah,label:(0,h._x)("Group","verb"),onClick:c}),u&&(0,s.createElement)(m.ToolbarButton,{icon:ch,label:(0,h._x)("Row","single horizontal line"),onClick:()=>c("row")}),d&&(0,s.createElement)(m.ToolbarButton,{icon:uh,label:(0,h._x)("Stack","verb"),onClick:()=>c("stack")}))};function mh(e){let{clientIds:t}=e;const n=1===t.length?t[0]:void 0,o=(0,p.useSelect)((e=>!!n&&"html"===e(co).getBlockMode(n)),[n]),{toggleBlockMode:l}=(0,p.useDispatch)(co);return o?(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarButton,{onClick:()=>{l(n)}},(0,h.__)("Edit visually"))):null}const gh=(0,s.createContext)(""),hh=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:r,hasFixedToolbar:a,hasReducedUI:u,isValid:g,isVisual:h,isContentLocked:f}=(0,p.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:r,getBlockRootClientId:i,getSettings:s,__unstableGetContentLockingParent:a}=e(co),c=o(),u=c[0],d=i(u),p=s();return{blockClientIds:c,blockClientId:u,blockType:u&&(0,l.getBlockType)(t(u)),hasFixedToolbar:p.hasFixedToolbar,hasReducedUI:p.hasReducedUI,rootClientId:d,isValid:c.every((e=>r(e))),isVisual:c.every((e=>"visual"===n(e))),isContentLocked:!!a(u)}}),[]),{toggleBlockHighlight:v}=(0,p.useDispatch)(co),b=(0,s.useRef)(),{showMovers:_,gestures:k}=lg({ref:b,onChange(e){e&&u||v(o,e)}}),y=(0,d.useViewportMatch)("medium","<")||a;if(r&&!(0,l.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const E=y||_;if(0===n.length)return null;const C=g&&h,S=n.length>1,w=c()("block-editor-block-toolbar",E&&"is-showing-movers");return(0,s.createElement)("div",{className:w},!S&&!y&&!f&&(0,s.createElement)(rg,null),(0,s.createElement)("div",i({ref:b},k),(C||S)&&!f&&(0,s.createElement)(m.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,s.createElement)(Ig,{clientIds:n}),!S&&(0,s.createElement)(sh,{clientId:n[0]}),(0,s.createElement)(Ym,{clientIds:n,hideDragHandle:t||u}))),C&&S&&(0,s.createElement)(ph,null),C&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ko.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(ko.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(ko.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(ko.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(ko.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(gh.Provider,{value:null==r?void 0:r.name},(0,s.createElement)(Ng.Slot,null))),(0,s.createElement)(mh,{clientIds:n}),!f&&(0,s.createElement)(ih,{clientIds:n}))},fh=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:r,hasParents:a,showParentSelector:u}=(0,p.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o,__unstableGetContentLockingParent:r}=e(co),{getBlockType:i}=e(l.store),s=o(),a=s[0],c=n(a),u=i(t(c[c.length-1]));return{blockType:a&&i(t(a)),hasParents:c.length,showParentSelector:u&&(0,l.hasBlockSupport)(u,"__experimentalParentSelector",!0)&&s.length<=1&&!r(a)}}),[]);if(r&&!(0,l.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const d=c()("block-editor-block-contextual-toolbar",{"has-parent":a&&u,"is-fixed":n});return(0,s.createElement)(Xm,i({focusOnMount:t,className:d
70
- /* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(hh,{hideDragHandle:n}))},vh={flip:!1,shift:!0},bh={flip:!0,shift:!1};function _h(e,t,n){if(!e||!t)return vh;const o=t.getBoundingClientRect(),l=e.getBoundingClientRect(),r=e.ownerDocument.documentElement.clientHeight,i=o.top-l.top>n,s=o.height>r-n;return i||s?vh:bh}function kh(e){const{__unstableGetEditorMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:l,getSettings:r,getLastMultiSelectedBlockClientId:i}=e(co);return{editorMode:t(),isMultiSelecting:n(),isTyping:l(),hasFixedToolbar:r().hasFixedToolbar,lastClientId:o()?i():null}}function yh(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:l,__unstablePopoverSlot:r,__unstableContentRef:a}=e;const{editorMode:u,isMultiSelecting:m,isTyping:g,hasFixedToolbar:h,lastClientId:f}=(0,p.useSelect)(kh,[]),v=(0,p.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:l}=e(co);if(!n())return!1;const r=o();return l(r.rootClientId)[r.index]===t}),[t]),b=(0,d.useViewportMatch)("medium"),_=(0,s.useRef)(!1),{stopTyping:k}=(0,p.useDispatch)(co),y="navigation"===u||"zoom-out"===u,E="edit"===u&&!h&&b&&!m&&!(!g&&"edit"===u&&o)&&!g,C="edit"===u&&!E&&!h&&!o;(0,Ou.useShortcut)("core/block-editor/focus-toolbar",(()=>{_.current=!0,k(!0)}),{isDisabled:!C}),(0,s.useEffect)((()=>{_.current=!1}));const S=(0,s.useRef)(),w=function(e){let{contentElement:t,clientId:n}=e;const o=Ro(n),[l,r]=(0,s.useState)(0),[i,a]=(0,s.useState)((()=>_h(t,o,l))),c=(0,p.useSelect)((e=>e(co).getBlockIndex(n)),[n]),u=(0,d.useRefEffect)((e=>{r(e.offsetHeight)}),[]),m=(0,s.useCallback)((()=>a(_h(t,o,l))),[t,o,l]);return(0,s.useLayoutEffect)(m,[c,m]),(0,s.useLayoutEffect)((()=>{var e,n,l;if(!t||!o)return;const r=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;let i;null==r||null===(n=r.addEventHandler)||void 0===n||n.call(r,"resize",m);const s=null==o||null===(l=o.ownerDocument)||void 0===l?void 0:l.defaultView;return s.ResizeObserver&&(i=new s.ResizeObserver(m),i.observe(o)),()=>{var e;null==r||null===(e=r.removeEventHandler)||void 0===e||e.call(r,"resize",m),i&&i.disconnect()}}),[m,t,o]),{...i,ref:u}}({contentElement:null==a?void 0:a.current,clientId:t});return y||E?(0,s.createElement)(yl,i({clientId:l||t,bottomClientId:f,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":v}),__unstablePopoverSlot:r,__unstableContentRef:a,resize:!1},w),E&&(0,s.createElement)(fh,{focusOnMount:_.current,__experimentalInitialIndex:S.current,__experimentalOnIndexChange:e=>{S.current=e},key:t}),y&&(0,s.createElement)(Zm,{clientId:t,rootClientId:n})):null}function Eh(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:r,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(co),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=r(a)||{},p=i(a),m=s(p),g=(0,u.find)(p,(e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isEmptyDefaultBlock:c&&(0,l.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function Ch(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,p.useSelect)(Eh,[]);if(!o)return null;const{clientId:l,rootClientId:r,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)(yh,{clientId:l,rootClientId:r,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Sh(e){let{children:t}=e;const n=(0,s.useContext)(Tm),o=(0,s.useContext)(m.Disabled.Context);return n||o?t:(V()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Pm,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Ch,{__unstablePopoverSlot:"block-toolbar"}),t))}const wh=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=go();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Bh=wh((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:l,isToggle:r}=e;return(0,s.createElement)(Bm,{className:c()({"block-list-appender__toggle":r}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:l})})),Ih=(0,d.compose)([wh,(0,p.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(co),l=o(n);return{lastBlockClientId:l[l.length-1]}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(Cm,{rootClientId:t})})),xh=new WeakMap;function Th(e,t){const n=(0,p.useSelect)((e=>e(co).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:r,getClientIdsOfDescendants:i}=(0,p.useSelect)(co),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,p.useDispatch)(co),d=function(e,t,n,o,r,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,l.cloneBlock)(e)));i(n,t,e,!0,null)}if("block"===d){const l=n(u[0]);if(c===e&&l===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;r(u,c,e,i&&l<t?t-s:t)}}}(e,t,r,i,a,s,u),m=function(e,t,n,o,r,i){return s=>{if(!n)return;const a=(0,l.findTransform)((0,l.getBlockTransforms)("from"),(t=>"files"===t.type&&r(t.blockName,e)&&t.isMatch(s)));if(a){const n=a.transform(s,o);i(n,t,e)}}}(e,t,n,c,o,s),g=function(e,t,n){return o=>{const r=(0,l.pasteHandler)({HTML:o,mode:"BLOCKS"});r.length&&n(r,t,e)}}(e,t,s);return e=>{const t=(0,Ur.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?g(n):t.length?m(t):d(e)}}function Nh(e,t,n){const o="top"===n||"bottom"===n,{x:l,y:r}=e,i=o?l:r,s=o?r:l,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 Ph(e,t){let n,o,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return l.forEach((l=>{const r=Nh(e,t,l);(void 0===n||r<n)&&(n=r,o=l)})),[n,o]}function Lh(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],l=(0,h.isRTL)();let r,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=Ph(t,s,o);(void 0===i||a<i)&&(i=a,r=n+("bottom"===c||!l&&"right"===c||l&&"left"===c?1:0))})),r}function Mh(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,p.useSelect)((t=>{const{getTemplateLock:n,__unstableIsWithinBlockOverlay:o,__unstableHasActiveBlockOverlayActive:l}=t(co),r=n(e);return["all","contentOnly"].some((e=>e===r))||l(e)||o(e)}),[e]),{getBlockListSettings:l}=(0,p.useSelect)(co),{showInsertionPoint:r,hideInsertionPoint:i}=(0,p.useDispatch)(co),a=Th(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=Lh(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=l(e))||void 0===i?void 0:i.orientation);n(void 0===s?0:s),null!==s&&r(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 Rh(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:r,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:m,__experimentalAppenderTagName:g,renderAppender:h,orientation:f,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,l,r,i,a){const{updateBlockListSettings:c}=(0,p.useDispatch)(co),{blockListSettings:u,parentLock:d}=(0,p.useSelect)((t=>{const n=t(co).getBlockRootClientId(e);return{blockListSettings:t(co).getBlockListSettings(e),parentLock:t(co).getTemplateLock(n)}}),[e]),m=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:m,templateLock:void 0===l||"contentOnly"===d?d:l};if(void 0!==r&&(t.__experimentalCaptureToolbars=r),void 0!==i)t.orientation=i;else{const e=hr(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),_l()(u,t)||c(e,t)}),[e,u,m,n,o,l,d,r,i,c,a])}(t,n,o,r,a,m,f,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:r}=(0,p.useSelect)(co),{replaceInnerBlocks:i}=(0,p.useDispatch)(co),a=(0,p.useSelect)((t=>t(co).getBlocks(e)),[e]),c=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{if((0===a.length||"all"===n||"contentOnly"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,l.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(n,a)||i(e,n,0===a.length&&o&&0!==n.length,r())}}),[a,t,n,e])}(t,i,a,d);const _=(0,p.useSelect)((e=>{const n=e(co).getBlock(t),o=(0,l.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){xh.has(t)||xh.set(t,new WeakMap);const n=xh.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)($r,{value:_},(0,s.createElement)(Wh,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:g,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Ah(e){return xu(e),(0,s.createElement)(Rh,e)}const Dh=(0,s.forwardRef)(((e,t)=>{const n=Oh({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function Oh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=go(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:r,hasOverlay:a}=(0,p.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:r,hasSelectedInnerBlock:i,__unstableGetEditorMode:s}=e(co),a=t(n),c="navigation"===s()||o;return{__experimentalCaptureToolbars:e(l.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!r(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,Mh({rootClientId:n})]),m={__experimentalCaptureToolbars:r,...t},g=m.value&&m.onChange?Ah:Rh;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(g,i({},m,{clientId:n})):(0,s.createElement)(Wh,t)}}Oh.save=l.__unstableGetInnerBlocksProps,Dh.DefaultBlockAppender=Ih,Dh.ButtonBlockAppender=Bh,Dh.Content=()=>Oh.save().children;const zh=Dh,Fh=(0,s.createContext)(),Vh=(0,s.createContext)();function Hh(e){let{className:t,...n}=e;const[o,l]=(0,s.useState)(),r=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,editorMode:u}=(0,p.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(co),{outlineMode:o,focusMode:l}=t();return{isOutlineMode:o,isFocusMode:l,editorMode:n()}}),[]),{setBlockVisibility:m}=(0,p.useDispatch)(co),g=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{const t={};for(const n of e)t[n.target.getAttribute("data-block")]=n.isIntersecting;m(t)}))}),[]),h=Oh({ref:(0,d.useMergeRefs)([Pu(),Lm(),l]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&r,"is-navigate-mode":"navigation"===u})},n);return(0,s.createElement)(Fh.Provider,{value:o},(0,s.createElement)(Vh.Provider,{value:g},(0,s.createElement)("div",h)))}function Gh(e){return function(){const e=(0,p.useSelect)((e=>e(co).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,p.select)(co).__experimentalGetParsedPattern(e[n].name),t=Mm(o))};return t=Mm(o),()=>Rm(t)}),[e])}(),(0,s.createElement)(Sh,null,(0,s.createElement)(mo,{value:uo},(0,s.createElement)(Hh,e)))}function Uh(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:l,__experimentalLayout:r=fr}=e;const{order:i,selectedBlocks:a,visibleBlocks:c}=(0,p.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:l}=e(co);return{order:t(n),selectedBlocks:o(),visibleBlocks:l()}}),[n]);return(0,s.createElement)(br,{value:r},i.map((e=>(0,s.createElement)(p.AsyncModeProvider,{key:e,value:!c.has(e)&&!a.includes(e)},(0,s.createElement)(bu,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,s.createElement)(Im,{tagName:l,rootClientId:n,renderAppender:o}))}function Wh(e){return(0,s.createElement)(p.AsyncModeProvider,{value:!1},(0,s.createElement)(Uh,e))}function $h(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function jh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||$h(Object.values(n).filter(Boolean))||"px"}function Kh(){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,m.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),l=n.every((e=>e===n[0]))?n[0]:"",r=$h(o),i=0===l||l?`${l}${r}`:void 0;return i}function qh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Kh(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function Yh(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Zh(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:l,...r}=e,a=Kh(l);void 0===a&&(a=jh(n));const c=Yh(l)&&qh(l),u=c?(0,h.__)("Mixed"):null;return(0,s.createElement)(m.__experimentalUnitControl,i({},r,{"aria-label":(0,h.__)("Border radius"),disableUnits:c,isOnly:!0,value:a,onChange:e=>{const n=!isNaN(parseFloat(e));t(n?e:void 0)},onUnitChange:e=>{o({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:u}))}Gh.__unstableElementContext=Fh;const Qh={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function Xh(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:l,...r}=e;const a=e=>n=>{if(!t)return;const o=isNaN(parseFloat(n))?void 0:n;t({...c,[e]:o})},c="string"!=typeof l?l:{topLeft:l,topRight:l,bottomLeft:l,bottomRight:l};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(Qh).map((e=>{let[t,l]=e;const[u,d]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(c[t]),p=c[t]?d:n[t]||n.flat;return(0,s.createElement)(m.Tooltip,{text:l,position:"top",key:t},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(m.__experimentalUnitControl,i({},r,{"aria-label":l,value:[u,p].join(""),onChange:a(t),onUnitChange:(g=t,e=>{const t={...n};t[g]=e,o(t)})}))));var g})))}function Jh(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink Radii"):(0,h.__)("Link Radii");return(0,s.createElement)(m.Tooltip,{text:o},(0,s.createElement)(m.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?tl:nl,iconSize:16,"aria-label":o})))}const ef={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},tf={px:100,em:20,rem:20};function nf(e){let{onChange:t,values:n}=e;const[o,l]=(0,s.useState)(!Yh(n)||!qh(n)),[r,i]=(0,s.useState)({flat:"string"==typeof n?(0,m.__experimentalParseQuantityAndUnitFromRawValue)(n)[1]:void 0,topLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topLeft)[1],topRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topRight)[1],bottomLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomLeft)[1],bottomRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomRight)[1]}),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["px","em","rem"]}),c=jh(r),u=a&&a.find((e=>e.value===c)),d=(null==u?void 0:u.step)||1,[p]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(Kh(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Zh,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,selectedUnits:r,setSelectedUnits:i,units:a}),(0,s.createElement)(m.RangeControl,{label:(0,h.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=p?p:"",min:0,max:tf[c],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${c}`:void 0)},step:d})):(0,s.createElement)(Xh,{min:0,onChange:t,selectedUnits:r,setSelectedUnits:i,values:n||ef,units:a}),(0,s.createElement)(Jh,{onClick:()=>l(!o),isLinked:o})))}function of(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(nf,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{const t=al({...n,border:{...null==n?void 0:n.border,radius:e}});o({style:t})}})}Cd([Sd,Id]);const lf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},rf=(e,t)=>(0,u.find)(e,{color:t});function sf(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function af(){return{disableCustomColors:!Yo("color.custom"),disableCustomGradients:!Yo("color.customGradient")}}function cf(){const e=af(),t=Yo("color.palette.custom"),n=Yo("color.palette.theme"),o=Yo("color.palette.default"),l=Yo("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}),l&&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 r=Yo("color.gradients.custom"),i=Yo("color.gradients.theme"),a=Yo("color.gradients.default"),c=Yo("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}),r&&r.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:r}),e}),[r,i,a]),e}const uf="__experimentalBorder",df=["top","right","bottom","left"],pf=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},mf=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},gf=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=mf(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return mf(t,"color",o)||{color:o}};function hf(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function ff(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:r}=t,{colors:i}=cf(),a=vf(e.name),c=Yo("border.color")&&vf(e.name,"color"),u=Yo("border.radius")&&vf(e.name,"radius"),d=Yo("border.style")&&vf(e.name,"style"),p=Yo("border.width")&&vf(e.name,"width");if([!c,!u,!d,!p].every(Boolean)||!a)return null;const g=(0,l.getBlockSupport)(e.name,[uf,"__experimentalDefaultControls"]),f=(null==g?void 0:g.color)||(null==g?void 0:g.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:l}=o||{};if(n){const{color:e}=gf({colors:t,namedColor:n});return e?{...l,color:e}:l}if(!l)return l;const r={...l};return df.forEach((e=>{var n;const o=hf(null===(n=r[e])||void 0===n?void 0:n.color);if(o){const{color:n}=gf({colors:t,namedColor:o});r[e]={...r[e],color:n}}})),r})(t,i);return(0,s.createElement)(vl,{__experimentalGroup:"border"},(p||c)&&(0,s.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,m.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,h.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:l}=n;o({borderColor:void 0,style:{...l,border:al({radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:f,resetAllFilter:pf,panelId:n},(0,s.createElement)(m.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,enableStyle:d,onChange:e=>{var t;let n,l={...e};if((0,m.__experimentalHasSplitBorders)(e))l={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},df.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=gf({colors:i,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(l[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=gf({colors:i,customColor:t});o.slug&&(n=o.slug,l.color=void 0)}const s=al({...r,border:{radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius,...l}});o({style:s,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",value:v,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(0,s.createElement)(m.__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:bf(o,"radius")})}(e),isShownByDefault:null==g?void 0:g.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,s.createElement)(of,e)))}function vf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==s.Platform.OS)return!1;const n=(0,l.getBlockSupport)(e,uf);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 bf(e,t){return al({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function _f(e,t,n){if(!vf(t,"color")||dl(t,uf,"color"))return e;const o=kf(n),l=c()(e.className,o);return e.className=l||void 0,e}function kf(e){var t;const{borderColor:n,style:o}=e,l=sf("border-color",n);return c()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[l]:!!l})}const yf=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l,r,a,c,u,d,p;const{name:m,attributes:g}=t,{borderColor:h,style:f}=g,{colors:v}=cf();if(!vf(m,"color")||dl(m,uf,"color"))return(0,s.createElement)(e,t);const{color:b}=gf({colors:v,namedColor:h}),{color:_}=gf({colors:v,namedColor:hf(null==f||null===(n=f.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:k}=gf({colors:v,namedColor:hf(null==f||null===(l=f.border)||void 0===l||null===(r=l.right)||void 0===r?void 0:r.color)}),{color:y}=gf({colors:v,namedColor:hf(null==f||null===(a=f.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=gf({colors:v,namedColor:hf(null==f||null===(u=f.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:_||b,borderRightColor:k||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,s.createElement)(e,i({},t,{wrapperProps:S}))}));function Ef(e){if(e)return`has-${e}-gradient-background`}function Cf(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 wf(e,t){const n=Sf(e,t);return n&&n.slug}function Bf(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=go(),o=Yo("color.gradients.custom"),l=Yo("color.gradients.theme"),r=Yo("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...l||[],...r||[]]),[o,l,r]),{gradient:a,customGradient:c}=(0,p.useSelect)((o=>{const{getBlockAttributes:l}=o(co),r=l(n)||{};return{customGradient:r[t],gradient:r[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,p.useDispatch)(co),d=(0,s.useCallback)((o=>{const l=wf(i,o);u(n,l?{[e]:l,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),m=Ef(a);let g;return g=a?Cf(i,a):c,{gradientClass:m,gradientValue:g,setGradient:d}}(0,r.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return vf(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",_f),(0,r.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!vf(e,"color")||dl(e,uf,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),_f(o,e,n)},e})),(0,r.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",yf);const If=["colors","disableCustomColors","gradients","disableCustomGradients"],xf={name:"color",title:"Solid",value:"color"},Tf={name:"gradient",title:"Gradient",value:"gradient"},Nf=[xf,Tf];function Pf(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:l,__experimentalHasMultipleOrigins:r,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:p,onGradientChange:g,colorValue:h,gradientValue:f,clearable:v,showTitle:b=!0,enableAlpha:_}=e;const k=p&&(!(0,u.isEmpty)(t)||!o),y=g&&(!(0,u.isEmpty)(n)||!l);if(!k&&!y)return null;const E={[xf.value]:(0,s.createElement)(m.ColorPalette,{value:h,onChange:y?e=>{p(e),g()}:p,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:r,__experimentalIsRenderedInSidebar:i,clearable:v,enableAlpha:_}),[Tf.value]:(0,s.createElement)(m.GradientPicker,{__nextHasNoMargin:!0,value:f,onChange:k?e=>{g(e),p()}:g,gradients:n,disableCustomGradients:l,__experimentalHasMultipleOrigins:r,__experimentalIsRenderedInSidebar:i,clearable:v})},C=e=>(0,s.createElement)("div",{className:"block-editor-color-gradient-control__panel"},E[e]);return(0,s.createElement)(m.BaseControl,{__nextHasNoMarginBottom:!0,className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(m.__experimentalVStack,{spacing:1},b&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(m.BaseControl.VisualLabel,null,d))),k&&y&&(0,s.createElement)(m.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:Nf,initialTabName:f?Tf.value:!!k&&xf.value},(e=>C(e.value))),!y&&C(xf.value),!k&&C(Tf.value))))}function Lf(e){const t={};return t.colors=Yo("color.palette"),t.gradients=Yo("color.gradients"),t.disableCustomColors=!Yo("color.custom"),t.disableCustomGradients=!Yo("color.customGradient"),(0,s.createElement)(Pf,i({},t,e))}const Mf=function(e){return(0,u.every)(If,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Pf,e):(0,s.createElement)(Lf,e)},Rf=e=>{let{setting:t,children:n,panelId:o,...l}=e;return(0,s.createElement)(m.__experimentalToolsPanelItem,i({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},l,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},Af=e=>{let{colorValue:t,label:n}=e;return(0,s.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(m.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,s.createElement)(m.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},Df=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:l,label:r}=e,i={onClick:n,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,s.createElement)(m.Button,i,(0,s.createElement)(Af,{colorValue:l,label:r}))};function Of(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:l,enableAlpha:r,gradients:a,settings:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...p}=e;return d&&(t={placement:"left-start",offset:36,shift:!0}),(0,s.createElement)(s.Fragment,null,c.map(((e,c)=>{var g;const h={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:l,enableAlpha:r,gradientValue:e.gradientValue,gradients:a,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...e},f={colorValue:null!==(g=e.gradientValue)&&void 0!==g?g:e.colorValue,label:e.label};return e&&(0,s.createElement)(Rf,i({key:c,setting:e},p),(0,s.createElement)(m.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:Df(f),renderContent:()=>(0,s.createElement)(m.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,s.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,s.createElement)(Mf,h)))}))})))}Cd([Sd,Id]);const zf=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:l,fontSize:r,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const p=a||o,g=c||l;if(!p&&!g)return null;const f=[{color:p,description:(0,h.__)("text color")},{color:g,description:(0,h.__)("link color")}],v=yd(d),b=v.alpha()<1,_=v.brightness(),k={level:"AA",size:i||!1!==i&&r>=24?"large":"small"};let y="",E="";for(const e of f){if(!e.color)continue;const t=yd(e.color),n=t.isReadable(v,k),o=t.alpha()<1;if(!n){if(b||o)continue;y=_<t.brightness()?(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
71
  (0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
72
- (0,h.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,h.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,h.__)("Transparent text may be hard for people to read."),E=(0,h.__)("Transparent text may be hard for people to read."))}return y?((0,qt.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(m.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function Ff(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function Vf(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:l=!0}=e;const[r,a]=(0,s.useState)(),[c,u]=(0,s.useState)(),[d,p]=(0,s.useState)(),m=Mo(o),g=n.filter((e=>null==e?void 0:e.colorValue));(0,s.useEffect)((()=>{var e;if(!l||!g.length)return;if(!m.current)return;u(Ff(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(Ff(t).color);let n=m.current,o=Ff(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Ff(n).backgroundColor;a(o)}));const h=cf();return(0,s.createElement)(vl,{__experimentalGroup:"color"},(0,s.createElement)(Of,i({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},h)),l&&(0,s.createElement)(zf,{backgroundColor:r,textColor:c,enableAlphaChecker:t,linkColor:d}))}const Hf="color",Gf=e=>{const t=(0,l.getBlockSupport)(e,Hf);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Uf=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,l.getBlockSupport)(e,Hf);return null!==t&&"object"==typeof t&&!!t.link},Wf=e=>{const t=(0,l.getBlockSupport)(e,Hf);return null!==t&&"object"==typeof t&&!!t.gradients},$f=e=>{const t=(0,l.getBlockSupport)(e,Hf);return t&&!1!==t.background},jf=e=>{const t=(0,l.getBlockSupport)(e,Hf);return t&&!1!==t.text},Kf=(e,t)=>al(cl(t,e,void 0)),qf=e=>({textColor:void 0,style:Kf(["color","text"],e.style)}),Yf=e=>({style:Kf(["elements","link","color","text"],e.style)}),Zf=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function Qf(e,t,n){var o,l,r,i,s,a;if(!Gf(t)||dl(t,Hf))return e;const u=Wf(t),{backgroundColor:d,textColor:p,gradient:m,style:g}=n,h=e=>!dl(t,Hf,e),f=h("text")?sf("color",p):void 0,v=h("gradients")?Ef(m):void 0,b=h("background")?sf("background-color",d):void 0,_=h("background")||h("gradients"),k=d||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||u&&(m||(null==g||null===(l=g.color)||void 0===l?void 0:l.gradient)),y=c()(e.className,f,v,{[b]:!(u&&null!=g&&null!==(r=g.color)&&void 0!==r&&r.gradient||!b),"has-text-color":h("text")&&(p||(null==g||null===(i=g.color)||void 0===i?void 0:i.text)),"has-background":_&&k,"has-link-color":h("link")&&(null==g||null===(s=g.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const Xf=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?lf(e,n[1]).color:t};function Jf(e){var t,n,o,r,i,a,c,u,d;const{name:p,attributes:m}=e,g=Yo("color.palette.custom"),f=Yo("color.palette.theme"),v=Yo("color.palette.default"),b=(0,s.useMemo)((()=>[...g||[],...f||[],...v||[]]),[g,f,v]),_=Yo("color.gradients.custom"),k=Yo("color.gradients.theme"),y=Yo("color.gradients.default"),E=(0,s.useMemo)((()=>[..._||[],...k||[],...y||[]]),[_,k,y]),C=Yo("color.custom"),S=Yo("color.customGradient"),w=Yo("color.background"),B=Yo("color.link"),I=Yo("color.text"),x=C||!f||(null==f?void 0:f.length)>0,T=S||!k||(null==k?void 0:k.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!Gf(p))return null;const P=Uf(p)&&B&&x,L=jf(p)&&I&&x,M=$f(p)&&w&&x,R=Wf(p)&&T;if(!(P||L||M||R))return null;const{style:A,textColor:D,backgroundColor:O,gradient:z}=m;let F;if(R&&z)F=Cf(E,z);else if(R){var V;F=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,l;const r=rf(b,n),i=t+"Color",s={...N.current.style,color:{...null===(o=N.current)||void 0===o||null===(l=o.style)||void 0===l?void 0:l.color,[t]:null!=r&&r.slug?void 0:n}},a=null!=r&&r.slug?r.slug:void 0,c={style:al(s),[i]:a};e.setAttributes(c),N.current={...N.current,...c}},G=(0,l.getBlockSupport)(e.name,[Hf,"__experimentalDefaultControls"]),U=!("web"!==s.Platform.OS||z||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient||!1===(0,l.getBlockSupport)(e.name,[Hf,"enableContrastChecker"]));return(0,s.createElement)(Vf,{enableContrastChecking:U,clientId:e.clientId,enableAlpha:!0,settings:[...L?[{label:(0,h.__)("Text"),onColorChange:H("text"),colorValue:lf(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==G?void 0:G.text,resetAllFilter:qf}]:[],...M||R?[{label:(0,h.__)("Background"),onColorChange:M?H("background"):void 0,colorValue:lf(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:F,onGradientChange:R?t=>{const n=wf(E,t);let o;if(n){var l,r,i;const e={...null===(l=N.current)||void 0===l?void 0:l.style,color:{...null===(r=N.current)||void 0===r||null===(i=r.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:al(e),gradient:n}}else{var s,a,c;const e={...null===(s=N.current)||void 0===s?void 0:s.style,color:{...null===(a=N.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:al(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==G?void 0:G.background,resetAllFilter:Zf}]:[],...P?[{label:(0,h.__)("Link"),onColorChange:t=>{var n;const o=rf(b,t),l=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,r=al(cl(null===(n=N.current)||void 0===n?void 0:n.style,["elements","link","color","text"],l));e.setAttributes({style:r}),N.current={...N.current,style:r}},colorValue:Xf(b,null==A||null===(r=A.elements)||void 0===r||null===(i=r.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==G?void 0:G.link,resetAllFilter:Yf}]:[]]})}const ev=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:l}=t,{backgroundColor:r,textColor:a}=l,c=Yo("color.palette.custom")||[],u=Yo("color.palette.theme")||[],d=Yo("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!Gf(o)||dl(o,Hf))return(0,s.createElement)(e,t);const m={};var g,h;a&&!dl(o,Hf,"text")&&(m.color=null===(g=lf(p,a))||void 0===g?void 0:g.color),r&&!dl(o,Hf,"background")&&(m.backgroundColor=null===(h=lf(p,r))||void 0===h?void 0:h.color);let f=t.wrapperProps;return f={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:f}))})),tv={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,r.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return Gf(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,r.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Qf),(0,r.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Gf(e)||dl(e,Hf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Qf(o,e,n)},e})),(0,r.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",ev),(0,r.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const l=e.name;return ul({linkColor:Uf(l),textColor:jf(l),backgroundColor:$f(l),gradient:Wf(l)},tv,e,t,n,o)}));const nv=[{name:(0,h._x)("Regular","font style"),value:"normal"},{name:(0,h._x)("Italic","font style"),value:"italic"}],ov=[{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"}],lv=(e,t)=>e?t?(0,h.__)("Appearance"):(0,h.__)("Font style"):(0,h.__)("Font weight");function rv(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:l,fontWeight:r},...a}=e,c=n||o,u=lv(n,o),d={key:"default",name:(0,h.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},p=(0,s.useMemo)((()=>n&&o?(()=>{const e=[d];return nv.forEach((t=>{let{name:n,value:o}=t;ov.forEach((t=>{let{name:l,value:r}=t;const i="normal"===o?l:(0,h.sprintf)(
73
  /* translators: 1: Font weight name. 2: Font style name. */
74
- (0,h.__)("%1$s %2$s"),l,n);e.push({key:`${o}-${r}`,name:i,style:{fontStyle:o,fontWeight:r}})}))})),e})():n?(()=>{const e=[d];return nv.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[d];return ov.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),g=p.find((e=>e.style.fontStyle===l&&e.style.fontWeight===r))||p[0];return c&&(0,s.createElement)(m.CustomSelectControl,i({},a,{className:"components-font-appearance-control",label:u,describedBy:g?n?o?(0,h.sprintf)(// translators: %s: Currently selected font appearance.
75
  (0,h.__)("Currently selected font appearance: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font style.
76
  (0,h.__)("Currently selected font style: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font weight.
77
- (0,h.__)("Currently selected font weight: %s"),g.name):(0,h.__)("No selected font appearance"),options:p,value:g,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}const iv=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:l="60px",...r}=e;const a=function(e){return void 0!==e&&""!==e}(t),c=a?t:"";o||V()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const u=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:u},(0,s.createElement)(m.__experimentalNumberControl,i({},r,{__unstableInputWidth:l,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),l=((e,t)=>{if(a)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o);return{...e,value:l}},onChange:n,label:(0,h.__)("Line height"),placeholder:1.5,step:.1,value:c,min:0})))},sv="typography.lineHeight";function av(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(iv,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:al(t)})},size:"__unstable-large"})}function cv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("typography.lineHeight");return!(0,l.hasBlockSupport)(e,sv)||t}const uv="typography.__experimentalFontStyle",dv="typography.__experimentalFontWeight";function pv(e){var t,n;const{attributes:{style:o},setAttributes:l}=e,r=!mv(e),i=!gv(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)(rv,{onChange:e=>{l({style:al({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:r,hasFontWeights:i,value:{fontStyle:a,fontWeight:c},size:"__unstable-large"})}function mv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,l.hasBlockSupport)(e,uv),n=Yo("typography.fontStyle");return!t||!n}function gv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,l.hasBlockSupport)(e,dv),n=Yo("typography.fontWeight");return!t||!n}function hv(e){const t=mv(e),n=gv(e);return t&&n}function fv(e){let{value:t="",onChange:n,fontFamilies:o,...l}=e;const r=Yo("typography.fontFamilies");if(o||(o=r),(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)(m.SelectControl,i({label:(0,h.__)("Font"),options:a,value:t,onChange:n,labelPosition:"top"},l))}const vv="typography.__experimentalFontFamily";function bv(e,t,n){if(!(0,l.hasBlockSupport)(t,vv))return e;if(dl(t,Zv,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(mg())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}function _v(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const l=Yo("typography.fontFamilies"),r=null===(t=(0,u.find)(l,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(fv,{className:"block-editor-hooks-font-family-control",fontFamilies:l,value:r,onChange:function(e){const t=(0,u.find)(l,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})},size:"__unstable-large",__nextHasNoMarginBottom:!0})}function kv(e){let{name:t}=e;const n=Yo("typography.fontFamilies");return!n||0===n.length||!(0,l.hasBlockSupport)(t,vv)}(0,r.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,l.hasBlockSupport)(e,vv)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",bv),(0,r.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,l.hasBlockSupport)(e,vv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),bv(o,e,n)},e}));const yv=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Ev(e,t){return(0,u.find)(e,{size:t})||{size:t}}function Cv(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}const Sv=function(e){const t=Yo("typography.fontSizes"),n=!Yo("typography.customFontSize");return(0,s.createElement)(m.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))},wv="typography.fontSize";function Bv(e,t,n){if(!(0,l.hasBlockSupport)(t,wv))return e;if(dl(t,Zv,"fontSize"))return e;const o=new(mg())(e.className);o.add(Cv(n.fontSize));const r=o.value;return e.className=r||void 0,e}function Iv(e){var t,n;const{attributes:{fontSize:o,style:l},setAttributes:r}=e,i=Yo("typography.fontSizes"),a=yv(i,o,null==l||null===(t=l.typography)||void 0===t?void 0:t.fontSize),c=(null==a?void 0:a.size)||(null==l||null===(n=l.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(Sv,{onChange:e=>{const t=Ev(i,e).slug;r({style:al({...l,typography:{...null==l?void 0:l.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1,size:"__unstable-large",__nextHasNoMarginBottom:!0})}function xv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Yo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,l.hasBlockSupport)(e,wv)||!n}const Tv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const r=Yo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,l.hasBlockSupport)(i,wv)||dl(i,Zv,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=yv(r,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"),Nv={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,r.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,l.hasBlockSupport)(e,wv)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Bv),(0,r.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,l.hasBlockSupport)(e,wv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Bv(o,e,n)},e})),(0,r.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Tv),(0,r.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const r=e.name;return ul({fontSize:(0,l.hasBlockSupport)(r,wv)},Nv,e,t,n,o)}));const Pv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Lv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Mv=[{name:(0,h.__)("Underline"),value:"underline",icon:Pv},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:Lv}];function Rv(e){let{value:t,onChange:n,className:o,...l}=e;return(0,s.createElement)(m.__experimentalToggleGroupControl,i({},l,{className:c()("block-editor-text-decoration-control",o),__experimentalIsBorderless:!0,label:(0,h.__)("Decoration"),value:t,onChange:n}),Mv.map((e=>(0,s.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:e.value,value:e.value,icon:e.icon,label:e.name}))))}const Av="typography.__experimentalTextDecoration";function Dv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Rv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:al({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})},size:"__unstable-large"})}function Ov(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,l.hasBlockSupport)(e,Av),n=Yo("typography.textDecoration");return t||!n}const zv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Fv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Vv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Hv=[{name:(0,h.__)("Uppercase"),value:"uppercase",icon:zv},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:Fv},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:Vv}];function Gv(e){let{value:t,onChange:n,...o}=e;return(0,s.createElement)(m.__experimentalToggleGroupControl,i({},o,{className:"block-editor-text-transform-control",__experimentalIsBorderless:!0,label:(0,h.__)("Letter case"),value:t,onChange:n}),Hv.map((e=>(0,s.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:e.value,value:e.value,icon:e.icon,label:e.name}))))}const Uv="typography.__experimentalTextTransform";function Wv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Gv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:al({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})},size:"__unstable-large"})}function $v(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,l.hasBlockSupport)(e,Uv),n=Yo("typography.textTransform");return t||!n}function jv(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...l}=e;const r=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(m.__experimentalUnitControl,i({},l,{label:(0,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n}))}const Kv="typography.__experimentalLetterSpacing";function qv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(jv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:al({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%",size:"__unstable-large"})}function Yv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,l.hasBlockSupport)(e,Kv),n=Yo("typography.letterSpacing");return t||!n}const Zv="typography",Qv=[sv,wv,uv,dv,vv,Av,Uv,Kv];function Xv(e){const{clientId:t}=e,n=kv(e),o=xv(e),r=hv(e),i=cv(e),a=Ov(e),c=$v(e),u=Yv(e),d=!mv(e),p=!gv(e),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[hv(e),xv(e),cv(e),kv(e),Ov(e),$v(e),Yv(e)];return t.filter(Boolean).length===t.length}(e),f=Jv(e.name);if(g||!f)return null;const v=(0,l.getBlockSupport)(e.name,[Zv,"__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)(vl,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(m.__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)(_v,e)),!o&&(0,s.createElement)(m.__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)
78
- /* translators: Ensure translation is distinct from "Letter case" */,label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:al({...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)(Iv,e)),!r&&(0,s.createElement)(m.__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:lv(d,p),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:al({...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)(pv,e)),!i&&(0,s.createElement)(m.__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:al({...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)(av,e)),!a&&(0,s.createElement)(m.__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:al({...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)(Dv,e)),!c&&(0,s.createElement)(m.__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)
79
- /* translators: Ensure translation is distinct from "Font size" */,label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:al({...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)(Wv,e)),!u&&(0,s.createElement)(m.__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:al({...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)(qv,e)))}const Jv=e=>Qv.some((t=>(0,l.hasBlockSupport)(e,t))),eb=[...Qv,uf,Hf,Nl],tb=e=>eb.some((t=>(0,l.hasBlockSupport)(e,t)));function nb(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return(0,mr.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const ob={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[Hf],[`${Zv}.__experimentalSkipSerialization`]:[Zv],[`${Nl}.__experimentalSkipSerialization`]:["spacing"]},lb={...ob,[`${Nl}`]:["spacing.blockGap"]},rb={gradients:"gradient"};function ib(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:lb;if(!tb(t))return e;let{style:r}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const i=(0,l.getBlockSupport)(t,n);!0===i&&(r=(0,u.omit)(r,o)),Array.isArray(i)&&i.forEach((e=>{const t=rb[e]||e;r=(0,u.omit)(r,[[...o,t]])}))})),e.style={...nb(r),...e.style},e}const sb=(0,d.createHigherOrderComponent)((e=>t=>{const n=ho();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Jf,t),(0,s.createElement)(Xv,t),(0,s.createElement)(ff,t),(0,s.createElement)(Ml,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),ab=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const r=`wp-elements-${(0,d.useInstanceId)(e)}`,a=dl(t.name,Hf,"link"),u=(0,s.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,o=[];if(n&&Object.keys(n).length>0){var i;const e={...n,link:{...n.link,color:a||null===(i=n.link)||void 0===i?void 0:i.color}};for(const[t,n]of Object.entries(e)){const e=(0,mr.compileCSS)(n,{selector:`.editor-styles-wrapper .${r} ${l.__EXPERIMENTAL_ELEMENTS[t]}`});e&&o.push(e)}}return o.length>0?o:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),p=(0,s.useContext)(Gh.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,u&&p&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:u}}),p),(0,s.createElement)(e,i({},t,{className:null!==(o=t.attributes.style)&&void 0!==o&&o.elements?c()(t.className,r):t.className})))}));(0,r.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return tb(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",ib),(0,r.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!tb(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ib(o,e,n,ob)},e})),(0,r.addFilter)("editor.BlockEdit","core/style/with-block-controls",sb),(0,r.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",ab),(0,r.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,l.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));const cb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),ub=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:l,disableCustomDuotone:r,value:i,onChange:a}=e;return t="unset"===i?(0,s.createElement)(m.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,s.createElement)(m.DuotoneSwatch,{values:i}):(0,s.createElement)(ur,{icon:cb}),(0,s.createElement)(m.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(m.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==au.DOWN||(e.preventDefault(),o())},label:(0,h.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,s.createElement)(m.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)(m.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:l,disableCustomDuotone:r,value:i,onChange:a}))})},db=[];function pb(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,s.createElement)(ep,{selector:t}):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(tp,{id:n,colors:o}),(0,s.createElement)(Jd,{id:n,selector:t}))}function mb(e){let{presetSetting:t,defaultSetting:n}=e;const o=!Yo(n),l=Yo(`${t}.custom`)||db,r=Yo(`${t}.theme`)||db,i=Yo(`${t}.default`)||db;return(0,s.useMemo)((()=>[...l,...r,...o?db:i]),[o,l,r,i])}function gb(e){var t;let{attributes:n,setAttributes:o}=e;const l=null==n?void 0:n.style,r=null==l||null===(t=l.color)||void 0===t?void 0:t.duotone,i=mb({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=mb({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!Yo("color.custom"),u=!Yo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(ko,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(ub,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:c,value:r,onChange:e=>{const t={...l,color:{...null==l?void 0:l.color,duotone:e}};o({style:t})}}))}Cd([Sd]);const hb=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,l.hasBlockSupport)(t.name,"color.__experimentalDuotone"),o=(0,p.useSelect)((e=>e(co).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&!o&&(0,s.createElement)(gb,t))}),"withDuotoneControls"),fb=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r;const a=(0,l.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(r=o.color)||void 0===r?void 0:r.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(","),l=[];return n.forEach((e=>{o.forEach((t=>{l.push(`${e.trim()} ${t.trim()}`)}))})),l.join(", ")}(`.editor-styles-wrapper .${p}`,a),g=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(Gh.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(pb,{selector:m,id:p,colors:u}),h),(0,s.createElement)(e,i({},t,{className:g})))}),"withDuotoneStyles");(0,r.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,l.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,r.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",hb),(0,r.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",fb);const vb="__experimentalLayout";function bb(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:r}=n,i=Yo("layout"),a=(0,p.useSelect)((e=>{const{getSettings:t}=e(co);return t().supportsLayout}),[]),c=(0,l.getBlockSupport)(o,vb,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:g=!0,default:f}=c;if(!d)return null;const v=!(!g||!i||null!=r&&r.type&&"default"!==(null==r?void 0:r.type)&&"constrained"!==(null==r?void 0:r.type)&&(null==r||!r.inherit)),b=r||f||{},{inherit:_=!1,type:k="default",contentSize:y=null}=b;if(("default"===k||"constrained"===k)&&!a)return null;const E=hr(k),C=hr("constrained"),S=!b.type&&(y||_),w=!!_||!!y,B=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(vl,null,(0,s.createElement)(m.PanelBody,{title:(0,h.__)("Layout")},v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.ToggleControl,{className:"block-editor-hooks__toggle-control",label:(0,h.__)("Inner blocks use content width"),checked:"constrained"===(null==E?void 0:E.name)||w,onChange:()=>t({layout:{type:"constrained"===(null==E?void 0:E.name)||w?"default":"constrained"}}),help:"constrained"===(null==E?void 0:E.name)||w?(0,h.__)("Nested blocks use content width with options for full and wide widths."):(0,h.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!_&&u&&(0,s.createElement)(_b,{type:k,onChange:e=>t({layout:{type:e}})}),E&&"default"!==E.name&&(0,s.createElement)(E.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}),C&&S&&(0,s.createElement)(C.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}))),!_&&E&&(0,s.createElement)(E.toolBarControls,{layout:b,onChange:B,layoutBlockSupport:c}))}function _b(e){let{type:t,onChange:n}=e;return(0,s.createElement)(m.ButtonGroup,null,gr.map((e=>{let{name:o,label:l}=e;return(0,s.createElement)(m.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},l)})))}const kb=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,l.hasBlockSupport)(n,vb)&&(0,s.createElement)(bb,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),yb=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,r=(0,l.hasBlockSupport)(n,vb),a=(0,p.useSelect)((e=>{const{getSettings:t}=e(co);return!!t().disableLayoutStyles})),m=r&&!a,g=(0,d.useInstanceId)(e),h=Yo("layout")||{},f=(0,s.useContext)(Gh.__unstableElementContext),{layout:v}=o,{default:b}=(0,l.getBlockSupport)(n,vb)||{},_=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},k=r?function(e,t){var n;const o=(0,p.useSelect)((e=>{var t;const{getSettings:n}=e(co);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),l=[];var r;return null!=t&&null!==(n=t[(null==e?void 0:e.type)||"default"])&&void 0!==n&&n.className&&l.push(null==t||null===(r=t[(null==e?void 0:e.type)||"default"])||void 0===r?void 0:r.className),(null!=e&&e.inherit||null!=e&&e.contentSize||"constrained"===(null==e?void 0:e.type))&&o&&l.push("has-global-padding"),null!=e&&e.orientation&&l.push(`is-${(0,u.kebabCase)(e.orientation)}`),null!=e&&e.justifyContent&&l.push(`is-content-justification-${(0,u.kebabCase)(e.justifyContent)}`),null!=e&&e.flexWrap&&"nowrap"===e.flexWrap&&l.push("is-nowrap"),l}(_,null==h?void 0:h.definitions):null,y=`.${(0,l.getBlockDefaultClassName)(n)}.wp-container-${g}`,E=null!==Yo("spacing.blockGap");let C;if(m){var S;const e=hr((null==_?void 0:_.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:_,layoutDefinitions:null==h?void 0:h.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=c()(null==t?void 0:t.className,{[`wp-container-${g}`]:m&&!!C},k);return(0,s.createElement)(s.Fragment,null,m&&f&&!!C&&(0,s.createPortal)((0,s.createElement)(kr,{blockName:n,selector:y,css:C,layout:_,style:null==o?void 0:o.style}),f),(0,s.createElement)(e,i({},t,{className:w})))}));function Eb(e){let{clientId:t,stopEditingAsBlock:n}=e;const o=(0,p.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=e(co);return n(t)||o(t,!0)}),[t]);return(0,s.useEffect)((()=>{o||n()}),[o]),null}(0,r.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.layout)&&void 0!==t?t:{})||(0,l.hasBlockSupport)(e,vb)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,r.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",yb),(0,r.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",kb);const Cb=(0,d.createHigherOrderComponent)((e=>t=>{const{getBlockListSettings:n,getSettings:o}=(0,p.useSelect)(co),l=(0,s.useRef)(),{templateLock:r,isLockedByParent:a,isEditingAsBlocks:u}=(0,p.useSelect)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:l}=e(co);return{templateLock:o(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:l()===t.clientId}}),[t.clientId]),{updateSettings:d,updateBlockListSettings:g,__unstableSetTemporarilyEditingAsBlocks:f}=(0,p.useDispatch)(co),v=!a&&"contentOnly"===r,{__unstableMarkNextChangeAsNotPersistent:b,updateBlockAttributes:_}=(0,p.useDispatch)(co),k=(0,s.useCallback)((()=>{b(),_(t.clientId,{templateLock:"contentOnly"}),g(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),d({focusMode:l.current}),f()}),[t.clientId,l,d,g,n,b,_,f]);return v||u?(0,s.createElement)(s.Fragment,null,u&&!v&&(0,s.createElement)(Eb,{clientId:t.clientId,stopEditingAsBlock:k}),(0,s.createElement)(ko,{group:"other"},(0,s.createElement)(m.ToolbarButton,{onClick:()=>{u&&!v?k():(b(),_(t.clientId,{templateLock:void 0}),g(t.clientId,{...n(t.clientId),templateLock:!1}),l.current=o().focusMode,d({focusMode:!0}),f(t.clientId))}},u&&!v?(0,h.__)("Done"):(0,h.__)("Modify"))),(0,s.createElement)(e,i({},t,{className:c()(t.className,u&&"is-content-locked-editing-as-blocks")}))):(0,s.createElement)(e,t)}),"withToolbarControls");(0,r.addFilter)("editor.BlockEdit","core/style/with-block-controls",Cb);function Sb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=(0,l.getBlockSupport)(e,"__experimentalMetadata");return!!(!0===n||null!=n&&n[t])}function wb(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:kf(e)||void 0,style:nb({border:n})}}function Bb(e){const{colors:t}=cf(),n=wb(e),{borderColor:o}=e;if(o){const e=gf({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function Ib(e){var t,n,o,l,r,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=sf("background-color",s),m=sf("color",a),g=Ef(u),h=g||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,g,{[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===(l=d.color)||void 0===l?void 0:l.gradient),"has-link-color":null==d||null===(r=d.elements)||void 0===r||null===(i=r.link)||void 0===i?void 0:i.color})||void 0,style:nb({color:(null==d?void 0:d.color)||{}})}}(0,r.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.metadata)&&void 0!==n&&n.type||Sb(e,"name",!1)&&(e.attributes={...e.attributes,metadata:{type:"object"}}),e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return Sb(t)&&(e.metadata=n.metadata),e})),(0,r.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||Sb(e,"name",!1)&&(e.__experimentalLabel=(e,t)=>{let{context:n}=t;const{metadata:o}=e;if("list-view"===n&&null!=o&&o.name)return o.name}),e}));const xb={};function Tb(e){const{backgroundColor:t,textColor:n,gradient:o}=e,l=Yo("color.palette.custom")||[],r=Yo("color.palette.theme")||[],i=Yo("color.palette.default")||[],a=Yo("color.gradients")||xb,c=(0,s.useMemo)((()=>[...l||[],...r||[],...i||[]]),[l,r,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=Ib(e);if(t){const e=lf(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Cf(u,o)),n){const e=lf(c,n);d.style.color=e.color}return d}function Nb(e){const{style:t}=e;return{style:nb({spacing:(null==t?void 0:t.spacing)||{}})}}function Pb(e){var t;const n=nb({typography:(null==e||null===(t=e.style)||void 0===t?void 0:t.typography)||{}}),o=null!=e&&e.fontFamily?`has-${(0,u.kebabCase)(e.fontFamily)}-font-family`:"";return{className:c()(o,Cv(null==e?void 0:e.fontSize)),style:n}}function Lb(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const Mb=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},Rb=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),Ab=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=Yo("color.palette.custom"),o=Yo("color.palette.theme"),l=Yo("color.palette.default"),r=(0,s.useMemo)((()=>[...n||[],...o||[],...l||[]]),[n,o,l]);return(0,s.createElement)(e,i({},t,{colors:r}))}),"withEditorColorPalette");function Db(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,..."string"==typeof 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=yd(t),o=e=>{let{color:t}=e;return n.contrast(t)},l=Math.max(...e.map(o));return e.find((e=>o(e)===l)).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=Mb(n),l=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,l),e}),{})}createSetColor(e,t){return n=>{const o=rf(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:l}=e;return(0,u.reduce)(n,((e,n,r)=>{const i=lf(l,o[r],o[`custom${Mb(r)}`]),s=t[r];return(null==s?void 0:s.color)===i.color&&s?e[r]=s:e[r]={...i,class:sf(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Ob(e){return function(){const t=Rb(e);for(var n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];return(0,d.createHigherOrderComponent)(Db(o,t),"withCustomColors")}}function zb(){const e=Ab();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(Db(n,e),"withColors")}const Fb=[],Vb=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},Hb=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${Vb(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=Yo("typography.fontSizes")||Fb;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${Vb(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:l}=e;const r=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,r))return null;const i=(0,u.reduce)((0,u.pickBy)(o,r),((e,t,o)=>{const r=n[o],i=yv(l,r,n[t]);return e[o]={...i,class:Cv(r)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Gb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),Ub=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),Wb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"})),$b=[{icon:Gb,title:(0,h.__)("Align text left"),align:"left"},{icon:Ub,title:(0,h.__)("Align text center"),align:"center"},{icon:Wb,title:(0,h.__)("Align text right"),align:"right"}],jb={position:"bottom right",isAlternate:!0},Kb=function(e){let{value:t,onChange:n,alignmentControls:o=$b,label:l=(0,h.__)("Align"),describedBy:r=(0,h.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const p=(0,u.find)(o,(e=>e.align===t)),g=c?m.ToolbarGroup:m.ToolbarDropdownMenu,f=c?{isCollapsed:a}:{toggleProps:{describedBy:r},popoverProps:jb};return(0,s.createElement)(g,i({icon:p?p.icon:(0,h.isRTL)()?Wb:Gb,label:l,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},f))},qb=e=>(0,s.createElement)(Kb,i({},e,{isToolbar:!1})),Yb=e=>(0,s.createElement)(Kb,i({},e,{isToolbar:!0})),Zb=()=>{},Qb={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,p.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(co),l=t();return{selectedBlockName:l?n(l):null,rootClientId:o().rootClientId}}),[]),[o,l,r]=_p(t,Zb),i=(0,s.useMemo)((()=>(e.trim()?Qp(o,l,r,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,l,r]);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)(Su,{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,l.createBlock)(t,n,(0,l.createBlocksFromInnerBlocksTemplate)(o))}}},Xb=window.wp.apiFetch;var Jb=n.n(Xb);const e_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),t_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),n_={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await Jb()({path:(0,im.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ur,{key:"icon",icon:"page"===e.subtype?e_:t_}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)},o_=[];function l_(e){let{completers:t=o_}=e;const{name:n}=go();return(0,s.useMemo)((()=>{let e=t;return(n===(0,l.getDefaultBlockName)()||(0,l.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Qb,n_])),(0,r.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,r.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}const r_=function(e){return(0,s.createElement)(m.Autocomplete,i({},e,{completers:l_(e)}))},i_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),s_=function(e){let{isActive:t,label:n=(0,h.__)("Toggle full height"),onToggle:o,isDisabled:l}=e;return(0,s.createElement)(m.ToolbarButton,{isActive:t,icon:i_,label:n,onClick:()=>o(!t),disabled:l})},a_=()=>{},c_=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=a_,value:o="center",isDisabled:l}=e,r=(0,s.createElement)(m.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,s.createElement)(m.Dropdown,{position:"bottom right",popoverProps:{isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(m.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==au.DOWN||(e.preventDefault(),n())},label:t,icon:r,showTooltip:!0,disabled:l})},renderContent:()=>(0,s.createElement)(m.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},u_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),d_=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,p.useDispatch)(co),{clientId:l,parents:r,hasSelection:i}=(0,p.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(co),l=n();return{parents:o(l),clientId:l,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)(m.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!l&&(0,s.createElement)(ur,{icon:u_,className:"block-editor-block-breadcrumb__separator"})),r.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(m.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,s.createElement)(Om,{clientId:e,maximumLength:35})),(0,s.createElement)(ur,{icon:u_,className:"block-editor-block-breadcrumb__separator"})))),!!l&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Om,{clientId:l,maximumLength:35})))},p_=()=>(0,s.createElement)(m.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(m.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"})),m_=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)(p_,null)))},g_=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:l}=e;return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,h.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{l||e.keyCode!==au.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(m_,null)))}))}},h_=e=>{let{children:t,...n}=e;return V()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,s.createElement)(m.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:g_(n),renderContent:()=>t})},f_=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"})),v_=$c(m.__experimentalTreeGridRow);function b_(e){let{isSelected:t,position:n,level:o,rowCount:l,children:r,className:a,path:u,...d}=e;const p=qc({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(v_,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:l},d),r)}const k_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));function y_(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)(ur,{icon:(0,h.isRTL)()?k_:u_}))}const E_=(0,s.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:l,onToggleExpanded:r,tabIndex:i,onFocus:a,onDragStart:u,onDragEnd:d,draggable:p}=e;const g=Am(o),h=Dm({clientId:o,context:"list-view"}),{isLocked:f}=jg(o);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:l,onKeyDown:function(e){e.keyCode!==au.ENTER&&e.keyCode!==au.SPACE||l(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:p,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(y_,{onClick:r}),(0,s.createElement)(Su,{icon:null==g?void 0:g.icon,showColors:!0}),(0,s.createElement)(m.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(m.__experimentalTruncate,{ellipsizeMode:"auto"},h)),(null==g?void 0:g.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,s.createElement)(m.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},g.anchor)),f&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(ur,{icon:qg})))))})),C_=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:l,isSelected:r,position:a,siblingBlockCount:u,level:d,isExpanded:m,selectedClientIds:g,...h}=e;const{clientId:f}=l,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,p.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(co);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[f]),_=v&&b===f,k=c()("block-editor-list-view-block-contents",{"is-dropping-before":_}),y=g.includes(f)?g:[f];return(0,s.createElement)(zm,{clientIds:y},(e=>{let{draggable:c,onDragStart:p,onDragEnd:g}=e;return(0,s.createElement)(E_,i({ref:t,className:k,block:l,onClick:n,onToggleExpanded:o,isSelected:r,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:p,onDragEnd:g,isExpanded:m},h))}))})),S_=(0,s.createContext)({}),w_=()=>(0,s.useContext)(S_),B_=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:i,selectBlock:a,position:u,level:g,rowCount:f,siblingBlockCount:v,showBlockMovers:b,path:_,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,s.useRef)(null),[S,w]=(0,s.useState)(!1),{clientId:B}=n,{isLocked:I,isContentLocked:x}=jg(B),T=(0,p.useSelect)((e=>!r&&!!x&&e(co).hasSelectedInnerBlock(B,!0)),[x,B,r]),N=T||r&&y[0]===B,P=T||r&&y[y.length-1]===B,{toggleBlockHighlight:L}=(0,p.useDispatch)(co),M=Am(B),R=(0,p.useSelect)((e=>e(co).getBlockName(B)),[B]),A=(0,l.hasBlockSupport)(R,"__experimentalToolbar",!0),D=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,O=((e,t,n)=>(0,h.sprintf)(
1
+ (()=>{var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(n=function(e,t){"use strict";var n,o,l="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))}}),r=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){r=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!l.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]})),l.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",l.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),l=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})),l&&(document.documentElement.scrollTop=l)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),l="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(l<t?"hidden"===n.overflowY&&(c("scroll"),u(),l="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),l="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==l){o=l;var i=r("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=l.get(e);t&&t.destroy()}function a(e){var t=l.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function l(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)){if(n.length){var i=l.apply(null,n);i&&e.push(i)}}else if("object"===r)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?(l.default=l,e.exports=l):void 0===(n=function(){return l}.apply(t,[]))||(e.exports=n)}()},4827:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:(e,t)=>{"use strict";function n(){}function o(e,t,n,o,l){for(var r=0,i=t.length,s=0,a=0;r<i;r++){var c=t[r];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,r&&t[r-1].added){var u=t[r-1];t[r-1]=t[r],t[r]=u}}else{if(!c.added&&l){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 l(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]:{},r=n.callback;"function"==typeof n&&(r=n,n={}),this.options=n;var i=this;function s(e){return r?(setTimeout((function(){r(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 g(){for(var n=-1*u;n<=u;n+=2){var r=void 0,d=p[n-1],m=p[n+1],g=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1<a,f=m&&0<=g&&g<c;if(h||f){if(!h||f&&d.newPos<m.newPos?(r=l(m),i.pushComponent(r.components,void 0,!0)):((r=d).newPos++,i.pushComponent(r.components,!0,void 0)),g=i.extractCommon(r,t,e,n),r.newPos+1>=a&&g+1>=c)return s(o(i,r.components,t,e,i.useLongestToken));p[n]=r}else p[n]=void 0}u++}if(r)!function e(){setTimeout((function(){if(u>d)return r();g()||e()}),0)}();else for(;u<=d;){var h=g();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 l=t.length,r=n.length,i=e.newPos,s=i-o,a=0;i+1<l&&s+1<r&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:(e,t,n)=>{"use strict";var o;t.Kx=function(e,t,n){return l.diff(e,t,n)};var l=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:(e,t,n)=>{"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var l=n.allowHorizontalScroll,r=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;l=void 0===l||l;var p=o.isWindow(t),m=!(!p||!t.frameElement),g=o.offset(e),h=o.outerHeight(e),f=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:g.left-S.left-c,top:g.top-S.top-a},E={left:g.left+f-(S.left+w)+d,top:g.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:g.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:g.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:g.left+f-(v.left+_+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:g.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):r||((i=void 0===i||!!i)?o.scrollTop(t,k.top+y.top):o.scrollTop(t,k.top+E.top)),l&&(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):r||((s=void 0===s||!!s)?o.scrollLeft(t,k.left+y.left):o.scrollLeft(t,k.left+E.left)))}},5425:(e,t,n)=>{"use strict";e.exports=n(1345)},5022: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 l=e.document;"number"!=typeof(n=l.documentElement[o])&&(n=l.body[o])}return n}function l(e){return o(e)}function r(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,l=e.ownerDocument,r=l.body,i=l&&l.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||r.clientLeft||0,top:o-=i.clientTop||r.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=l(o),t.top+=r(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="",l=e.ownerDocument,r=n||l.defaultView.getComputedStyle(e,null);return r&&(o=r.getPropertyValue(t)||r[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,l=o.left,r=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=l,e.runtimeStyle.left=r}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},l=e.style,r=void 0;for(r in t)t.hasOwnProperty(r)&&(o[r]=l[r],l[r]=t[r]);for(r in n.call(e),t)t.hasOwnProperty(r)&&(l[r]=o[r])}function g(e,t,n){var o=0,l=void 0,r=void 0,i=void 0;for(r=0;r<t.length;r++)if(l=t[r])for(i=0;i<n.length;i++){var s;s="border"===l?l+n[i]+"Width":l+n[i],o+=parseFloat(c(e,s))||0}return o}function h(e){return null!=e&&e==e.window}var f={};function v(e,t,n){if(h(e))return"width"===t?f.viewportWidth(e):f.viewportHeight(e);if(9===e.nodeType)return"width"===t?f.docWidth(e):f.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],l="width"===t?e.offsetWidth:e.offsetHeight,r=(c(e),d(e)),i=0;(null==l||l<=0)&&(l=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=r?1:-1);var s=void 0!==l||r,a=l||i;if(-1===n)return s?a-g(e,["border","padding"],o):i;if(s){var u=2===n?-g(e,["border"],o):g(e,["margin"],o);return a+(1===n?0:u)}return i+g(e,p.slice(n),o)}u(["Width","Height"],(function(e){f["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],f["viewport"+e](n))},f["viewport"+e]=function(t){var n="client"+e,o=t.document,l=o.body,r=o.documentElement[n];return"CSS1Compat"===o.compatMode&&r||l&&l[n]||r}}));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 l=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==l?("number"==typeof l&&(l+="px"),void(e.style[t]=l)):c(e,t);for(var r in t)t.hasOwnProperty(r)&&k(e,r,t[r])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);f["outer"+t]=function(t,n){return t&&_(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];f[e]=function(t,o){return void 0===o?t&&_(t,e,-1):t?(c(t),d(t)&&(o+=g(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={},l=void 0,r=void 0;for(r in t)t.hasOwnProperty(r)&&(l=parseFloat(k(e,r))||0,o[r]=l+t[r]-n[r]);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 l(e);window.scrollTo(t,r(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(l(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},f)},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:(e,t,n)=>{var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var l=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),l?e.style.lineHeight=l: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 r=e.nodeName,i=document.createElement(r);i.innerHTML="&nbsp;","TEXTAREA"===r.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},5372:(e,t,n)=>{"use strict";var o=n(9567);function l(){}function r(){}r.resetWarningCache=l,e.exports=function(){function e(e,t,n,l,r,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:r,resetWarningCache:l};return n.PropTypes=n,n}},2652:(e,t,n)=>{e.exports=n(5372)()},9567:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,l=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 __)}),r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);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 l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&(n[o[l]]=e[o[l]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return l(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),l=(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",r({},a,{onChange:this.onChange,style:u?r({},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)}}),l)},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,r({},e,{innerRef:t}))}))},773:(e,t,n)=>{"use strict";var o=n(5438);t.Z=o.TextareaAutosize},4793:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),l=new RegExp(n,""),r=function(e){return e.replace(o,(function(e){return t[e]}))};e.exports=r,e.exports.has=function(e){return!!e.match(l)},e.exports.remove=r},3124: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?l(d):d,m={},g=!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&&(g=!1)},delete:function(e){delete h.parent.node[h.key],e&&(g=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key],e&&(g=!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(){g=!1}};if(!u)return h;function f(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=r(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}f();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),g?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),f(),a(h.keys,(function(t,l){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var r=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=r.node),r.isLast=l==h.keys.length-1,r.isFirst=0==l,m.post&&m.post.call(h,r),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(e).node}function l(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(r(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 l=e[o];c.call(n,l)||(n[l]={}),n=n[l]}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=l(o);return e.push(o),t.push(s),a(r(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var r=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(r(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),l=new n(t);return l[e].apply(l,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:e=>{"use strict";e.exports=window.React}},t={};function n(o){var l=t[o];if(void 0!==l)return l.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentControl:()=>e_,AlignmentToolbar:()=>t_,Autocomplete:()=>d_,BlockAlignmentControl:()=>Lr,BlockAlignmentToolbar:()=>Mr,BlockBreadcrumb:()=>v_,BlockColorsStyleSelector:()=>E_,BlockContextProvider:()=>jr,BlockControls:()=>ko,BlockEdit:()=>Zr,BlockEditorKeyboardShortcuts:()=>_C,BlockEditorProvider:()=>Nu,BlockFormatControls:()=>_o,BlockIcon:()=>wu,BlockInspector:()=>pC,BlockList:()=>Kh,BlockMover:()=>Xm,BlockNavigationDropdown:()=>U_,BlockPreview:()=>ap,BlockSelectionClearer:()=>Mu,BlockSettingsMenu:()=>ch,BlockSettingsMenuControls:()=>lh,BlockStyles:()=>q_,BlockTitle:()=>Vm,BlockToolbar:()=>bh,BlockTools:()=>hC,BlockVerticalAlignmentControl:()=>Yl,BlockVerticalAlignmentToolbar:()=>Zl,ButtonBlockAppender:()=>xm,ButtonBlockerAppender:()=>Im,ColorPalette:()=>dk,ColorPaletteControl:()=>pk,ContrastChecker:()=>Uf,CopyHandler:()=>Fg,DefaultBlockAppender:()=>wm,FontSizePicker:()=>Tv,InnerBlocks:()=>Gh,Inserter:()=>Sm,InspectorAdvancedControls:()=>fl,InspectorControls:()=>vl,JustifyContentControl:()=>Jl,JustifyToolbar:()=>er,LineHeightControl:()=>dv,MediaPlaceholder:()=>Jy,MediaReplaceFlow:()=>Ky,MediaUpload:()=>Uy,MediaUploadCheck:()=>Wy,MultiSelectScrollIntoView:()=>kC,NavigableToolbar:()=>tg,ObserveTyping:()=>SC,PanelColorSettings:()=>eE,PlainText:()=>RE,RichText:()=>PE,RichTextShortcut:()=>OE,RichTextToolbarButton:()=>zE,SETTINGS_DEFAULTS:()=>v,SkipToSelectedBlock:()=>nC,ToolSelector:()=>HE,Typewriter:()=>xC,URLInput:()=>ay,URLInputButton:()=>$E,URLPopover:()=>Zy,Warning:()=>Xr,WritingFlow:()=>Ku,__experimentalBlockAlignmentMatrixControl:()=>h_,__experimentalBlockFullHeightAligmentControl:()=>m_,__experimentalBlockPatternSetup:()=>ik,__experimentalBlockPatternsList:()=>Np,__experimentalBlockVariationPicker:()=>Z_,__experimentalBlockVariationTransforms:()=>ck,__experimentalBorderRadiusControl:()=>af,__experimentalColorGradientControl:()=>zf,__experimentalColorGradientSettingsDropdown:()=>Gf,__experimentalDateFormatPicker:()=>hk,__experimentalDuotoneControl:()=>fb,__experimentalFontAppearanceControl:()=>uv,__experimentalFontFamilyControl:()=>yv,__experimentalGetBorderClassesAndStyles:()=>Pb,__experimentalGetColorClassesAndStyles:()=>Mb,__experimentalGetElementClassName:()=>DC,__experimentalGetGapCSSValue:()=>Vl,__experimentalGetGradientClass:()=>If,__experimentalGetGradientObjectByGradientValue:()=>Tf,__experimentalGetMatchingVariation:()=>zC,__experimentalGetSpacingClassesAndStyles:()=>Db,__experimentalImageEditingProvider:()=>Hk,__experimentalImageEditor:()=>Qk,__experimentalImageSizeControl:()=>ey,__experimentalImageURLInputUI:()=>JE,__experimentalInspectorPopoverHeader:()=>MC,__experimentalLayoutStyle:()=>yr,__experimentalLetterSpacingControl:()=>Xv,__experimentalLibrary:()=>vC,__experimentalLinkControl:()=>Fy,__experimentalLinkControlSearchInput:()=>Ny,__experimentalLinkControlSearchItem:()=>vy,__experimentalLinkControlSearchResults:()=>Cy,__experimentalListView:()=>H_,__experimentalPanelColorGradientSettings:()=>yk,__experimentalPreviewOptions:()=>eC,__experimentalPublishDateTimePicker:()=>RC,__experimentalRecursionProvider:()=>NC,__experimentalResponsiveBlockControl:()=>DE,__experimentalSpacingSizesControl:()=>ll,__experimentalTextDecorationControl:()=>Vv,__experimentalTextTransformControl:()=>qv,__experimentalUnitControl:()=>GE,__experimentalUseBlockOverlayActive:()=>mu,__experimentalUseBlockPreview:()=>cp,__experimentalUseBorderProps:()=>Lb,__experimentalUseColorProps:()=>Ab,__experimentalUseCustomSides:()=>Dl,__experimentalUseGradient:()=>Pf,__experimentalUseHasRecursion:()=>PC,__experimentalUseMultipleOriginColorsAndGradients:()=>gf,__experimentalUseResizeCanvas:()=>tC,__unstableBlockNameContext:()=>vh,__unstableBlockSettingsMenuFirstItem:()=>jg,__unstableBlockToolbarLastItem:()=>Mg,__unstableDuotoneFilter:()=>np,__unstableDuotoneStylesheet:()=>ep,__unstableDuotoneUnsetStylesheet:()=>tp,__unstableEditorStyles:()=>Xd,__unstableGetValuesFromColors:()=>Jd,__unstableIframe:()=>Zu,__unstableInserterMenuExtension:()=>mm,__unstablePresetDuotoneFilter:()=>op,__unstableRichTextInputEvent:()=>FE,__unstableUseBlockSelectionClearer:()=>Lu,__unstableUseClipboardHandler:()=>zg,__unstableUseMouseMoveTypingReset:()=>EC,__unstableUseTypewriter:()=>IC,__unstableUseTypingObserver:()=>CC,createCustomColorsHOC:()=>Ub,getColorClassName:()=>pf,getColorObjectByAttributeValues:()=>uf,getColorObjectByColorValue:()=>df,getFontSize:()=>Bv,getFontSizeClass:()=>xv,getFontSizeObjectByValue:()=>Iv,getGradientSlugByValue:()=>Nf,getGradientValueBySlug:()=>xf,getPxFromCssUnit:()=>qC,getTypographyClassesAndStyles:()=>Ob,store:()=>co,storeConfig:()=>ao,transformStyles:()=>Yd,useBlockDisplayInformation:()=>zm,useBlockEditContext:()=>go,useBlockProps:()=>gu,useCachedTruthy:()=>zb,useInnerBlocksProps:()=>Hh,useSetting:()=>Yo,withColorContext:()=>uk,withColors:()=>Wb,withFontSizes:()=>Kb});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:()=>Vt,__experimentalGetAllowedBlocks:()=>_t,__experimentalGetAllowedPatterns:()=>Ct,__experimentalGetBlockListSettingsForBlocks:()=>Tt,__experimentalGetDirectInsertBlock:()=>kt,__experimentalGetGlobalBlocksByName:()=>ee,__experimentalGetLastBlockAttributeChanges:()=>Lt,__experimentalGetParsedPattern:()=>yt,__experimentalGetPatternTransformItems:()=>wt,__experimentalGetPatternsByBlockTypes:()=>St,__experimentalGetReusableBlockTitle:()=>Nt,__unstableGetBlockWithoutInnerBlocks:()=>K,__unstableGetClientIdWithClientIdsTree:()=>Y,__unstableGetClientIdsTree:()=>Z,__unstableGetContentLockingParent:()=>Wt,__unstableGetEditorMode:()=>At,__unstableGetSelectedBlocksWithPartialSelection:()=>Re,__unstableGetTemporarilyEditingAsBlocks:()=>$t,__unstableGetVisibleBlocks:()=>Ut,__unstableHasActiveBlockOverlayActive:()=>jt,__unstableIsFullySelected:()=>Ne,__unstableIsLastBlockChangeIgnored:()=>Pt,__unstableIsSelectionCollapsed:()=>Pe,__unstableIsSelectionMergeable:()=>Me,__unstableIsWithinBlockOverlay:()=>Kt,__unstableSelectionHasUnmergeableBlock:()=>Le,areInnerBlocksControlled:()=>Ft,canEditBlock:()=>ct,canInsertBlockType:()=>ot,canInsertBlocks:()=>lt,canLockBlockType:()=>ut,canMoveBlock:()=>st,canMoveBlocks:()=>at,canRemoveBlock:()=>rt,canRemoveBlocks:()=>it,didAutomaticChange:()=>Ot,getAdjacentBlockClientId:()=>fe,getBlock:()=>j,getBlockAttributes:()=>$,getBlockCount:()=>ne,getBlockHierarchyRootClientId:()=>ge,getBlockIndex:()=>De,getBlockInsertionPoint:()=>Ze,getBlockListSettings:()=>Bt,getBlockMode:()=>Ue,getBlockName:()=>U,getBlockOrder:()=>Ae,getBlockParents:()=>pe,getBlockParentsByBlockName:()=>me,getBlockRootClientId:()=>de,getBlockSelectionEnd:()=>ie,getBlockSelectionStart:()=>re,getBlockTransformItems:()=>vt,getBlocks:()=>q,getBlocksByClientId:()=>te,getClientIdsOfDescendants:()=>Q,getClientIdsWithDescendants:()=>X,getDraggedBlockClientIds:()=>je,getFirstMultiSelectedBlockClientId:()=>Ce,getGlobalBlockCount:()=>J,getInserterItems:()=>ft,getLastMultiSelectedBlockClientId:()=>Se,getLowestCommonAncestorWithSelectedBlock:()=>he,getMultiSelectedBlockClientIds:()=>ye,getMultiSelectedBlocks:()=>Ee,getMultiSelectedBlocksEndClientId:()=>Te,getMultiSelectedBlocksStartClientId:()=>xe,getNextBlockClientId:()=>be,getPreviousBlockClientId:()=>ve,getSelectedBlock:()=>ue,getSelectedBlockClientId:()=>ce,getSelectedBlockClientIds:()=>ke,getSelectedBlockCount:()=>se,getSelectedBlocksInitialCaretPosition:()=>_e,getSelectionEnd:()=>le,getSelectionStart:()=>oe,getSettings:()=>It,getTemplate:()=>Je,getTemplateLock:()=>et,hasBlockMovingClientId:()=>Dt,hasInserterItems:()=>bt,hasMultiSelection:()=>Ve,hasSelectedBlock:()=>ae,hasSelectedInnerBlock:()=>ze,isAncestorBeingDragged:()=>qe,isAncestorMultiSelected:()=>Ie,isBlockBeingDragged:()=>Ke,isBlockHighlighted:()=>zt,isBlockInsertionPointVisible:()=>Qe,isBlockMultiSelected:()=>Be,isBlockSelected:()=>Oe,isBlockValid:()=>W,isBlockVisible:()=>Gt,isBlockWithinSelection:()=>Fe,isCaretWithinFormattedText:()=>Ye,isDraggingBlocks:()=>$e,isFirstMultiSelectedBlock:()=>we,isLastBlockChangePersistent:()=>xt,isMultiSelecting:()=>He,isNavigationMode:()=>Rt,isSelectionEnabled:()=>Ge,isTyping:()=>We,isValidTemplate:()=>Xe,wasBlockJustInserted:()=>Ht});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:()=>xn,__unstableExpandSelection:()=>Nn,__unstableMarkAutomaticChange:()=>Yn,__unstableMarkLastChangeAsPersistent:()=>Kn,__unstableMarkNextChangeAsNotPersistent:()=>qn,__unstableSaveReusableBlock:()=>jn,__unstableSetEditorMode:()=>Qn,__unstableSetTemporarilyEditingAsBlocks:()=>io,__unstableSplitSelection:()=>Tn,clearSelectedBlock:()=>dn,duplicateBlocks:()=>Jn,enterFormattedText:()=>Vn,exitFormattedText:()=>Hn,flashBlock:()=>oo,hideInsertionPoint:()=>wn,insertAfterBlock:()=>to,insertBeforeBlock:()=>eo,insertBlock:()=>En,insertBlocks:()=>Cn,insertDefaultBlock:()=>Un,mergeBlocks:()=>Pn,moveBlockToPosition:()=>yn,moveBlocksDown:()=>vn,moveBlocksToPosition:()=>kn,moveBlocksUp:()=>bn,multiSelect:()=>un,receiveBlocks:()=>tn,removeBlock:()=>Mn,removeBlocks:()=>Ln,replaceBlock:()=>hn,replaceBlocks:()=>gn,replaceInnerBlocks:()=>Rn,resetBlocks:()=>Xt,resetSelection:()=>en,selectBlock:()=>ln,selectNextBlock:()=>sn,selectPreviousBlock:()=>rn,selectionChange:()=>Gn,setBlockMovingClientId:()=>Xn,setBlockVisibility:()=>ro,setHasControlledInnerBlocks:()=>lo,setNavigationMode:()=>Zn,setTemplateValidity:()=>Bn,showInsertionPoint:()=>Sn,startDraggingBlocks:()=>zn,startMultiSelect:()=>an,startTyping:()=>Dn,stopDraggingBlocks:()=>Fn,stopMultiSelect:()=>cn,stopTyping:()=>On,synchronizeTemplate:()=>In,toggleBlockHighlight:()=>no,toggleBlockMode:()=>An,toggleSelection:()=>pn,updateBlock:()=>on,updateBlockAttributes:()=>nn,updateBlockListSettings:()=>Wn,updateSettings:()=>$n,validateBlocksToTemplate:()=>Jt});const l=window.wp.blocks,r=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,r.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,l.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));const s=window.wp.element;var a=n(4403),c=n.n(a);const u=window.lodash,d=window.wp.compose,p=window.wp.data,m=window.wp.components,g={default:(0,m.createSlotFill)("BlockControls"),block:(0,m.createSlotFill)("BlockControlsBlock"),inline:(0,m.createSlotFill)("BlockFormatControls"),other:(0,m.createSlotFill)("BlockControlsOther"),parent:(0,m.createSlotFill)("BlockControlsParent")},h=window.wp.i18n,f={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,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!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 l=[...e];return l.splice(t,o),b(l,e.slice(t,t+o),n)}const k=e=>e;function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:l}=e;n[t].push(o),Object.assign(n,y(l,o))})),n}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},E(n.innerBlocks,n.clientId))),{})}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...l}=o.shift();o.push(...e),n[l.clientId]=t(l)}return n}function S(e){return C(e,(e=>(0,u.omit)(e,"attributes")))}function w(e){return C(e,(e=>e.attributes))}function B(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)(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function I(e,t){const n={},o=[...t],l=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),l.push(...e.innerBlocks)}for(const e of l)n[e.clientId]={};for(const t of l)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function x(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const l=new Set([]),r=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){r.add(n);break}l.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of l)t[e]={...t[e]};for(const n of l)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of r)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const T=(0,u.flow)(p.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,l)=>{const{name:r}=t.byClientId[l];return"core/block"===r&&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=I(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=x(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=x(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=I(o,n.blocks);o.tree=x(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const l=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||l.push(t.parents[e]);o.tree=x(o,o.tree,l,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const l of n.clientIds)void 0===t.parents[l]||""!==t.parents[l]&&!o.byClientId[t.parents[l]]||e.push(t.parents[l]);o.tree=x(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=x(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=Object.keys((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=x(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let l=0;l<o.length;l++)!t.order[o[l]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[l]]||(o===e&&(o=[...o]),o.push(...t.order[o[l]]));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,...l}=e.shift();e.push(...n),t.controlledInnerBlocks[l.clientId]&&(o[l.clientId]=!0)}}let l=t;t.order[n.rootClientId]&&(l=e(l,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let r=l;return n.blocks.length&&(r=e(r,{...n,type:"INSERT_BLOCKS",index:0}),r.order={...r.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})},r.tree={...r.tree,...(0,u.reduce)(o,((e,n,o)=>{const l=`controlled||${o}`;return t.tree[l]&&(e[l]=t.tree[l]),e}),{})}),r}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:S(n.blocks),attributes:w(n.blocks),order:y(n.blocks),parents:E(n.blocks),controlledInnerBlocks:{}},o=I(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,l)=>{let r=e(o,l);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===l.type||n;if(o===r&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===l.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...r,isPersistentChange:e}}return r={...r,isPersistentChange:i?!n:!B(l,t)},t=l,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===l.type,r}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const l=e(n,o);return l!==n&&(l.isIgnoredChange=t.has(o.type)),l}}),(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,...S(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),...S(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,...w(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,l)=>{var r,i;return n!==t[l]&&((t=(r=e[o])===(i=t)?{...r}:i)[l]=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),...w(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=y(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]||[],l=y(t.blocks,n),{index:r=o.length}=t;return{...e,...l,[n]:b(o,l[n],r)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:l}=t,{index:r=e[o].length}=t;if(n===o){const t=e[o].indexOf(l[0]);return{...e,[o]:_(e[o],t,r,l.length)}}return{...e,[n]:(0,u.without)(e[n],...l),[o]:b(e[o],l,r)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,l=n[0],r=e[o];if(!r.length||l===r[0])return e;const i=r.indexOf(l);return{...e,[o]:_(r,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,l=n[0],r=n[n.length-1],i=e[o];if(!i.length||r===i[i.length-1])return e;const s=i.indexOf(l);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=y(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,...E(t.blocks)};case"INSERT_BLOCKS":return{...e,...E(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),...E(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 N(){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}const P=(0,p.combineReducers)({blocks:T,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},selection:function(){var e,t,n,o;let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;switch(r.type){case"SELECTION_CHANGE":return r.clientId?{selectionStart:{clientId:r.clientId,attributeKey:r.attributeKey,offset:r.startOffset},selectionEnd:{clientId:r.clientId,attributeKey:r.attributeKey,offset:r.endOffset}}:{selectionStart:r.start||l.selectionStart,selectionEnd:r.end||l.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=r;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=r;return a===(null===(e=l.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=l.selectionEnd)||void 0===t?void 0:t.clientId)?l:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==l||null===(n=l.selectionStart)||void 0===n?void 0:n.clientId,d=null==l||null===(o=l.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return l;if(!r.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!r.blocks.some((e=>e.clientId===d)))return{...l,selectionEnd:l.selectionStart}}return{selectionStart:N(l.selectionStart,r),selectionEnd:N(l.selectionEnd,r)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,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:r}=n,i=(0,p.select)(l.store).getActiveBlockVariation(r,o);let s=null!=i&&i.name?`${r}/${i.name}`:r;const a={name:s};return"core/block"===r&&(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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;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 e},editorMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"edit",t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode: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_EDITOR_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"SET_BLOCK_VISIBILITY":case"START_TYPING":case"STOP_TYPING":case"UPDATE_BLOCK_LIST_SETTINGS":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},temporarilyEditingAsBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},blockVisibility:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}});var L={};function M(e){return[e]}function R(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 A(e,t){var n,o=t||M;function l(e){var t,o,l,r,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):(l=new WeakMap,s.set(o,l),s=l)}return s.has(L)||((r=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(L,r)),s.get(L)}function r(){n=new WeakMap}function i(){var t,n,r,i,s,a=arguments.length;for(i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];for((t=l(s=o.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!R(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(R(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return i.getDependants=o,i.clear=r,r(),i}const D=window.wp.primitives,O=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),z=window.wp.richText,F=window.wp.deprecated;var V=n.n(F);function H(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const G=[];function U(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:l}=n;return l?`core/social-link-${l}`:o}return n?n.name:null}function W(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function $(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function j(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const K=A(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:$(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function q(e,t){var n;const o=t&&Ft(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||G}const Y=A(((e,t)=>({clientId:t,innerBlocks:Z(e,t)})),(e=>[e.blocks.order])),Z=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Ae(e,t),(t=>Y(e,t)))}),(e=>[e.blocks.order])),Q=A(((e,t)=>{const n=[];for(const o of t)for(const t of Ae(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Ae(e))t.push(n,...Q(e,[n]));return t}),(e=>[e.blocks.order])),J=A(((e,t)=>{const n=X(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])),ee=A(((e,t)=>{if(!t)return G;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:G}),(e=>[e.blocks.order,e.blocks.byClientId])),te=A(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>j(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function ne(e,t){return Ae(e,t).length}function oe(e){return e.selection.selectionStart}function le(e){return e.selection.selectionEnd}function re(e){return e.selection.selectionStart.clientId}function ie(e){return e.selection.selectionEnd.clientId}function se(e){return ye(e).length||(e.selection.selectionStart.clientId?1:0)}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ue(e){const t=ce(e);return t?j(e,t):null}function de(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const pe=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let l=t;for(;e.blocks.parents[l];)l=e.blocks.parents[l],o.push(l);return n?o:o.reverse()}),(e=>[e.blocks.parents])),me=A((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const l=pe(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(l,(t=>({id:t,name:U(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 ge(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function he(e,t){const n=ce(e),o=[...pe(e,t),t],l=[...pe(e,n),n];let r;const i=Math.min(o.length,l.length);for(let e=0;e<i&&o[e]===l[e];e++)r=o[e];return r}function fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ce(e)),void 0===t&&(t=n<0?Ce(e):Se(e)),!t)return null;const o=de(e,t);if(null===o)return null;const{order:l}=e.blocks,r=l[o],i=r.indexOf(t),s=i+1*n;return s<0||s===r.length?null:r[s]}function ve(e,t){return fe(e,t,-1)}function be(e,t){return fe(e,t,1)}function _e(e){return e.initialPosition}const ke=A((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return G;if(t.clientId===n.clientId)return[t.clientId];const o=de(e,t.clientId);if(null===o)return G;const l=Ae(e,o),r=l.indexOf(t.clientId),i=l.indexOf(n.clientId);return r>i?l.slice(i,r+1):l.slice(r,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ye(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?G:ke(e)}const Ee=A((e=>{const t=ye(e);return t.length?t.map((t=>j(e,t))):G}),(e=>[...ke.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ce(e){return ye(e)[0]||null}function Se(e){const t=ye(e);return t[t.length-1]||null}function we(e,t){return Ce(e)===t}function Be(e,t){return-1!==ye(e).indexOf(t)}const Ie=A(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=de(e,n),o=Be(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ne(e){const t=oe(e),n=le(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Pe(e){const t=oe(e),n=le(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Le(e){return ke(e).some((t=>{const n=U(e,t);return!(0,l.getBlockType)(n).merge}))}function Me(e,t){const n=oe(e),o=le(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const r=de(e,n.clientId);if(r!==de(e,o.clientId))return!1;const i=Ae(e,r);let s,a;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,a=n):(s=n,a=o);const c=t?a.clientId:s.clientId,u=t?s.clientId:a.clientId,d=U(e,c);if(!(0,l.getBlockType)(d).merge)return!1;const p=j(e,u);if(p.name===d)return!0;const m=(0,l.switchToBlockType)(p,d);return m&&m.length}const Re=e=>{const t=oe(e),n=le(e);if(t.clientId===n.clientId)return G;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return G;const o=de(e,t.clientId);if(o!==de(e,n.clientId))return G;const r=Ae(e,o),i=r.indexOf(t.clientId),s=r.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=j(e,a.clientId),d=(0,l.getBlockType)(u.name),p=j(e,c.clientId),m=(0,l.getBlockType)(p.name),g=u.attributes[a.attributeKey],h=p.attributes[c.attributeKey],f=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,z.create)({html:g,...H(f)}),_=(0,z.create)({html:h,...H(v)});return b=(0,z.remove)(b,0,a.offset),_=(0,z.remove)(_,c.offset,_.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,z.toHTMLString)({value:b,...H(f)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,z.toHTMLString)({value:_,...H(v)})}}]};function Ae(e,t){return e.blocks.order[t||""]||G}function De(e,t){return Ae(e,de(e,t)).indexOf(t)}function Oe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Ae(e,t),(t=>Oe(e,t)||Be(e,t)||n&&ze(e,t,n)))}function Fe(e,t){if(!t)return!1;const n=ye(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function He(e){return e.isMultiSelecting}function Ge(e){return e.isSelectionEnabled}function Ue(e,t){return e.blocksMode[t]||"visual"}function We(e){return e.isTyping}function $e(e){return!!e.draggedBlocks.length}function je(e){return e.draggedBlocks}function Ke(e,t){return e.draggedBlocks.includes(t)}function qe(e,t){if(!$e(e))return!1;const n=pe(e,t);return(0,u.some)(n,(t=>Ke(e,t)))}function Ye(){return V()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Ze(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:l}}=e;if(null!==o)return o;const{clientId:r}=l;return r?(t=de(e,r)||void 0,n=De(e,l.clientId)+1):n=Ae(e).length,{rootClientId:t,index:n}}function Qe(e){return null!==e.insertionPoint}function Xe(e){return e.template.isValid}function Je(e){return e.settings.template}function et(e,t){if(!t)return e.settings.templateLock;const n=Bt(e,t);return n?n.templateLock:void 0}const tt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},nt=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,l.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=It(e),s=tt(i,t,!0);if(!s)return!1;const a=!!et(e,o);if(a)return!1;const c=Bt(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=tt(d,t),m=n.parent,g=U(e,o),h=tt(m,g);let f=!0;const v=n.ancestor;if(v){const t=[o,...pe(e,o)];f=(0,u.some)(t,(t=>tt(v,U(e,t))))}const b=f&&(null===p&&null===h||!0===p||!0===h);return b?(0,r.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:j.bind(null,e),getBlockParentsByBlockName:me.bind(null,e)}):b},ot=A(nt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ot(e,U(e,t),n)))}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return!0;const{lock:l}=o,r=!!et(e,n);return void 0===l||void 0===(null==l?void 0:l.remove)?!r:!(null!=l&&l.remove)}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>rt(e,t,n)))}function st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return;const{lock:l}=o,r="all"===et(e,n);return void 0===l||void 0===(null==l?void 0:l.move)?!r:!(null!=l&&l.move)}function at(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>st(e,t,n)))}function ct(e,t){const n=$(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function ut(e,t){var n;return!!(0,l.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function dt(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 pt=(e,t,n)=>!!(0,l.hasBlockSupport)(t,"inserter",!0)&&nt(e,t.name,n),mt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:l,count:r=0}=dt(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:gt(l,r)}},gt=(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}},ht=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let r=!1;(0,l.hasBlockSupport)(t.name,"multiple",!0)||(r=(0,u.some)(te(e,X(e)),{name:t.name}));const{time:i,count:s=0}=dt(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:r,frecency:gt(i,s)};if("transform"===n)return a;const c=(0,l.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},ft=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=ht(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,r=t=>{let n=O;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,r=(0,l.getBlockType)(t+o);r&&(n=r.icon)}}const r=`core/block/${t.id}`,{time:i,count:a=0}=dt(e,r)||{},c=gt(i,a);return{id:r,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,l.getBlockTypes)().filter((n=>pt(e,n,t))).map(n),a=nt(e,"core/block",t)?Mt(e).map(r):[],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 l=mt(e,n);t.push(...o.map(l))}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,Mt(e),(0,l.getBlockTypes)()])),vt=A((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=(0,u.castArray)(t),[i]=r,s=ht(e,{buildScope:"transform"}),a=(0,l.getBlockTypes)().filter((t=>pt(e,t,o))).map(s),c=Object.fromEntries(Object.entries(a).map((e=>{let[,t]=e;return[t.name,t]})));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,h.__)("Unwrap"),icon:null===(n=c[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const d=(0,l.getPossibleBlockTransformations)(r).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return(0,u.orderBy)(d,(e=>c[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,l.getBlockTypes)()])),bt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,l.getBlockTypes)(),(n=>pt(e,n,t)));if(n)return!0;const o=nt(e,"core/block",t)&&Mt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Mt(e),(0,l.getBlockTypes)()])),_t=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,l.getBlockTypes)(),(n=>pt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,l.getBlockTypes)()])),kt=A((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const l=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,r=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return l&&r?"function"==typeof r?r(j(e,o))?l:null:l:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),yt=A(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,l.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),Et=A((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=It(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return yt(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!tt(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])),Ct=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Et(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return ot(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),St=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;const o=Ct(e,n),l=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=>l.includes(e)))}))}),((e,t)=>[...Ct.getDependants(e,t)])),wt=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Ft(e,n)})))return G;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return St(e,o,n)}),((e,t)=>[...St.getDependants(e,t)]));function Bt(e,t){return e.blockListSettings[t]}function It(e){return e.settings}function xt(e){return e.blocks.isPersistentChange}const Tt=A((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])),Nt=A(((e,t)=>{var n;const o=(0,u.find)(Mt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Mt(e)]));function Pt(e){return e.blocks.isIgnoredChange}function Lt(e){return e.lastBlockAttributesChange}function Mt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:G}function Rt(e){return"navigation"===e.editorMode}function At(e){return e.editorMode}function Dt(e){return e.hasBlockMovingClientId}function Ot(e){return!!e.automaticChangeStatus}function zt(e,t){return e.highlightedBlock===t}function Ft(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Vt=A(((e,t)=>{if(!t.length)return null;const n=ce(e);if(t.includes(U(e,n)))return n;const o=ye(e),l=me(e,n||o[0],t);return l?l[l.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Ht(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}function Gt(e,t){var n,o;return null===(n=null===(o=e.blockVisibility)||void 0===o?void 0:o[t])||void 0===n||n}const Ut=A((e=>new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])))),(e=>[e.blockVisibility])),Wt=A(((e,t)=>{let n,o=t;for(;e.blocks.parents[o];)o=e.blocks.parents[o],"contentOnly"===et(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function $t(e){return e.temporarilyEditingAsBlocks}function jt(e,t){if(!ct(e,t))return!0;const n=At(e);if("zoom-out"===n&&!de(e,t))return!0;const o=(0,l.hasBlockSupport)(U(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&Ft(e,t))&&!Oe(e,t)&&!ze(e,t,!0)}function Kt(e,t){let n=e.blocks.parents[t];for(;n;){if(jt(e,n))return!0;n=e.blocks.parents[n]}return!1}const qt=window.wp.a11y,Yt="†";function Zt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Yt)}))}const Qt=e=>Array.isArray(e)?e:[e],Xt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Jt(e))},Jt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getTemplate(),i=n.getTemplateLock(),s=!r||"all"!==i||(0,l.doBlocksMatchTemplate)(e,r);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function en(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function tn(e){return V()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function nn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Qt(e),attributes:t,uniqueByBlock:n}}function on(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function ln(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const rn=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getPreviousBlockClientId(e);l&&o.selectBlock(l,-1)},sn=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getNextBlockClientId(e);l&&o.selectBlock(l)};function an(){return{type:"START_MULTI_SELECT"}}function cn(){return{type:"STOP_MULTI_SELECT"}}const un=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:l,dispatch:r}=o;if(l.getBlockRootClientId(e)!==l.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=l.getSelectedBlockCount();(0,qt.speak)((0,h.sprintf)(
2
  /* translators: %s: number of selected blocks */
3
  (0,h._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function dn(){return{type:"CLEAR_SELECTED_BLOCK"}}function pn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function mn(e,t){var n,o;const r=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,l.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!r[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=r[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const gn=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,l=arguments.length>4?arguments[4]:void 0;return r=>{let{select:i,dispatch:s}=r;e=Qt(e),t=mn(Qt(t),i.getSettings());const a=i.getBlockRootClientId(e[0]);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:l}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function hn(e,t){return gn(e,t)}const fn=e=>(t,n)=>o=>{let{select:l,dispatch:r}=o;l.canMoveBlocks(t,n)&&r({type:e,clientIds:Qt(t),rootClientId:n})},vn=fn("MOVE_BLOCKS_DOWN"),bn=fn("MOVE_BLOCKS_UP"),kn=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 l=>{let{select:r,dispatch:i}=l;if(r.canMoveBlocks(e,t)){if(t!==n){if(!r.canRemoveBlocks(e,t))return;if(!r.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function yn(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 kn([e],t,n,o)}function En(e,t,n,o,l){return Cn([e],t,n,o,0,l)}const Cn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;null!==l&&"object"==typeof l&&(r=l,l=0,V()("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=mn(Qt(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?l:null,meta:r})}};function Sn(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 wn(){return{type:"HIDE_INSERTION_POINT"}}function Bn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const In=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),r=t.getTemplate(),i=(0,l.synchronizeBlocksWithTemplate)(o,r);n.resetBlocks(i)},xn=e=>t=>{let{registry:n,select:o,dispatch:r}=t;const i=o.getSelectionStart(),s=o.getSelectionEnd();if(i.clientId===s.clientId)return;if(!i.attributeKey||!s.attributeKey||void 0===i.offset||void 0===s.offset)return!1;const a=o.getBlockRootClientId(i.clientId);if(a!==o.getBlockRootClientId(s.clientId))return;const c=o.getBlockOrder(a);let u,d;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(u=s,d=i):(u=i,d=s);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,l.getBlockType)(m.name);if(!g.merge)return;const h=u,f=d,v=o.getBlock(h.clientId),b=(0,l.getBlockType)(v.name),_=o.getBlock(f.clientId),k=(0,l.getBlockType)(_.name),y=v.attributes[h.attributeKey],E=_.attributes[f.attributeKey],C=b.attributes[h.attributeKey],S=k.attributes[f.attributeKey];let w=(0,z.create)({html:y,...H(C)}),B=(0,z.create)({html:E,...H(S)});w=(0,z.remove)(w,h.offset,w.text.length),B=(0,z.insert)(B,Yt,0,f.offset);const I=(0,l.cloneBlock)(v,{[h.attributeKey]:(0,z.toHTMLString)({value:w,...H(C)})}),x=(0,l.cloneBlock)(_,{[f.attributeKey]:(0,z.toHTMLString)({value:B,...H(S)})}),T=e?I:x,N=v.name===_.name?[T]:(0,l.switchToBlockType)(T,g.name);if(!N||!N.length)return;let P;if(e){const e=N.pop();P=g.merge(e.attributes,x.attributes)}else{const e=N.shift();P=g.merge(I.attributes,e.attributes)}const L=Zt(P),M=P[L],R=(0,z.create)({html:M,...H(g.attributes[L])}),A=R.text.indexOf(Yt),D=(0,z.remove)(R,A,A+1),O=(0,z.toHTMLString)({value:D,...H(g.attributes[L])});P[L]=O;const F=o.getSelectedBlockClientIds(),V=[...e?N:[],{...m,attributes:{...m.attributes,...P}},...e?[]:N];n.batch((()=>{r.selectionChange(m.clientId,L,A,A),r.replaceBlocks(F,V,0,o.getSelectedBlocksInitialCaretPosition())}))},Tn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();if(o.clientId===r.clientId)return;if(!o.attributeKey||!r.attributeKey||void 0===o.offset||void 0===r.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(r.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(r.clientId)?(a=r,c=o):(a=o,c=r);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,l.getBlockType)(p.name),g=t.getBlock(d.clientId),h=(0,l.getBlockType)(g.name),f=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],_=h.attributes[d.attributeKey];let k=(0,z.create)({html:f,...H(b)}),y=(0,z.create)({html:v,...H(_)});k=(0,z.remove)(k,u.offset,k.text.length),y=(0,z.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,z.toHTMLString)({value:k,...H(b)})}},(0,l.createBlock)((0,l.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...H(_)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Nn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:l.clientId}})},Pn=(e,t)=>n=>{let{registry:o,select:r,dispatch:i}=n;const s=[e,t];i({type:"MERGE_BLOCKS",blocks:s});const[a,c]=s,u=r.getBlock(a),d=(0,l.getBlockType)(u.name);if(!d)return;const p=r.getBlock(c);if(d&&!d.merge){const e=(0,l.switchToBlockType)(p,d.name);if(1!==(null==e?void 0:e.length))return void i.selectBlock(u.clientId);const[t]=e;return t.innerBlocks.length<1?void i.selectBlock(u.clientId):void o.batch((()=>{i.insertBlocks(t.innerBlocks,void 0,a),i.removeBlock(c),i.selectBlock(t.innerBlocks[0].clientId)}))}const m=(0,l.getBlockType)(p.name),{clientId:g,attributeKey:h,offset:f}=r.getSelectionStart(),v=(g===a?d:m).attributes[h],b=(g===a||g===c)&&void 0!==h&&void 0!==f&&!!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,l.cloneBlock)(u),k=(0,l.cloneBlock)(p);if(b){const e=g===a?_:k,t=e.attributes[h],n=(0,z.insert)((0,z.create)({html:t,...H(v)}),Yt,f,f);e.attributes[h]=(0,z.toHTMLString)({value:n,...H(v)})}const y=u.name===p.name?[k]:(0,l.switchToBlockType)(k,u.name);if(!y||!y.length)return;const E=d.merge(_.attributes,y[0].attributes);if(b){const e=Zt(E),t=E[e],n=(0,z.create)({html:t,...H(d.attributes[e])}),o=n.text.indexOf(Yt),l=(0,z.remove)(n,o,o+1),r=(0,z.toHTMLString)({value:l,...H(d.attributes[e])});E[e]=r,i.selectionChange(u.clientId,e,o,o)}i.replaceBlocks([u.clientId,p.clientId],[{...u,attributes:{...u.attributes,...E}},...y.slice(1)],0)},Ln=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;e=Qt(e);const r=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,r)&&(t&&l.selectPreviousBlock(e[0]),l({type:"REMOVE_BLOCKS",clientIds:e}),l((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function Mn(e,t){return Ln([e],t)}function Rn(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 An(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Dn(){return{type:"START_TYPING"}}function On(){return{type:"STOP_TYPING"}}function zn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Fn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Vn(){return V()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Hn(){return V()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Gn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Un=(e,t,n)=>o=>{let{dispatch:r}=o;const i=(0,l.getDefaultBlockName)();if(!i)return;const s=(0,l.createBlock)(i,e);return r.insertBlock(s,n,t)};function Wn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function $n(e){return{type:"UPDATE_SETTINGS",settings:e}}function jn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Kn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function qn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Yn=()=>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"})}))},Zn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},Qn=e=>t=>{let{dispatch:n,select:o}=t;if("zoom-out"===e){const e=o.getBlockSelectionStart();e&&n.selectBlock(o.getBlockHierarchyRootClientId(e))}n({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,qt.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.")):"edit"===e?(0,qt.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,qt.speak)((0,h.__)("You are currently in zoom-out mode."))},Xn=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,qt.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."))}},Jn=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;const i=o.getBlocksByClientId(e);if(i.some((e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,l.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=Qt(e),c=o.getBlockIndex(a[a.length-1]),u=i.map((e=>(0,l.__experimentalCloneSanitizedBlock)(e)));return r.insertBlocks(u,c+1,s,t),u.length>1&&t&&r.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))}},eo=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const l=n.getBlockRootClientId(e);if(n.getTemplateLock(l))return;const r=n.getBlockIndex(e);return o.insertDefaultBlock({},l,r)},to=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const l=n.getBlockRootClientId(e);if(n.getTemplateLock(l))return;const r=n.getBlockIndex(e);return o.insertDefaultBlock({},l,r+1)};function no(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const oo=e=>async t=>{let{dispatch:n}=t;n(no(e,!0)),await new Promise((e=>setTimeout(e,150))),n(no(e,!1))};function lo(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function ro(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function io(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const so="core/block-editor",ao={reducer:P,selectors:e,actions:t},co=(0,p.createReduxStore)(so,{...ao,persist:["preferences"]});(0,p.registerStore)(so,{...ao,persist:["preferences"]});const uo={name:"",isSelected:!1},po=(0,s.createContext)(uo),{Provider:mo}=po;function go(){return(0,s.useContext)(po)}function ho(){const{isSelected:e,clientId:t,name:n}=go();return(0,p.useSelect)((o=>{if(e)return!0;const{getBlockName:l,isFirstMultiSelectedBlock:r,getMultiSelectedBlockClientIds:i}=o(co);return!!r(t)&&i().every((e=>l(e)===n))}),[t,e,n])}function fo(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:r=!1}=e;const i=function(e,t){const n=ho(),{clientId:o}=go(),r=(0,p.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e(co),{hasBlockSupport:i}=e(l.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)}),[t,o]);var i;return n?null===(i=g[e])||void 0===i?void 0:i.Fill:r?g.parent.Fill:null}(t,r);return i?(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(i,null,(e=>{const l=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(m.__experimentalToolbarContext.Provider,{value:l},"default"===t&&(0,s.createElement)(m.ToolbarGroup,{controls:n}),o)}))):null}function vo(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(m.__experimentalToolbarContext),l=g[t].Slot,r=(0,m.__experimentalUseSlot)(l.__unstableName);return Boolean(r.fills&&r.fills.length)?"default"===t?(0,s.createElement)(l,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(l,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const bo=fo;bo.Slot=vo;const _o=e=>(0,s.createElement)(fo,i({group:"inline"},e));_o.Slot=e=>(0,s.createElement)(vo,i({group:"inline"},e));const ko=bo,yo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),Eo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),Co=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),So=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),wo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Bo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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 Io(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function xo(e,t,n,o){var l,r;let i="";return null!=t&&null!==(l=t[n])&&void 0!==l&&null!==(r=l.spacingStyles)&&void 0!==r&&r.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${Io(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}function To(e){const{contentSize:t,wideSize:n}=e,o={},l=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return l.test(t)&&(
4
  // translators: %s: container size (i.e. 600px etc)
5
  o.none=(0,h.sprintf)((0,h.__)("Max %s wide"),t)),l.test(n)&&(
6
  // translators: %s: container size (i.e. 600px etc)
7
+ o.wide=(0,h.sprintf)((0,h.__)("Max %s wide"),n)),o}const No=(0,s.createContext)({refs:new Map,callbacks:new Map});function Po(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(No.Provider,{value:n},t)}function Lo(e){const{refs:t,callbacks:n}=(0,s.useContext)(No),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 Mo(e){const{refs:t}=(0,s.useContext)(No),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,l]of t.entries())l===n.current&&o.current&&(e=o.current);return e}})),[])}function Ro(e){const{callbacks:t}=(0,s.useContext)(No),n=Mo(e),[o,l]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(l,e),()=>{t.delete(l)}}),[e]),n.current||o}function Ao(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function Do(e,t){if(!Ao(e))return e;const n=zo(e),o=t.find((e=>String(e.slug)===n));return null==o?void 0:o.size}function Oo(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function zo(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}const Fo={all:(0,h.__)("All sides"),top:(0,h.__)("Top"),bottom:(0,h.__)("Bottom"),left:(0,h.__)("Left"),right:(0,h.__)("Right"),mixed:(0,h.__)("Mixed"),vertical:(0,h.__)("Vertical"),horizontal:(0,h.__)("Horizontal")},Vo={top:void 0,right:void 0,bottom:void 0,left:void 0},Ho=["top","right","bottom","left"];function Go(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function Uo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ho;return Object.values(e).length>=1&&Object.values(e).length<t.length||new Set(Object.values(e)).size>1}function Wo(e){return null!=e&&!(0,u.isEmpty)(Object.values(e).filter((e=>!!e)))}const $o=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"})),jo=["color","border","typography","spacing"],Ko={"color.palette":e=>e.colors,"color.gradients":e=>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=>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},qo={"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 Yo(e){const{name:t,clientId:n}=go();return(0,p.useSelect)((o=>{if(jo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let r;const i=(e=>qo[e]||e)(e),s=[n,...o(co).getBlockParents(n,!0)];for(const e of s){const n=o(co).getBlockName(e);if((0,l.hasBlockSupport)(n,"__experimentalSettings",!1)){var a;const n=o(co).getBlockAttributes(e);if(r=null!==(a=(0,u.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==a?a:(0,u.get)(n,`settings.${i}`),void 0!==r)break}}const c=o(co).getSettings();if(void 0===r){var d;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;r=null!==(d=(0,u.get)(c,n))&&void 0!==d?d:(0,u.get)(c,e)}var p,m;if(void 0!==r)return l.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(p=null!==(m=r.custom)&&void 0!==m?m:r.theme)&&void 0!==p?p:r.default:r;const g=Ko[i]?Ko[i](c):void 0;return void 0!==g?g:"typography.dropCap"===i||void 0}),[t,n,e])}function Zo(e){var t;let{spacingSizes:n,value:o,side:l,onChange:r,isMixed:i=!1,type:a,minimumCustomValue:u}=e;o=function(e,t){if(Ao(e))return e;const n=t.find((t=>String(t.size)===String(e)));return null!=n&&n.slug?`var:preset|spacing|${n.slug}`:e}(o,n);let d=n;const g=n.length<=8,f=(0,p.useSelect)((e=>{const t=e(co).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[v,b]=(0,s.useState)(!f&&void 0!==o&&!Ao(o)),_=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["px","em","rem"]});let k=null;g||v||void 0===o||!(!Ao(o)||Ao(o)&&i)?i||(k=v?Do(o,n):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":zo(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(o,n)):(d=[...n,{name:i?(0,h.__)("Mixed"):// translators: A custom measurement, eg. a number followed by a unit like 12px.
8
  (0,h.sprintf)((0,h.__)("Custom (%s)"),o),slug:"custom",size:o}],k=d.length-1);const y=(0,s.useMemo)((()=>(0,m.__experimentalParseQuantityAndUnitFromRawValue)(k)),[k])[1]||_[0].value,E=e=>{var t;return void 0===o||null===(t=n[e])||void 0===t?void 0:t.name},C=parseInt(k,10),S=(e,t)=>{var o;const l=parseInt(e,10);if("selectList"===t){if(0===l)return;if(1===l)return"0"}else if(0===l)return"0";return`var:preset|spacing|${null===(o=n[e])||void 0===o?void 0:o.slug}`},w=i?(0,h.__)("Mixed"):null,B=i?(0,h.__)("Mixed"):E(k),I=d.map(((e,t)=>({key:t,name:e.name}))),x=n.map(((e,t)=>({value:t,label:void 0}))),T=(0,h.sprintf)(// translators: 1: The side of the block being modified (top, bottom, left, etc.). 2. Type of spacing being modified (Padding, margin, etc)
9
+ (0,h.__)("%1$s %2$s"),Fo[l],null==a?void 0:a.toLowerCase()),N=g&&!v&&void 0!==B;return(0,s.createElement)(s.Fragment,null,"all"!==l&&(0,s.createElement)(m.__experimentalHStack,{className:"components-spacing-sizes-control__side-labels"},(0,s.createElement)(m.__experimentalText,{className:"components-spacing-sizes-control__side-label"},Fo[l]),N&&(0,s.createElement)(m.__experimentalText,{className:"components-spacing-sizes-control__hint-single"},B)),"all"===l&&N&&(0,s.createElement)(m.__experimentalText,{className:"components-spacing-sizes-control__hint-all"},B),!f&&(0,s.createElement)(m.Button,{label:v?(0,h.__)("Use size preset"):(0,h.__)("Set custom size"),icon:$o,onClick:()=>{b(!v)},isPressed:v,isSmall:!0,className:c()({"components-spacing-sizes-control__custom-toggle-all":"all"===l,"components-spacing-sizes-control__custom-toggle-single":"all"!==l}),iconSize:24}),v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.__experimentalUnitControl,{onChange:e=>r((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:k,units:_,min:u,placeholder:w,disableUnits:i,label:T,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",style:{gridColumn:"1"}}),(0,s.createElement)(m.RangeControl,{value:C,min:0,max:100,withInputField:!1,onChange:e=>{r([e,y].join(""))},className:"components-spacing-sizes-control__custom-value-range"})),g&&!v&&(0,s.createElement)(m.RangeControl,{className:"components-spacing-sizes-control__range-control",value:k,onChange:e=>r(S(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===o&&r("0")},withInputField:!1,"aria-valuenow":k,"aria-valuetext":null===(t=n[k])||void 0===t?void 0:t.name,renderTooltipContent:E,min:0,max:n.length-1,marks:x,label:T,hideLabelFromVision:!0}),!g&&!v&&(0,s.createElement)(m.CustomSelectControl,{className:"components-spacing-sizes-control__custom-select-control",value:I.find((e=>e.key===k))||"",onChange:e=>{r(S(e.selectedItem.key,"selectList"))},options:I,label:T,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0}))}function Qo(e){let{onChange:t,values:n,sides:o,spacingSizes:l,type:r,minimumCustomValue:i}=e;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Go(Object.values(e))}(n),c=Wo(n)&&Uo(n,o);return(0,s.createElement)(Zo,{value:a,onChange:e=>{const l=(0,m.__experimentalApplyValueToSides)(n,e,o);t(l)},side:"all",spacingSizes:l,isMixed:c,type:r,minimumCustomValue:i})}function Xo(e){let{values:t,sides:n,onChange:o,spacingSizes:l,type:r,minimumCustomValue:i}=e;const a=null!=n&&n.length?Ho.filter((e=>n.includes(e))):Ho,c=e=>n=>{const l={...t};l[e]=n,o(l)};return(0,s.createElement)(s.Fragment,null,a.map((e=>(0,s.createElement)(Zo,{value:t[e],label:Fo[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:c(e),spacingSizes:l,type:r,minimumCustomValue:i}))))}const Jo=["vertical","horizontal"];function el(e){let{onChange:t,values:n,sides:o,spacingSizes:l,type:r,minimumCustomValue:i}=e;const a=e=>o=>{if(!t)return;const l={...n};"vertical"===e&&(l.top=o,l.bottom=o),"horizontal"===e&&(l.left=o,l.right=o),t(l)},c=null!=o&&o.length?Jo.filter((e=>o.includes(e))):Jo;return(0,s.createElement)(s.Fragment,null,c.map((e=>{const t="vertical"===e?n.top:n.left;return(0,s.createElement)(Zo,{value:t,onChange:a(e),label:Fo[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:l,type:r,minimumCustomValue:i})})))}const tl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),nl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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 ol(e){let{isLinked:t,onClick:n}=e;const o=t?(0,h.__)("Unlink sides"):(0,h.__)("Link sides");return(0,s.createElement)(m.Tooltip,{text:o},(0,s.createElement)("span",{className:"component-spacing-sizes-control__linked-button"},(0,s.createElement)(m.Button,{isSmall:!0,icon:t?tl:nl,iconSize:24,"aria-label":o,onClick:n})))}function ll(e){let{inputProps:t,onChange:n,label:o=(0,h.__)("Spacing Control"),values:l,sides:r,splitOnAxis:a=!1,useSelect:c,minimumCustomValue:u=0}=e;const d=[{name:0,slug:"0",size:0},...Yo("spacing.spacingSizes")||[]];d.length>8&&d.unshift({name:(0,h.__)("Default"),slug:"default",size:void 0});const p=l||Vo,g=Wo(l),f=1===(null==r?void 0:r.length),[v,b]=(0,s.useState)(!g||!Uo(p,r)||f),_={...t,onChange:e=>{const t={...l,...e};n(t)},isLinked:v,sides:r,values:p,spacingSizes:d,useSelect:c,type:o,minimumCustomValue:u};return(0,s.createElement)("fieldset",{role:"region",className:"component-spacing-sizes-control"},(0,s.createElement)(m.__experimentalText,{as:"legend"},o),!f&&(0,s.createElement)(ol,{onClick:()=>{b(!v)},isLinked:v}),v&&(0,s.createElement)(Qo,i({"aria-label":o},_)),!v&&a&&(0,s.createElement)(el,_),!v&&!a&&(0,s.createElement)(Xo,_))}window.wp.warning;const rl={default:(0,m.createSlotFill)("InspectorControls"),advanced:(0,m.createSlotFill)("InspectorAdvancedControls"),border:(0,m.createSlotFill)("InspectorControlsBorder"),color:(0,m.createSlotFill)("InspectorControlsColor"),dimensions:(0,m.createSlotFill)("InspectorControlsDimensions"),typography:(0,m.createSlotFill)("InspectorControlsTypography")};function il(e){var t;let{__experimentalGroup:n="default",children:o}=e;const l=ho(),r=null===(t=rl[n])||void 0===t?void 0:t.Fill;return r?l?(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(r,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(m.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const sl=e=>e,al=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,al),sl);return(0,u.isEmpty)(t)?void 0:t};function cl(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function ul(e,t,n,o,l,r){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===r.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(r.length>1&&o.length>1){if(!o[l])return n;var a;s=null===(a=o[l])||void 0===a?void 0:a.attributes}let c=n;return Object.entries(e).forEach((e=>{let[n,o]=e;o&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:cl(c.attributes,e,t)})}))})),c}function dl(e,t,n){const o=(0,l.getBlockSupport)(e,t),r=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}function pl(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:l}=(0,p.useDispatch)(co),{getBlockAttributes:r,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,p.useSelect)(co),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}=r(n);let l={style:o};e.forEach((e=>{l={...l,...e(l)}})),l={...l,style:al(l.style)},t[n]=l})),l(n,t,!0)}),[al,r,i,c,u,l]);return(0,s.createElement)(m.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function ml(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(m.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function gl(e){var t;let{__experimentalGroup:n="default",label:o,...l}=e;const r=null===(t=rl[n])||void 0===t?void 0:t.Slot,a=(0,m.__experimentalUseSlot)(null==r?void 0:r.__unstableName);return r&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(pl,{group:n,label:o},(0,s.createElement)(ml,i({},l,{Slot:r}))):(0,s.createElement)(r,i({},l,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const hl=il;hl.Slot=gl;const fl=e=>(0,s.createElement)(il,i({},e,{__experimentalGroup:"advanced"}));fl.Slot=e=>(0,s.createElement)(gl,i({},e,{__experimentalGroup:"advanced"})),fl.slotName="InspectorAdvancedControls";const vl=hl,bl=window.wp.isShallowEqual;var _l=n.n(bl);const kl=function(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])},yl=Number.MAX_SAFE_INTEGER,El=(0,s.forwardRef)((function(e,t){let{clientId:n,bottomClientId:o,children:l,__unstableRefreshSize:r,__unstableCoverTarget:a=!1,__unstablePopoverSlot:u,__unstableContentRef:p,...g}=e;const h=Ro(n),f=Ro(null!=o?o:n),v=(0,d.useMergeRefs)([t,kl(p)]),b=(0,s.useMemo)((()=>h&&f===h?{position:"absolute",width:h.offsetWidth,height:h.offsetHeight}:{}),[h,f,r]),[_,k]=(0,s.useReducer)((e=>(e+1)%yl),0);(0,s.useLayoutEffect)((()=>{if(!h)return;const e=new window.MutationObserver(k);return e.observe(h,{attributes:!0}),()=>{e.disconnect()}}),[h]);const y=(0,s.useMemo)((()=>{if(!(_<0||!h||o&&!f))return{getBoundingClientRect(){var e,t,n,o;const l=h.getBoundingClientRect(),r=null==f?void 0:f.getBoundingClientRect(),i=Math.min(l.left,null!==(e=null==r?void 0:r.left)&&void 0!==e?e:1/0),s=Math.min(l.top,null!==(t=null==r?void 0:r.top)&&void 0!==t?t:1/0),a=Math.max(l.right,null!==(n=r.right)&&void 0!==n?n:-1/0)-i,c=Math.max(l.bottom,null!==(o=r.bottom)&&void 0!==o?o:-1/0)-s;return new window.DOMRect(i,s,a,c)},ownerDocument:h.ownerDocument}}),[o,f,h,_]);return!h||o&&!f?null:(0,s.createElement)(m.Popover,i({ref:v,animate:!1,position:"top right left",focusOnMount:!1,anchor:y,__unstableSlotName:u||null,resize:!1,flip:!1,shift:!0},g,{className:c()("block-editor-block-popover",g.className)}),a&&(0,s.createElement)("div",{style:b},l),!a&&l)}));function Cl(e){const t=(0,l.getBlockSupport)(e,Pl);return!!(!0===t||null!=t&&t.margin)}function Sl(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("spacing.margin"),n=!Ol(e,"margin");return!Cl(e)||t||n}function wl(e){var t,n;const{name:o,attributes:{style:l},setAttributes:r}=e,i=Yo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]}),c=Dl(o,"margin"),u=c&&c.some((e=>Ml.includes(e)));if(Sl(e))return null;const d=e=>{const t={...l,spacing:{...null==l?void 0:l.spacing,margin:e}};r({style:al(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(0,s.createElement)(m.__experimentalBoxControl,{values:null==l||null===(t=l.spacing)||void 0===t?void 0:t.margin,onChange:d,label:(0,h.__)("Margin"),sides:c,units:a,allowReset:!1,splitOnAxis:u}),(null==i?void 0:i.length)>0&&(0,s.createElement)(ll,{values:null==l||null===(n=l.spacing)||void 0===n?void 0:n.margin,onChange:d,label:(0,h.__)("Margin"),sides:c,units:a,allowReset:!1,splitOnAxis:!1})),native:null})}function Bl(e){var t,n;let{clientId:o,attributes:l}=e;const r=null==l||null===(t=l.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,i=Yo("spacing.spacingSizes"),a=(0,s.useMemo)((()=>{const e=null!=r&&r.top?Do(null==r?void 0:r.top,i):0,t=null!=r&&r.right?Do(null==r?void 0:r.right,i):0,n=null!=r&&r.bottom?Do(null==r?void 0:r.bottom,i):0,o=null!=r&&r.left?Do(null==r?void 0:r.left,i):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:0!==e?`-${e}`:0,right:0!==t?`-${t}`:0,bottom:0!==n?`-${n}`:0,left:0!==o?`-${o}`:0}}),[r]),[c,u]=(0,s.useState)(!1),d=(0,s.useRef)(r),p=(0,s.useRef)(),m=()=>{p.current&&window.clearTimeout(p.current)};return(0,s.useEffect)((()=>(_l()(r,d.current)||(u(!0),d.current=r,m(),p.current=setTimeout((()=>{u(!1)}),400)),()=>m())),[r]),c?(0,s.createElement)(El,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:r},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}function Il(e){const t=(0,l.getBlockSupport)(e,Pl);return!!(!0===t||null!=t&&t.padding)}function xl(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("spacing.padding"),n=!Ol(e,"padding");return!Il(e)||t||n}function Tl(e){var t,n;const{name:o,attributes:{style:l},setAttributes:r}=e,i=Yo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]}),c=Dl(o,"padding"),u=c&&c.some((e=>Ml.includes(e)));if(xl(e))return null;const d=e=>{const t={...l,spacing:{...null==l?void 0:l.spacing,padding:e}};r({style:al(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(0,s.createElement)(m.__experimentalBoxControl,{values:null==l||null===(t=l.spacing)||void 0===t?void 0:t.padding,onChange:d,label:(0,h.__)("Padding"),sides:c,units:a,allowReset:!1,splitOnAxis:u}),(null==i?void 0:i.length)>0&&(0,s.createElement)(ll,{values:null==l||null===(n=l.spacing)||void 0===n?void 0:n.padding,onChange:d,label:(0,h.__)("Padding"),sides:c,units:a,allowReset:!1,splitOnAxis:u})),native:null})}function Nl(e){var t,n;let{clientId:o,attributes:l}=e;const r=null==l||null===(t=l.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,i=(0,s.useMemo)((()=>({borderTopWidth:Ao(null==r?void 0:r.top)?Oo(null==r?void 0:r.top):null==r?void 0:r.top,borderRightWidth:Ao(null==r?void 0:r.right)?Oo(null==r?void 0:r.right):null==r?void 0:r.right,borderBottomWidth:Ao(null==r?void 0:r.bottom)?Oo(null==r?void 0:r.bottom):null==r?void 0:r.bottom,borderLeftWidth:Ao(null==r?void 0:r.left)?Oo(null==r?void 0:r.left):null==r?void 0:r.left})),[r]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(r),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(_l()(r,u.current)||(c(!0),u.current=r,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[r]),a?(0,s.createElement)(El,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:r},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const Pl="spacing",Ll=["top","right","bottom","left"],Ml=["vertical","horizontal"];function Rl(e){const t=Hl(e),n=xl(e),o=Sl(e),r=Al(e),i=(u=e.name,"web"===s.Platform.OS&&(zl(u)||Il(u)||Cl(u))),a=Yo("spacing.spacingSizes");var u;if(r||!i)return null;const d=(0,l.getBlockSupport)(e.name,[Pl,"__experimentalDefaultControls"]),p=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}},g=c()({"tools-panel-item-spacing":a&&a.length>0});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(vl,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:g,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:al({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:p("padding"),isShownByDefault:null==d?void 0:d.padding,panelId:e.clientId},(0,s.createElement)(Tl,e)),!o&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:g,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:al({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:p("margin"),isShownByDefault:null==d?void 0:d.margin,panelId:e.clientId},(0,s.createElement)(wl,e)),!t&&(0,s.createElement)(m.__experimentalToolsPanelItem,{className:g,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:p("blockGap"),isShownByDefault:null==d?void 0:d.blockGap,panelId:e.clientId},(0,s.createElement)(Gl,e))),!n&&(0,s.createElement)(Nl,e),!o&&(0,s.createElement)(Bl,e))}const Al=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Hl(e),n=xl(e),o=Sl(e);return t&&n&&o};function Dl(e,t){var n;const o=(0,l.getBlockSupport)(e,Pl);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function Ol(e,t){const n=Dl(e,t);return!(n&&n.some((e=>Ll.includes(e)))&&n.some((e=>Ml.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function zl(e){const t=(0,l.getBlockSupport)(e,Pl);return!!(!0===t||null!=t&&t.blockGap)}function Fl(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function Vl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=Fl(e);if(!n)return null;const o=Oo(null==n?void 0:n.top)||t,l=Oo(null==n?void 0:n.left)||t;return o===l?o:`${o} ${l}`}function Hl(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("spacing.blockGap");return!zl(e)||t}function Gl(e){var t;const{clientId:n,attributes:{style:o},name:l,setAttributes:r}=e,i=Yo("spacing.spacingSizes"),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["%","px","em","rem","vw"]}),c=Dl(l,"blockGap"),u=Mo(n);if(Hl(e))return null;const d=c&&c.some((e=>Ml.includes(e))),p=e=>{var t;let n=e;e&&d?n={...Fl(e)}:null!=e&&e.hasOwnProperty("top")&&(n=e.top);const l={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};r({style:al(l)});const i=(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;u.current&&i&&(null===(s=u.current.parentNode)||void 0===s||s.replaceChild(u.current,u.current))},g=Fl(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=d?{...g,right:null==g?void 0:g.left,bottom:null==g?void 0:g.top}:{top:null==g?void 0:g.top};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(d?(0,s.createElement)(m.__experimentalBoxControl,{label:(0,h.__)("Block spacing"),min:0,onChange:p,units:a,sides:c,values:f,allowReset:!1,splitOnAxis:d}):(0,s.createElement)(m.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:p,units:a,value:f})),(null==i?void 0:i.length)>0&&(0,s.createElement)(ll,{values:f,onChange:p,label:(0,h.__)("Block spacing"),sides:d?c:["top"],units:a,allowReset:!1,splitOnAxis:d})),native:null})}const Ul=(0,s.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(m.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Wl=(0,s.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(m.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),$l={top:{icon:(0,s.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(m.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,h._x)("Align top","Block vertical alignment setting")},center:{icon:Wl,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Ul,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},jl=["top","center","bottom"],Kl={isAlternate:!0},ql=function(e){let{value:t,onChange:n,controls:o=jl,isCollapsed:l=!0,isToolbar:r}=e;const a=$l[t],c=$l.top,u=r?m.ToolbarGroup:m.ToolbarDropdownMenu,d=r?{isCollapsed:l}:{popoverProps:{POPOVER_PROPS:Kl}};return(0,s.createElement)(u,i({icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...$l[e],isActive:t===e,role:l?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))},Yl=e=>(0,s.createElement)(ql,i({},e,{isToolbar:!1})),Zl=e=>(0,s.createElement)(ql,i({},e,{isToolbar:!0})),Ql={left:yo,center:Eo,right:Co,"space-between":So},Xl=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:l,popoverProps:r,isToolbar:a}=e;const c=e=>{o(e===l?void 0:e)},u=l?Ql[l]:Ql.left,d=[{name:"left",icon:yo,title:(0,h.__)("Justify items left"),isActive:"left"===l,onClick:()=>c("left")},{name:"center",icon:Eo,title:(0,h.__)("Justify items center"),isActive:"center"===l,onClick:()=>c("center")},{name:"right",icon:Co,title:(0,h.__)("Justify items right"),isActive:"right"===l,onClick:()=>c("right")},{name:"space-between",icon:So,title:(0,h.__)("Space between items"),isActive:"space-between"===l,onClick:()=>c("space-between")}],p=a?m.ToolbarGroup:m.ToolbarDropdownMenu,g=a?{isCollapsed:n}:{};return(0,s.createElement)(p,i({icon:u,popoverProps:r,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},g))},Jl=e=>(0,s.createElement)(Xl,i({},e,{isToolbar:!1})),er=e=>(0,s.createElement)(Xl,i({},e,{isToolbar:!0})),tr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},nr={left:"flex-start",right:"flex-end",center:"center"},or={top:"flex-start",center:"center",bottom:"flex-end"},lr=["wrap","nowrap"],rr={name:"flex",label:(0,h.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:l=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.Flex,null,(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(sr,{layout:t,onChange:n})),(0,s.createElement)(m.FlexItem,null,l&&(0,s.createElement)(cr,{layout:t,onChange:n}))),(0,s.createElement)(ar,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:l=!0}=o;return(0,s.createElement)(ko,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(sr,{layout:t,onChange:n,isToolbar:!0}),l&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(ir,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:l,style:r,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{orientation:c="horizontal"}=l,u=null!=r&&null!==(t=r.spacing)&&void 0!==t&&t.blockGap&&!dl(i,"spacing","blockGap")?Vl(null==r||null===(n=r.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=tr[l.justifyContent],p=lr.includes(l.flexWrap)?l.flexWrap:"wrap",m=or[l.verticalAlignment],g=nr[l.justifyContent]||nr.left;let h="";const f=[];return p&&"wrap"!==p&&f.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&f.push(`align-items: ${m}`),d&&f.push(`justify-content: ${d}`)):(f.push("flex-direction: column"),f.push(`align-items: ${g}`)),f.length&&(h=`${Io(o)} {\n\t\t\t\t${f.join("; ")};\n\t\t\t}`),s&&u&&(h+=xo(o,a,"flex",u)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function ir(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:l=or.center}=t,r=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(Yl,{onChange:r,value:l});const i=[{value:"flex-start",label:(0,h.__)("Align items top")},{value:"center",label:(0,h.__)("Align items center")},{value:"flex-end",label:(0,h.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,h.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(m.Button,{key:e,label:n,icon:t,isPressed:l===e,onClick:()=>r(e)})))))}function sr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:l="left",orientation:r="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===r&&a.push("space-between"),o)return(0,s.createElement)(Jl,{allowedControls:a,value:l,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:yo,label:(0,h.__)("Justify items left")},{value:"center",icon:Eo,label:(0,h.__)("Justify items center")},{value:"right",icon:Co,label:(0,h.__)("Justify items right")}];return"horizontal"===r&&c.push({value:"space-between",icon:So,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)(m.Button,{key:t,label:o,icon:n,isPressed:l===t,onClick:()=>i(t)})}))))}function ar(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(m.ToggleControl,{label:(0,h.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function cr(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)(m.Button,{label:(0,h.__)("Horizontal"),icon:wo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(m.Button,{label:(0,h.__)("Vertical"),icon:Bo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}const ur={name:"default",label:(0,h.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function(e){var t;let{selector:n,style:o,blockName:l,hasBlockGapSupport:r,layoutDefinitions:i}=e;const s=Vl(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap);let a="";dl(l,"spacing","blockGap")||(null!=s&&s.top?a=Vl(null==s?void 0:s.top):"string"==typeof s&&(a=Vl(s)));let c="";return r&&a&&(c+=xo(n,i,"default",a)),c},getOrientation:()=>"vertical",getAlignments(e){const t=To(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,l=[{name:"left"},{name:"center"},{name:"right"}];return n&&l.unshift({name:"full"}),o&&l.unshift({name:"wide",info:t.wide}),l.unshift({name:"none",info:t.none}),l}},dr=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},pr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),mr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),gr=window.wp.styleEngine,hr=[ur,rr,{name:"constrained",label:(0,h.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:l,justifyContent:r="center"}=t,i=[{value:"left",icon:yo,label:(0,h.__)("Justify items left")},{value:"center",icon:Eo,label:(0,h.__)("Justify items center")},{value:"right",icon:Co,label:(0,h.__)("Justify items right")}],a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("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)(m.__experimentalUnitControl,{label:(0,h.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:l||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:a}),(0,s.createElement)(dr,{icon:pr})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(m.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||l||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:a}),(0,s.createElement)(dr,{icon:mr}))),(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.")),(0,s.createElement)(m.__experimentalToggleGroupControl,{__experimentalIsBorderless:!0,label:(0,h.__)("Justification"),value:r,onChange:e=>{n({...t,justifyContent:e})}},i.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})}))))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:o,layout:l={},style:r,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{contentSize:c,wideSize:u,justifyContent:d}=l,p=Vl(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap);let m="";dl(i,"spacing","blockGap")||(null!=p&&p.top?m=Vl(null==p?void 0:p.top):"string"==typeof p&&(m=Vl(p)));const g="left"===d?"0 !important":"auto !important",h="right"===d?"0 !important":"auto !important";let f=c||u?`\n\t\t\t\t\t${Io(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: ${g};\n\t\t\t\t\t\tmargin-right: ${h};\n\t\t\t\t\t}\n\t\t\t\t\t${Io(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${Io(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return"left"===d?f+=`${Io(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${g}; }`:"right"===d&&(f+=`${Io(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${h}; }`),null!=r&&null!==(n=r.spacing)&&void 0!==n&&n.padding&&(0,gr.getCSSRules)(r).forEach((e=>{"paddingRight"===e.key?f+=`\n\t\t\t\t\t${Io(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(f+=`\n\t\t\t\t\t${Io(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),s&&m&&(f+=xo(o,a,"constrained",m)),f},getOrientation:()=>"vertical",getAlignments(e){const t=To(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,l=[{name:"left"},{name:"center"},{name:"right"}];return n&&l.unshift({name:"full"}),o&&l.unshift({name:"wide",info:t.wide}),l.unshift({name:"none",info:t.none}),l}}];function fr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return hr.find((t=>t.name===e))}const vr={type:"default"},br=(0,s.createContext)(vr),_r=br.Provider;function kr(){return(0,s.useContext)(br)}function yr(e){let{layout:t={},css:n,...o}=e;const l=fr(t.type),r=null!==Yo("spacing.blockGap");if(l){var i;if(n)return(0,s.createElement)("style",null,n);const e=null===(i=l.getLayoutStyle)||void 0===i?void 0:i.call(l,{hasBlockGapSupport:r,layout:t,...o});if(e)return(0,s.createElement)("style",null,e)}return null}const Er=["none","left","center","right","wide","full"],Cr=["wide","full"];function Sr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Er;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,p.useSelect)((e=>{const{getSettings:t}=e(co),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=kr(),l=fr(null==o?void 0:o.type),r=l.getAlignments(o);if(n){const t=r.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==l.name&&"constrained"!==l.name)return[];const{alignments:i=Er}=o,s=e.filter((e=>(o.alignments||t||!Cr.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const wr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),Br=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Ir=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),xr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),Tr={none:{icon:wr,title:(0,h._x)("None","Alignment option")},left:{icon:Br,title:(0,h.__)("Align left")},center:{icon:pr,title:(0,h.__)("Align center")},right:{icon:Ir,title:(0,h.__)("Align right")},wide:{icon:mr,title:(0,h.__)("Wide width")},full:{icon:xr,title:(0,h.__)("Full width")}},Nr={isAlternate:!0},Pr=function(e){let{value:t,onChange:n,controls:o,isToolbar:l,isCollapsed:r=!0}=e;const a=Sr(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Tr[t],p=Tr.none,g=l?m.ToolbarGroup:m.ToolbarDropdownMenu,f={icon:d?d.icon:p.icon,label:(0,h.__)("Align")},v=l?{isCollapsed:r,controls:a.map((e=>{let{name:n}=e;return{...Tr[n],isActive:t===n||!t&&"none"===n,role:r?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{toggleProps:{describedBy:(0,h.__)("Change alignment")},popoverProps:Nr,children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:l}=e;const{icon:r,title:i}=Tr[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(m.MenuItem,{key:o,icon:r,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:l},i)}))))}};return(0,s.createElement)(g,i({},f,v))},Lr=e=>(0,s.createElement)(Pr,i({},e,{isToolbar:!1})),Mr=e=>(0,s.createElement)(Pr,i({},e,{isToolbar:!0})),Rr=["left","center","right","wide","full"],Ar=["wide","full"];function Dr(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)?Rr.filter((t=>e.includes(t))):!0===e?[...Rr]:[],!o||!0===e&&!n?(0,u.without)(t,...Ar):t}const Or=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,s.createElement)(e,t),{name:o}=t,r=Sr(Dr((0,l.getBlockSupport)(o,"align"),(0,l.hasBlockSupport)(o,"alignWide",!0))).map((e=>{let{name:t}=e;return t})),i=(0,p.useSelect)((e=>e(co).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return!r.length||i?n:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ko,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Lr,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const r=(0,l.getBlockType)(t.name);(null==r||null===(n=r.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:r})),n)}),"withToolbarControls"),zr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:r}=o,a=Sr(Dr((0,l.getBlockSupport)(n,"align"),(0,l.hasBlockSupport)(n,"alignWide",!0)));if(void 0===r)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===r))&&(c={...c,"data-align":r}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,r.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.align)&&void 0!==t?t:{})||(0,l.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Rr,""]}}),e})),(0,r.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",zr),(0,r.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Or),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Dr((0,l.getBlockSupport)(t,"align"),(0,l.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,r.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Fr=/[\s#]/g,Vr={type:"string",source:"attribute",attribute:"id",selector:"*"},Hr=(0,d.createHigherOrderComponent)((e=>t=>{if((0,l.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(m.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)(m.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(Fr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(vl,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(vl,null,(0,s.createElement)(m.PanelBody,{title:(0,h.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,r.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.anchor)&&void 0!==t?t:{})||(0,l.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Vr}),e})),(0,r.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Hr),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,l.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Gr={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,r.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,l.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Gr}),e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,l.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Ur=(0,d.createHigherOrderComponent)((e=>t=>(0,l.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(vl,{__experimentalGroup:"advanced"},(0,s.createElement)(m.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,r.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,l.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,r.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Ur),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,l.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,r.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,l.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var r;const o=null===(r=t[n])||void 0===r?void 0:r.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,l.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,l.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,l.getBlockDefaultClassName)(t.name)),e}));const Wr=window.wp.dom,$r=(0,s.createContext)({});function jr(e){let{value:t,children:n}=e;const o=(0,s.useContext)($r),l=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)($r.Provider,{value:l,children:n})}const Kr=$r,qr={},Yr=(0,m.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,l.getBlockType)(n),r=(0,s.useContext)(Kr),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(r,o.usesContext):qr),[o,r]);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,l.hasBlockSupport)(o,"className",!0)?(0,l.getBlockDefaultClassName)(n):null,m=c()(p,t.className,e.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function Zr(e){const{name:t,isSelected:n,clientId:o}=e,l={name:t,isSelected:n,clientId:o};return(0,s.createElement)(mo,{value:(0,s.useMemo)((()=>l),Object.values(l))},(0,s.createElement)(Yr,e))}const Qr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),Xr=function(e){let{className:t,actions:n,children:o,secondaryActions:l}=e;return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(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||l)&&(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))),l&&(0,s.createElement)(m.DropdownMenu,{className:"block-editor-warning__secondary",icon:Qr,label:(0,h.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(m.MenuGroup,null,l.map(((e,t)=>(0,s.createElement)(m.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))};var Jr=n(1973);function ei(e){let{title:t,rawContent:n,renderedContent:o,action:l,actionText:r,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,Wr.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(m.Button,{variant:"secondary",tabIndex:"0",onClick:l},r)))}const ti=function(e){let{block:t,onKeep:n,onConvert:o,convertor:r,convertButtonText:i}=e;const a=(d=r(t),(0,u.castArray)(d).map((e=>(0,l.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,g=a,(0,Jr.Kx)(m,g).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,g;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(ei,{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)(ei,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))},ni=e=>(0,l.rawHandler)({HTML:e.originalContent}),oi=(0,d.compose)([(0,p.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(co).getBlock(n)}})),(0,p.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(co);return{convertToClassic(){o(n.clientId,(e=>(0,l.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,l.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,ni(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,l.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:r,block:i}=e;const a=!!(0,l.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),p=(0,s.useCallback)((()=>u(!1)),[]),g=(0,s.useMemo)((()=>[{
10
  // translators: Button to fix block content
11
+ 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)(Xr,{actions:[(0,s.createElement)(m.Button,{key:"recover",onClick:r,variant:"primary"},(0,h.__)("Attempt Block Recovery"))],secondaryActions:g},(0,h.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(m.Modal,{title:// translators: Dialog title to fix block content
12
+ (0,h.__)("Resolve Block"),onRequestClose:p,className:"block-editor-block-compare"},(0,s.createElement)(ti,{block:i,onKeep:t,onConvert:n,convertor:ni,convertButtonText:(0,h.__)("Convert to Blocks")})))})),li=(0,s.createElement)(Xr,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed.")),ri=()=>li;class ii 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}}const si=ii;var ai=n(773);const ci=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),r=(0,p.useSelect)((e=>e(co).getBlock(t)),[t]),{updateBlock:i}=(0,p.useDispatch)(co);return(0,s.useEffect)((()=>{o((0,l.getBlockContent)(r))}),[r]),(0,s.createElement)(ai.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,l.getBlockType)(r.name);if(!e)return;const s=(0,l.getBlockAttributes)(e,n,r.attributes),a=n||(0,l.getSaveContent)(e,s),[c]=n?(0,l.validateBlock)({...r,attributes:s,originalContent:a}):[!0];i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let ui=Bi();const di=e=>Ei(e,ui);let pi=Bi();di.write=e=>Ei(e,pi);let mi=Bi();di.onStart=e=>Ei(e,mi);let gi=Bi();di.onFrame=e=>Ei(e,gi);let hi=Bi();di.onFinish=e=>Ei(e,hi);let fi=[];di.setTimeout=(e,t)=>{let n=di.now()+t,o=()=>{let e=fi.findIndex((e=>e.cancel==o));~e&&fi.splice(e,1),ki-=~e?1:0},l={time:n,handler:e,cancel:o};return fi.splice(vi(n),0,l),ki+=1,Ci(),l};let vi=e=>~(~fi.findIndex((t=>t.time>e))||~fi.length);di.cancel=e=>{mi.delete(e),gi.delete(e),ui.delete(e),pi.delete(e),hi.delete(e)},di.sync=e=>{yi=!0,di.batchedUpdates(e),yi=!1},di.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,di.onStart(n)}return o.handler=e,o.cancel=()=>{mi.delete(n),t=null},o};let bi="undefined"!=typeof window?window.requestAnimationFrame:()=>{};di.use=e=>bi=e,di.now="undefined"!=typeof performance?()=>performance.now():Date.now,di.batchedUpdates=e=>e(),di.catch=console.error,di.frameLoop="always",di.advance=()=>{"demand"!==di.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):wi()};let _i=-1,ki=0,yi=!1;function Ei(e,t){yi?(t.delete(e),e(0)):(t.add(e),Ci())}function Ci(){_i<0&&(_i=0,"demand"!==di.frameLoop&&bi(Si))}function Si(){~_i&&(bi(Si),di.batchedUpdates(wi))}function wi(){let e=_i;_i=di.now();let t=vi(_i);t&&(Ii(fi.splice(0,t),(e=>e.handler())),ki-=t),mi.flush(),ui.flush(e?Math.min(64,_i-e):16.667),gi.flush(),pi.flush(),hi.flush(),ki||(_i=-1)}function Bi(){let e=new Set,t=e;return{add(n){ki+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(ki-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,ki-=t.size,Ii(t,(t=>t(n)&&e.add(t))),ki+=e.size,t=e)}}}function Ii(e,t){e.forEach((e=>{try{t(e)}catch(e){di.catch(e)}}))}var xi=n(9196),Ti=n.n(xi);function Ni(){}const Pi={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 Li(e,t){if(Pi.arr(e)){if(!Pi.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 Mi=(e,t)=>e.forEach(t);function Ri(e,t,n){if(Pi.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Ai=e=>Pi.und(e)?[]:Pi.arr(e)?e:[e];function Di(e,t){if(e.size){const n=Array.from(e);e.clear(),Mi(n,t)}}const Oi=(e,...t)=>Di(e,(e=>e(...t))),zi=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Fi,Vi,Hi=null,Gi=!1,Ui=Ni;var Wi=Object.freeze({__proto__:null,get createStringInterpolator(){return Fi},get to(){return Vi},get colors(){return Hi},get skipAnimation(){return Gi},get willAdvance(){return Ui},assign:e=>{e.to&&(Vi=e.to),e.now&&(di.now=e.now),void 0!==e.colors&&(Hi=e.colors),null!=e.skipAnimation&&(Gi=e.skipAnimation),e.createStringInterpolator&&(Fi=e.createStringInterpolator),e.requestAnimationFrame&&di.use(e.requestAnimationFrame),e.batchedUpdates&&(di.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Ui=e.willAdvance),e.frameLoop&&(di.frameLoop=e.frameLoop)}});const $i=new Set;let ji=[],Ki=[],qi=0;const Yi={get idle(){return!$i.size&&!ji.length},start(e){qi>e.priority?($i.add(e),di.onStart(Zi)):(Qi(e),di(Ji))},advance:Ji,sort(e){if(qi)di.onFrame((()=>Yi.sort(e)));else{const t=ji.indexOf(e);~t&&(ji.splice(t,1),Xi(e))}},clear(){ji=[],$i.clear()}};function Zi(){$i.forEach(Qi),$i.clear(),di(Ji)}function Qi(e){ji.includes(e)||Xi(e)}function Xi(e){ji.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(ji),0,e)}function Ji(e){const t=Ki;for(let n=0;n<ji.length;n++){const o=ji[n];qi=o.priority,o.idle||(Ui(o),o.advance(e),o.idle||t.push(o))}return qi=0,Ki=ji,Ki.length=0,ji=t,ji.length>0}const es="[-+]?\\d*\\.?\\d+",ts=es+"%";function ns(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const os=new RegExp("rgb"+ns(es,es,es)),ls=new RegExp("rgba"+ns(es,es,es,es)),rs=new RegExp("hsl"+ns(es,ts,ts)),is=new RegExp("hsla"+ns(es,ts,ts,es)),ss=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,as=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,cs=/^#([0-9a-fA-F]{6})$/,us=/^#([0-9a-fA-F]{8})$/;function ds(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 ps(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o,r=ds(l,o,e+1/3),i=ds(l,o,e),s=ds(l,o,e-1/3);return Math.round(255*r)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function ms(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function gs(e){return(parseFloat(e)%360+360)%360/360}function hs(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function fs(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function vs(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=cs.exec(e))?parseInt(t[1]+"ff",16)>>>0:Hi&&void 0!==Hi[e]?Hi[e]:(t=os.exec(e))?(ms(t[1])<<24|ms(t[2])<<16|ms(t[3])<<8|255)>>>0:(t=ls.exec(e))?(ms(t[1])<<24|ms(t[2])<<16|ms(t[3])<<8|hs(t[4]))>>>0:(t=ss.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=us.exec(e))?parseInt(t[1],16)>>>0:(t=as.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=rs.exec(e))?(255|ps(gs(t[1]),fs(t[2]),fs(t[3])))>>>0:(t=is.exec(e))?(ps(gs(t[1]),fs(t[2]),fs(t[3]))|hs(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 bs=(e,t,n)=>{if(Pi.fun(e))return e;if(Pi.arr(e))return bs({range:e,output:t,extrapolate:n});if(Pi.str(e.output[0]))return Fi(e);const o=e,l=o.output,r=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,r);return function(e,t,n,o,l,r,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===l?o:t===n?e<=t?o:l:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=r(c),o===-1/0?c=-c:l===1/0?c+=o:c=c*(l-o)+o,c)}(e,r[t],r[t+1],l[t],l[t+1],a,i,s,o.map)}};function _s(){return(_s=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 ks=Symbol.for("FluidValue.get"),ys=Symbol.for("FluidValue.observers"),Es=e=>Boolean(e&&e[ks]),Cs=e=>e&&e[ks]?e[ks]():e,Ss=e=>e[ys]||null;function ws(e,t){let n=e[ys];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Bs{constructor(e){if(this[ks]=void 0,this[ys]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Is(this,e)}}const Is=(e,t)=>Ns(e,ks,t);function xs(e,t){if(e[ks]){let n=e[ys];n||Ns(e,ys,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Ts(e,t){let n=e[ys];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[ys]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Ns=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ps=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Ls=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ms=new RegExp(`(${Ps.source})(%|[a-z]+)`,"i"),Rs=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,As=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Ds=e=>{const[t,n]=Os(e);if(!t||zi())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&As.test(n)?Ds(n):n||e},Os=e=>{const t=As.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let zs;const Fs=(e,t,n,o,l)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${l})`,Vs=e=>{zs||(zs=Hi?new RegExp(`(${Object.keys(Hi).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Cs(e).replace(As,Ds).replace(Ls,vs).replace(zs,vs))),n=t.map((e=>e.match(Ps).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=>bs(_s({},e,{output:t}))));return e=>{var n;const l=!Ms.test(t[0])&&(null==(n=t.find((e=>Ms.test(e))))?void 0:n.replace(Ps,""));let r=0;return t[0].replace(Ps,(()=>`${o[r++](e)}${l||""}`)).replace(Rs,Fs)}},Hs="react-spring: ",Gs=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Hs}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Us=Gs(console.warn),Ws=Gs(console.warn);function $s(e){return Pi.str(e)&&("#"==e[0]||/\d/.test(e)||!zi()&&As.test(e)||e in(Hi||{}))}const js="undefined"!=typeof window&&window.document&&window.document.createElement?xi.useLayoutEffect:xi.useEffect;function Ks(){const e=(0,xi.useState)()[1],t=(()=>{const e=(0,xi.useRef)(!1);return js((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const qs=e=>(0,xi.useEffect)(e,Ys),Ys=[];function Zs(e){const t=(0,xi.useRef)();return(0,xi.useEffect)((()=>{t.current=e})),t.current}const Qs=Symbol.for("Animated:node"),Xs=e=>e&&e[Qs],Js=(e,t)=>{return n=e,o=Qs,l=t,Object.defineProperty(n,o,{value:l,writable:!0,configurable:!0});var n,o,l},ea=e=>e&&e[Qs]&&e[Qs].getPayload();class ta{constructor(){this.payload=void 0,Js(this,this)}getPayload(){return this.payload||[]}}class na extends ta{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,Pi.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new na(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Pi.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,Pi.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class oa extends na{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=bs({output:[e,e]})}static create(e){return new oa(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Pi.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=bs({output:[this.getValue(),e]})),this._value=0,super.reset()}}const la={dependencies:null};class ra extends ta{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Ri(this.source,((n,o)=>{var l;(l=n)&&l[Qs]===l?t[o]=n.getValue(e):Es(n)?t[o]=Cs(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Mi(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Ri(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){la.dependencies&&Es(e)&&la.dependencies.add(e);const t=ea(e);t&&Mi(t,(e=>this.add(e)))}}class ia extends ra{constructor(e){super(e)}static create(e){return new ia(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(sa)),!0)}}function sa(e){return($s(e)?oa:na).create(e)}function aa(e){const t=Xs(e);return t?t.constructor:Pi.arr(e)?ia:$s(e)?oa:na}function ca(){return(ca=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 ua=(e,t)=>{const n=!Pi.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,xi.forwardRef)(((o,l)=>{const r=(0,xi.useRef)(null),i=n&&(0,xi.useCallback)((e=>{r.current=function(e,t){return e&&(Pi.fun(e)?e(t):e.current=t),t}(l,e)}),[l]),[s,a]=function(e,t){const n=new Set;return la.dependencies=n,e.style&&(e=ca({},e,{style:t.createAnimatedStyle(e.style)})),e=new ra(e),la.dependencies=null,[e,n]}(o,t),c=Ks(),u=()=>{const e=r.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new da(u,a),p=(0,xi.useRef)();js((()=>(p.current=d,Mi(a,(e=>xs(e,d))),()=>{p.current&&(Mi(p.current.deps,(e=>Ts(e,p.current))),di.cancel(p.current.update))}))),(0,xi.useEffect)(u,[]),qs((()=>()=>{const e=p.current;Mi(e.deps,(t=>Ts(t,e)))}));const m=t.getComponentProps(s.getValue());return xi.createElement(e,ca({},m,{ref:i}))}))};class da{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&di.write(this.update)}}const pa=Symbol.for("AnimatedComponent"),ma=e=>Pi.str(e)?e:e&&Pi.str(e.displayName)?e.displayName:Pi.fun(e)&&e.name||null;function ga(){return(ga=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 ha(e,...t){return Pi.fun(e)?e(...t):e}const fa=(e,t)=>!0===e||!!(t&&e&&(Pi.fun(e)?e(t):Ai(e).includes(t))),va=(e,t)=>Pi.obj(e)?t&&e[t]:e,ba=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,_a=e=>e,ka=(e,t=_a)=>{let n=ya;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const l of n){const n=t(e[l],l);Pi.und(n)||(o[l]=n)}return o},ya=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Ea={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 Ca(e){const t=function(e){const t={};let n=0;if(Ri(e,((e,o)=>{Ea[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Ri(e,((e,o)=>o in t||(n[o]=e))),n}return ga({},e)}function Sa(e){return e=Cs(e),Pi.arr(e)?e.map(Sa):$s(e)?Wi.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function wa(e){for(const t in e)return!0;return!1}function Ba(e){return Pi.fun(e)||Pi.arr(e)&&Pi.obj(e[0])}function Ia(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function xa(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}Math.PI,Math.PI;const Ta=ga({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Na{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,Ta)}}function Pa(e,t){if(Pi.und(t.decay)){const n=!Pi.und(t.tension)||!Pi.und(t.friction);!n&&Pi.und(t.frequency)&&Pi.und(t.damping)&&Pi.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const La=[];class Ma{constructor(){this.changed=!1,this.values=La,this.toValues=null,this.fromValues=La,this.to=void 0,this.from=void 0,this.config=new Na,this.immediate=!1}}function Ra(e,{key:t,props:n,defaultProps:o,state:l,actions:r}){return new Promise(((i,s)=>{var a;let c,u,d=fa(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{Pi.und(n.pause)||(l.paused=fa(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=l.paused||fa(e,t)),c=ha(n.delay||0,t),e?(l.resumeQueue.add(m),r.pause()):(r.resume(),m())}function p(){l.resumeQueue.add(m),l.timeouts.delete(u),u.cancel(),c=u.time-di.now()}function m(){c>0&&!Wi.skipAnimation?(l.delayed=!0,u=di.setTimeout(g,c),l.pauseQueue.add(p),l.timeouts.add(u)):g()}function g(){l.delayed&&(l.delayed=!1),l.pauseQueue.delete(p),l.timeouts.delete(u),e<=(l.cancelId||0)&&(d=!0);try{r.start(ga({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Aa=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?za(e.get()):t.every((e=>e.noop))?Da(e.get()):Oa(e.get(),t.every((e=>e.finished))),Da=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Oa=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),za=e=>({value:e,cancelled:!0,finished:!1});function Fa(e,t,n,o){const{callId:l,parentId:r,onRest:i}=t,{asyncTo:s,promise:a}=n;return r||e!==s||t.reset?n.promise=(async()=>{n.asyncId=l,n.asyncTo=e;const c=ka(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=l<=(n.cancelId||0)&&za(o)||l!==n.asyncId&&Oa(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const r=new Ha,i=new Ga;return(async()=>{if(Wi.skipAnimation)throw Va(n),i.result=Oa(o,!1),d(i),i;m(r);const s=Pi.obj(e)?ga({},e):ga({},t,{to:e});s.parentId=l,Ri(c,((e,t)=>{Pi.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(r),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let h;if(Wi.skipAnimation)return Va(n),Oa(o,!1);try{let t;t=Pi.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(u),p]),h=Oa(o.get(),!0,!1)}catch(e){if(e instanceof Ha)h=e.result;else{if(!(e instanceof Ga))throw e;h=e.result}}finally{l==n.asyncId&&(n.asyncId=r,n.asyncTo=r?s:void 0,n.promise=r?a:void 0)}return Pi.fun(i)&&di.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function Va(e,t){Di(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Ha 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 Ga extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Ua=e=>e instanceof $a;let Wa=1;class $a extends Bs{constructor(...e){super(...e),this.id=Wa++,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=Xs(this);return e&&e.getValue()}to(...e){return Wi.to(this,e)}interpolate(...e){return Us(`${Hs}The "interpolate" function is deprecated in v9 (use "to" instead)`),Wi.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){ws(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Yi.sort(this),ws(this,{type:"priority",parent:this,priority:e})}}const ja=Symbol.for("SpringPhase"),Ka=e=>(1&e[ja])>0,qa=e=>(2&e[ja])>0,Ya=e=>(4&e[ja])>0,Za=(e,t)=>t?e[ja]|=3:e[ja]&=-3,Qa=(e,t)=>t?e[ja]|=4:e[ja]&=-5;class Xa extends $a{constructor(e,t){if(super(),this.key=void 0,this.animation=new Ma,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Pi.und(e)||!Pi.und(t)){const n=Pi.obj(e)?ga({},e):ga({},t,{from:e});Pi.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(qa(this)||this._state.asyncTo)||Ya(this)}get goal(){return Cs(this.animation.to)}get velocity(){const e=Xs(this);return e instanceof na?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Ka(this)}get isAnimating(){return qa(this)}get isPaused(){return Ya(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:l,toValues:r}=o;const i=ea(o.to);!i&&Es(o.to)&&(r=Ai(Cs(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==oa?1:i?i[a].lastPosition:r[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,l.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],r=null!=s.v0?s.v0:s.v0=Pi.arr(l.velocity)?l.velocity[a]:l.velocity;let i;if(Pi.und(l.duration))if(l.decay){const e=!0===l.decay?.998:l.decay,o=Math.exp(-(1-e)*t);d=n+r/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,i=r*o}else{i=null==s.lastVelocity?r:s.lastVelocity;const t=l.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=l.restVelocity||t/10,a=l.clamp?0:l.bounce,p=!Pi.und(a),m=n==c?s.v0>0:n<c;let g,h=!1;const f=1,v=Math.ceil(e/f);for(let e=0;e<v&&(g=Math.abs(i)>o,g||(u=Math.abs(c-d)<=t,!u));++e)p&&(h=d==c||d>c==m,h&&(i=-i*a,d=c)),i+=(1e-6*-l.tension*(d-c)+.001*-l.friction*i)/l.mass*f,d+=i*f}else{let o=1;l.duration>0&&(this._memoizedDuration!==l.duration&&(this._memoizedDuration=l.duration,s.durationProgress>0&&(s.elapsedTime=l.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(l.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+l.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,l.round)&&(n=!0)}));const s=Xs(this),a=s.getValue();if(t){const e=Cs(o.to);a===e&&!n||l.decay?n&&l.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return di.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(qa(this)){const{to:e,config:t}=this.animation;di.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 Pi.und(e)?(n=this.queue||[],this.queue=[]):n=[Pi.obj(e)?e:ga({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Aa(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Va(this._state,e&&this._lastCallId),di.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=Pi.obj(n)?n[t]:n,(null==n||Ba(n))&&(n=void 0),o=Pi.obj(o)?o[t]:o,null==o&&(o=void 0);const l={to:n,from:o};return Ka(this)||(e.reverse&&([n,o]=[o,n]),o=Cs(o),Pi.und(o)?Xs(this)||this._set(n):this._set(o)),l}_update(e,t){let n=ga({},e);const{key:o,defaultProps:l}=this;n.default&&Object.assign(l,ka(n,((e,t)=>/^on/.test(t)?va(e,o):e))),rc(this,n,"onProps"),ic(this,"onProps",n,this);const r=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 Ra(++this._lastCallId,{key:o,props:n,defaultProps:l,state:i,actions:{pause:()=>{Ya(this)||(Qa(this,!0),Oi(i.pauseQueue),ic(this,"onPause",Oa(this,Ja(this,this.animation.to)),this))},resume:()=>{Ya(this)&&(Qa(this,!1),qa(this)&&this._resume(),Oi(i.resumeQueue),ic(this,"onResume",Oa(this,Ja(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=ec(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(za(this));const o=!Pi.und(e.to),l=!Pi.und(e.from);if(o||l){if(!(t.callId>this._lastToId))return n(za(this));this._lastToId=t.callId}const{key:r,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!l||o||t.default&&!Pi.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Li(d,c);p&&(s.from=d),d=Cs(d);const m=!Li(u,a);m&&this._focus(u);const g=Ba(t.to),{config:h}=s,{decay:f,velocity:v}=h;(o||l)&&(h.velocity=0),t.config&&!g&&function(e,t,n){n&&(Pa(n=ga({},n),t),t=ga({},n,t)),Pa(e,t),Object.assign(e,t);for(const t in Ta)null==e[t]&&(e[t]=Ta[t]);let{mass:o,frequency:l,damping:r}=e;Pi.und(l)||(l<.01&&(l=.01),r<0&&(r=0),e.tension=Math.pow(2*Math.PI/l,2)*o,e.friction=4*Math.PI*r*o/l)}(h,ha(t.config,r),t.config!==i.config?ha(i.config,r):void 0);let b=Xs(this);if(!b||Pi.und(u))return n(Oa(this,!0));const _=Pi.und(t.reset)?l&&!t.default:!Pi.und(d)&&fa(t.reset,r),k=_?d:this.get(),y=Sa(u),E=Pi.num(y)||Pi.arr(y)||$s(y),C=!g&&(!E||fa(i.immediate||t.immediate,r));if(m){const e=aa(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=Es(u),B=!1;if(!w){const e=_||!Ka(this)&&p;(m||e)&&(B=Li(Sa(k),y),w=!B),(Li(s.immediate,C)||C)&&Li(h.decay,f)&&Li(h.velocity,v)||(w=!0)}if(B&&qa(this)&&(s.changed&&!_?w=!0:w||this._stop(a)),!g&&((w||Es(a))&&(s.values=b.getPayload(),s.toValues=Es(u)?null:S==oa?[1]:Ai(y)),s.immediate!=C&&(s.immediate=C,C||_||this._set(a)),w)){const{onRest:e}=s;Mi(lc,(e=>rc(this,t,e)));const o=Oa(this,Ja(this,a));Oi(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&di.batchedUpdates((()=>{s.changed=!_,null==e||e(o,this),_?ha(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}_&&this._set(k),g?n(Fa(t.to,t,this._state,this)):w?this._start():qa(this)&&!m?this._pendingCalls.add(n):n(Da(k))}_focus(e){const t=this.animation;e!==t.to&&(Ss(this)&&this._detach(),t.to=e,Ss(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Es(t)&&(xs(t,this),Ua(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Es(e)&&Ts(e,this)}_set(e,t=!0){const n=Cs(e);if(!Pi.und(n)){const e=Xs(this);if(!e||!Li(n,e.getValue())){const o=aa(n);e&&e.constructor==o?e.setValue(n):Js(this,o.create(n)),e&&di.batchedUpdates((()=>{this._onChange(n,t)}))}}return Xs(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,ic(this,"onStart",Oa(this,Ja(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),ha(this.animation.onChange,e,this)),ha(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Xs(this).reset(Cs(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),qa(this)||(Za(this,!0),Ya(this)||this._resume())}_resume(){Wi.skipAnimation?this.finish():Yi.start(this)}_stop(e,t){if(qa(this)){Za(this,!1);const n=this.animation;Mi(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),ws(this,{type:"idle",parent:this});const o=t?za(this.get()):Oa(this.get(),Ja(this,null!=e?e:n.to));Oi(this._pendingCalls,o),n.changed&&(n.changed=!1,ic(this,"onRest",o,this))}}}function Ja(e,t){const n=Sa(t);return Li(Sa(e.get()),n)}function ec(e,t=e.loop,n=e.to){let o=ha(t);if(o){const l=!0!==o&&Ca(o),r=(l||e).reverse,i=!l||l.reset;return tc(ga({},e,{loop:t,default:!1,pause:void 0,to:!r||Ba(n)?n:void 0,from:i?e.from:void 0,reset:i},l))}}function tc(e){const{to:t,from:n}=e=Ca(e),o=new Set;return Pi.obj(t)&&oc(t,o),Pi.obj(n)&&oc(n,o),e.keys=o.size?Array.from(o):null,e}function nc(e){const t=tc(e);return Pi.und(t.default)&&(t.default=ka(t)),t}function oc(e,t){Ri(e,((e,n)=>null!=e&&t.add(n)))}const lc=["onStart","onRest","onChange","onPause","onResume"];function rc(e,t,n){e.animation[n]=t[n]!==ba(t,n)?va(t[n],e.key):void 0}function ic(e,t,...n){var o,l,r,i;null==(o=(l=e.animation)[t])||o.call(l,...n),null==(r=(i=e.defaultProps)[t])||r.call(i,...n)}const sc=["onStart","onChange","onRest"];let ac=1;class cc{constructor(e,t){this.id=ac++,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(ga({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}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];Pi.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(tc(e)),this}start(e){let{queue:t}=this;return e?t=Ai(e).map(tc):this.queue=[],this._flush?this._flush(this,t):(fc(this,t),uc(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Mi(Ai(t),(t=>n[t].stop(!!e)))}else Va(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Pi.und(e))this.start({pause:!0});else{const t=this.springs;Mi(Ai(e),(e=>t[e].pause()))}return this}resume(e){if(Pi.und(e))this.start({pause:!1});else{const t=this.springs;Mi(Ai(e),(e=>t[e].resume()))}return this}each(e){Ri(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,l=this._changed.size>0;(o&&!this._started||l&&!this._started)&&(this._started=!0,Di(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const r=!o&&this._started,i=l||r&&n.size?this.get():null;l&&t.size&&Di(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),r&&(this._started=!1,Di(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)}di.onFrame(this._onFrame)}}function uc(e,t){return Promise.all(t.map((t=>dc(e,t)))).then((t=>Aa(e,t)))}async function dc(e,t,n){const{keys:o,to:l,from:r,loop:i,onRest:s,onResolve:a}=t,c=Pi.obj(t.default)&&t.default;i&&(t.loop=!1),!1===l&&(t.to=null),!1===r&&(t.from=null);const u=Pi.arr(l)||Pi.fun(l)?l:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Mi(sc,(n=>{const o=t[n];if(Pi.fun(o)){const l=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=l.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):l.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,Oi(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===ba(t,"cancel");(u||m&&d.asyncId)&&p.push(Ra(++e._lastAsyncId,{props:t,state:d,actions:{pause:Ni,resume:Ni,start(t,n){m?(Va(d,e._lastAsyncId),n(za(e))):(t.onRest=s,n(Fa(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=Aa(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){const n=ec(t,i,l);if(n)return fc(e,[n]),dc(e,n,!0)}return a&&di.batchedUpdates((()=>a(g,e,e.item))),g}function pc(e,t){const n=ga({},e.springs);return t&&Mi(Ai(t),(e=>{Pi.und(e.keys)&&(e=tc(e)),Pi.obj(e.to)||(e=ga({},e,{to:void 0})),hc(n,e,(e=>gc(e)))})),mc(e,n),n}function mc(e,t){Ri(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,xs(t,e))}))}function gc(e,t){const n=new Xa;return n.key=e,t&&xs(n,t),n}function hc(e,t,n){t.keys&&Mi(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function fc(e,t){Mi(t,(t=>{hc(e.springs,t,(t=>gc(t,e)))}))}const vc=["children"],bc=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,l={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(l[n]=e[n]);return l}(e,vc);const o=(0,xi.useContext)(_c),l=n.pause||!!o.pause,r=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,xi.useState)((()=>({inputs:t,result:e()}))),o=(0,xi.useRef)(),l=o.current;let r=l;return r?Boolean(t&&r.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,r.inputs))||(r={inputs:t,result:e()}):r=n,(0,xi.useEffect)((()=>{o.current=r,l==n&&(n.inputs=n.result=void 0)}),[r]),r.result}((()=>({pause:l,immediate:r})),[l,r]);const{Provider:i}=_c;return xi.createElement(i,{value:n},t)},_c=(kc=bc,yc={},Object.assign(kc,xi.createContext(yc)),kc.Provider._context=kc,kc.Consumer._context=kc,kc);var kc,yc;bc.Provider=_c.Provider,bc.Consumer=_c.Consumer;const Ec=()=>{const e=[],t=function(t){Ws(`${Hs}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 Mi(e,((e,l)=>{if(Pi.und(t))o.push(e.start());else{const r=n(t,e,l);r&&o.push(e.start(r))}})),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 Mi(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Mi(e,(e=>e.resume(...arguments))),this},t.set=function(t){Mi(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Mi(e,((e,o)=>{if(Pi.und(t))n.push(e.start());else{const l=this._getProps(t,e,o);l&&n.push(e.start(l))}})),n},t.stop=function(){return Mi(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Mi(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Pi.fun(e)?e(n,t):e};return t._getProps=n,t};function Cc(e,t,n){const o=Pi.fun(t)&&t;o&&!n&&(n=[]);const l=(0,xi.useMemo)((()=>o||3==arguments.length?Ec():void 0),[]),r=(0,xi.useRef)(0),i=Ks(),s=(0,xi.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=pc(e,t);return r.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?uc(e,t):new Promise((o=>{mc(e,n),s.queue.push((()=>{o(uc(e,t))})),i()}))}})),[]),a=(0,xi.useRef)([...s.ctrls]),c=[],u=Zs(e)||0;function d(e,n){for(let l=e;l<n;l++){const e=a.current[l]||(a.current[l]=new cc(null,s.flush)),n=o?o(l,e):t[l];n&&(c[l]=nc(n))}}(0,xi.useMemo)((()=>{Mi(a.current.slice(e,u),(e=>{Ia(e,l),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,xi.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>pc(e,c[t]))),m=(0,xi.useContext)(bc),g=Zs(m),h=m!==g&&wa(m);js((()=>{r.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Mi(e,(e=>e()))),Mi(a.current,((e,t)=>{null==l||l.add(e),h&&e.start({default:m});const n=c[t];n&&(xa(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),qs((()=>()=>{Mi(s.ctrls,(e=>e.stop(!0)))}));const f=p.map((e=>ga({},e)));return l?[f,l]:f}let Sc;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Sc||(Sc={}));class wc extends $a{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=bs(...t);const n=this._get(),o=aa(n);Js(this,o.create(n))}advance(e){const t=this._get();Li(t,this.get())||(Xs(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Ic(this._active)&&xc(this)}_get(){const e=Pi.arr(this.source)?this.source.map(Cs):Ai(Cs(this.source));return this.calc(...e)}_start(){this.idle&&!Ic(this._active)&&(this.idle=!1,Mi(ea(this),(e=>{e.done=!1})),Wi.skipAnimation?(di.batchedUpdates((()=>this.advance())),xc(this)):Yi.start(this))}_attach(){let e=1;Mi(Ai(this.source),(t=>{Es(t)&&xs(t,this),Ua(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Mi(Ai(this.source),(e=>{Es(e)&&Ts(e,this)})),this._active.clear(),xc(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=Ai(this.source).reduce(((e,t)=>Math.max(e,(Ua(t)?t.priority:0)+1)),0))}}function Bc(e){return!1!==e.idle}function Ic(e){return!e.size||Array.from(e).every(Bc)}function xc(e){e.idle||(e.idle=!0,Mi(ea(e),(e=>{e.done=!0})),ws(e,{type:"idle",parent:e}))}Wi.assign({createStringInterpolator:Vs,to:(e,t)=>new wc(e,t)}),Yi.advance;const Tc=window.ReactDOM;function Nc(e,t){if(null==e)return{};var n,o,l={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(l[n]=e[n]);return l}const Pc=["style","children","scrollTop","scrollLeft"],Lc=/^--/;function Mc(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Lc.test(e)||Ac.hasOwnProperty(e)&&Ac[e]?(""+t).trim():t+"px"}const Rc={};let Ac={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 Dc=["Webkit","Ms","Moz","O"];Ac=Object.keys(Ac).reduce(((e,t)=>(Dc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Ac);const Oc=["x","y","z"],zc=/^(matrix|translate|scale|rotate|skew)/,Fc=/^(translate)/,Vc=/^(rotate|skew)/,Hc=(e,t)=>Pi.num(e)&&0!==e?e+t:e,Gc=(e,t)=>Pi.arr(e)?e.every((e=>Gc(e,t))):Pi.num(e)?e===t:parseFloat(e)===t;class Uc extends ra{constructor(e){let{x:t,y:n,z:o}=e,l=Nc(e,Oc);const r=[],i=[];(t||n||o)&&(r.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Hc(e,"px"))).join(",")})`,Gc(e,0)]))),Ri(l,((e,t)=>{if("transform"===t)r.push([e||""]),i.push((e=>[e,""===e]));else if(zc.test(t)){if(delete l[t],Pi.und(e))return;const n=Fc.test(t)?"px":Vc.test(t)?"deg":"";r.push(Ai(e)),i.push("rotate3d"===t?([e,t,o,l])=>[`rotate3d(${e},${t},${o},${Hc(l,n)})`,Gc(l,0)]:e=>[`${t}(${e.map((e=>Hc(e,n))).join(",")})`,Gc(e,t.startsWith("scale")?1:0)])}})),r.length&&(l.transform=new Wc(r,i)),super(l)}}class Wc extends Bs{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 Mi(this.inputs,((n,o)=>{const l=Cs(n[0]),[r,i]=this.transforms[o](Pi.arr(l)?l:n.map(Cs));e+=" "+r,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Mi(this.inputs,(e=>Mi(e,(e=>Es(e)&&xs(e,this)))))}observerRemoved(e){0==e&&Mi(this.inputs,(e=>Mi(e,(e=>Es(e)&&Ts(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),ws(this,e)}}const $c=["scrollTop","scrollLeft"];Wi.assign({batchedUpdates:Tc.unstable_batchedUpdates,createStringInterpolator:Vs,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 jc=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new ra(e)),getComponentProps:o=(e=>e)}={})=>{const l={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},r=e=>{const t=ma(e)||"Anonymous";return(e=Pi.str(e)?r[e]||(r[e]=ua(e,l)):e[pa]||(e[pa]=ua(e,l))).displayName=`Animated(${t})`,e};return Ri(e,((t,n)=>{Pi.arr(e)&&(n=ma(t)),r[n]=r(t)})),{animated:r}})(["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:l,children:r,scrollTop:i,scrollLeft:s}=o,a=Nc(o,Pc),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Rc[t]||(Rc[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(let t in l)if(l.hasOwnProperty(t)){const n=Mc(t,l[t]);Lc.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 Uc(e),getComponentProps:e=>Nc(e,$c)}).animated,Kc=e=>e+1,qc=e=>({top:e.offsetTop,left:e.offsetLeft}),Yc=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:l}=e;const r=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(Kc,0),[u,p]=(0,s.useReducer)(Kc,0),[m,g]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>r.current?qc(r.current):null),[l]),f=(0,s.useMemo)((()=>{if(!n||!r.current)return()=>{};const e=(0,Wr.getScrollContainer)(r.current);if(!e)return()=>{};const t=r.current.getBoundingClientRect();return()=>{const n=r.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[l,n]);return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void f();r.current.style.transform=void 0;const e=qc(r.current);c(),g({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[l]),function(e,t){const n=Pi.fun(e),[[o],l]=Cc(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:function(e){let{value:n}=e;if(!r.current)return;let{x:o,y:l}=n;o=Math.round(o),l=Math.round(l);const i=0===o&&0===l;r.current.style.transformOrigin="center center",r.current.style.transform=i?void 0:`translate3d(${o}px,${l}px,0)`,r.current.style.zIndex=t?"1":"",f()}}),r},Zc=".block-editor-block-list__block",Qc=".block-list-appender",Xc=".block-editor-button-block-appender";function Jc(e,t){return t.closest([Zc,Qc,Xc].join(","))===e}function eu(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Zc);return t?t.id.slice("block-".length):void 0}function tu(e){const t=(0,s.useRef)(),n=function(e){return(0,p.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:l}=t(co);if(l(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:l}=(0,p.useSelect)(co);return(0,s.useEffect)((()=>{if(!o(e)||l())return;if(null==n)return;if(!t.current)return;const{ownerDocument:r}=t.current;if(Jc(t.current,r.activeElement))return;const i=Wr.focus.tabbable.find(t.current).filter((e=>(0,Wr.isTextField)(e))),s=-1===n,a=i[s?i.length-1:0]||t.current;if(Jc(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=Wr.focus.tabbable.findNext(t.current);if(e&&Jc(t.current,e)&&(0,Wr.isFormElement)(e))return void e.focus()}(0,Wr.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function nu(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function ou(){const e=(0,p.useSelect)((e=>{const{getSettings:t}=e(co);return t().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",nu),t.addEventListener("mouseover",nu),()=>{t.removeEventListener("mouseout",nu),t.removeEventListener("mouseover",nu),t.classList.remove("is-hovered")}}),[e])}function lu(e){return(0,p.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:r,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__unstableIsFullySelected:p,__unstableSelectionHasUnmergeableBlock:m}=t(co),{outlineMode:g}=a(),h=n(e),f=r(e),v=s(e),b=u(e,!0),_=i(e);return c()({"is-selected":f,"is-highlighted":o(e),"is-multi-selected":_,"is-partially-selected":_&&!p()&&!m(),"is-reusable":(0,l.isReusableBlock)((0,l.getBlockType)(v)),"is-dragging":h,"has-child-selected":b,"remove-outline":f&&g&&d()})}),[e])}function ru(e){return(0,p.useSelect)((t=>{const n=t(co).getBlockName(e),o=(0,l.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,l.getBlockDefaultClassName)(n)}),[e])}function iu(e){return(0,p.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(co),r=o(e);if(null==r||!r.className)return;const i=(0,l.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?r.className:void 0}),[e])}function su(e){return(0,p.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:l,getBlockRootClientId:r,isBlockSelected:i}=t(co);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(l(s),r(e))}):void 0}),[e])}function au(e){const{isBlockSelected:t}=(0,p.useSelect)(co),{selectBlock:n,selectionChange:o}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((l=>{function r(r){l.parentElement.closest('[contenteditable="true"]')||(t(e)?r.target.isContentEditable||o(e):Jc(l,r.target)&&n(e))}return l.addEventListener("focusin",r),()=>{l.removeEventListener("focusin",r)}}),[t,n])}const cu=window.wp.keycodes;function uu(e){const t=(0,p.useSelect)((t=>t(co).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,p.useSelect)(co),{insertDefaultBlock:l,removeBlock:r}=(0,p.useDispatch)(co);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!==cu.ENTER&&s!==cu.BACKSPACE&&s!==cu.DELETE||a!==i||(0,Wr.isTextField)(a)||(t.preventDefault(),s===cu.ENTER?l({},n(e),o(e)+1):r(e))}function a(e){e.preventDefault()}}),[e,t,n,o,l,r])}function du(e){const{isNavigationMode:t,isBlockSelected:n}=(0,p.useSelect)(co),{setNavigationMode:o,selectBlock:l}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((r=>{function i(r){t()&&!r.defaultPrevented&&(r.preventDefault(),n(e)?o(!1):l(e))}return r.addEventListener("mousedown",i),()=>{r.addEventListener("mousedown",i)}}),[e,t,n,o])}function pu(){const e=(0,s.useContext)(Wh);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function mu(e){return(0,p.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(co);return n(e)}),[e])}function gu(){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:r={},isAligned:i}=(0,s.useContext)(hu),{index:a,mode:u,name:m,blockApiVersion:g,blockTitle:f,isPartOfSelection:v,adjustScrolling:b,enableAnimation:_}=(0,p.useSelect)((e=>{const{getBlockAttributes:t,getBlockIndex:o,getBlockMode:r,getBlockName:i,isTyping:s,getGlobalBlockCount:a,isBlockSelected:c,isBlockMultiSelected:u,isAncestorMultiSelected:d,isFirstMultiSelectedBlock:p}=e(co),{getActiveBlockVariation:m}=e(l.store),g=c(n),h=u(n)||d(n),f=i(n),v=(0,l.getBlockType)(f),b=m(f,t(n));return{index:o(n),mode:r(n),name:f,blockApiVersion:(null==v?void 0:v.apiVersion)||1,blockTitle:(null==b?void 0:b.title)||(null==v?void 0:v.title),isPartOfSelection:g||h,adjustScrolling:g||p(n),enableAnimation:!s()&&a()<=200}}),[n]),k=mu(n),y=(0,h.sprintf)((0,h.__)("Block: %s"),f),E="html"!==u||t?"":"-visual",C=(0,d.useMergeRefs)([e.ref,tu(n),Lo(n),au(n),uu(n),du(n),ou(),pu(),Yc({isSelected:v,adjustScrolling:b,enableAnimation:_,triggerAnimationOnChange:a}),(0,d.useDisabled)({isDisabled:!k})]),S=go();return g<2&&n===S.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...r,...e,ref:C,id:`block-${n}${E}`,role:"document","aria-label":y,"data-block":n,"data-type":m,"data-title":f,className:c()(c()("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":k}),o,e.className,r.className,lu(n),ru(n),iu(n),su(n)),style:{...r.style,...e.style}}}gu.save=l.__unstableGetBlockProps;const hu=(0,s.createContext)();function fu(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",gu(o,{__unstableIsHtml:n}),t)}const vu=(0,p.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:l,getBlockMode:r,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(co),d=a(n),p=l(n),m=s(o),g=c(n,o),h=u(n,o),{name:f,attributes:v,isValid:b}=d||{};return{mode:r(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:h,block:d,name:f,attributes:v,isValid:b,isSelected:p}})),bu=(0,p.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:r,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(co);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(co),l=n(),{clientId:i}=t,s=l.length?l:[i];r(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:l}=t,{getBlockIndex:r}=o(co),s=r(n);i(e,s+1,l)},onMerge(e){const{clientId:n,rootClientId:r}=t,{getPreviousBlockClientId:i,getNextBlockClientId:c,getBlock:u}=o(co);if(e){const e=c(n);e&&s(n,e)}else{const e=i(n);if(e)s(e,n);else if(r){const e=(0,l.switchToBlockType)(u(r),"*");e&&e.length&&a(r,e,0)}}},onReplace(e,n,o){e.length&&!(0,l.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}})),_u=(0,d.compose)(d.pure,vu,bu,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,m.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:r,canRemove:i,clientId:a,isSelected:u,isSelectionEnabled:d,className:m,name:g,isValid:h,attributes:f,wrapperProps:v,setAttributes:b,onReplace:_,onInsertBlocksAfter:k,onMerge:y,toggleSelection:E}=e;const{themeSupportsLayout:C,hasContentLockedParent:S,isContentBlock:w,isContentLocking:B,isTemporarilyEditingAsBlocks:I}=(0,p.useSelect)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(co),i=!!n(a);return{themeSupportsLayout:t().supportsLayout,isContentBlock:e(l.store).__experimentalHasContentRoleAttribute(g),hasContentLockedParent:i,isContentLocking:"contentOnly"===o(a)&&!i,isTemporarilyEditingAsBlocks:r()===a}}),[g,a]),{removeBlock:x}=(0,p.useDispatch)(co),T=(0,s.useCallback)((()=>x(a)),[a]);let N=(0,s.createElement)(Zr,{name:g,isSelected:u,attributes:f,setAttributes:b,insertBlocksAfter:r?void 0:k,onReplace:i?_:void 0,onRemove:i?T:void 0,mergeBlocks:i?y:void 0,clientId:a,isSelectionEnabled:d,toggleSelection:E});const P=(0,l.getBlockType)(g);S&&!w&&(v={...v,tabIndex:-1}),null!=P&&P.getEditWrapperProps&&(v=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=c()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(v,P.getEditWrapperProps(f)));const L=v&&!!v["data-align"]&&!C;let M;if(L&&(N=(0,s.createElement)("div",{className:"wp-block","data-align":v["data-align"]},N)),h)M="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},N),(0,s.createElement)(fu,{isHtml:!0},(0,s.createElement)(ci,{clientId:a}))):(null==P?void 0:P.apiVersion)>1?N:(0,s.createElement)(fu,v,N);else{const e=n?(0,l.serializeRawBlock)(n):(0,l.getSaveContent)(P,f);M=(0,s.createElement)(fu,{className:"has-warning"},(0,s.createElement)(oi,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,Wr.safeHTML)(e)))}const{"data-align":R,...A}=null!==(t=v)&&void 0!==t?t:{},D={clientId:a,className:c()({"is-content-locked":B,"is-content-locked-temporarily-editing-as-blocks":I,"is-content-block":S&&w},R&&C&&`align${R}`,m),wrapperProps:A,isAligned:L},O=(0,s.useMemo)((()=>D),Object.values(D));return(0,s.createElement)(hu.Provider,{value:O},(0,s.createElement)(si,{fallback:(0,s.createElement)(fu,{className:"has-warning"},(0,s.createElement)(ri,null))},M))})),ku=window.wp.htmlEntities,yu=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),Eu=[(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.")],Cu=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Eu.length));return(0,s.createElement)(m.Tip,null,Eu[e])},Su=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),wu=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:l}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:Su});const r=(0,s.createElement)(m.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",l,{"has-colors":o})},r)})),Bu=function(e){let{title:t,icon:n,description:o,blockType:l}=e;return l&&(V()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=l)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(wu,{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)))},Iu=(0,d.createHigherOrderComponent)((e=>(0,p.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...l}=t;if(!n)return(0,s.createElement)(e,i({registry:o},l));const[r,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,p.createRegistry)({},o);e.registerStore(so,ao),a(e)}),[o]),r?(0,s.createElement)(p.RegistryProvider,{value:r},(0,s.createElement)(e,i({registry:r},l))):null}))),"withRegistryProvider"),xu=()=>{};function Tu(e){let{clientId:t=null,value:n,selection:o,onChange:r=xu,onInput:i=xu}=e;const a=(0,p.useRegistry)(),{resetBlocks:c,resetSelection:u,replaceInnerBlocks:d,setHasControlledInnerBlocks:m,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(co),{getBlockName:h,getBlocks:f}=a.select(co),v=(0,p.useSelect)((e=>!t||e(co).areInnerBlocksControlled(t)),[t]),b=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),k=()=>{n&&(g(),t?a.batch((()=>{m(t,!0);const e=n.map((e=>(0,l.cloneBlock)(e)));_.current&&(b.current.incoming=e),g(),d(t,e)})):(_.current&&(b.current.incoming=n),c(n)))},y=(0,s.useRef)(i),E=(0,s.useRef)(r);(0,s.useEffect)((()=>{y.current=i,E.current=r}),[i,r]),(0,s.useEffect)((()=>{b.current.outgoing.includes(n)?b.current.outgoing[b.current.outgoing.length-1]===n&&(b.current.outgoing=[]):f(t)!==n&&(b.current.outgoing=[],k(),o&&u(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{v||(b.current.outgoing=[],k())}),[v]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:l,__unstableIsLastBlockChangeIgnored:r,areInnerBlocksControlled:i}=a.select(co);let s=f(t),c=l(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(t))return;if(t&&!i(t))return;const a=l(),d=f(t),p=d!==s;if(s=d,p&&(b.current.incoming||r()))return b.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,b.current.outgoing.push(s),(c?E.current:y.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}const Nu=Iu((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,p.useDispatch)(co);return(0,s.useEffect)((()=>{o(n)}),[n]),Tu(e),(0,s.createElement)(Po,null,t)}));function Pu(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(m.Disabled,null,(0,s.createElement)(Kh,null)))}function Lu(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,p.useSelect)(co),{clearSelectedBlock:n}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((o=>{function l(l){(e()||t())&&l.target===o&&n()}return o.addEventListener("mousedown",l),()=>{o.removeEventListener("mousedown",l)}}),[e,t,n])}function Mu(e){return(0,s.createElement)("div",i({ref:Lu()},e))}function Ru(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:l,getSelectedBlocksInitialCaretPosition:r,__unstableIsFullySelected:i}=e(co);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:l(),initialPosition:r(),isFullSelection:i()}}function Au(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:l,isFullSelection:r}=(0,p.useSelect)(Ru,[]);return(0,d.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:s}=i;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||r&&(l.contentEditable=!0,l.focus(),s.getSelection().removeAllRanges())}),[o,t,n,l,e,r])}function Du(e,t,n,o){let l,r=Wr.focus.focusable.find(n);return t&&r.reverse(),r=r.slice(r.indexOf(e)+1),o&&(l=e.getBoundingClientRect()),r.find((function(e){if(1!==e.children.length||!function(e,t){return e.closest(Zc)===t.closest(Zc)}(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!Wr.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=l.right||t.right<=l.left)return!1}return!0}}))}function Ou(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:l}=(0,p.useSelect)(co),{selectBlock:r}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u}=a,d=c===cu.UP,p=c===cu.DOWN,m=c===cu.LEFT,g=c===cu.RIGHT,h=d||m,f=m||g,v=d||p,b=f||v,_=a.shiftKey,k=_||a.ctrlKey||a.altKey||a.metaKey,y=v?Wr.isVerticalEdge:Wr.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(o()){if(!l())return;if(a.defaultPrevented)return;if(!b)return;if(_)return;return a.preventDefault(),void(h?r(e()):r(t(),-1))}if(v?s||(s=(0,Wr.computeCaretRect)(C)):s=null,a.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===cu.UP||t===cu.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"===o?["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type")):"TEXTAREA"!==o}(u,c,k))return;const S=(0,Wr.isRTL)(u)?!h:h,{keepCaretInsideBlock:w}=n();if(_)(function(e,t){const n=Du(e,t,i);return n&&eu(n)})(u,h)&&y(u,h)&&(i.contentEditable=!0,i.focus());else if(v&&(0,Wr.isVerticalEdge)(u,h)&&!w){const e=Du(u,h,i,!0);e&&((0,Wr.placeCaretAtVerticalEdge)(e,h,s),a.preventDefault())}else if(f&&C.getSelection().isCollapsed&&(0,Wr.isHorizontalEdge)(u,S)&&!w){const e=Du(u,S,i);(0,Wr.placeCaretAtHorizontalEdge)(e,h),a.preventDefault()}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}const zu=window.wp.keyboardShortcuts;function Fu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,p.useSelect)(co),{multiSelect:o,selectBlock:l}=(0,p.useDispatch)(co),r=(0,zu.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((i=>{function s(s){if(!r("core/block-editor/select-all",s))return;const a=t();if(a.length<2&&!(0,Wr.isEntirelySelected)(s.target))return;s.preventDefault();const[c]=a,u=n(c),d=e(u);a.length!==d.length?o(d[0],d[d.length-1]):u&&(i.ownerDocument.defaultView.getSelection().removeAllRanges(),l(u))}return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}}),[])}function Vu(e,t){e.contentEditable=t,t&&e.focus()}function Hu(){const{startMultiSelect:e,stopMultiSelect:t}=(0,p.useDispatch)(co),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:l}=(0,p.useSelect)(co);return(0,d.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:s}=i;let a,c;function u(){t(),s.removeEventListener("mouseup",u),c=s.requestAnimationFrame((()=>{if(o())return;Vu(r,!1);const e=s.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);a.contains(t)&&a.focus()}}))}function d(t){let{buttons:o,target:c}=t;l()||1===o&&c.getAttribute("contenteditable")&&n()&&(a=i.activeElement,e(),s.addEventListener("mouseup",u),Vu(r,!0))}return r.addEventListener("mouseout",d),()=>{r.removeEventListener("mouseout",d),s.removeEventListener("mouseup",u),s.cancelAnimationFrame(c)}}),[e,t,n,o])}function Gu(e,t){e.contentEditable=t,t&&e.focus()}function Uu(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,p.useDispatch)(co),{getBlockParents:o,getBlockSelectionStart:l}=(0,p.useSelect)(co);return(0,d.useRefEffect)((n=>{const{ownerDocument:r}=n,{defaultView:i}=r;function s(r){const s=i.getSelection();if(!s.rangeCount)return;const a=r.shiftKey&&"mouseup"===r.type;if(s.isCollapsed&&!a)return void Gu(n,!1);let c=eu(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(s)),u=eu(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(s));if(a){const e=l(),t=eu(r.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],l=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[l],n[l])}else Gu(n,!1)}function a(){r.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){r.removeEventListener("selectionchange",s),i.removeEventListener("mouseup",s)}function u(){c(),a()}return a(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function Wu(){const{selectBlock:e}=(0,p.useDispatch)(co),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,p.useSelect)(co);return(0,d.useRefEffect)((l=>{function r(r){if(!t()||0!==r.button)return;const i=n(),s=eu(r.target);r.shiftKey?i!==s&&(l.contentEditable=!0,l.focus()):o()&&e(s)}return l.addEventListener("mousedown",r),()=>{l.removeEventListener("mousedown",r)}}),[e,t,n,o])}function $u(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,p.useSelect)(co),{replaceBlocks:r,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,p.useDispatch)(co);return(0,d.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===cu.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?r(t(),(0,l.createBlock)((0,l.getDefaultBlockName)())):i()):d.keyCode===cu.BACKSPACE||d.keyCode===cu.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===cu.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===cu.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function ju(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:l,getSelectedBlockClientId:r,getBlockCount:i}=(0,p.useSelect)(co),{setNavigationMode:a}=(0,p.useDispatch)(co),c=(0,p.useSelect)((e=>e(co).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function m(t){if(u.current)u.current=null;else if(l())e.current.focus();else if(r())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Wr.focus.tabbable[n](t.target).focus()}}const g=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:m}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:m}),f=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===cu.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==cu.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!l()&&!r())return void(e.target===s&&a(!0));if(((0,Wr.isFormElement)(e.target)||e.target.getAttribute("data-block")===r())&&(0,Wr.isFormElement)(Wr.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 l;if(o.keyCode!==cu.TAB)return;if("region"===(null===(l=o.target)||void 0===l?void 0:l.getAttribute("role")))return;if(e.current===o.target)return;const r=o.shiftKey?"findPrevious":"findNext",i=Wr.focus.tabbable[r](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[g,(0,d.useMergeRefs)([e,f]),h]}(),o=(0,p.useSelect)((e=>e(co).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,$u(),Hu(),Uu(),Wu(),Au(),Fu(),Ou(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}const Ku=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[l,r,a]=ju();return(0,s.createElement)(s.Fragment,null,l,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([r,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)})),qu="editor-styles-wrapper";function Yu(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}const Zu=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:l,tabIndex:r=0,assets:a,isZoomedOut:u,...p}=e;const[,g]=(0,s.useReducer)((()=>({}))),[f,v]=(0,s.useState)(),[b,_]=(0,s.useState)([]),k=Yu(null==a?void 0:a.styles),y=Yu(null==a?void 0:a.scripts),E=Lu(),[C,S,w]=ju(),[B,{height:I}]=(0,d.useResizeObserver)(),x=(0,d.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:l}=e,{readyState:r,documentElement:i}=o;return t=o,("interactive"===r||"complete"===r)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,l=window[o],r={};for(const t in e)r[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();r.clientX+=e.left,r.clientY+=e.top}const i=new l(e.type,r);!n.dispatchEvent(i)&&e.preventDefault()}const l=["dragover"];for(const t of l)e.addEventListener(t,o)}(o),v(o),E(i),_(Array.from(l.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=l.dir,i.removeChild(o.head),i.removeChild(o.body),t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1),!0)}return e.addEventListener("load",o),()=>{var l,r;e.removeEventListener("load",o),null===(l=t)||void 0===l||l.removeEventListener("dragover",n),null===(r=t)||void 0===r||r.removeEventListener("drop",n)}}),[]),T=(0,d.useRefEffect)((e=>{y.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,l)=>{const r=e.ownerDocument.createElement("script");r.id=n,o?(r.src=o,r.onload=()=>t(),r.onerror=()=>l()):t(),e.appendChild(r)}))}(e,n)))),Promise.resolve()).finally((()=>{g()}))}),[]),N=(0,d.useMergeRefs)([n,E,S]),P=(0,d.useRefEffect)((e=>{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&&function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:l}=t;return o?e(l):n&&(n.includes(`.${qu}`)||n.includes(".wp-block"))}))}(o)&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return l=(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:l,media:r,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:l,media:r,key:o})})),l),(0,s.createElement)(s.Fragment,null,r>=0&&C,(0,s.createElement)("iframe",i({},p,{ref:(0,d.useMergeRefs)([t,x]),tabIndex:r,srcDoc:"<!doctype html>",title:(0,h.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:T},l,(0,s.createElement)("style",null,`html { transition: background 5s; ${u?"background: #2f2f2f; transition: background 0s;":""} }`)),(0,s.createElement)("body",{ref:N,className:c()("block-editor-iframe__body",qu,...b,{"is-zoomed-out":u}),style:u?{marginBottom:`-${.55*I-100}px`}:{}},B,(0,s.createElement)("div",{style:{display:"none"},ref:P}),(0,s.createElement)(m.__experimentalStyleProvider,{document:f},o))),f.documentElement)),r>=0&&w)}));var Qu={grad:.9,turn:360,rad:360/(2*Math.PI)},Xu=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Ju=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},ed=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},td=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},nd=function(e){return{r:ed(e.r,0,255),g:ed(e.g,0,255),b:ed(e.b,0,255),a:ed(e.a)}},od=function(e){return{r:Ju(e.r),g:Ju(e.g),b:Ju(e.b),a:Ju(e.a,3)}},ld=/^#([0-9a-f]{3,8})$/i,rd=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},id=function(e){var t=e.r,n=e.g,o=e.b,l=e.a,r=Math.max(t,n,o),i=r-Math.min(t,n,o),s=i?r===t?(n-o)/i:r===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:r?i/r*100:0,v:r/255*100,a:l}},sd=function(e){var t=e.h,n=e.s,o=e.v,l=e.a;t=t/360*6,n/=100,o/=100;var r=Math.floor(t),i=o*(1-n),s=o*(1-(t-r)*n),a=o*(1-(1-t+r)*n),c=r%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:l}},ad=function(e){return{h:td(e.h),s:ed(e.s,0,100),l:ed(e.l,0,100),a:ed(e.a)}},cd=function(e){return{h:Ju(e.h),s:Ju(e.s),l:Ju(e.l),a:Ju(e.a,3)}},ud=function(e){return sd((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},dd=function(e){return{h:(t=id(e)).h,s:(l=(200-(n=t.s))*(o=t.v)/100)>0&&l<200?n*o/100/(l<=100?l:200-l)*100:0,l:l/2,a:t.a};var t,n,o,l},pd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,md=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,fd={string:[[function(e){var t=ld.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?Ju(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?Ju(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=gd.exec(e)||hd.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:nd({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=pd.exec(e)||md.exec(e);if(!t)return null;var n,o,l=ad({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Qu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ud(l)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,l=e.a,r=void 0===l?1:l;return Xu(t)&&Xu(n)&&Xu(o)?nd({r:Number(t),g:Number(n),b:Number(o),a:Number(r)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,l=e.a,r=void 0===l?1:l;if(!Xu(t)||!Xu(n)||!Xu(o))return null;var i=ad({h:Number(t),s:Number(n),l:Number(o),a:Number(r)});return ud(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,l=e.a,r=void 0===l?1:l;if(!Xu(t)||!Xu(n)||!Xu(o))return null;var i=function(e){return{h:td(e.h),s:ed(e.s,0,100),v:ed(e.v,0,100),a:ed(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(r)});return sd(i)},"hsv"]]},vd=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]},bd=function(e,t){var n=dd(e);return{h:n.h,s:ed(n.s+100*t,0,100),l:n.l,a:n.a}},_d=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},kd=function(e,t){var n=dd(e);return{h:n.h,s:n.s,l:ed(n.l+100*t,0,100),a:n.a}},yd=function(){function e(e){this.parsed=function(e){return"string"==typeof e?vd(e.trim(),fd.string):"object"==typeof e&&null!==e?vd(e,fd.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 Ju(_d(this.rgba),2)},e.prototype.isDark=function(){return _d(this.rgba)<.5},e.prototype.isLight=function(){return _d(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=od(this.rgba)).r,n=e.g,o=e.b,r=(l=e.a)<1?rd(Ju(255*l)):"","#"+rd(t)+rd(n)+rd(o)+r;var e,t,n,o,l,r},e.prototype.toRgb=function(){return od(this.rgba)},e.prototype.toRgbString=function(){return t=(e=od(this.rgba)).r,n=e.g,o=e.b,(l=e.a)<1?"rgba("+t+", "+n+", "+o+", "+l+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,l},e.prototype.toHsl=function(){return cd(dd(this.rgba))},e.prototype.toHslString=function(){return t=(e=cd(dd(this.rgba))).h,n=e.s,o=e.l,(l=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+l+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,l},e.prototype.toHsv=function(){return e=id(this.rgba),{h:Ju(e.h),s:Ju(e.s),v:Ju(e.v),a:Ju(e.a,3)};var e},e.prototype.invert=function(){return Ed({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),Ed(bd(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Ed(bd(this.rgba,-e))},e.prototype.grayscale=function(){return Ed(bd(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Ed(kd(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Ed(kd(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?Ed({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Ju(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=dd(this.rgba);return"number"==typeof e?Ed({h:e,s:t.s,l:t.l,a:t.a}):Ju(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Ed(e).toHex()},e}(),Ed=function(e){return e instanceof yd?e:new yd(e)},Cd=[],Sd=function(e){e.forEach((function(e){Cd.indexOf(e)<0&&(e(yd,fd),Cd.push(e))}))};function wd(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 l in n)o[n[l]]=l;var r={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var l,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(!r.length)for(var d in n)r[d]=new e(n[d]).toRgb();for(var p in n){var m=(l=a,i=r[p],Math.pow(l.r-i.r,2)+Math.pow(l.g-i.g,2)+Math.pow(l.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),l="transparent"===o?"#0000":n[o];return l?new e(l).toRgb():null},"name"])}var Bd=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Id=function(e){return.2126*Bd(e.r)+.7152*Bd(e.g)+.0722*Bd(e.b)};function xd(e){e.prototype.luminance=function(){return e=Id(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,l,r,i,s,a,c=t instanceof e?t:new e(t);return r=this.rgba,i=c.toRgb(),n=(s=Id(r))>(a=Id(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===l&&(l=Math.pow(10,o)),Math.floor(l*n)/l+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(r=(n=t).size)?"normal":r,"AAA"===(l=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===l&&"large"===i?3:4.5);var n,o,l,r,i}}var Td=n(3124),Nd=n.n(Td);const Pd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Ld(e,t){t=t||{};let n=1,o=1;function l(e){const t=e.match(/\n/g);t&&(n+=t.length);const l=e.lastIndexOf("\n");o=~l?e.length-l:o+e.length}function r(){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(l){const r=new Error(t.source+":"+n+":"+o+": "+l);if(r.reason=l,r.filename=t.source,r.line=n,r.column=o,r.source=e,!t.silent)throw r;s.push(r)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return l(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function g(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){const t=r();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,l(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function f(){const e=p(/^([^{]+)/);if(e)return Md(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=r();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=Md(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Pd,""),value:n?Md(n[0]).replace(Pd,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(e));return u()?e:a("missing '}'")}function _(){let e;const t=[],n=r();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=r(),o=p(t);if(!o)return;const l={type:e};return l[e]=o[1].trim(),n(l)}}function S(){if("@"===e[0])return function(){const e=r();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 l,i=g();for(;l=_();)i.push(l),i=i.concat(g());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=r(),t=p(/^@media *([^{]+)/);if(!t)return;const n=Md(t[1]);if(!c())return a("@media missing '{'");const o=g().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=r(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Md(t[1]),media:Md(t[2])})}()||function(){const e=r(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Md(t[1]);if(!c())return a("@supports missing '{'");const o=g().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||k()||y()||E()||function(){const e=r(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Md(t[1]),o=Md(t[2]);if(!c())return a("@document missing '{'");const l=g().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:l}):a("@document missing '}'")}()||function(){const e=r();if(!p(/^@page */))return;const t=f()||[];if(!c())return a("@page missing '{'");let n,o=g();for(;n=v();)o.push(n),o=o.concat(g());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=r();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=g().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=r();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=r(),t=f();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Rd(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Md(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Rd(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){Rd(e,o)})):n&&"object"==typeof n&&Rd(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ad=n(8575),Dd=n.n(Ad);const Od=zd;function zd(e){this.options=e||{}}zd.prototype.emit=function(e){return e},zd.prototype.visit=function(e){return this[e.type](e)},zd.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,l=e.length;o<l;o++)n+=this.visit(e[o]),t&&o<l-1&&(n+=this.emit(t));return n};const Fd=Vd;function Vd(e){Od.call(this,e)}Dd()(Vd,Od),Vd.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Vd.prototype.comment=function(e){return this.emit("",e.position)},Vd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Vd.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Vd.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("}")},Vd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Vd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Vd.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Vd.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Vd.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Vd.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("}")},Vd.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Vd.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Vd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Vd.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("}"):""},Vd.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};const Hd=Gd;function Gd(e){e=e||{},Od.call(this,e),this.indentation=e.indent}Dd()(Gd,Od),Gd.prototype.compile=function(e){return this.stylesheet(e)},Gd.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Gd.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Gd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Gd.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}")},Gd.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}")},Gd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Gd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Gd.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}")},Gd.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)+"}")},Gd.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")},Gd.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}")},Gd.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}")},Gd.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}")},Gd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Gd.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()+"}"):""},Gd.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Gd.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};const Ud=function(e,t){try{const l=Ld(e);return n=Nd().map(l,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new Fd(o):new Hd(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function Wd(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 $d(e,t){return new URL(e,t).toString()}const jd=e=>t=>{if("declaration"===t.type){const r=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]};Wd(e)&&o.push(e)}return o}(t.value).map((l=e,e=>({...e,newUrl:"url("+e.before+e.quote+$d(e.value,l)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=r,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,l;return t},Kd=/^(body|html|:root).*$/,qd=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(Kd)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},Yd=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 l=[];return t&&l.push(qd(t)),o&&l.push(jd(o)),l.length?Ud(n,(0,d.compose)(l)):n}))},Zd=".editor-styles-wrapper";function Qd(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,l=t.querySelector(Zd);let r;if(l)r=n.getComputedStyle(l,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),r=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=Ed(r);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function Xd(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>Yd(t,Zd)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Qd(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}function Jd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Ed(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 ep(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)("style",null,o)}function tp(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,s.createElement)("style",null,n)}function np(e){let{id:t,colors:n}=e;const o=Jd(n);return(0,s.createElement)(m.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:t},(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"}))))}function op(e){let{preset:t}=e;return(0,s.createElement)(np,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let lp;Sd([wd,xd]);const rp=2e3;function ip(e){let{viewportWidth:t,containerWidth:n,__experimentalPadding:o,__experimentalMinHeight:l}=e;const[r,{height:i}]=(0,d.useResizeObserver)(),{styles:a,assets:c,duotone:u}=(0,p.useSelect)((e=>{var t,n;const o=e(co).getSettings();return{styles:o.styles,assets:o.__unstableResolvedAssets,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),g=(0,s.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:a),[a]),h=(0,s.useMemo)((()=>{var e,t;return[...null!==(e=null==u?void 0:u.default)&&void 0!==e?e:[],...null!==(t=null==u?void 0:u.theme)&&void 0!==t?t:[]]}),[u]);lp=lp||(0,d.pure)(Kh);const f=n/t;return(0,s.createElement)(m.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${f})`,height:i*f,maxHeight:i>rp?rp*f:void 0,minHeight:l}},(0,s.createElement)(Zu,{head:(0,s.createElement)(Xd,{styles:g}),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=o+"px",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:rp,minHeight:0!==f&&f<1&&l?l/f:l}},r,h.map((e=>(0,s.createElement)(op,{preset:e,key:e.slug}))),(0,s.createElement)(lp,{renderAppender:!1})))}function sp(e){const[t,{width:n}]=(0,d.useResizeObserver)();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,s.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,s.createElement)(ip,i({},e,{containerWidth:n}))))}const ap=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:l=!1,__experimentalOnClick:r,__experimentalMinHeight:i}=e;const a=(0,p.useSelect)((e=>e(co).getSettings()),[]),c=(0,s.useMemo)((()=>{const e={...a};return e.__experimentalBlockPatterns=[],e}),[a]),d=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(Nu,{value:d,settings:c},l?(0,s.createElement)(Pu,{onClick:r}):(0,s.createElement)(sp,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function cp(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const l=(0,p.useSelect)((e=>e(co).getSettings()),[]),r=(0,d.useDisabled)(),i=(0,d.useMergeRefs)([n.ref,r]),a=(0,s.useMemo)((()=>({...l,__experimentalBlockPatterns:[]})),[l]),m=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),g=(0,s.createElement)(Nu,{value:m,settings:a},(0,s.createElement)(Yh,{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?g:null}}const up=function(e){var t;let{item:n}=e;const{name:o,title:r,icon:i,description:a,initialAttributes:c,example:u}=n,d=(0,l.isReusableBlock)(n);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},d||u?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(ap,{__experimentalPadding:16,viewportWidth:null!==(t=null==u?void 0:u.viewportWidth)&&void 0!==t?t:500,blocks:u?(0,l.getBlockFromExample)(o,{attributes:{...u.attributes,...c},innerBlocks:u.innerBlocks}):(0,l.createBlock)(o,c)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,h.__)("No Preview Available."))),!d&&(0,s.createElement)(Bu,{title:r,icon:i,description:a}))},dp=(0,s.createContext)(),pp=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:l,...r}=e;const a=(0,s.useContext)(dp);return(0,s.createElement)(m.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},r),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,l):"function"==typeof l?l(t):(0,s.createElement)(m.Button,t,l)}))})),mp=(0,s.createElement)(D.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function gp(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","data-testid":"block-draggable-chip"},(0,s.createElement)(m.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(m.FlexItem,null,n?(0,s.createElement)(wu,{icon:n}):(0,h.sprintf)(
13
  /* translators: %d: Number of blocks. */
14
+ (0,h._n)("%d block","%d blocks",t),t)),(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(wu,{icon:mp})))))}const hp=e=>{let{isEnabled:t,blocks:n,icon:o,children:l}=e;const r={type:"inserter",blocks:n};return(0,s.createElement)(m.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:r,__experimentalDragComponent:(0,s.createElement)(gp,{count:n.length,icon:o})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return l({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))},fp=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:r,onHover:a,isDraggable:u,...d}=e;const p=(0,s.useRef)(!1),g=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},h=(0,s.useMemo)((()=>[(0,l.createBlock)(o.name,o.initialAttributes,(0,l.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,s.createElement)(hp,{isEnabled:u&&!o.disabled,blocks:h,icon:o.icon},(e=>{let{draggable:l,onDragStart:u,onDragEnd:h}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:l,onDragStart:e=>{p.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{p.current=!1,h&&h(e)}},(0,s.createElement)(pp,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),r(o,(0,cu.isAppleOS)()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===cu.ENTER&&(e.preventDefault(),r(o,(0,cu.isAppleOS)()?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:g},(0,s.createElement)(wu,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,s.createElement)(m.__experimentalTruncate,{numberOfLines:3},o.title))))}))})),vp=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,qt.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))})),bp=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(dp);return(0,s.createElement)(m.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),_p=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:r,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(vp,{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)(bp,{key:t},e.map(((e,r)=>(0,s.createElement)(fp,{key:e.id,item:e,className:(0,l.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a&&!e.isDisabled,isFirst:0===t&&0===r})))))),r)},kp=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)(m.Icon,{icon:n})),(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},o))},yp=(e,t)=>{const{categories:n,collections:o,items:r}=(0,p.useSelect)((t=>{const{getInserterItems:n}=t(co),{getCategories:o,getCollections:r}=t(l.store);return{categories:o(),collections:r(),items:n(e)}}),[e]);return[r,n,o,(0,s.useCallback)(((e,n)=>{let{name:o,initialAttributes:r,innerBlocks:i}=e;const s=(0,l.createBlock)(o,r,(0,l.createBlocksFromInnerBlocksTemplate)(i));t(s,void 0,n)}),[t])]},Ep=function(e){let{children:t}=e;const n=(0,m.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(dp.Provider,{value:n},t)},Cp=[],Sp=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:l}=e;const[r,i,a,c]=yp(t,n),p=(0,s.useMemo)((()=>(0,u.orderBy)(r,["frecency"],["desc"]).slice(0,6)),[r]),m=(0,s.useMemo)((()=>r.filter((e=>!e.category))),[r]),g=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(r)),[r]),f=(0,s.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=r.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[r,a]);(0,s.useEffect)((()=>()=>o(null)),[]);const v=(0,d.useAsyncList)(i),b=i.length===v.length,_=(0,s.useMemo)((()=>Object.entries(a)),[a]),k=(0,d.useAsyncList)(b?_:Cp);return(0,s.createElement)(Ep,null,(0,s.createElement)("div",null,l&&!!p.length&&(0,s.createElement)(kp,{title:(0,h._x)("Most used","blocks")},(0,s.createElement)(_p,{items:p,onSelect:c,onHover:o,label:(0,h._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=g[e.slug];return t&&t.length?(0,s.createElement)(kp,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(_p,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(kp,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,h.__)("Uncategorized")},(0,s.createElement)(_p,{items:m,onSelect:c,onHover:o,label:(0,h.__)("Uncategorized")})),(0,u.map)(k,(e=>{let[t,n]=e;const l=f[t];return l&&l.length?(0,s.createElement)(kp,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(_p,{items:l,onSelect:c,onHover:o,label:n.title})):null}))))},wp=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,openPatternExplorer:l}=e;const r=(0,d.useViewportMatch)("medium","<"),i=c()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns");return(0,s.createElement)(m.Flex,{justify:"space-between",align:"start",gap:"4",className:i},(0,s.createElement)(m.FlexItem,{isBlock:!0},(0,s.createElement)(m.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})()})),!r&&(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(m.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:(0,h.__)("Explore all patterns"),onClick:()=>l()},(0,h._x)("Explore","Label for showing all block patterns"))))},Bp=window.wp.notices,Ip=(e,t)=>{const{patternCategories:n,patterns:o}=(0,p.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(co);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:r}=(0,p.useDispatch)(Bp.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,l.cloneBlock)(e))),t.name),r((0,h.sprintf)(
15
  /* translators: %s: block pattern title. */
16
+ (0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function xp(e){let{isDraggable:t,pattern:n,onClick:o,composite:l}=e;const{blocks:r,viewportWidth:a}=n,c=`block-editor-block-patterns-list__item-description-${(0,d.useInstanceId)(xp)}`;return(0,s.createElement)(hp,{isEnabled:t,blocks:r},(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)(m.__unstableCompositeItem,i({role:"option",as:"div"},l,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,r)}),(0,s.createElement)(ap,{blocks:r,viewportWidth:a}),(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,s.createElement)(m.VisuallyHidden,{id:c},n.description)))}))}function Tp(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const Np=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:l,orientation:r,label:a=(0,h.__)("Block Patterns")}=e;const c=(0,m.__unstableUseCompositeState)({orientation:r});return(0,s.createElement)(m.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,s.createElement)(xp,{key:e.name,pattern:e,onClick:l,isDraggable:t,composite:c}):(0,s.createElement)(Tp,{key:e.name}))))};function Pp(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const l="block-editor-block-patterns-explorer__sidebar";return(0,s.createElement)("div",{className:`${l}__categories-list`},n.map((e=>{let{name:n,label:r}=e;return(0,s.createElement)(m.Button,{key:n,label:r,className:`${l}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},r)})))}function Lp(e){let{filterValue:t,setFilterValue:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,s.createElement)(m.SearchControl,{onChange:n,value:t,label:(0,h.__)("Search for patterns"),placeholder:(0,h.__)("Search")}))}const Mp=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:l,setFilterValue:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,s.createElement)(Lp,{filterValue:l,setFilterValue:r}),!l&&(0,s.createElement)(Pp,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},Rp=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(dr,{className:"block-editor-inserter__no-results-icon",icon:Su}),(0,s.createElement)("p",null,(0,h.__)("No results found.")))},Ap=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:r,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,p.useSelect)(co),{destinationRootClientId:d,destinationIndex:m}=(0,p.useSelect)((e=>{const{getSelectedBlockClientId:l,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(co),c=l();let u,d=t;return void 0!==n?u=n:o?u=s(o):!r&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,r]),{replaceBlocks:g,insertBlocks:f,showInsertionPoint:v,hideInsertionPoint:b}=(0,p.useDispatch)(co),_=(0,s.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!r&&o&&(0,l.isUnmodifiedDefaultBlock)(o)?g(o.clientId,e,null,a||n?0:null,t):f(e,m,d,!0,a||n?0:null,t);const s=(0,h.sprintf)(// translators: %d: the name of the block that has been added
17
+ (0,h._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,qt.speak)(s),i&&i()}),[r,c,g,f,d,m,i,a]),k=(0,s.useCallback)((e=>{e?v(d,m):b()}),[v,b,d,m]);return[d,_,k]};function Dp(e){return e.toLowerCase()}var Op=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],zp=/[^A-Z0-9]+/gi;function Fp(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?Op:n,l=t.stripRegexp,r=void 0===l?zp:l,i=t.transform,s=void 0===i?Dp:i,a=t.delimiter,c=void 0===a?" ":a,u=Vp(Vp(e,o,"$1\0$2"),r,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(s).join(c)}function Vp(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}var Hp=n(4793),Gp=n.n(Hp);const Up=e=>e.name||"",Wp=e=>e.title,$p=e=>e.description||"",jp=e=>e.keywords||[],Kp=e=>e.category,qp=()=>null;function Yp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=Gp()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}function Zp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Fp(e).split(" ").filter(Boolean)}const Qp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Zp(Yp(e))},Xp=(e,t)=>e.filter((e=>!Qp(t).some((t=>t.includes(e))))),Jp=(e,t,n,o)=>0===Qp(o).length?e:em(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}}),em=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=Qp(t);if(0===o.length)return e;const l=e.map((e=>[e,tm(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return l.sort(((e,t)=>{let[,n]=e,[,o]=t;return o-n})),l.map((e=>{let[t]=e;return t}))};function tm(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Up,getTitle:l=Wp,getDescription:r=$p,getKeywords:i=jp,getCategory:s=Kp,getCollection:a=qp}=n,c=o(e),u=l(e),d=r(e),p=i(e),m=s(e),g=a(e),h=Yp(t),f=Yp(u);let v=0;if(h===f)v+=30;else if(f.startsWith(h))v+=20;else{const e=[c,u,d,...p,m,g].join(" "),t=Zp(h);0===Xp(t,e).length&&(v+=10)}return 0!==v&&c.startsWith("core/")&&(v+=c!==e.id?1:2),v}function nm(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,s.createElement)(m.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,h.sprintf)(
18
  /* translators: %d: number of patterns. %s: block pattern search query */
19
+ (0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}const om=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const l=(0,d.useDebounce)(qt.speak,500),[r,i]=Ap({shouldFocusBlock:!0}),[a,,c]=Ip(i,r),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?em(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)(
20
  /* translators: %d: number of results. */
21
+ (0,h._n)("%d result found.","%d results found.",e),e);l(n)}),[t,l]);const m=(0,d.useAsyncList)(p,{step:2}),g=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,s.createElement)(nm,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(Ep,null,!g&&(0,s.createElement)(Rp,null),g&&(0,s.createElement)(Np,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function lm(e){let{initialCategory:t,patternCategories:n}=e;const[o,l]=(0,s.useState)(""),[r,i]=(0,s.useState)(null==t?void 0:t.name);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,s.createElement)(Mp,{selectedCategory:r,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:l}),(0,s.createElement)(om,{filterValue:o,selectedCategory:r,patternCategories:n}))}const rm=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(m.Modal,{title:(0,h.__)("Patterns"),closeLabel:(0,h.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(lm,n))};function im(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:l}=e;const[r,,i]=Ip(n,t),a=(0,s.useCallback)((e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=l.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)))}),[l]),c=(0,s.useMemo)((()=>r.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)}))),[r,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)(Np,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}const sm=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:l}=e;const[r,i]=(0,s.useState)(!1),[a,c]=Ip(),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=l||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wp,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!r&&(0,s.createElement)(im,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),r&&(0,s.createElement)(rm,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},am=window.wp.url;function cm(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[l,,,r]=yp(o,n),i=(0,s.useMemo)((()=>l.filter((e=>{let{category:t}=e;return"reusable"===t}))),[l]);return 0===i.length?(0,s.createElement)(Rp,null):(0,s.createElement)(kp,{title:(0,h.__)("Reusable blocks")},(0,s.createElement)(_p,{items:i,onSelect:r,onHover:t,label:(0,h.__)("Reusable blocks")}))}const um=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(cm,{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,am.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,h.__)("Manage Reusable blocks"))))},{Fill:dm,Slot:pm}=(0,m.createSlotFill)("__unstableInserterMenuExtension");dm.Slot=pm;const mm=dm,gm=[],hm=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:l,clientId:r,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:p,showBlockDirectory:g=!1,isDraggable:f=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const _=(0,d.useDebounce)(qt.speak,500),[k,y]=Ap({onSelect:n,rootClientId:l,clientId:r,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=yp(k,y),[B,,I]=Ip(y,k),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=em(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=p;b&&x.length>2&&(T=0);const N=(0,s.useMemo)((()=>{if(0===T)return[];const e=Jp((0,u.orderBy)(E,["frecency"],["desc"]),C,S,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,S,p]);(0,s.useEffect)((()=>{if(!t)return;const e=N.length+x.length,n=(0,h.sprintf)(
22
  /* translators: %d: number of results. */
23
+ (0,h._n)("%d result found.","%d results found.",e),e);_(n)}),[t,_]);const P=(0,d.useAsyncList)(N,{step:9}),L=(0,d.useAsyncList)(P.length===N.length?x:gm),M=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),R=!!N.length&&(0,s.createElement)(kp,{title:(0,s.createElement)(m.VisuallyHidden,null,(0,h.__)("Blocks"))},(0,s.createElement)(_p,{items:P,onSelect:w,onHover:o,label:(0,h.__)("Blocks"),isDraggable:f})),A=!!x.length&&(0,s.createElement)(kp,{title:(0,s.createElement)(m.VisuallyHidden,null,(0,h.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(Np,{shownPatterns:L,blockPatterns:x,onClickPattern:I,isDraggable:f})));return(0,s.createElement)(Ep,null,!g&&!M&&(0,s.createElement)(Rp,null),b?A:R,!!N.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?R:A,g&&(0,s.createElement)(mm.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:M,rootClientId:k}},(e=>e.length?e:M?null:(0,s.createElement)(Rp,null))))},fm={name:"blocks",
24
  /* translators: Blocks tab title in the block inserter. */
25
+ title:(0,h.__)("Blocks")},vm={name:"patterns",
26
  /* translators: Patterns tab title in the block inserter. */
27
+ title:(0,h.__)("Patterns")},bm={name:"reusable",
28
  /* translators: Reusable blocks tab title in the block inserter. */
29
+ title:(0,h.__)("Reusable")},_m=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:l,prioritizePatterns:r}=e;const i=(0,s.useMemo)((()=>{const e=[];return r&&n&&e.push(vm),e.push(fm),!r&&n&&e.push(vm),o&&e.push(bm),e}),[r,fm,n,vm,o,bm]);return(0,s.createElement)(m.TabPanel,{className:"block-editor-inserter__tabs",tabs:i,onSelect:l},t)},km=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:l,__experimentalInsertionIndex:r,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:u,__experimentalFilterValue:d="",shouldFocusBlock:g=!0,prioritizePatterns:f}=e;const[v,b]=(0,s.useState)(d),[_,k]=(0,s.useState)(null),[y,E]=(0,s.useState)(null),[C,S,w]=Ap({rootClientId:n,clientId:o,isAppender:l,insertionIndex:r,shouldFocusBlock:g}),{showPatterns:B,hasReusableBlocks:I}=(0,p.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(co);return{showPatterns:!!n(C).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[C]),x=(0,s.useCallback)(((e,t,n)=>{S(e,t,n),i()}),[S,i]),T=(0,s.useCallback)(((e,t)=>{S(e,{patternName:t}),i()}),[S,i]),N=(0,s.useCallback)((e=>{w(!!e),k(e)}),[w,k]),P=(0,s.useCallback)((e=>{E(e)}),[E]),L=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(Sp,{rootClientId:C,onInsert:x,onHover:N,showMostUsedBlocks:u})),a&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(m.VisuallyHidden,{as:"h2"},(0,h.__)("A tip for using the block editor")),(0,s.createElement)(Cu,null)))),[C,x,N,v,u,a]),M=(0,s.useMemo)((()=>(0,s.createElement)(sm,{rootClientId:C,onInsert:T,onClickCategory:P,selectedCategory:y})),[C,T,P,y]),R=(0,s.useMemo)((()=>(0,s.createElement)(um,{rootClientId:C,onInsert:x,onHover:N})),[C,x,N]),A=(0,s.useCallback)((e=>"blocks"===e.name?L:"patterns"===e.name?M:R),[L,M,R]),D=(0,s.useRef)();(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{D.current.focus()}})));const O=!v&&(B||I);return(0,s.createElement)("div",{className:"block-editor-inserter__menu"},(0,s.createElement)("div",{className:c()("block-editor-inserter__main-area",{"show-as-tabs":O})},(0,s.createElement)(m.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{_&&k(null),b(e)},value:v,label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search"),ref:D}),!!v&&(0,s.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,s.createElement)(hm,{filterValue:v,onSelect:i,onHover:N,rootClientId:n,clientId:o,isAppender:l,__experimentalInsertionIndex:r,showBlockDirectory:!0,shouldFocusBlock:g})),O&&(0,s.createElement)(_m,{showPatterns:B,showReusableBlocks:I,prioritizePatterns:f},A),!v&&!O&&(0,s.createElement)("div",{className:"block-editor-inserter__no-tab-container"},L)),a&&_&&(0,s.createElement)(up,{item:_}))}));function ym(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:l,prioritizePatterns:r}=e;const[i,a]=(0,s.useState)(""),[u,d]=Ap({onSelect:t,rootClientId:n,clientId:o,isAppender:l}),[g]=yp(u,d),[f]=Ip(d,u),{setInserterIsOpened:v,insertionIndex:b}=(0,p.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:l}=e(co),r=t(),i=n(o),s=l();return{setInserterIsOpened:r.__experimentalSetIsInserterOpened,insertionIndex:-1===i?s:i}}),[o]),_=f.length&&(!!i||r),k=_&&f.length>6||g.length>6;(0,s.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return _&&(y=r?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":k,"has-expand":v})},k&&(0,s.createElement)(m.SearchControl,{className:"block-editor-inserter__search",value:i,onChange:e=>{a(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)(hm,{filterValue:i,onSelect:t,rootClientId:n,clientId:o,isAppender:l,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:r})),v&&(0,s.createElement)(m.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{v({rootClientId:n,insertionIndex:b,filterValue:i})},"aria-label":(0,h.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,h.__)("Browse all")))}const Em=e=>{let t,{onToggle:n,disabled:o,isOpen:l,blockTitle:r,hasSingleBlockType:a,toggleProps:c={},prioritizePatterns:u}=e;t=a?(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"),r):u?(0,h.__)("Add pattern"):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:d,...p}=c;return(0,s.createElement)(m.Button,i({icon:yu,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),d&&d(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&l,disabled:o},p))};class Cm 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:l,hasSingleBlockType:r,directInsertBlock:i,toggleProps:s,hasItems:a,renderToggle:c=Em,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:l,hasSingleBlockType:r,directInsertBlock:i,toggleProps:s,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:l,showInserterHelpPanel:r,__experimentalIsQuick:i,prioritizePatterns:a}=this.props;return i?(0,s.createElement)(ym,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:l,prioritizePatterns:a}):(0,s.createElement)(km,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:l,showInserterHelpPanel:r,prioritizePatterns:a})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:l,onSelectOrClose:r}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,s.createElement)(m.Dropdown,{className:"block-editor-inserter",contentClassName:c()("block-editor-inserter__popover",{"is-quick":l}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,h.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:r})}}const Sm=(0,d.compose)([(0,p.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:r}=t;const{getBlockRootClientId:i,hasInserterItems:s,__experimentalGetAllowedBlocks:a,__experimentalGetDirectInsertBlock:c,getSettings:u}=e(co),{getBlockVariations:d}=e(l.store);r=r||i(o)||void 0;const p=a(r),m=c(r),g=u(),h=1===(null==p?void 0:p.length)&&0===(null===(n=d(p[0].name,"inserter"))||void 0===n?void 0:n.length);let f=!1;return h&&(f=p[0]),{hasItems:s(r),hasSingleBlockType:h,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:m,rootClientId:r,prioritizePatterns:g.__experimentalPreferPatternsOnRoot&&!r}})),(0,p.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:r,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u}=t;if(!s&&!c)return;const{insertBlock:d}=e(co);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:l}=o(co);if(!e||!r&&!n)return{};const i={};let s={};if(r){const e=t(r),n=t(l(r));(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,l.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,l.createBlock)(a.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:l,getBlockRootClientId:s}=o(co);if(r)return e(r);const a=t();return!i&&a&&s(a)===n?e(a)+1:l(n).length}(),n),u&&u();const m=(0,h.sprintf)(// translators: %s: the name of the block that has been added
31
+ (0,h.__)("%s block added"),a.title);(0,qt.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:l}=e;return t||!n&&!o&&!l}))])(Cm),wm=(0,d.compose)((0,p.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:l}=e(co),r=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:r,isLocked:!!l(t.rootClientId),placeholder:i}})),(0,p.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(co);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:l,rootClientId:r}=e;if(t)return null;const i=(0,ku.decodeEntities)(l)||(0,h.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":r||"",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=>{cu.ENTER!==e.keyCode&&cu.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(Sm,{rootClientId:r,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Bm(e,t){let{rootClientId:n,className:o,onFocus:l,tabIndex:r}=e;return(0,s.createElement)(Sm,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:a,isOpen:u,blockTitle:d,hasSingleBlockType:p}=e;n=p?(0,h.sprintf)(// translators: %s: the name of the block when there is only one
32
+ (0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const g=!p;let f=(0,s.createElement)(m.Button,{ref:t,onFocus:l,tabIndex:r,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":g?"true":void 0,"aria-expanded":g?u:void 0,disabled:a,label:n},!p&&(0,s.createElement)(m.VisuallyHidden,{as:"span"},n),(0,s.createElement)(dr,{icon:yu}));return(g||p)&&(f=(0,s.createElement)(m.Tooltip,{text:n},f)),f},isAppender:!0})}const Im=(0,s.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Bm(e,t)))),xm=(0,s.forwardRef)(Bm),Tm=function(e){let{rootClientId:t,renderAppender:n,className:o,tagName:r="div"}=e;const{hideInserter:i,canInsertDefaultBlock:a,selectedBlockClientId:u}=(0,p.useSelect)((e=>{const{canInsertBlockType:n,getTemplateLock:o,getSelectedBlockClientId:r,__unstableGetEditorMode:i}=e(co);return{hideInserter:!!o(t)||"zoom-out"===i(),canInsertDefaultBlock:n((0,l.getDefaultBlockName)(),t),selectedBlockClientId:r()}}),[t]);if(i||!1===n)return null;let d;if(n)d=(0,s.createElement)(n,null);else{if(u!==t&&(t||u))return null;d=a?(0,s.createElement)(wm,{rootClientId:t}):(0,s.createElement)(xm,{rootClientId:t,className:"block-list-appender__toggle"})}return(0,s.createElement)(r,{tabIndex:-1,className:c()("block-list-appender wp-block",o),contentEditable:!1,"data-block":!0},d)},Nm=Number.MAX_SAFE_INTEGER;(0,s.createContext)();const Pm=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:l,__unstableContentRef:r,...a}=e;const[u,d]=(0,s.useReducer)((e=>(e+1)%Nm),0),{orientation:g,rootClientId:f,isVisible:v}=(0,p.useSelect)((e=>{var o;const{getBlockListSettings:l,getBlockRootClientId:r,isBlockVisible:i}=e(co),s=r(null!=t?t:n);return{orientation:(null===(o=l(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:i(t)&&i(n)}}),[t,n]),b=Ro(t),_=Ro(n),k="vertical"===g,y=(0,s.useMemo)((()=>{if(u<0||!b&&!_||!v)return{};const e=b?b.getBoundingClientRect():null,t=_?_.getBoundingClientRect():null;if(k)return{width:e?e.width:t.width,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:e?e.height:t.height}}),[b,_,k,u,v]),E=(0,s.useMemo)((()=>{if(u<0||!b&&!_||!v)return;const{ownerDocument:e}=b||_;return{ownerDocument:e,getBoundingClientRect(){const e=b?b.getBoundingClientRect():null,t=_?_.getBoundingClientRect():null;let n=0,o=0;return k?(o=e?e.bottom:t.top,n=(0,h.isRTL)()?e?e.right:t.right:e?e.left:t.left):(o=e?e.top:t.top,n=(0,h.isRTL)()?e?e.left:t.right:e?e.right:t.left),new window.DOMRect(n,o,0,0)}}}),[b,_,u,k,v]),C=kl(r);return(0,s.useLayoutEffect)((()=>{if(!b)return;const e=new window.MutationObserver(d);return e.observe(b,{attributes:!0}),()=>{e.disconnect()}}),[b]),(0,s.useLayoutEffect)((()=>{if(!_)return;const e=new window.MutationObserver(d);return e.observe(_,{attributes:!0}),()=>{e.disconnect()}}),[_]),(0,s.useLayoutEffect)((()=>{if(b)return b.ownerDocument.defaultView.addEventListener("resize",d),()=>{b.ownerDocument.defaultView.removeEventListener("resize",d)}}),[b]),(b||_)&&v?(0,s.createElement)(m.Popover,i({ref:C,animate:!1,anchor:E,focusOnMount:!1,__unstableSlotName:l||null,key:n+"--"+f},a,{className:c()("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"bottom-start"}),(0,s.createElement)("div",{className:"block-editor-block-popover__inbetween-container",style:y},o)):null},Lm=(0,s.createContext)();function Mm(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:l}=(0,p.useDispatch)(co),r=(0,s.useContext)(Lm),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:g,rootClientId:h,isInserterShown:f}=(0,p.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:l,isBlockBeingDragged:r,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(co),a=l(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;r(u);)u=i(u);for(;r(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}}),[]),v="vertical"===a,b=(0,d.useReducedMotion)(),_={start:{...v?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:f?.1:0,type:"tween"}},hover:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.1,type:"tween"}}},k={start:{scale:b?1:0},rest:{scale:1,transition:{type:"tween"}}},y=c()("block-editor-block-list__insertion-point","is-"+a);return(0,s.createElement)(Pm,{previousClientId:u,nextClientId:g,__unstablePopoverSlot:t,__unstableContentRef:n},(0,s.createElement)(m.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&g&&o(g,-1)},onFocus:function(e){e.target!==i.current&&(r.current=!0)},className:c()(y,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||r.current||l()}},(0,s.createElement)(m.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&(0,s.createElement)(m.__unstableMotion.div,{variants:k,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Sm,{position:"bottom center",clientId:g,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{r.current=e},onSelectOrClose:()=>{r.current=!1}}))))}function Rm(e){return(0,p.useSelect)((e=>e(co).isBlockInsertionPointVisible()),[])&&(0,s.createElement)(Mm,e)}function Am(){const e=(0,s.useContext)(Lm),t=(0,p.useSelect)((e=>e(co).getSettings().hasReducedUI||"zoom-out"===e(co).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:l,isBlockInsertionPointVisible:r,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c,__unstableIsWithinBlockOverlay:u}=(0,p.useSelect)(co),{showInsertionPoint:m,hideInsertionPoint:g}=(0,p.useDispatch)(co),h=(0,d.useDebounce)(m,500,{trailing:!0});return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return h.cancel(),void(r()&&g());let s;if(t.target.classList.contains("is-root-container")||(s=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(s))return;const d=(null===(o=n(s))||void 0===o?void 0:o.orientation)||"vertical",p=t.target.getBoundingClientRect(),m=t.clientY-p.top,f=t.clientX-p.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===d&&e.offsetTop>m||e.classList.contains("wp-block")&&"horizontal"===d&&e.offsetLeft>f));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;const b=v.id.slice("block-".length);if(!b||u(b))return;if(a().includes(b))return;const _=v.getBoundingClientRect();if("horizontal"===d&&(t.clientY>_.bottom||t.clientY<_.top)||"vertical"===d&&(t.clientX>_.right||t.clientX<_.left))return h.cancel(),void(r()&&g());const k=l(b);if(0===k)return h.cancel(),void(r()&&g());h(s,k,{__unstableWithInserter:!0})}}),[e,n,o,l,r,i,m,g,a,t])}const Dm="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Om="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function zm(e){return(0,p.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(co),{getBlockType:r,getActiveBlockVariation:i}=t(l.store),s=n(e),a=r(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,anchor:null==c?void 0:c.anchor}:d}),[e])}function Fm(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:r,name:i,reusableBlockTitle:s}=(0,p.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=e(co),i=n(t);if(!i)return{};const s=(0,l.isReusableBlock)((0,l.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&r(o(t).ref)}}),[t]),a=zm(t);if(!i||!a)return null;const c=(0,l.getBlockType)(i),u=c?(0,l.__experimentalGetBlockLabel)(c,r,o):null,d=s||u,m=d&&d!==c.title?d:a.title;if(n&&n>0&&m.length>n){const e="...";return m.slice(0,n-e.length)+e}return m}function Vm(e){let{clientId:t,maximumLength:n,context:o}=e;return Fm({clientId:t,maximumLength:n,context:o})}const Hm=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:r,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,p.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:r,getBlockName:i}=e(co),s=r(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,l.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[g,h,f]=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)((l=>{e.current=l.clientY,n.current=(0,Wr.getScrollContainer)(l.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 l=n.current.offsetHeight,r=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>r){const e=Math.max(l-r-50,0),n=Math.max(i-r-50,0)/e;t.current=25*n}else if(o.clientY<r){const e=Math.max(r-50,0),n=Math.max(r-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,p.useDispatch)(co);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const _={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(m.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:_,onDragStart:e=>{v(n),d.current=!0,g(e),r&&r()},onDragOver:h,onDragEnd:()=>{b(),d.current=!1,f(),i&&i()},__experimentalDragComponent:(0,s.createElement)(gp,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Gm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),Um=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Wm=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),$m=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),jm=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,h.isRTL)()?"left":"right":"down":null;const Km=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?Gm:Um:Wm:"down"===e?"horizontal"===t?(0,h.isRTL)()?Um:Gm:$m:null,qm=(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,Ym=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:r,...a}=e;const u=(0,d.useInstanceId)(Ym),g=Array.isArray(n)?n:[n],f=g.length,{blockType:v,isDisabled:b,rootClientId:_,isFirst:k,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,p.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:n,getBlockOrder:i,getBlock:s,getBlockListSettings:a}=e(co),c=g[0],u=n(c),d=t(c),p=t(g[g.length-1]),m=i(u),h=s(c),f=0===d,v=p===m.length-1,{orientation:b}=a(u)||{};return{blockType:h?(0,l.getBlockType)(h.name):null,isDisabled:"up"===o?f:v,rootClientId:u,firstIndex:d,isFirst:f,isLast:v,orientation:r||b}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,p.useDispatch)(co),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${u}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:Km(o,C),label:qm(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,_),a.onClick&&a.onClick(e)},disabled:b,__experimentalIsFocusable:!0})),(0,s.createElement)(m.VisuallyHidden,{id:I},function(e,t,n,o,l,r,i){const s=n+1;if(e>1)return function(e,t,n,o,l,r){const i=t+1;if(n&&o)return(0,h.__)("All blocks are selected, and cannot be moved");if(l>0&&!o){const t=jm("down",r);if("down"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
33
  (0,h.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
34
  (0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
35
+ (0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(l>0&&o){const e=jm("down",r);if("down"===e)return(0,h.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,h.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,h.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(l<0&&!n){const t=jm("up",r);if("up"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
36
  (0,h.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
37
  (0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
38
+ (0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(l<0&&n){const e=jm("up",r);if("up"===e)return(0,h.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,h.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,h.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,l,r,i);if(o&&l)return(0,h.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
39
+ (0,h.__)("Block %s is the only block, and cannot be moved"),t);if(r>0&&!l){const e=jm("down",i);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
40
  (0,h.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
41
  (0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===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(r>0&&l){const e=jm("down",i);if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
43
  (0,h.__)("Block %1$s is at the end of the content and can’t be moved down"),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 end 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 end of the content and can’t be moved right"),t)}if(r<0&&!o){const e=jm("up",i);if("up"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
46
  (0,h.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
47
  (0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
48
+ (0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(r<0&&o){const e=jm("up",i);if("up"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
49
  (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)
50
  (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)
51
+ (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(f,v&&v.title,E,k,y,"up"===o?-1:1,C)))})),Zm=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Ym,i({direction:"up",ref:t},e)))),Qm=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Ym,i({direction:"down",ref:t},e)))),Xm=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:l,isFirst:r,isLast:a,orientation:u}=(0,p.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:l,canMoveBlocks:r,getBlockOrder:i,getBlockRootClientId:s}=e(co),a=Array.isArray(t)?t:[t],c=a[0],u=s(c),d=o(c),p=o(a[a.length-1]),m=i(u);return{canMove:r(t,u),rootClientId:u,isFirst:0===d,isLast:p===m.length-1,orientation:null===(n=l(u))||void 0===n?void 0:n.orientation}}),[t]);if(!o||r&&a&&!l)return null;const d=(0,h.__)("Drag");return(0,s.createElement)(m.ToolbarGroup,{className:c()("block-editor-block-mover",{"is-horizontal":"horizontal"===u})},!n&&(0,s.createElement)(Hm,{clientIds:t},(e=>(0,s.createElement)(m.Button,i({icon:mp,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:d,tabIndex:"-1"},e)))),(0,s.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(Zm,i({clientIds:t},e)))),(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(Qm,i({clientIds:t},e))))))},Jm=function(e){let{clientId:t,rootClientId:n}=e;const o=zm(t),r=(0,p.useSelect)((e=>{var o;const{getBlock:l,getBlockIndex:r,hasBlockMovingClientId:i,getBlockListSettings:s,__unstableGetEditorMode:a}=e(co),c=r(t),{name:u,attributes:d}=l(t);return{index:c,name:u,attributes:d,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation,editorMode:a()}}),[t,n]),{index:a,name:u,attributes:d,blockMovingMode:g,orientation:f,editorMode:v}=r,{setNavigationMode:b,removeBlock:_}=(0,p.useDispatch)(co),k=(0,s.useRef)(),y=(0,l.getBlockType)(u),E=(0,l.__experimentalGetAccessibleBlockLabel)(y,d,a+1,f);(0,s.useEffect)((()=>{k.current.focus(),(0,qt.speak)(E)}),[E]);const C=Ro(t),{hasBlockMovingClientId:S,getBlockIndex:w,getBlockRootClientId:B,getClientIdsOfDescendants:I,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:T,getPreviousBlockClientId:N,getNextBlockClientId:P}=(0,p.useSelect)(co),{selectBlock:L,clearSelectedBlock:M,setBlockMovingClientId:R,moveBlockToPosition:A}=(0,p.useDispatch)(co),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)(m.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(wu,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(m.FlexItem,null,"zoom-out"===v&&(0,s.createElement)(Xm,{clientIds:[t],hideDragHandle:!0}),"navigation"===v&&(0,s.createElement)(Hm,{clientIds:[t]},(e=>(0,s.createElement)(m.Button,i({icon:mp,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(m.Button,{ref:k,onClick:"navigation"===v?()=>b(!1):void 0,onKeyDown:function(e){const{keyCode:n}=e,o=n===cu.UP,l=n===cu.DOWN,r=n===cu.LEFT,i=n===cu.RIGHT,s=n===cu.TAB,a=n===cu.ESCAPE,c=n===cu.ENTER,u=n===cu.SPACE,d=e.shiftKey;if(n===cu.BACKSPACE||n===cu.DELETE)return _(t),void e.preventDefault();const p=x(),m=T(),g=N(m||p),h=P(m||p),f=s&&d||o,v=s&&!d||l,b=r,k=i;let y;if(f)y=g;else if(v)y=h;else if(b){var E;y=null!==(E=B(p))&&void 0!==E?E:p}else if(k){var D;y=null!==(D=I([p])[0])&&void 0!==D?D:p}const O=S();if(a&&O&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&O){const e=B(O),t=B(p),n=w(O);let o=w(p);n<o&&e===t&&(o-=1),A(O,e,t,o),L(O),R(null)}if(v||f||b||k)if(y)e.preventDefault(),L(y);else if(s&&p){let t;if(v){t=C;do{t=Wr.focus.tabbable.findNext(t)}while(t&&C.contains(t));t||(t=C.ownerDocument.defaultView.frameElement,t=Wr.focus.tabbable.findNext(t))}else t=Wr.focus.tabbable.findPrevious(C);t&&(e.preventDefault(),t.focus(),M())}},label:E,showTooltip:!1,className:"block-selection-button_select-button"},(0,s.createElement)(Vm,{clientId:t,maximumLength:35})))))};function eg(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}const tg=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:l,...r}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!Wr.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||V()("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,l){const[r]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=Wr.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,zu.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{r&&a()}),[n,r,a]),(0,s.useEffect)((()=>{let t=0;return i&&!r&&(t=window.requestAnimationFrame((()=>{const t=eg(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!l||!e.current)return;const n=eg(e.current).findIndex((e=>0===e.tabIndex));l(n)}}),[i,r])}(a,n,c,o,l),c?(0,s.createElement)(m.Toolbar,i({label:r["aria-label"],ref:a},r),t):(0,s.createElement)(m.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},r),t)},{clearTimeout:ng,setTimeout:og}=window,lg=()=>{},rg=200;function ig(e){let{ref:t,isFocused:n,debounceTimeout:o=rg,onChange:l=lg}=e;const[r,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),l(e)},u=()=>{const e=a.current;e&&ng&&ng(e)};return(0,s.useEffect)((()=>()=>{c(!1),u()}),[]),{showMovers:r,debouncedShowMovers:e=>{e&&e.stopPropagation(),u(),r||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),u(),a.current=og((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function sg(e){let{ref:t,debounceTimeout:n=rg,onChange:o=lg}=e;const[l,r]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=ig({ref:t,debounceTimeout:n,isFocused:l,onChange:o}),u=(0,s.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{d()&&(r(!0),a())},o=()=>{d()||(r(!1),c())};return e&&!u.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),u.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,u,r,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function ag(){const{selectBlock:e,toggleBlockHighlight:t}=(0,p.useDispatch)(co),{firstParentClientId:n,shouldHide:o,hasReducedUI:r}=(0,p.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:r}=e(co),{hasBlockSupport:i}=e(l.store),s=n(o()),a=s[s.length-1],c=t(a),u=(0,l.getBlockType)(c),d=r();return{firstParentClientId:a,shouldHide:!i(u,"__experimentalParentSelector",!0),hasReducedUI:d.hasReducedUI}}),[]),a=zm(n),c=(0,s.useRef)(),{gestures:u}=sg({ref:c,onChange(e){e&&r||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)(m.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,h.sprintf)(
52
  /* translators: %s: Name of the block's parent. */
53
+ (0,h.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(wu,{icon:a.icon})}))}const cg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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 ug(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)(m.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)(ap,{viewportWidth:500,blocks:t})))))}function dg(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:o}=e;return t.map((e=>(0,s.createElement)(pg,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:o})))}function pg(e){let{item:t,onSelect:n,setHoveredTransformItemName:o}=e;const{name:r,icon:i,title:a,isDisabled:c}=t;return(0,s.createElement)(m.MenuItem,{className:(0,l.getBlockMenuDefaultClassName)(r),onClick:e=>{e.preventDefault(),n(r)},disabled:c,onMouseLeave:()=>o(null),onMouseEnter:()=>o(r)},(0,s.createElement)(wu,{icon:i,showColors:!0}),a)}const mg=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:r}=e;const[i,a]=(0,s.useState)(),{priorityTextTransformations:c,restTransformations:u}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,s.useMemo)((()=>{const n=Object.keys(t);return e.reduce(((e,t)=>{const{name:o}=t;return n.includes(o)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]})}),[e]);return n.priorityTextTransformations.sort(((e,n)=>{let{name:o}=e,{name:l}=n;return t[o]<t[l]?-1:1})),n}(n),d=c.length&&u.length,p=!!u.length&&(0,s.createElement)(dg,{restTransformations:u,onSelect:o,setHoveredTransformItemName:a});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuGroup,{label:(0,h.__)("Transform to"),className:t},i&&(0,s.createElement)(ug,{blocks:(0,l.switchToBlockType)(r,i)}),c.map((e=>(0,s.createElement)(pg,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:a}))),!d&&p),!!d&&(0,s.createElement)(m.MenuGroup,{className:t},p))},gg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),hg=window.wp.tokenList;var fg=n.n(hg);function vg(e,t,n){const o=new(fg())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function bg(e){return(0,u.find)(e,"isDefault")}function _g(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:r,blockType:i,className:a}=(0,p.useSelect)((e=>{const{getBlock:n}=e(co),o=n(t);if(!o)return{};const r=(0,l.getBlockType)(o.name),{getBlockStyles:i}=e(l.store);return{block:o,blockType:r,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,p.useDispatch)(co),d=function(e){return e&&0!==e.length?bg(e)?e:[{name:"default",label:(0,h._x)("Default","block style"),isDefault:!0},...e]:[]}(o),m=function(e,t){for(const n of new(fg())(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),g=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,l.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,l.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(r,i);return{onSelect:e=>{const o=vg(a,m,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:m,genericPreviewBlock:g,className:a}}const kg=()=>{};function yg(e){let{clientId:t,onSwitch:n=kg}=e;const{onSelect:o,stylesToRender:l,activeStyle:r}=_g({clientId:t,onSwitch:n});return l&&0!==l.length?(0,s.createElement)(s.Fragment,null,l.map((e=>{const t=e.label||e.name;return(0,s.createElement)(m.MenuItem,{key:e.name,icon:r.name===e.name?gg:null,onClick:()=>o(e)},(0,s.createElement)(m.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Eg(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(m.MenuGroup,{label:(0,h.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(yg,{clientId:o,onSwitch:n}))}const Cg=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:l,innerBlocks:r=[]}=e;if(!n.has(o)){if(l===t)return e;for(const e of r){const o=Cg(e,t,n);if(o)return o}}},Sg=(e,t)=>{const n=((e,t)=>{const n=(0,l.__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 wg(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)(m.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)(Bg,{patterns:t,onSelect:n})))))}function Bg(e){let{patterns:t,onSelect:n}=e;const o=(0,m.__unstableUseCompositeState)();return(0,s.createElement)(m.__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)(Ig,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Ig(e){let{pattern:t,onSelect:n,composite:o}=e;const l="block-editor-block-switcher__preview-patterns-container",r=(0,d.useInstanceId)(Ig,`${l}-list__item-description`);return(0,s.createElement)("div",{className:`${l}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?r:void 0},(0,s.createElement)(m.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${l}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,s.createElement)(ap,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,s.createElement)("div",{className:`${l}-list__item-title`},t.title)),!!t.description&&(0,s.createElement)(m.VisuallyHidden,{id:r},t.description))}const xg=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,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,l.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const l of n){const n=Cg(l,t.name,o);if(n){e=!0,o.add(n.clientId),Sg(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)(m.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,s.createElement)(wg,{patterns:a,onSelect:o}),(0,s.createElement)(m.MenuItem,{onClick:e=>{e.preventDefault(),i(!r)},icon:Gm},(0,h.__)("Patterns"))):null},Tg=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,p.useDispatch)(co),r=zm(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,patterns:g}=(0,p.useSelect)((e=>{const{getBlockRootClientId:o,getBlockTransformItems:i,__experimentalGetPatternTransformItems:s}=e(co),{getBlockStyles:a,getBlockType:c}=e(l.store),{canRemoveBlocks:d}=e(co),p=o((0,u.castArray)(t)[0]),[{name:m}]=n,g=1===n.length,h=g&&a(m);let f;var v;g?f=null==r?void 0:r.icon:f=1===new Set(n.map((e=>{let{name:t}=e;return t}))).size?null===(v=c(m))||void 0===v?void 0:v.icon:cg;return{possibleBlockTransformations:i(n,p),canRemove:d(t,p),hasBlockStyles:!(null==h||!h.length),icon:f,patterns:s(n,p)}}),[t,n,null==r?void 0:r.icon]),f=Fm({clientId:Array.isArray(t)?t[0]:t,maximumLength:35}),v=1===n.length&&(0,l.isReusableBlock)(n[0]),b=1===n.length&&(0,l.isTemplatePart)(n[0]),_=!!i.length&&a&&!b,k=!(null==g||!g.length)&&a;if(!c&&!_)return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wu,{icon:d,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},f))}));const y=f,E=1===n.length?(0,h.sprintf)(
54
  /* translators: %s: block title. */
55
  (0,h.__)("%s: Change block type or style"),f):(0,h.sprintf)(
56
  /* translators: %d: number of blocks. */
57
+ (0,h._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||_||k;return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(m.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)(wu,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},f)),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:r}=e;return C&&(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},k&&(0,s.createElement)(xg,{blocks:n,patterns:g,onSelect:e=>{(e=>{o(t,e)})(e),r()}}),_&&(0,s.createElement)(mg,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{(e=>{o(t,(0,l.switchToBlockType)(n,e))})(e),r()}}),c&&(0,s.createElement)(Eg,{hoveredBlock:n[0],onSwitch:r}))})))))},Ng=e=>{let{clientIds:t}=e;const n=(0,p.useSelect)((e=>e(co).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(Tg,{clientIds:t,blocks:n})},{Fill:Pg,Slot:Lg}=(0,m.createSlotFill)("__unstableBlockToolbarLastItem");Pg.Slot=Lg;const Mg=Pg,Rg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Ag=window.wp.blob;function Dg(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;if(1!==(null===(n=t.match(e))||void 0===n?void 0:n.length))return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}function Og(){const{getBlockName:e}=(0,p.useSelect)(co),{getBlockType:t}=(0,p.useSelect)(l.store),{createSuccessNotice:n}=(0,p.useDispatch)(Bp.store);return(0,s.useCallback)(((o,l)=>{let r="";if(1===l.length){var i;const n=l[0],s=null===(i=t(e(n)))||void 0===i?void 0:i.title;r="copy"===o?(0,h.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
58
  (0,h.__)('Copied "%s" to clipboard.'),s):(0,h.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
59
  (0,h.__)('Moved "%s" to clipboard.'),s)}else r="copy"===o?(0,h.sprintf)(// Translators: %d: Number of blocks being copied.
60
  (0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",l.length),l.length):(0,h.sprintf)(// Translators: %d: Number of blocks being cut.
61
+ (0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",l.length),l.length);n(r,{type:"snackbar"})}),[])}function zg(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:r,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a}=(0,p.useSelect)(co),{flashBlock:c,removeBlocks:u,replaceBlocks:m,__unstableDeleteSelection:g,__unstableExpandSelection:h}=(0,p.useDispatch)(co),f=Og();return(0,d.useRefEffect)((d=>{function p(p){const v=t();if(0===v.length)return;if(!n()){const{target:e}=p,{ownerDocument:t}=e;if("copy"===p.type||"cut"===p.type?(0,Wr.documentHasUncollapsedSelection)(t):(0,Wr.documentHasSelection)(t))return}if(!d.contains(p.target.ownerDocument.activeElement))return;const b=p.defaultPrevented;p.preventDefault();const _=s(),k=i()||r(),y=!k&&!_;if("copy"===p.type||"cut"===p.type)if(1===v.length&&c(v[0]),y)h();else{let t;if(f(p.type,v),k)t=e(v);else{const[n,o]=a();t=[n,...e(v.slice(1,v.length-1)),o]}const n=p.clipboardData.getData("__unstableWrapperBlockName");n&&(t=(0,l.createBlock)(n,JSON.parse(p.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,l.serialize)(t);p.clipboardData.setData("text/plain",(E=(E=o).replace(/<br>/g,"\n"),(0,Wr.__unstableStripHTML)(E).trim().replace(/\n\n+/g,"\n\n"))),p.clipboardData.setData("text/html",o)}var E;if("cut"===p.type)k&&!y?u(v):g();else if("paste"===p.type){if(b)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 l=(0,Wr.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return l.length&&!Dg(l,o)&&(o=l.map((e=>`<img src="${(0,Ag.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(p),r=(0,l.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});m(v,r,r.length-1,-1)}}return d.ownerDocument.addEventListener("copy",p),d.ownerDocument.addEventListener("cut",p),d.ownerDocument.addEventListener("paste",p),()=>{d.ownerDocument.removeEventListener("copy",p),d.ownerDocument.removeEventListener("cut",p),d.ownerDocument.removeEventListener("paste",p)}}),[])}const Fg=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:zg()},t)};function Vg(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:r,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,p.useSelect)(co),{getDefaultBlockName:u,getGroupingBlockName:d}=(0,p.useSelect)(l.store),m=s(t),g=i(t[0]),h=m.every((e=>!!e&&(0,l.hasBlockSupport)(e.name,"multiple",!0)&&r(e.name,g))),f=r(u(),g),v=a(t,g),b=c(t,g),{removeBlocks:_,replaceBlocks:k,duplicateBlocks:y,insertAfterBlock:E,insertBeforeBlock:C,flashBlock:S,setBlockMovingClientId:w,setNavigationMode:B,selectBlock:I}=(0,p.useDispatch)(co),x=Og();return n({canDuplicate:h,canInsertDefaultBlock:f,canMove:v,canRemove:b,rootClientId:g,blocks:m,onDuplicate:()=>y(t,o),onRemove:()=>_(t,o),onInsertBefore(){const e=Array.isArray(t)?t[0]:e;C(e)},onInsertAfter(){const e=Array.isArray(t)?t[t.length-1]:e;E(e)},onMoveTo(){B(!0),I(t[0]),w(t[0])},onGroup(){if(!m.length)return;const e=d(),n=(0,l.switchToBlockType)(m,e);n&&k(t,n)},onUngroup(){if(!m.length)return;const e=m[0].innerBlocks;e.length&&k(t,e)},onCopy(){const e=m.map((e=>{let{clientId:t}=e;return t}));1===m.length&&S(e[0]),x("copy",e)}})}const Hg=()=>{},Gg=(0,d.compose)([(0,p.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:r,getSettings:i}=e(co),s=o(n),a=i().codeEditingEnabled;return{mode:r(n),blockType:s?(0,l.getBlockType)(s.name):null,isCodeEditingEnabled:a}})),(0,p.withDispatch)(((e,t)=>{let{onToggle:n=Hg,clientId:o}=t;return{onToggleMode(){e(co).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:r=!1,isCodeEditingEnabled:i=!0}=e;if(!t||!(0,l.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,h.__)("Edit as HTML"):(0,h.__)("Edit visually");return(0,s.createElement)(m.MenuItem,{onClick:o},!r&&a)})),Ug=(0,d.compose)((0,p.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(co).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,p.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(co).replaceBlocks(n.clientId,(0,l.rawHandler)({HTML:(0,l.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const l=(0,h.__)("Convert to Blocks");return(0,s.createElement)(m.MenuItem,{onClick:n},!o&&l)})),{Fill:Wg,Slot:$g}=(0,m.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Wg.Slot=$g;const jg=Wg;function Kg(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:r,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,p.useDispatch)(co);return n||o?(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(m.MenuItem,{onClick:()=>{(()=>{const e=(0,l.switchToBlockType)(r,i);e&&c(t,e)})(),a()}},(0,h._x)("Group","verb")),o&&(0,s.createElement)(m.MenuItem,{onClick:()=>{(()=>{const e=r[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}function qg(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}=(0,p.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:r,getSelectedBlockClientIds:i}=e(co),{getGroupingBlockName:s}=e(l.store),a=i(),c=s(),u=r(c,null!=a&&a.length?n(a[0]):void 0),d=o(a),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:a,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}}function Yg(e){return(0,p.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:l,canLockBlockType:r,getBlockName:i,getBlockRootClientId:s,getTemplateLock:a}=t(co),c=s(e),u=n(e),d=o(e,c),p=l(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:r(i(e)),isContentLocked:"contentOnly"===a(e),isLocked:!u||!d||!p}}),[e])}const Zg=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"})),Qg=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"}));function Xg(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function Jg(e){let{clientId:t,onClose:n}=e;const[o,r]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=Yg(t),{isReusable:u,templateLock:g,hasTemplateLock:f}=(0,p.useSelect)((e=>{var n,o;const{getBlockName:r,getBlockAttributes:i}=e(co),s=r(t),a=(0,l.getBlockType)(s);return{isReusable:(0,l.isReusableBlock)(a),templateLock:null===(n=i(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==a||null===(o=a.attributes)||void 0===o||!o.templateLock)}}),[t]),[v,b]=(0,s.useState)(!!g),{updateBlockAttributes:_}=(0,p.useDispatch)(co),k=zm(t),y=(0,d.useInstanceId)(Jg,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{r({move:!a,remove:!c,...u?{edit:!i}:{}})}),[i,a,c,u]);const E=Object.values(o).every(Boolean),C=Object.values(o).some(Boolean)&&!E;return(0,s.createElement)(m.Modal,{title:(0,h.sprintf)(
62
  /* translators: %s: Name of the block. */
63
+ (0,h.__)("Lock %s"),k.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,h.__)("Close"),onRequestClose:n},(0,s.createElement)("p",null,(0,h.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),_([t],{lock:o,templateLock:v?Xg(o):void 0}),n()}},(0,s.createElement)("div",{role:"group","aria-labelledby":y,className:"block-editor-block-lock-modal__options"},(0,s.createElement)(m.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,s.createElement)("span",{id:y},(0,h.__)("Lock all")),checked:E,indeterminate:C,onChange:e=>r({move:e,remove:e,...u?{edit:e}:{}})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},u&&(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(m.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Restrict editing"),(0,s.createElement)(m.Icon,{icon:o.edit?Qg:Zg})),checked:!!o.edit,onChange:e=>r((t=>({...t,edit:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(m.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Disable movement"),(0,s.createElement)(m.Icon,{icon:o.move?Qg:Zg})),checked:o.move,onChange:e=>r((t=>({...t,move:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(m.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Prevent removal"),(0,s.createElement)(m.Icon,{icon:o.remove?Qg:Zg})),checked:o.remove,onChange:e=>r((t=>({...t,remove:e})))}))),f&&(0,s.createElement)(m.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,h.__)("Apply to all blocks inside"),checked:v,disabled:o.move&&!o.remove,onChange:()=>b(!v)})),(0,s.createElement)(m.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(m.Button,{variant:"tertiary",onClick:n},(0,h.__)("Cancel"))),(0,s.createElement)(m.FlexItem,null,(0,s.createElement)(m.Button,{variant:"primary",type:"submit"},(0,h.__)("Apply"))))))}function eh(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=Yg(t),[l,r]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,h.__)("Unlock"):(0,h.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuItem,{icon:o?Zg:Qg,onClick:r},i),l&&(0,s.createElement)(Jg,{clientId:t,onClose:r}))}const{Fill:th,Slot:nh}=(0,m.createSlotFill)("BlockSettingsMenuControls");function oh(e){let{...t}=e;return(0,s.createElement)(m.__experimentalStyleProvider,{document},(0,s.createElement)(th,t))}oh.Slot=e=>{let{fillProps:t,clientIds:n=null,__unstableDisplayLocation:o}=e;const{selectedBlocks:l,selectedClientIds:r,canRemove:a}=(0,p.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:l}=e(co),r=null!==n?n:o();return{selectedBlocks:(0,u.map)(t(r).filter(Boolean),(e=>e.name)),selectedClientIds:r,canRemove:l(r)}}),[n]),{canLock:c}=Yg(r[0]),d=1===r.length&&c,g=qg(),{isGroupable:h,isUngroupable:f}=g,v=(h||f)&&a;return(0,s.createElement)(nh,{fillProps:{...t,__unstableDisplayLocation:o,selectedBlocks:l,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!v&&!d?null:(0,s.createElement)(m.MenuGroup,null,d&&(0,s.createElement)(eh,{clientId:r[0]}),e,v&&(0,s.createElement)(Kg,i({},g,{onClose:null==t?void 0:t.onClose})))))};const lh=oh,rh=()=>{},ih={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function sh(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,l.serialize)(t)),n),r=t.length>1?(0,h.__)("Copy blocks"):(0,h.__)("Copy block");return(0,s.createElement)(m.MenuItem,{ref:o},r)}const ah=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:r,...a}=e;const c=(0,u.castArray)(t),d=c.length,g=c[0],{firstParentClientId:f,hasReducedUI:v,onlyBlock:b,parentBlockType:_,previousBlockClientId:k,nextBlockClientId:y,selectedBlockClientIds:E}=(0,p.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:r,getNextBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a}=e(co),c=o(g),u=c[c.length-1],d=n(u);return{firstParentClientId:u,hasReducedUI:a().hasReducedUI,onlyBlock:1===t(),parentBlockType:(0,l.getBlockType)(d),previousBlockClientId:r(g),nextBlockClientId:i(g),selectedBlockClientIds:s()}}),[g]),C=(0,p.useSelect)((e=>{const{getShortcutRepresentation:t}=e(zu.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")}}),[]),{selectBlock:S,toggleBlockHighlight:w}=(0,p.useDispatch)(co),B=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:rh,[n]),I=Fm({clientId:g,maximumLength:25}),x=(0,s.useCallback)(n?()=>{const e=k||y;e&&E.includes(g)&&!E.includes(e)&&n(e)}:rh,[n,k,y,E]),T=(0,h.sprintf)(
64
  /* translators: %s: block name */
65
+ (0,h.__)("Remove %s"),I),N=1===d?T:(0,h.__)("Remove blocks"),P=(0,s.useRef)(),{gestures:L}=sg({ref:P,onChange(e){e&&v||w(f,e)}});return(0,s.createElement)(Vg,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:l,canMove:c,canRemove:p,onDuplicate:v,onInsertAfter:k,onInsertBefore:y,onRemove:E,onCopy:w,onMoveTo:I,blocks:T}=e;return(0,s.createElement)(m.DropdownMenu,i({icon:Rg,label:(0,h.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:ih,noIcons:!0},a),(e=>{let{onClose:a}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuGroup,null,(0,s.createElement)(jg.Slot,{fillProps:{onClose:a}}),void 0!==f&&(0,s.createElement)(m.MenuItem,i({},L,{ref:P,icon:(0,s.createElement)(wu,{icon:_.icon}),onClick:()=>S(f)}),(0,h.sprintf)(
66
  /* translators: %s: Name of the block's parent. */
67
+ (0,h.__)("Select parent block (%s)"),_.title)),1===d&&(0,s.createElement)(Ug,{clientId:g}),(0,s.createElement)(sh,{blocks:T,onCopy:w}),n&&(0,s.createElement)(m.MenuItem,{onClick:(0,u.flow)(a,v,B),shortcut:C.duplicate},(0,h.__)("Duplicate")),l&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.MenuItem,{onClick:(0,u.flow)(a,y),shortcut:C.insertBefore},(0,h.__)("Insert before")),(0,s.createElement)(m.MenuItem,{onClick:(0,u.flow)(a,k),shortcut:C.insertAfter},(0,h.__)("Insert after"))),c&&!b&&(0,s.createElement)(m.MenuItem,{onClick:(0,u.flow)(a,I)},(0,h.__)("Move to")),1===d&&(0,s.createElement)(Gg,{clientId:g,onToggle:a})),(0,s.createElement)(lh.Slot,{fillProps:{onClose:a},clientIds:t,__unstableDisplayLocation:r}),"function"==typeof o?o({onClose:a}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:a}))),p&&(0,s.createElement)(m.MenuGroup,null,(0,s.createElement)(m.MenuItem,{onClick:(0,u.flow)(a,E,x),shortcut:C.remove},N)))}))}))},ch=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarItem,null,(e=>(0,s.createElement)(ah,i({clientIds:t,toggleProps:e},n)))))};function uh(e){let{clientId:t}=e;const n=zm(t),{canEdit:o,canMove:l,canRemove:r,canLock:i}=Yg(t),[a,c]=(0,s.useReducer)((e=>!e),!1);return i?o&&l&&r?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(m.ToolbarButton,{icon:Qg,label:(0,h.sprintf)(
68
  /* translators: %s: block name */
69
+ (0,h.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(Jg,{clientId:t,onClose:c})):null}const dh=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})),ph=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"})),mh=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"})),gh={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}},hh=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=qg(),{replaceBlocks:r}=(0,p.useDispatch)(co),{canRemove:i,variations:a}=(0,p.useSelect)((e=>{const{canRemoveBlocks:o}=e(co),{getBlockVariations:r}=e(l.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),c=o=>{const i=(0,l.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),i&&i.length>0&&(i[0].attributes.layout=gh[o],r(t,i))};if(!o||!i)return null;const u=!!a.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!a.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarButton,{icon:dh,label:(0,h._x)("Group","verb"),onClick:c}),u&&(0,s.createElement)(m.ToolbarButton,{icon:ph,label:(0,h._x)("Row","single horizontal line"),onClick:()=>c("row")}),d&&(0,s.createElement)(m.ToolbarButton,{icon:mh,label:(0,h._x)("Stack","verb"),onClick:()=>c("stack")}))};function fh(e){let{clientIds:t}=e;const n=1===t.length?t[0]:void 0,o=(0,p.useSelect)((e=>!!n&&"html"===e(co).getBlockMode(n)),[n]),{toggleBlockMode:l}=(0,p.useDispatch)(co);return o?(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarButton,{onClick:()=>{l(n)}},(0,h.__)("Edit visually"))):null}const vh=(0,s.createContext)(""),bh=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:r,hasFixedToolbar:a,hasReducedUI:u,isValid:g,isVisual:h,isContentLocked:f}=(0,p.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:r,getBlockRootClientId:i,getSettings:s,__unstableGetContentLockingParent:a}=e(co),c=o(),u=c[0],d=i(u),p=s();return{blockClientIds:c,blockClientId:u,blockType:u&&(0,l.getBlockType)(t(u)),hasFixedToolbar:p.hasFixedToolbar,hasReducedUI:p.hasReducedUI,rootClientId:d,isValid:c.every((e=>r(e))),isVisual:c.every((e=>"visual"===n(e))),isContentLocked:!!a(u)}}),[]),{toggleBlockHighlight:v}=(0,p.useDispatch)(co),b=(0,s.useRef)(),{showMovers:_,gestures:k}=sg({ref:b,onChange(e){e&&u||v(o,e)}}),y=(0,d.useViewportMatch)("medium","<")||a;if(r&&!(0,l.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const E=y||_;if(0===n.length)return null;const C=g&&h,S=n.length>1,w=c()("block-editor-block-toolbar",E&&"is-showing-movers");return(0,s.createElement)("div",{className:w},!S&&!y&&!f&&(0,s.createElement)(ag,null),(0,s.createElement)("div",i({ref:b},k),(C||S)&&!f&&(0,s.createElement)(m.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,s.createElement)(Ng,{clientIds:n}),!S&&(0,s.createElement)(uh,{clientId:n[0]}),(0,s.createElement)(Xm,{clientIds:n,hideDragHandle:t||u}))),C&&S&&(0,s.createElement)(hh,null),C&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ko.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(ko.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(ko.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(ko.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(ko.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(vh.Provider,{value:null==r?void 0:r.name},(0,s.createElement)(Mg.Slot,null))),(0,s.createElement)(fh,{clientIds:n}),!f&&(0,s.createElement)(ch,{clientIds:n}))},_h=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:r,hasParents:a,showParentSelector:u}=(0,p.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o,__unstableGetContentLockingParent:r}=e(co),{getBlockType:i}=e(l.store),s=o(),a=s[0],c=n(a),u=i(t(c[c.length-1]));return{blockType:a&&i(t(a)),hasParents:c.length,showParentSelector:u&&(0,l.hasBlockSupport)(u,"__experimentalParentSelector",!0)&&s.length<=1&&!r(a)}}),[]);if(r&&!(0,l.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const d=c()("block-editor-block-contextual-toolbar",{"has-parent":a&&u,"is-fixed":n});return(0,s.createElement)(tg,i({focusOnMount:t,className:d
70
+ /* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(bh,{hideDragHandle:n}))},kh={flip:!1,shift:!0},yh={flip:!0,shift:!1};function Eh(e,t,n){if(!e||!t)return kh;const o=t.getBoundingClientRect(),l=e.getBoundingClientRect(),r=e.ownerDocument.documentElement.clientHeight,i=o.top-l.top>n,s=o.height>r-n;return i||s?kh:yh}function Ch(e){const{__unstableGetEditorMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:l,getSettings:r,getLastMultiSelectedBlockClientId:i}=e(co);return{editorMode:t(),isMultiSelecting:n(),isTyping:l(),hasFixedToolbar:r().hasFixedToolbar,lastClientId:o()?i():null}}function Sh(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:l,__unstablePopoverSlot:r,__unstableContentRef:a}=e;const{editorMode:u,isMultiSelecting:m,isTyping:g,hasFixedToolbar:h,lastClientId:f}=(0,p.useSelect)(Ch,[]),v=(0,p.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:l}=e(co);if(!n())return!1;const r=o();return l(r.rootClientId)[r.index]===t}),[t]),b=(0,d.useViewportMatch)("medium"),_=(0,s.useRef)(!1),{stopTyping:k}=(0,p.useDispatch)(co),y="navigation"===u||"zoom-out"===u,E="edit"===u&&!h&&b&&!m&&!(!g&&"edit"===u&&o)&&!g,C="edit"===u&&!E&&!h&&!o;(0,zu.useShortcut)("core/block-editor/focus-toolbar",(()=>{_.current=!0,k(!0)}),{isDisabled:!C}),(0,s.useEffect)((()=>{_.current=!1}));const S=(0,s.useRef)(),w=function(e){let{contentElement:t,clientId:n}=e;const o=Ro(n),[l,r]=(0,s.useState)(0),[i,a]=(0,s.useState)((()=>Eh(t,o,l))),c=(0,p.useSelect)((e=>e(co).getBlockIndex(n)),[n]),u=(0,d.useRefEffect)((e=>{r(e.offsetHeight)}),[]),m=(0,s.useCallback)((()=>a(Eh(t,o,l))),[t,o,l]);return(0,s.useLayoutEffect)(m,[c,m]),(0,s.useLayoutEffect)((()=>{var e,n,l;if(!t||!o)return;const r=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;let i;null==r||null===(n=r.addEventHandler)||void 0===n||n.call(r,"resize",m);const s=null==o||null===(l=o.ownerDocument)||void 0===l?void 0:l.defaultView;return s.ResizeObserver&&(i=new s.ResizeObserver(m),i.observe(o)),()=>{var e;null==r||null===(e=r.removeEventHandler)||void 0===e||e.call(r,"resize",m),i&&i.disconnect()}}),[m,t,o]),{...i,ref:u}}({contentElement:null==a?void 0:a.current,clientId:t});return y||E?(0,s.createElement)(El,i({clientId:l||t,bottomClientId:f,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":v}),__unstablePopoverSlot:r,__unstableContentRef:a,resize:!1},w),E&&(0,s.createElement)(_h,{focusOnMount:_.current,__experimentalInitialIndex:S.current,__experimentalOnIndexChange:e=>{S.current=e},key:t}),y&&(0,s.createElement)(Jm,{clientId:t,rootClientId:n})):null}function wh(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:r,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(co),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=r(a)||{},p=i(a),m=s(p),g=(0,u.find)(p,(e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isEmptyDefaultBlock:c&&(0,l.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function Bh(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,p.useSelect)(wh,[]);if(!o)return null;const{clientId:l,rootClientId:r,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)(Sh,{clientId:l,rootClientId:r,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Ih(e){let{children:t}=e;const n=(0,s.useContext)(Lm),o=(0,s.useContext)(m.Disabled.Context);return n||o?t:(V()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Rm,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Bh,{__unstablePopoverSlot:"block-toolbar"}),t))}const xh=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=go();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Th=xh((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:l,isToggle:r}=e;return(0,s.createElement)(xm,{className:c()({"block-list-appender__toggle":r}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:l})})),Nh=(0,d.compose)([xh,(0,p.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(co),l=o(n);return{lastBlockClientId:l[l.length-1]}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(wm,{rootClientId:t})})),Ph=new WeakMap,Lh=new WeakMap;function Mh(e,t){const n=(0,p.useSelect)((e=>e(co).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:r,getClientIdsOfDescendants:i}=(0,p.useSelect)(co),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,p.useDispatch)(co),d=function(e,t,n,o,r,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,l.cloneBlock)(e)));i(n,t,e,!0,null)}if("block"===d){const l=n(u[0]);if(c===e&&l===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;r(u,c,e,i&&l<t?t-s:t)}}}(e,t,r,i,a,s,u),m=function(e,t,n,o,r,i){return s=>{if(!n)return;const a=(0,l.findTransform)((0,l.getBlockTransforms)("from"),(t=>"files"===t.type&&r(t.blockName,e)&&t.isMatch(s)));if(a){const n=a.transform(s,o);i(n,t,e)}}}(e,t,n,c,o,s),g=function(e,t,n){return o=>{const r=(0,l.pasteHandler)({HTML:o,mode:"BLOCKS"});r.length&&n(r,t,e)}}(e,t,s);return e=>{const t=(0,Wr.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?g(n):t.length?m(t):d(e)}}function Rh(e,t,n){const o="top"===n||"bottom"===n,{x:l,y:r}=e,i=o?l:r,s=o?r:l,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 Ah(e,t){let n,o,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return l.forEach((l=>{const r=Rh(e,t,l);(void 0===n||r<n)&&(n=r,o=l)})),[n,o]}function Dh(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],l=(0,h.isRTL)();let r,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=Ah(t,s,o);(void 0===i||a<i)&&(i=a,r=n+("bottom"===c||!l&&"right"===c||l&&"left"===c?1:0))})),r}function Oh(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,p.useSelect)((t=>{const{getTemplateLock:n,__unstableIsWithinBlockOverlay:o,__unstableHasActiveBlockOverlayActive:l}=t(co),r=n(e);return["all","contentOnly"].some((e=>e===r))||l(e)||o(e)}),[e]),{getBlockListSettings:l}=(0,p.useSelect)(co),{showInsertionPoint:r,hideInsertionPoint:i}=(0,p.useDispatch)(co),a=Mh(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=Dh(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=l(e))||void 0===i?void 0:i.orientation);n(void 0===s?0:s),null!==s&&r(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 zh(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:r,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:m,__experimentalAppenderTagName:g,renderAppender:h,orientation:f,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,l,r,i,a){const{updateBlockListSettings:c}=(0,p.useDispatch)(co),u=(0,p.useRegistry)(),{blockListSettings:d,parentLock:m}=(0,p.useSelect)((t=>{const n=t(co).getBlockRootClientId(e);return{blockListSettings:t(co).getBlockListSettings(e),parentLock:t(co).getTemplateLock(n)}}),[e]),g=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:g,templateLock:void 0===l||"contentOnly"===m?m:l};if(void 0!==r&&(t.__experimentalCaptureToolbars=r),void 0!==i)t.orientation=i;else{const e=fr(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),_l()(d,t)||(Ph.get(u)||Ph.set(u,[]),Ph.get(u).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=Ph.get(u))&&void 0!==e&&e.length&&u.batch((()=>{Ph.get(u).forEach((e=>{c(...e)})),Ph.set(u,[])}))})))}),[e,d,g,n,o,l,m,r,i,c,a,u])}(t,n,o,r,a,m,f,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:r}=(0,p.useSelect)(co),{replaceInnerBlocks:i}=(0,p.useDispatch)(co),a=(0,p.useSelect)((t=>t(co).getBlocks(e)),[e]),{getBlocks:c}=(0,p.useSelect)(co),d=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{window.queueMicrotask((()=>{const s=c(e),a=0===s.length||"all"===n||"contentOnly"===n,p=!(0,u.isEqual)(t,d.current);if(!a||!p)return;d.current=t;const m=(0,l.synchronizeBlocksWithTemplate)(s,t);(0,u.isEqual)(m,s)||i(e,m,0===s.length&&o&&0!==m.length,r())}))}),[a,t,n,e])}(t,i,a,d);const _=(0,p.useSelect)((e=>{const n=e(co).getBlock(t);if(!n)return;const o=(0,l.getBlockType)(n.name);return o&&o.providesContext?function(e,t){Lh.has(t)||Lh.set(t,new WeakMap);const n=Lh.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):void 0}),[t]);return(0,s.createElement)(jr,{value:_},(0,s.createElement)(Yh,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:g,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Fh(e){return Tu(e),(0,s.createElement)(zh,e)}const Vh=(0,s.forwardRef)(((e,t)=>{const n=Hh({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function Hh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=go(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:r,hasOverlay:a}=(0,p.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:r,hasSelectedInnerBlock:i,__unstableGetEditorMode:s}=e(co),a=t(n),c="navigation"===s()||o;return{__experimentalCaptureToolbars:e(l.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!r(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,Oh({rootClientId:n})]),m={__experimentalCaptureToolbars:r,...t},g=m.value&&m.onChange?Fh:zh;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(g,i({},m,{clientId:n})):(0,s.createElement)(Yh,t)}}Hh.save=l.__unstableGetInnerBlocksProps,Vh.DefaultBlockAppender=Nh,Vh.ButtonBlockAppender=Th,Vh.Content=()=>Hh.save().children;const Gh=Vh,Uh=(0,s.createContext)(),Wh=(0,s.createContext)(),$h=new WeakMap;function jh(e){let{className:t,...n}=e;const[o,l]=(0,s.useState)(),r=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,editorMode:u}=(0,p.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(co),{outlineMode:o,focusMode:l}=t();return{isOutlineMode:o,isFocusMode:l,editorMode:n()}}),[]),m=(0,p.useRegistry)(),{setBlockVisibility:g}=(0,p.useDispatch)(co),h=(0,d.useDebounce)((0,s.useCallback)((()=>{const e={};$h.get(m).forEach((t=>{let[n,o]=t;e[n]=o})),g(e)}),[m]),300,{trailing:!0}),f=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{$h.get(m)||$h.set(m,[]);for(const t of e){const e=t.target.getAttribute("data-block");$h.get(m).push([e,t.isIntersecting])}h()}))}),[]),v=Hh({ref:(0,d.useMergeRefs)([Lu(),Am(),l]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&r,"is-navigate-mode":"navigation"===u})},n);return(0,s.createElement)(Uh.Provider,{value:o},(0,s.createElement)(Wh.Provider,{value:f},(0,s.createElement)("div",v)))}function Kh(e){return function(){const e=(0,p.useSelect)((e=>e(co).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,p.select)(co).__experimentalGetParsedPattern(e[n].name),t=Dm(o))};return t=Dm(o),()=>Om(t)}),[e])}(),(0,s.createElement)(Ih,null,(0,s.createElement)(mo,{value:uo},(0,s.createElement)(jh,e)))}function qh(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:l,__experimentalLayout:r=vr}=e;const{order:i,selectedBlocks:a,visibleBlocks:c}=(0,p.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:l}=e(co);return{order:t(n),selectedBlocks:o(),visibleBlocks:l()}}),[n]);return(0,s.createElement)(_r,{value:r},i.map((e=>(0,s.createElement)(p.AsyncModeProvider,{key:e,value:!c.has(e)&&!a.includes(e)},(0,s.createElement)(_u,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,s.createElement)(Tm,{tagName:l,rootClientId:n,renderAppender:o}))}function Yh(e){return(0,s.createElement)(p.AsyncModeProvider,{value:!1},(0,s.createElement)(qh,e))}function Zh(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Qh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||Zh(Object.values(n).filter(Boolean))||"px"}function Xh(){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,m.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),l=n.every((e=>e===n[0]))?n[0]:"",r=Zh(o),i=0===l||l?`${l}${r}`:void 0;return i}function Jh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Xh(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function ef(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function tf(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:l,...r}=e,a=Xh(l);void 0===a&&(a=Qh(n));const c=ef(l)&&Jh(l),u=c?(0,h.__)("Mixed"):null;return(0,s.createElement)(m.__experimentalUnitControl,i({},r,{"aria-label":(0,h.__)("Border radius"),disableUnits:c,isOnly:!0,value:a,onChange:e=>{const n=!isNaN(parseFloat(e));t(n?e:void 0)},onUnitChange:e=>{o({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:u}))}Kh.__unstableElementContext=Uh;const nf={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function of(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:l,...r}=e;const a=e=>n=>{if(!t)return;const o=isNaN(parseFloat(n))?void 0:n;t({...c,[e]:o})},c="string"!=typeof l?l:{topLeft:l,topRight:l,bottomLeft:l,bottomRight:l};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(nf).map((e=>{let[t,l]=e;const[u,d]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(c[t]),p=c[t]?d:n[t]||n.flat;return(0,s.createElement)(m.Tooltip,{text:l,position:"top",key:t},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(m.__experimentalUnitControl,i({},r,{"aria-label":l,value:[u,p].join(""),onChange:a(t),onUnitChange:(g=t,e=>{const t={...n};t[g]=e,o(t)})}))));var g})))}function lf(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink radii"):(0,h.__)("Link radii");return(0,s.createElement)(m.Tooltip,{text:o},(0,s.createElement)("span",null,(0,s.createElement)(m.Button,i({},n,{className:"component-border-radius-control__linked-button",isSmall:!0,icon:t?tl:nl,iconSize:24,"aria-label":o}))))}const rf={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},sf={px:100,em:20,rem:20};function af(e){let{onChange:t,values:n}=e;const[o,l]=(0,s.useState)(!ef(n)||!Jh(n)),[r,i]=(0,s.useState)({flat:"string"==typeof n?(0,m.__experimentalParseQuantityAndUnitFromRawValue)(n)[1]:void 0,topLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topLeft)[1],topRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topRight)[1],bottomLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomLeft)[1],bottomRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomRight)[1]}),a=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["px","em","rem"]}),c=Qh(r),u=a&&a.find((e=>e.value===c)),d=(null==u?void 0:u.step)||1,[p]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(Xh(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(tf,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,selectedUnits:r,setSelectedUnits:i,units:a}),(0,s.createElement)(m.RangeControl,{label:(0,h.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=p?p:"",min:0,max:sf[c],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${c}`:void 0)},step:d})):(0,s.createElement)(of,{min:0,onChange:t,selectedUnits:r,setSelectedUnits:i,values:n||rf,units:a}),(0,s.createElement)(lf,{onClick:()=>l(!o),isLinked:o})))}function cf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(af,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{const t=al({...n,border:{...null==n?void 0:n.border,radius:e}});o({style:t})}})}Sd([wd,xd]);const uf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},df=(e,t)=>(0,u.find)(e,{color:t});function pf(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function mf(){return{disableCustomColors:!Yo("color.custom"),disableCustomGradients:!Yo("color.customGradient")}}function gf(){const e=mf(),t=Yo("color.palette.custom"),n=Yo("color.palette.theme"),o=Yo("color.palette.default"),l=Yo("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}),l&&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 r=Yo("color.gradients.custom"),i=Yo("color.gradients.theme"),a=Yo("color.gradients.default"),c=Yo("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}),r&&r.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:r}),e}),[r,i,a]),e}const hf="__experimentalBorder",ff=["top","right","bottom","left"],vf=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},bf=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},_f=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=bf(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return bf(t,"color",o)||{color:o}};function kf(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function yf(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:r}=t,{colors:i}=gf(),a=Ef(e.name),c=Yo("border.color")&&Ef(e.name,"color"),u=Yo("border.radius")&&Ef(e.name,"radius"),d=Yo("border.style")&&Ef(e.name,"style"),p=Yo("border.width")&&Ef(e.name,"width");if([!c,!u,!d,!p].every(Boolean)||!a)return null;const g=(0,l.getBlockSupport)(e.name,[hf,"__experimentalDefaultControls"]),f=(null==g?void 0:g.color)||(null==g?void 0:g.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:l}=o||{};if(n){const{color:e}=_f({colors:t,namedColor:n});return e?{...l,color:e}:l}if(!l)return l;const r={...l};return ff.forEach((e=>{var n;const o=kf(null===(n=r[e])||void 0===n?void 0:n.color);if(o){const{color:n}=_f({colors:t,namedColor:o});r[e]={...r[e],color:n}}})),r})(t,i);return(0,s.createElement)(vl,{__experimentalGroup:"border"},(p||c)&&(0,s.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,m.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,h.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:l}=n;o({borderColor:void 0,style:{...l,border:al({radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:f,resetAllFilter:vf,panelId:n},(0,s.createElement)(m.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,enableStyle:d,onChange:e=>{var t;let n,l={...e};if((0,m.__experimentalHasSplitBorders)(e))l={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},ff.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=_f({colors:i,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(l[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=_f({colors:i,customColor:t});o.slug&&(n=o.slug,l.color=void 0)}const s=al({...r,border:{radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius,...l}});o({style:s,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",value:v,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(0,s.createElement)(m.__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:Cf(o,"radius")})}(e),isShownByDefault:null==g?void 0:g.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,s.createElement)(cf,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,l.getBlockSupport)(e,hf);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 Cf(e,t){return al({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Sf(e,t,n){if(!Ef(t,"color")||dl(t,hf,"color"))return e;const o=wf(n),l=c()(e.className,o);return e.className=l||void 0,e}function wf(e){var t;const{borderColor:n,style:o}=e,l=pf("border-color",n);return c()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[l]:!!l})}const Bf=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l,r,a,c,u,d,p;const{name:m,attributes:g}=t,{borderColor:h,style:f}=g,{colors:v}=gf();if(!Ef(m,"color")||dl(m,hf,"color"))return(0,s.createElement)(e,t);const{color:b}=_f({colors:v,namedColor:h}),{color:_}=_f({colors:v,namedColor:kf(null==f||null===(n=f.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:k}=_f({colors:v,namedColor:kf(null==f||null===(l=f.border)||void 0===l||null===(r=l.right)||void 0===r?void 0:r.color)}),{color:y}=_f({colors:v,namedColor:kf(null==f||null===(a=f.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=_f({colors:v,namedColor:kf(null==f||null===(u=f.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:_||b,borderRightColor:k||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,s.createElement)(e,i({},t,{wrapperProps:S}))}));function If(e){if(e)return`has-${e}-gradient-background`}function xf(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function Tf(e,t){return(0,u.find)(e,["gradient",t])}function Nf(e,t){const n=Tf(e,t);return n&&n.slug}function Pf(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=go(),o=Yo("color.gradients.custom"),l=Yo("color.gradients.theme"),r=Yo("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...l||[],...r||[]]),[o,l,r]),{gradient:a,customGradient:c}=(0,p.useSelect)((o=>{const{getBlockAttributes:l}=o(co),r=l(n)||{};return{customGradient:r[t],gradient:r[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,p.useDispatch)(co),d=(0,s.useCallback)((o=>{const l=Nf(i,o);u(n,l?{[e]:l,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),m=If(a);let g;return g=a?xf(i,a):c,{gradientClass:m,gradientValue:g,setGradient:d}}(0,r.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,r.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Sf),(0,r.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Ef(e,"color")||dl(e,hf,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Sf(o,e,n)},e})),(0,r.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Bf);const Lf=["colors","disableCustomColors","gradients","disableCustomGradients"],Mf={name:"color",title:"Solid",value:"color"},Rf={name:"gradient",title:"Gradient",value:"gradient"},Af=[Mf,Rf];function Df(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:l,__experimentalHasMultipleOrigins:r,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:p,onGradientChange:g,colorValue:h,gradientValue:f,clearable:v,showTitle:b=!0,enableAlpha:_}=e;const k=p&&(!(0,u.isEmpty)(t)||!o),y=g&&(!(0,u.isEmpty)(n)||!l);if(!k&&!y)return null;const E={[Mf.value]:(0,s.createElement)(m.ColorPalette,{value:h,onChange:y?e=>{p(e),g()}:p,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:r,__experimentalIsRenderedInSidebar:i,clearable:v,enableAlpha:_}),[Rf.value]:(0,s.createElement)(m.GradientPicker,{__nextHasNoMargin:!0,value:f,onChange:k?e=>{g(e),p()}:g,gradients:n,disableCustomGradients:l,__experimentalHasMultipleOrigins:r,__experimentalIsRenderedInSidebar:i,clearable:v})},C=e=>(0,s.createElement)("div",{className:"block-editor-color-gradient-control__panel"},E[e]);return(0,s.createElement)(m.BaseControl,{__nextHasNoMarginBottom:!0,className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(m.__experimentalVStack,{spacing:1},b&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(m.BaseControl.VisualLabel,null,d))),k&&y&&(0,s.createElement)(m.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:Af,initialTabName:f?Rf.value:!!k&&Mf.value},(e=>C(e.value))),!y&&C(Mf.value),!k&&C(Rf.value))))}function Of(e){const t={};return t.colors=Yo("color.palette"),t.gradients=Yo("color.gradients"),t.disableCustomColors=!Yo("color.custom"),t.disableCustomGradients=!Yo("color.customGradient"),(0,s.createElement)(Df,i({},t,e))}const zf=function(e){return(0,u.every)(Lf,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Df,e):(0,s.createElement)(Of,e)},Ff=e=>{let{setting:t,children:n,panelId:o,...l}=e;return(0,s.createElement)(m.__experimentalToolsPanelItem,i({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},l,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},Vf=e=>{let{colorValue:t,label:n}=e;return(0,s.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(m.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,s.createElement)(m.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},Hf=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:l,label:r}=e,i={onClick:n,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,s.createElement)(m.Button,i,(0,s.createElement)(Vf,{colorValue:l,label:r}))};function Gf(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:l,enableAlpha:r,gradients:a,settings:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...p}=e;return d&&(t={placement:"left-start",offset:36,shift:!0}),(0,s.createElement)(s.Fragment,null,c.map(((e,c)=>{var g;const h={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:l,enableAlpha:r,gradientValue:e.gradientValue,gradients:a,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...e},f={colorValue:null!==(g=e.gradientValue)&&void 0!==g?g:e.colorValue,label:e.label};return e&&(0,s.createElement)(Ff,i({key:c,setting:e},p),(0,s.createElement)(m.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:Hf(f),renderContent:()=>(0,s.createElement)(m.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,s.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,s.createElement)(zf,h)))}))})))}Sd([wd,xd]);const Uf=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:l,fontSize:r,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const p=a||o,g=c||l;if(!p&&!g)return null;const f=[{color:p,description:(0,h.__)("text color")},{color:g,description:(0,h.__)("link color")}],v=Ed(d),b=v.alpha()<1,_=v.brightness(),k={level:"AA",size:i||!1!==i&&r>=24?"large":"small"};let y="",E="";for(const e of f){if(!e.color)continue;const t=Ed(e.color),n=t.isReadable(v,k),o=t.alpha()<1;if(!n){if(b||o)continue;y=_<t.brightness()?(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
71
  (0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
72
+ (0,h.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,h.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,h.__)("Transparent text may be hard for people to read."),E=(0,h.__)("Transparent text may be hard for people to read."))}return y?((0,qt.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(m.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function Wf(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function $f(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:l=!0}=e;const[r,a]=(0,s.useState)(),[c,u]=(0,s.useState)(),[d,p]=(0,s.useState)(),m=Mo(o),g=n.filter((e=>null==e?void 0:e.colorValue));(0,s.useEffect)((()=>{var e;if(!l||!g.length)return;if(!m.current)return;u(Wf(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(Wf(t).color);let n=m.current,o=Wf(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Wf(n).backgroundColor;a(o)}));const h=gf();return(0,s.createElement)(vl,{__experimentalGroup:"color"},(0,s.createElement)(Gf,i({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},h)),l&&(0,s.createElement)(Uf,{backgroundColor:r,textColor:c,enableAlphaChecker:t,linkColor:d}))}const jf="color",Kf=e=>{const t=(0,l.getBlockSupport)(e,jf);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},qf=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,l.getBlockSupport)(e,jf);return null!==t&&"object"==typeof t&&!!t.link},Yf=e=>{const t=(0,l.getBlockSupport)(e,jf);return null!==t&&"object"==typeof t&&!!t.gradients},Zf=e=>{const t=(0,l.getBlockSupport)(e,jf);return t&&!1!==t.background},Qf=e=>{const t=(0,l.getBlockSupport)(e,jf);return t&&!1!==t.text},Xf=(e,t)=>al(cl(t,e,void 0)),Jf=e=>({textColor:void 0,style:Xf(["color","text"],e.style)}),ev=e=>({style:Xf(["elements","link","color","text"],e.style)}),tv=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function nv(e,t,n){var o,l,r,i,s,a;if(!Kf(t)||dl(t,jf))return e;const u=Yf(t),{backgroundColor:d,textColor:p,gradient:m,style:g}=n,h=e=>!dl(t,jf,e),f=h("text")?pf("color",p):void 0,v=h("gradients")?If(m):void 0,b=h("background")?pf("background-color",d):void 0,_=h("background")||h("gradients"),k=d||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||u&&(m||(null==g||null===(l=g.color)||void 0===l?void 0:l.gradient)),y=c()(e.className,f,v,{[b]:!(u&&null!=g&&null!==(r=g.color)&&void 0!==r&&r.gradient||!b),"has-text-color":h("text")&&(p||(null==g||null===(i=g.color)||void 0===i?void 0:i.text)),"has-background":_&&k,"has-link-color":h("link")&&(null==g||null===(s=g.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const ov=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?uf(e,n[1]).color:t};function lv(e){var t,n,o,r,i,a,c,u,d;const{name:p,attributes:m}=e,g=Yo("color.palette.custom"),f=Yo("color.palette.theme"),v=Yo("color.palette.default"),b=(0,s.useMemo)((()=>[...g||[],...f||[],...v||[]]),[g,f,v]),_=Yo("color.gradients.custom"),k=Yo("color.gradients.theme"),y=Yo("color.gradients.default"),E=(0,s.useMemo)((()=>[..._||[],...k||[],...y||[]]),[_,k,y]),C=Yo("color.custom"),S=Yo("color.customGradient"),w=Yo("color.background"),B=Yo("color.link"),I=Yo("color.text"),x=C||!f||(null==f?void 0:f.length)>0,T=S||!k||(null==k?void 0:k.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!Kf(p))return null;const P=qf(p)&&B&&x,L=Qf(p)&&I&&x,M=Zf(p)&&w&&x,R=Yf(p)&&T;if(!(P||L||M||R))return null;const{style:A,textColor:D,backgroundColor:O,gradient:z}=m;let F;if(R&&z)F=xf(E,z);else if(R){var V;F=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,l;const r=df(b,n),i=t+"Color",s={...N.current.style,color:{...null===(o=N.current)||void 0===o||null===(l=o.style)||void 0===l?void 0:l.color,[t]:null!=r&&r.slug?void 0:n}},a=null!=r&&r.slug?r.slug:void 0,c={style:al(s),[i]:a};e.setAttributes(c),N.current={...N.current,...c}},G=(0,l.getBlockSupport)(e.name,[jf,"__experimentalDefaultControls"]),U=!("web"!==s.Platform.OS||z||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient||!1===(0,l.getBlockSupport)(e.name,[jf,"enableContrastChecker"]));return(0,s.createElement)($f,{enableContrastChecking:U,clientId:e.clientId,enableAlpha:!0,settings:[...L?[{label:(0,h.__)("Text"),onColorChange:H("text"),colorValue:uf(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==G?void 0:G.text,resetAllFilter:Jf}]:[],...M||R?[{label:(0,h.__)("Background"),onColorChange:M?H("background"):void 0,colorValue:uf(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:F,onGradientChange:R?t=>{const n=Nf(E,t);let o;if(n){var l,r,i;const e={...null===(l=N.current)||void 0===l?void 0:l.style,color:{...null===(r=N.current)||void 0===r||null===(i=r.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:al(e),gradient:n}}else{var s,a,c;const e={...null===(s=N.current)||void 0===s?void 0:s.style,color:{...null===(a=N.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:al(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==G?void 0:G.background,resetAllFilter:tv}]:[],...P?[{label:(0,h.__)("Link"),onColorChange:t=>{var n;const o=df(b,t),l=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,r=al(cl(null===(n=N.current)||void 0===n?void 0:n.style,["elements","link","color","text"],l));e.setAttributes({style:r}),N.current={...N.current,style:r}},colorValue:ov(b,null==A||null===(r=A.elements)||void 0===r||null===(i=r.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==G?void 0:G.link,resetAllFilter:ev}]:[]]})}const rv=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:l}=t,{backgroundColor:r,textColor:a}=l,c=Yo("color.palette.custom")||[],u=Yo("color.palette.theme")||[],d=Yo("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!Kf(o)||dl(o,jf))return(0,s.createElement)(e,t);const m={};var g,h;a&&!dl(o,jf,"text")&&(m.color=null===(g=uf(p,a))||void 0===g?void 0:g.color),r&&!dl(o,jf,"background")&&(m.backgroundColor=null===(h=uf(p,r))||void 0===h?void 0:h.color);let f=t.wrapperProps;return f={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:f}))})),iv={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,r.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return Kf(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Yf(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",nv),(0,r.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Kf(e)||dl(e,jf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),nv(o,e,n)},e})),(0,r.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",rv),(0,r.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const l=e.name;return ul({linkColor:qf(l),textColor:Qf(l),backgroundColor:Zf(l),gradient:Yf(l)},iv,e,t,n,o)}));const sv=[{name:(0,h._x)("Regular","font style"),value:"normal"},{name:(0,h._x)("Italic","font style"),value:"italic"}],av=[{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"}],cv=(e,t)=>e?t?(0,h.__)("Appearance"):(0,h.__)("Font style"):(0,h.__)("Font weight");function uv(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:l,fontWeight:r},...a}=e,c=n||o,u=cv(n,o),d={key:"default",name:(0,h.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},p=(0,s.useMemo)((()=>n&&o?(()=>{const e=[d];return sv.forEach((t=>{let{name:n,value:o}=t;av.forEach((t=>{let{name:l,value:r}=t;const i="normal"===o?l:(0,h.sprintf)(
73
  /* translators: 1: Font weight name. 2: Font style name. */
74
+ (0,h.__)("%1$s %2$s"),l,n);e.push({key:`${o}-${r}`,name:i,style:{fontStyle:o,fontWeight:r}})}))})),e})():n?(()=>{const e=[d];return sv.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[d];return av.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),g=p.find((e=>e.style.fontStyle===l&&e.style.fontWeight===r))||p[0];return c&&(0,s.createElement)(m.CustomSelectControl,i({},a,{className:"components-font-appearance-control",label:u,describedBy:g?n?o?(0,h.sprintf)(// translators: %s: Currently selected font appearance.
75
  (0,h.__)("Currently selected font appearance: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font style.
76
  (0,h.__)("Currently selected font style: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font weight.
77
+ (0,h.__)("Currently selected font weight: %s"),g.name):(0,h.__)("No selected font appearance"),options:p,value:g,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}const dv=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:l="60px",...r}=e;const a=function(e){return void 0!==e&&""!==e}(t),c=a?t:"";o||V()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const u=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:u},(0,s.createElement)(m.__experimentalNumberControl,i({},r,{__unstableInputWidth:l,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),l=((e,t)=>{if(a)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o);return{...e,value:l}},onChange:n,label:(0,h.__)("Line height"),placeholder:1.5,step:.1,value:c,min:0})))},pv="typography.lineHeight";function mv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(dv,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:al(t)})},size:"__unstable-large"})}function gv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Yo("typography.lineHeight");return!(0,l.hasBlockSupport)(e,pv)||t}const hv="typography.__experimentalFontStyle",fv="typography.__experimentalFontWeight";function vv(e){var t,n;const{attributes:{style:o},setAttributes:l}=e,r=!bv(e),i=!_v(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)(uv,{onChange:e=>{l({style:al({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:r,hasFontWeights:i,value:{fontStyle:a,fontWeight:c},size:"__unstable-large"})}function bv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,l.hasBlockSupport)(e,hv),n=Yo("typography.fontStyle");return!t||!n}function _v(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,l.hasBlockSupport)(e,fv),n=Yo("typography.fontWeight");return!t||!n}function kv(e){const t=bv(e),n=_v(e);return t&&n}function yv(e){let{value:t="",onChange:n,fontFamilies:o,...l}=e;const r=Yo("typography.fontFamilies");if(o||(o=r),(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)(m.SelectControl,i({label:(0,h.__)("Font"),options:a,value:t,onChange:n,labelPosition:"top"},l))}const Ev="typography.__experimentalFontFamily";function Cv(e,t,n){if(!(0,l.hasBlockSupport)(t,Ev))return e;if(dl(t,nb,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(fg())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}function Sv(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const l=Yo("typography.fontFamilies"),r=null===(t=(0,u.find)(l,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(yv,{className:"block-editor-hooks-font-family-control",fontFamilies:l,value:r,onChange:function(e){const t=(0,u.find)(l,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})},size:"__unstable-large",__nextHasNoMarginBottom:!0})}function wv(e){let{name:t}=e;const n=Yo("typography.fontFamilies");return!n||0===n.length||!(0,l.hasBlockSupport)(t,Ev)}(0,r.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,l.hasBlockSupport)(e,Ev)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Cv),(0,r.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,l.hasBlockSupport)(e,Ev))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Cv(o,e,n)},e}));const Bv=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Iv(e,t){return(0,u.find)(e,{size:t})||{size:t}}function xv(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}const Tv=function(e){const t=Yo("typography.fontSizes"),n=!Yo("typography.customFontSize");return(0,s.createElement)(m.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))},Nv="typography.fontSize";function Pv(e,t,n){if(!(0,l.hasBlockSupport)(t,Nv))return e;if(dl(t,nb,"fontSize"))return e;const o=new(fg())(e.className);o.add(xv(n.fontSize));const r=o.value;return e.className=r||void 0,e}function Lv(e){var t,n;const{attributes:{fontSize:o,style:l},setAttributes:r}=e,i=Yo("typography.fontSizes"),a=Bv(i,o,null==l||null===(t=l.typography)||void 0===t?void 0:t.fontSize),c=(null==a?void 0:a.size)||(null==l||null===(n=l.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(Tv,{onChange:e=>{const t=Iv(i,e).slug;r({style:al({...l,typography:{...null==l?void 0:l.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1,size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Mv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Yo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,l.hasBlockSupport)(e,Nv)||!n}const Rv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const r=Yo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,l.hasBlockSupport)(i,Nv)||dl(i,nb,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=Bv(r,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"),Av={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,r.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,l.hasBlockSupport)(e,Nv)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Pv),(0,r.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,l.hasBlockSupport)(e,Nv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Pv(o,e,n)},e})),(0,r.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Rv),(0,r.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const r=e.name;return ul({fontSize:(0,l.hasBlockSupport)(r,Nv)},Av,e,t,n,o)}));const Dv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 11.5h10V13H7z"})),Ov=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),zv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Fv=[{name:(0,h.__)("None"),value:"none",icon:Dv},{name:(0,h.__)("Underline"),value:"underline",icon:Ov},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:zv}];function Vv(e){let{value:t,onChange:n,className:o}=e;return(0,s.createElement)("fieldset",{className:c()("block-editor-text-decoration-control",o)},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},Fv.map((e=>(0,s.createElement)(m.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const Hv="typography.__experimentalTextDecoration";function Gv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Vv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:al({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})},size:"__unstable-large"})}function Uv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,l.hasBlockSupport)(e,Hv),n=Yo("typography.textDecoration");return t||!n}const Wv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),$v=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),jv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Kv=[{name:(0,h.__)("None"),value:"none",icon:Dv},{name:(0,h.__)("Uppercase"),value:"uppercase",icon:Wv},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:$v},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:jv}];function qv(e){let{className:t,value:n,onChange:o}=e;return(0,s.createElement)("fieldset",{className:c()("block-editor-text-transform-control",t)},(0,s.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Kv.map((e=>(0,s.createElement)(m.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===n,onClick:()=>{o(e.value===n?void 0:e.value)}})))))}const Yv="typography.__experimentalTextTransform";function Zv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(qv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:al({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})},size:"__unstable-large"})}function Qv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,l.hasBlockSupport)(e,Yv),n=Yo("typography.textTransform");return t||!n}function Xv(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...l}=e;const r=(0,m.__experimentalUseCustomUnits)({availableUnits:Yo("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(m.__experimentalUnitControl,i({},l,{label:(0,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n}))}const Jv="typography.__experimentalLetterSpacing";function eb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Xv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:al({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%",size:"__unstable-large"})}function tb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,l.hasBlockSupport)(e,Jv),n=Yo("typography.letterSpacing");return t||!n}const nb="typography",ob=[pv,Nv,hv,fv,Ev,Hv,Yv,Jv];function lb(e){const{clientId:t}=e,n=wv(e),o=Mv(e),r=kv(e),i=gv(e),a=Uv(e),c=Qv(e),u=tb(e),d=!bv(e),p=!_v(e),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[kv(e),Mv(e),gv(e),wv(e),Uv(e),Qv(e),tb(e)];return t.filter(Boolean).length===t.length}(e),f=rb(e.name);if(g||!f)return null;const v=(0,l.getBlockSupport)(e.name,[nb,"__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)(vl,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(m.__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)(Sv,e)),!o&&(0,s.createElement)(m.__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)
78
+ /* translators: Ensure translation is distinct from "Letter case" */,label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:al({...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)(Lv,e)),!r&&(0,s.createElement)(m.__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:cv(d,p),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:al({...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)(vv,e)),!i&&(0,s.createElement)(m.__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:al({...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)(mv,e)),!u&&(0,s.createElement)(m.__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:al({...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)(eb,e)),!a&&(0,s.createElement)(m.__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:al({...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)(Gv,e)),!c&&(0,s.createElement)(m.__experimentalToolsPanelItem,{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)
79
+ /* translators: Ensure translation is distinct from "Font size" */,label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:al({...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)(Zv,e)))}const rb=e=>ob.some((t=>(0,l.hasBlockSupport)(e,t))),ib=[...ob,hf,jf,Pl],sb=e=>ib.some((t=>(0,l.hasBlockSupport)(e,t)));function ab(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return(0,gr.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const cb={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[jf],[`${nb}.__experimentalSkipSerialization`]:[nb],[`${Pl}.__experimentalSkipSerialization`]:["spacing"]},ub={...cb,[`${Pl}`]:["spacing.blockGap"]},db={gradients:"gradient"};function pb(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ub;if(!sb(t))return e;let{style:r}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const i=(0,l.getBlockSupport)(t,n);!0===i&&(r=(0,u.omit)(r,o)),Array.isArray(i)&&i.forEach((e=>{const t=db[e]||e;r=(0,u.omit)(r,[[...o,t]])}))})),e.style={...ab(r),...e.style},e}const mb=(0,d.createHigherOrderComponent)((e=>t=>{const n=ho();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(lv,t),(0,s.createElement)(lb,t),(0,s.createElement)(yf,t),(0,s.createElement)(Rl,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),gb=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const r=`wp-elements-${(0,d.useInstanceId)(e)}`,a=dl(t.name,jf,"link"),u=(0,s.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,o=[];if(n&&Object.keys(n).length>0){var i;const e={...n,link:{...n.link,color:a||null===(i=n.link)||void 0===i?void 0:i.color}};for(const[t,n]of Object.entries(e)){const e=(0,gr.compileCSS)(n,{selector:`.editor-styles-wrapper .${r} ${l.__EXPERIMENTAL_ELEMENTS[t]}`});e&&o.push(e)}}return o.length>0?o:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),p=(0,s.useContext)(Kh.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,u&&p&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:u}}),p),(0,s.createElement)(e,i({},t,{className:null!==(o=t.attributes.style)&&void 0!==o&&o.elements?c()(t.className,r):t.className})))}));(0,r.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return sb(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",pb),(0,r.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!sb(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),pb(o,e,n,cb)},e})),(0,r.addFilter)("editor.BlockEdit","core/style/with-block-controls",mb),(0,r.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",gb),(0,r.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,l.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));const hb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),fb=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:l,disableCustomDuotone:r,value:i,onChange:a}=e;return t="unset"===i?(0,s.createElement)(m.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,s.createElement)(m.DuotoneSwatch,{values:i}):(0,s.createElement)(dr,{icon:hb}),(0,s.createElement)(m.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(m.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==cu.DOWN||(e.preventDefault(),o())},label:(0,h.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,s.createElement)(m.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)(m.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:l,disableCustomDuotone:r,value:i,onChange:a}))})},vb=[];function bb(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,s.createElement)(tp,{selector:t}):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(np,{id:n,colors:o}),(0,s.createElement)(ep,{id:n,selector:t}))}function _b(e){let{presetSetting:t,defaultSetting:n}=e;const o=!Yo(n),l=Yo(`${t}.custom`)||vb,r=Yo(`${t}.theme`)||vb,i=Yo(`${t}.default`)||vb;return(0,s.useMemo)((()=>[...l,...r,...o?vb:i]),[o,l,r,i])}function kb(e){var t;let{attributes:n,setAttributes:o}=e;const l=null==n?void 0:n.style,r=null==l||null===(t=l.color)||void 0===t?void 0:t.duotone,i=_b({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=_b({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!Yo("color.custom"),u=!Yo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(ko,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(fb,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:c,value:r,onChange:e=>{const t={...l,color:{...null==l?void 0:l.color,duotone:e}};o({style:t})}}))}Sd([wd]);const yb=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,l.hasBlockSupport)(t.name,"color.__experimentalDuotone"),o=(0,p.useSelect)((e=>e(co).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&!o&&(0,s.createElement)(kb,t))}),"withDuotoneControls"),Eb=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r;const a=(0,l.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(r=o.color)||void 0===r?void 0:r.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(","),l=[];return n.forEach((e=>{o.forEach((t=>{l.push(`${e.trim()} ${t.trim()}`)}))})),l.join(", ")}(`.editor-styles-wrapper .${p}`,a),g=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(Kh.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(bb,{selector:m,id:p,colors:u}),h),(0,s.createElement)(e,i({},t,{className:g})))}),"withDuotoneStyles");(0,r.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,l.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,r.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",yb),(0,r.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Eb);const Cb="__experimentalLayout";function Sb(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:r}=n,i=Yo("layout"),a=(0,p.useSelect)((e=>{const{getSettings:t}=e(co);return t().supportsLayout}),[]),c=(0,l.getBlockSupport)(o,Cb,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:g=!0,default:f}=c;if(!d)return null;const v=!(!g||!i||null!=r&&r.type&&"default"!==(null==r?void 0:r.type)&&"constrained"!==(null==r?void 0:r.type)&&(null==r||!r.inherit)),b=r||f||{},{inherit:_=!1,type:k="default",contentSize:y=null}=b;if(("default"===k||"constrained"===k)&&!a)return null;const E=fr(k),C=fr("constrained"),S=!b.type&&(y||_),w=!!_||!!y,B=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(vl,null,(0,s.createElement)(m.PanelBody,{title:(0,h.__)("Layout")},v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.ToggleControl,{className:"block-editor-hooks__toggle-control",label:(0,h.__)("Inner blocks use content width"),checked:"constrained"===(null==E?void 0:E.name)||w,onChange:()=>t({layout:{type:"constrained"===(null==E?void 0:E.name)||w?"default":"constrained"}}),help:"constrained"===(null==E?void 0:E.name)||w?(0,h.__)("Nested blocks use content width with options for full and wide widths."):(0,h.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!_&&u&&(0,s.createElement)(wb,{type:k,onChange:e=>t({layout:{type:e}})}),E&&"default"!==E.name&&(0,s.createElement)(E.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}),C&&S&&(0,s.createElement)(C.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}))),!_&&E&&(0,s.createElement)(E.toolBarControls,{layout:b,onChange:B,layoutBlockSupport:c}))}function wb(e){let{type:t,onChange:n}=e;return(0,s.createElement)(m.ButtonGroup,null,hr.map((e=>{let{name:o,label:l}=e;return(0,s.createElement)(m.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},l)})))}const Bb=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,l.hasBlockSupport)(n,Cb)&&(0,s.createElement)(Sb,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Ib=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,r=(0,l.hasBlockSupport)(n,Cb),a=(0,p.useSelect)((e=>{const{getSettings:t}=e(co);return!!t().disableLayoutStyles})),m=r&&!a,g=(0,d.useInstanceId)(e),h=Yo("layout")||{},f=(0,s.useContext)(Kh.__unstableElementContext),{layout:v}=o,{default:b}=(0,l.getBlockSupport)(n,Cb)||{},_=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},k=r?function(e,t){var n;const o=(0,p.useSelect)((e=>{var t;const{getSettings:n}=e(co);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),l=[];var r;return null!=t&&null!==(n=t[(null==e?void 0:e.type)||"default"])&&void 0!==n&&n.className&&l.push(null==t||null===(r=t[(null==e?void 0:e.type)||"default"])||void 0===r?void 0:r.className),(null!=e&&e.inherit||null!=e&&e.contentSize||"constrained"===(null==e?void 0:e.type))&&o&&l.push("has-global-padding"),null!=e&&e.orientation&&l.push(`is-${(0,u.kebabCase)(e.orientation)}`),null!=e&&e.justifyContent&&l.push(`is-content-justification-${(0,u.kebabCase)(e.justifyContent)}`),null!=e&&e.flexWrap&&"nowrap"===e.flexWrap&&l.push("is-nowrap"),l}(_,null==h?void 0:h.definitions):null,y=`.${(0,l.getBlockDefaultClassName)(n)}.wp-container-${g}`,E=null!==Yo("spacing.blockGap");let C;if(m){var S;const e=fr((null==_?void 0:_.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:_,layoutDefinitions:null==h?void 0:h.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=c()(null==t?void 0:t.className,{[`wp-container-${g}`]:m&&!!C},k);return(0,s.createElement)(s.Fragment,null,m&&f&&!!C&&(0,s.createPortal)((0,s.createElement)(yr,{blockName:n,selector:y,css:C,layout:_,style:null==o?void 0:o.style}),f),(0,s.createElement)(e,i({},t,{className:w})))}));function xb(e){let{clientId:t,stopEditingAsBlock:n}=e;const o=(0,p.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=e(co);return n(t)||o(t,!0)}),[t]);return(0,s.useEffect)((()=>{o||n()}),[o]),null}(0,r.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.layout)&&void 0!==t?t:{})||(0,l.hasBlockSupport)(e,Cb)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,r.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Ib),(0,r.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",Bb);const Tb=(0,d.createHigherOrderComponent)((e=>t=>{const{getBlockListSettings:n,getSettings:o}=(0,p.useSelect)(co),l=(0,s.useRef)(),{templateLock:r,isLockedByParent:a,isEditingAsBlocks:u}=(0,p.useSelect)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:l}=e(co);return{templateLock:o(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:l()===t.clientId}}),[t.clientId]),{updateSettings:d,updateBlockListSettings:g,__unstableSetTemporarilyEditingAsBlocks:f}=(0,p.useDispatch)(co),v=!a&&"contentOnly"===r,{__unstableMarkNextChangeAsNotPersistent:b,updateBlockAttributes:_}=(0,p.useDispatch)(co),k=(0,s.useCallback)((()=>{b(),_(t.clientId,{templateLock:"contentOnly"}),g(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),d({focusMode:l.current}),f()}),[t.clientId,l,d,g,n,b,_,f]);return v||u?(0,s.createElement)(s.Fragment,null,u&&!v&&(0,s.createElement)(xb,{clientId:t.clientId,stopEditingAsBlock:k}),(0,s.createElement)(ko,{group:"other"},(0,s.createElement)(m.ToolbarButton,{onClick:()=>{u&&!v?k():(b(),_(t.clientId,{templateLock:void 0}),g(t.clientId,{...n(t.clientId),templateLock:!1}),l.current=o().focusMode,d({focusMode:!0}),f(t.clientId))}},u&&!v?(0,h.__)("Done"):(0,h.__)("Modify"))),(0,s.createElement)(e,i({},t,{className:c()(t.className,u&&"is-content-locked-editing-as-blocks")}))):(0,s.createElement)(e,t)}),"withToolbarControls");(0,r.addFilter)("editor.BlockEdit","core/style/with-block-controls",Tb);function Nb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=(0,l.getBlockSupport)(e,"__experimentalMetadata");return!!(!0===n||null!=n&&n[t])}function Pb(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:wf(e)||void 0,style:ab({border:n})}}function Lb(e){const{colors:t}=gf(),n=Pb(e),{borderColor:o}=e;if(o){const e=_f({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function Mb(e){var t,n,o,l,r,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=pf("background-color",s),m=pf("color",a),g=If(u),h=g||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,g,{[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===(l=d.color)||void 0===l?void 0:l.gradient),"has-link-color":null==d||null===(r=d.elements)||void 0===r||null===(i=r.link)||void 0===i?void 0:i.color})||void 0,style:ab({color:(null==d?void 0:d.color)||{}})}}(0,r.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.metadata)&&void 0!==n&&n.type||Nb(e,"name",!1)&&(e.attributes={...e.attributes,metadata:{type:"object"}}),e})),(0,r.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return Nb(t)&&(e.metadata=n.metadata),e})),(0,r.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||Nb(e,"name",!1)&&(e.__experimentalLabel=(e,t)=>{let{context:n}=t;const{metadata:o}=e;if("list-view"===n&&null!=o&&o.name)return o.name}),e}));const Rb={};function Ab(e){const{backgroundColor:t,textColor:n,gradient:o}=e,l=Yo("color.palette.custom")||[],r=Yo("color.palette.theme")||[],i=Yo("color.palette.default")||[],a=Yo("color.gradients")||Rb,c=(0,s.useMemo)((()=>[...l||[],...r||[],...i||[]]),[l,r,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=Mb(e);if(t){const e=uf(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=xf(u,o)),n){const e=uf(c,n);d.style.color=e.color}return d}function Db(e){const{style:t}=e;return{style:ab({spacing:(null==t?void 0:t.spacing)||{}})}}function Ob(e){var t;const n=ab({typography:(null==e||null===(t=e.style)||void 0===t?void 0:t.typography)||{}}),o=null!=e&&e.fontFamily?`has-${(0,u.kebabCase)(e.fontFamily)}-font-family`:"";return{className:c()(o,xv(null==e?void 0:e.fontSize)),style:n}}function zb(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const Fb=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},Vb=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),Hb=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=Yo("color.palette.custom"),o=Yo("color.palette.theme"),l=Yo("color.palette.default"),r=(0,s.useMemo)((()=>[...n||[],...o||[],...l||[]]),[n,o,l]);return(0,s.createElement)(e,i({},t,{colors:r}))}),"withEditorColorPalette");function Gb(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,..."string"==typeof 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=Ed(t),o=e=>{let{color:t}=e;return n.contrast(t)},l=Math.max(...e.map(o));return e.find((e=>o(e)===l)).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=Fb(n),l=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,l),e}),{})}createSetColor(e,t){return n=>{const o=df(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:l}=e;return(0,u.reduce)(n,((e,n,r)=>{const i=uf(l,o[r],o[`custom${Fb(r)}`]),s=t[r];return(null==s?void 0:s.color)===i.color&&s?e[r]=s:e[r]={...i,class:pf(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Ub(e){return function(){