Sindbad~EG File Manager

Current Path : /var/www/quickscrum.com/old_wordpress/wp-includes/js/dist/
Upload File :
Current File : /var/www/quickscrum.com/old_wordpress/wp-includes/js/dist/block-editor.min.js

/*! This file is auto-generated */
(()=>{var e={4306:function(e,t){var n,o,r;
/*!
	autosize 4.0.4
	license: MIT
	http://www.jacklmoore.com/autosize
*/o=[e,t],n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),s=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){s=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&p()},l=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",l,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",l,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:l,update:p}),a()}function a(){var n=window.getComputedStyle(e,null);"vertical"===n.resize?e.style.resize="none":"both"===n.resize&&(e.style.resize="horizontal"),t="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(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}function d(){if(0!==e.scrollHeight){var o=u(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function p(){d();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=s("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function l(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],l),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default},void 0===(r="function"==typeof n?n.apply(t,o):n)||(e.exports=r)},6109: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()}))]}},5417:(e,t)=>{"use strict";function n(){}function o(e,t,n,o,r){for(var s=0,i=t.length,l=0,a=0;s<i;s++){var c=t[s];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,s&&t[s-1].added){var u=t[s-1];t[s-1]=t[s],t[s]=u}}else{if(!c.added&&r){var d=n.slice(l,l+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(l,l+c.count));l+=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}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 s=this;function i(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 l=(t=this.removeEmpty(this.tokenize(t))).length,a=e.length,c=1,u=l+a,d=[{newPos:-1,components:[]}],p=this.extractCommon(d[0],t,e,0);if(d[0].newPos+1>=l&&p+1>=a)return i([{value:this.join(t),count:t.length}]);function h(){for(var n=-1*c;n<=c;n+=2){var r=void 0,u=d[n-1],p=d[n+1],h=(p?p.newPos:0)-n;u&&(d[n-1]=void 0);var g=u&&u.newPos+1<l,m=p&&0<=h&&h<a;if(g||m){if(!g||m&&u.newPos<p.newPos?(r={newPos:(f=p).newPos,components:f.components.slice(0)},s.pushComponent(r.components,void 0,!0)):((r=u).newPos++,s.pushComponent(r.components,!0,void 0)),h=s.extractCommon(r,t,e,n),r.newPos+1>=l&&h+1>=a)return i(o(s,r.components,t,e,s.useLongestToken));d[n]=r}else d[n]=void 0}var f;c++}if(r)!function e(){setTimeout((function(){if(c>u)return r();h()||e()}),0)}();else for(;c<=u;){var g=h();if(g)return g}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,s=n.length,i=e.newPos,l=i-o,a=0;i+1<r&&l+1<s&&this.equals(t[i+1],n[l+1]);)i++,l++,a++;return a&&e.components.push({count:a}),e.newPos=i,l},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("")}}},8021:(e,t,n)=>{"use strict";var o;t.JJ=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(5417))&&o.__esModule?o:{default:o}).default)},7734:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var o,r,s;if(Array.isArray(t)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],n.get(r[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(t[r]!==n[r])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((o=(s=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=o;0!=r--;){var i=s[r];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}},5215:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var o,r,s;if(Array.isArray(t)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((o=(s=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=o;0!=r--;){var i=s[r];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}},461:(e,t,n)=>{var o=n(6109);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var s=e.nodeName,i=document.createElement(s);i.innerHTML="&nbsp;","TEXTAREA"===s.toUpperCase()&&i.setAttribute("rows","1");var l=o(e,"font-size");i.style.fontSize=l,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},7520:(e,t,n)=>{e.exports=n(7191)},8202:e=>{"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},2213:e=>{var t,n,o,r,s,i,l,a,c,u,d,p,h,g,m,f=!1;function b(){if(!f){f=!0;var e=navigator.userAgent,b=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),v=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),h=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),g=/FBAN\/\w+;/i.exec(e),m=/Mobile/i.exec(e),d=!!/Win64/.exec(e),b){(t=b[1]?parseFloat(b[1]):b[5]?parseFloat(b[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var k=/(?:Trident\/(\d+.\d+))/.exec(e);i=k?parseFloat(k[1])+4:t,n=b[2]?parseFloat(b[2]):NaN,o=b[3]?parseFloat(b[3]):NaN,(r=b[4]?parseFloat(b[4]):NaN)?(b=/(?:Chrome\/(\d+\.\d+))/.exec(e),s=b&&b[1]?parseFloat(b[1]):NaN):s=NaN}else t=n=o=s=r=NaN;if(v){if(v[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);l=!_||parseFloat(_[1].replace("_","."))}else l=!1;a=!!v[2],c=!!v[3]}else l=a=c=!1}}var v={ie:function(){return b()||t},ieCompatibilityMode:function(){return b()||i>t},ie64:function(){return v.ie()&&d},firefox:function(){return b()||n},opera:function(){return b()||o},webkit:function(){return b()||r},safari:function(){return v.webkit()},chrome:function(){return b()||s},windows:function(){return b()||a},osx:function(){return b()||l},linux:function(){return b()||c},iphone:function(){return b()||p},mobile:function(){return b()||p||h||u||m},nativeApp:function(){return b()||g},android:function(){return b()||u},ipad:function(){return b()||h}};e.exports=v},1087:(e,t,n)=>{"use strict";var o,r=n(8202);r.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""))
/**
 * Checks if an event is supported in the current execution environment.
 *
 * NOTE: This will not work correctly for non-generic events such as `change`,
 * `reset`, `load`, `error`, and `select`.
 *
 * Borrows from Modernizr.
 *
 * @param {string} eventNameSuffix Event name, e.g. "click".
 * @param {?boolean} capture Check if the capture phase is supported.
 * @return {boolean} True if the event is supported.
 * @internal
 * @license Modernizr 3.0.0pre (Custom Build) | MIT
 */,e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,s=n in document;if(!s){var i=document.createElement("div");i.setAttribute(n,"return;"),s="function"==typeof i[n]}return!s&&o&&"wheel"===e&&(s=document.implementation.hasFeature("Events.wheel","3.0")),s}},7191:(e,t,n)=>{"use strict";var o=n(2213),r=n(1087);function s(e){var t=0,n=0,o=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),o=10*t,r=10*n,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||r)&&e.deltaMode&&(1==e.deltaMode?(o*=40,r*=40):(o*=800,r*=800)),o&&!t&&(t=o<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:t,spinY:n,pixelX:o,pixelY:r}}s.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=s},2775:e=>{var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t}};e.exports=n(),e.exports.createColors=n},4465:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8036:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n(4465);const r=o(n(4529)),s=o(n(3576));e.exports=(0,s.default)(r.default)},5525:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prefixWrapCSSSelector=t.prefixWrapCSSRule=void 0;const o=n(3467);t.prefixWrapCSSRule=(e,n,r,s,i)=>{const l=e.selectors.filter((e=>!(0,o.cssRuleMatchesPrefixSelector)({selector:e},s)));0!==l.length&&(e.selector=l.map((o=>(0,t.prefixWrapCSSSelector)(o,e,n,r,s,i))).filter(o.isValidCSSSelector).join(", "))};t.prefixWrapCSSSelector=(e,t,n,r,s,i)=>{const l=(0,o.cleanSelector)(e);return""===l?null:null!==n&&l.startsWith(n,0)||(0,o.isKeyframes)(t)||r.some((e=>l.match(e)))?l:(0,o.isNotRootTag)(l)?s+" "+l:i?s+" ."+l:l.replace(/^(body|html|:root)/,s)}},3467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cssRuleMatchesPrefixSelector=t.isNotRootTag=t.isKeyframes=t.cleanSelector=t.isValidCSSSelector=void 0;const n=/(^\s*|\s*$)/g,o=/^(body|html|:root).*$/;t.isValidCSSSelector=e=>null!==e;t.cleanSelector=e=>e.replace(n,"");t.isKeyframes=e=>{const{parent:t}=e,n=t;return void 0!==t&&"atrule"===n.type&&void 0!==n.name&&null!==n.name.match(/keyframes$/)};t.isNotRootTag=e=>!e.match(o);t.cssRuleMatchesPrefixSelector=(e,t)=>{const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${n}$`).test(e.selector)}},9411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldIncludeFilePath=void 0;t.shouldIncludeFilePath=(e,t,n)=>t.length>0?null!=e&&t.some((t=>e.match(t))):!(n.length>0)||!(null!=e&&n.some((t=>e.match(t))))},8061:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.asPostCSSv7PluginGenerator=void 0;const i=s(n(1311));t.asPostCSSv7PluginGenerator=e=>e.plugin(i.PLUGIN_NAME,((e,t)=>new i.default(e,t).prefix()))},2888:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.asPostCSSv8PluginGenerator=t.isPostCSSv8=void 0;const i=s(n(1311));t.isPostCSSv8=e=>void 0!==e.Root;t.asPostCSSv8PluginGenerator=()=>(e,t)=>{const n=new i.default(e,t);return{postcssPlugin:i.PLUGIN_NAME,Once(e){n.prefixRoot(e)}}}},3576:(e,t,n)=>{"use strict";const o=n(2888),r=n(8061);e.exports=e=>(0,o.isPostCSSv8)(e)?(0,o.asPostCSSv8PluginGenerator)():(0,r.asPostCSSv7PluginGenerator)(e)},1311:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PLUGIN_NAME=void 0;const o=n(5525),r=n(9411);t.PLUGIN_NAME="postcss-prefixwrap";t.default=class{blacklist;ignoredSelectors;isPrefixSelector;prefixRootTags;prefixSelector;whitelist;nested;constructor(e,t={}){this.blacklist=t.blacklist??[],this.ignoredSelectors=t.ignoredSelectors??[],this.isPrefixSelector=new RegExp(`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`),this.prefixRootTags=t.prefixRootTags??!1,this.prefixSelector=e,this.whitelist=t.whitelist??[],this.nested=t.nested??null}prefixRoot(e){(0,r.shouldIncludeFilePath)(e.source?.input?.file,this.whitelist,this.blacklist)&&e.walkRules((e=>{(0,o.prefixWrapCSSRule)(e,this.nested,this.ignoredSelectors,this.prefixSelector,this.prefixRootTags)}))}prefix(){return e=>{this.prefixRoot(e)}}}},5404:(e,t,n)=>{const o=n(1544);e.exports=e=>{const t=Object.assign({skipHostRelativeUrls:!0},e);return{postcssPlugin:"rebaseUrl",Declaration(n){const r=o(n.value);let s=!1;r.walk((n=>{if("function"!==n.type||"url"!==n.value)return;const o=n.nodes[0].value,r=new URL(o,e.rootUrl);return r.pathname===o&&t.skipHostRelativeUrls||(n.nodes[0].value=r.toString(),s=!0),!1})),s&&(n.value=o.stringify(r))}}},e.exports.postcss=!0},1544:(e,t,n)=>{var o=n(8491),r=n(3815),s=n(4725);function i(e){return this instanceof i?(this.nodes=o(e),this):new i(e)}i.prototype.toString=function(){return Array.isArray(this.nodes)?s(this.nodes):""},i.prototype.walk=function(e,t){return r(this.nodes,e,t),this},i.unit=n(1524),i.walk=r,i.stringify=s,e.exports=i},8491:e=>{var t="(".charCodeAt(0),n=")".charCodeAt(0),o="'".charCodeAt(0),r='"'.charCodeAt(0),s="\\".charCodeAt(0),i="/".charCodeAt(0),l=",".charCodeAt(0),a=":".charCodeAt(0),c="*".charCodeAt(0),u="u".charCodeAt(0),d="U".charCodeAt(0),p="+".charCodeAt(0),h=/^[a-f0-9?-]+$/i;e.exports=function(e){for(var g,m,f,b,v,k,_,x,y,S=[],w=e,C=0,B=w.charCodeAt(C),I=w.length,j=[{nodes:S}],E=0,T="",M="",P="";C<I;)if(B<=32){g=C;do{g+=1,B=w.charCodeAt(g)}while(B<=32);b=w.slice(C,g),f=S[S.length-1],B===n&&E?P=b:f&&"div"===f.type?(f.after=b,f.sourceEndIndex+=b.length):B===l||B===a||B===i&&w.charCodeAt(g+1)!==c&&(!y||y&&"function"===y.type&&"calc"!==y.value)?M=b:S.push({type:"space",sourceIndex:C,sourceEndIndex:g,value:b}),C=g}else if(B===o||B===r){g=C,b={type:"string",sourceIndex:C,quote:m=B===o?"'":'"'};do{if(v=!1,~(g=w.indexOf(m,g+1)))for(k=g;w.charCodeAt(k-1)===s;)k-=1,v=!v;else g=(w+=m).length-1,b.unclosed=!0}while(v);b.value=w.slice(C+1,g),b.sourceEndIndex=b.unclosed?g:g+1,S.push(b),C=g+1,B=w.charCodeAt(C)}else if(B===i&&w.charCodeAt(C+1)===c)b={type:"comment",sourceIndex:C,sourceEndIndex:(g=w.indexOf("*/",C))+2},-1===g&&(b.unclosed=!0,g=w.length,b.sourceEndIndex=g),b.value=w.slice(C+2,g),S.push(b),C=g+2,B=w.charCodeAt(C);else if(B!==i&&B!==c||!y||"function"!==y.type||"calc"!==y.value)if(B===i||B===l||B===a)b=w[C],S.push({type:"div",sourceIndex:C-M.length,sourceEndIndex:C+b.length,value:b,before:M,after:""}),M="",C+=1,B=w.charCodeAt(C);else if(t===B){g=C;do{g+=1,B=w.charCodeAt(g)}while(B<=32);if(x=C,b={type:"function",sourceIndex:C-T.length,value:T,before:w.slice(x+1,g)},C=g,"url"===T&&B!==o&&B!==r){g-=1;do{if(v=!1,~(g=w.indexOf(")",g+1)))for(k=g;w.charCodeAt(k-1)===s;)k-=1,v=!v;else g=(w+=")").length-1,b.unclosed=!0}while(v);_=g;do{_-=1,B=w.charCodeAt(_)}while(B<=32);x<_?(b.nodes=C!==_+1?[{type:"word",sourceIndex:C,sourceEndIndex:_+1,value:w.slice(C,_+1)}]:[],b.unclosed&&_+1!==g?(b.after="",b.nodes.push({type:"space",sourceIndex:_+1,sourceEndIndex:g,value:w.slice(_+1,g)})):(b.after=w.slice(_+1,g),b.sourceEndIndex=g)):(b.after="",b.nodes=[]),C=g+1,b.sourceEndIndex=b.unclosed?g:C,B=w.charCodeAt(C),S.push(b)}else E+=1,b.after="",b.sourceEndIndex=C+1,S.push(b),j.push(b),S=b.nodes=[],y=b;T=""}else if(n===B&&E)C+=1,B=w.charCodeAt(C),y.after=P,y.sourceEndIndex+=P.length,P="",E-=1,j[j.length-1].sourceEndIndex=C,j.pop(),S=(y=j[E]).nodes;else{g=C;do{B===s&&(g+=1),g+=1,B=w.charCodeAt(g)}while(g<I&&!(B<=32||B===o||B===r||B===l||B===a||B===i||B===t||B===c&&y&&"function"===y.type&&"calc"===y.value||B===i&&"function"===y.type&&"calc"===y.value||B===n&&E));b=w.slice(C,g),t===B?T=b:u!==b.charCodeAt(0)&&d!==b.charCodeAt(0)||p!==b.charCodeAt(1)||!h.test(b.slice(2))?S.push({type:"word",sourceIndex:C,sourceEndIndex:g,value:b}):S.push({type:"unicode-range",sourceIndex:C,sourceEndIndex:g,value:b}),C=g}else b=w[C],S.push({type:"word",sourceIndex:C-M.length,sourceEndIndex:C+b.length,value:b}),C+=1,B=w.charCodeAt(C);for(C=j.length-1;C;C-=1)j[C].unclosed=!0,j[C].sourceEndIndex=w.length;return j[0].nodes}},4725:e=>{function t(e,t){var o,r,s=e.type,i=e.value;return t&&void 0!==(r=t(e))?r:"word"===s||"space"===s?i:"string"===s?(o=e.quote||"")+i+(e.unclosed?"":o):"comment"===s?"/*"+i+(e.unclosed?"":"*/"):"div"===s?(e.before||"")+i+(e.after||""):Array.isArray(e.nodes)?(o=n(e.nodes,t),"function"!==s?o:i+"("+(e.before||"")+o+(e.after||"")+(e.unclosed?"":")")):i}function n(e,n){var o,r;if(Array.isArray(e)){for(o="",r=e.length-1;~r;r-=1)o=t(e[r],n)+o;return o}return t(e,n)}e.exports=n},1524:e=>{var t="-".charCodeAt(0),n="+".charCodeAt(0),o=".".charCodeAt(0),r="e".charCodeAt(0),s="E".charCodeAt(0);e.exports=function(e){var i,l,a,c=0,u=e.length;if(0===u||!function(e){var r,s=e.charCodeAt(0);if(s===n||s===t){if((r=e.charCodeAt(1))>=48&&r<=57)return!0;var i=e.charCodeAt(2);return r===o&&i>=48&&i<=57}return s===o?(r=e.charCodeAt(1))>=48&&r<=57:s>=48&&s<=57}(e))return!1;for((i=e.charCodeAt(c))!==n&&i!==t||c++;c<u&&!((i=e.charCodeAt(c))<48||i>57);)c+=1;if(i=e.charCodeAt(c),l=e.charCodeAt(c+1),i===o&&l>=48&&l<=57)for(c+=2;c<u&&!((i=e.charCodeAt(c))<48||i>57);)c+=1;if(i=e.charCodeAt(c),l=e.charCodeAt(c+1),a=e.charCodeAt(c+2),(i===r||i===s)&&(l>=48&&l<=57||(l===n||l===t)&&a>=48&&a<=57))for(c+=l===n||l===t?3:2;c<u&&!((i=e.charCodeAt(c))<48||i>57);)c+=1;return{number:e.slice(0,c),unit:e.slice(c)}}},3815:e=>{e.exports=function e(t,n,o){var r,s,i,l;for(r=0,s=t.length;r<s;r+=1)i=t[r],o||(l=n(i,r,t)),!1!==l&&"function"===i.type&&Array.isArray(i.nodes)&&e(i.nodes,n,o),o&&n(i,r,t)}},1326:(e,t,n)=>{"use strict";let o=n(683);class r extends o{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}e.exports=r,r.default=r,o.registerAtRule(r)},6589:(e,t,n)=>{"use strict";let o=n(7490);class r extends o{constructor(e){super(e),this.type="comment"}}e.exports=r,r.default=r},683:(e,t,n)=>{"use strict";let o,r,s,i,{isClean:l,my:a}=n(1381),c=n(1516),u=n(6589),d=n(7490);function p(e){return e.map((e=>(e.nodes&&(e.nodes=p(e.nodes)),delete e.source,e)))}function h(e){if(e[l]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)h(t)}class g extends d{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,o=this.getIterator();for(;this.indexes[o]<this.proxyOf.nodes.length&&(t=this.indexes[o],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[o]+=1;return delete this.indexes[o],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map((e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e))):"every"===t||"some"===t?n=>e[t](((e,...t)=>n(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,o=this.index(e),r=this.normalize(t,this.proxyOf.nodes[o]).reverse();o=this.index(e);for(let e of r)this.proxyOf.nodes.splice(o+1,0,e);for(let e in this.indexes)n=this.indexes[e],o<n&&(this.indexes[e]=n+r.length);return this.markDirty(),this}insertBefore(e,t){let n,o=this.index(e),r=0===o&&"prepend",s=this.normalize(t,this.proxyOf.nodes[o],r).reverse();o=this.index(e);for(let e of s)this.proxyOf.nodes.splice(o,0,e);for(let e in this.indexes)n=this.indexes[e],o<=n&&(this.indexes[e]=n+s.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=p(o(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new c(e)]}else if(e.selector)e=[new r(e)];else if(e.name)e=[new s(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new u(e)]}return e.map((e=>(e[a]||g.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[l]&&h(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls((o=>{t.props&&!t.props.includes(o.prop)||t.fast&&!o.value.includes(t.fast)||(o.value=o.value.replace(e,n))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,n)=>{let o;try{o=e(t,n)}catch(e){throw t.addToError(e)}return!1!==o&&t.walk&&(o=t.walk(e)),o}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((n,o)=>{if("atrule"===n.type&&e.test(n.name))return t(n,o)})):this.walk(((n,o)=>{if("atrule"===n.type&&n.name===e)return t(n,o)})):(t=e,this.walk(((e,n)=>{if("atrule"===e.type)return t(e,n)})))}walkComments(e){return this.walk(((t,n)=>{if("comment"===t.type)return e(t,n)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((n,o)=>{if("decl"===n.type&&e.test(n.prop))return t(n,o)})):this.walk(((n,o)=>{if("decl"===n.type&&n.prop===e)return t(n,o)})):(t=e,this.walk(((e,n)=>{if("decl"===e.type)return t(e,n)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((n,o)=>{if("rule"===n.type&&e.test(n.selector))return t(n,o)})):this.walk(((n,o)=>{if("rule"===n.type&&n.selector===e)return t(n,o)})):(t=e,this.walk(((e,n)=>{if("rule"===e.type)return t(e,n)})))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}g.registerParse=e=>{o=e},g.registerRule=e=>{r=e},g.registerAtRule=e=>{s=e},g.registerRoot=e=>{i=e},e.exports=g,g.default=g,g.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,s.prototype):"rule"===e.type?Object.setPrototypeOf(e,r.prototype):"decl"===e.type?Object.setPrototypeOf(e,c.prototype):"comment"===e.type?Object.setPrototypeOf(e,u.prototype):"root"===e.type&&Object.setPrototypeOf(e,i.prototype),e[a]=!0,e.nodes&&e.nodes.forEach((e=>{g.rebuild(e)}))}},356:(e,t,n)=>{"use strict";let o=n(2775),r=n(9746);class s extends Error{constructor(e,t,n,o,r,i){super(e),this.name="CssSyntaxError",this.reason=e,r&&(this.file=r),o&&(this.source=o),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=o.isColorSupported),r&&e&&(t=r(t));let n,s,i=t.split(/\r?\n/),l=Math.max(this.line-3,0),a=Math.min(this.line+2,i.length),c=String(a).length;if(e){let{bold:e,gray:t,red:r}=o.createColors(!0);n=t=>e(r(t)),s=e=>t(e)}else n=s=e=>e;return i.slice(l,a).map(((e,t)=>{let o=l+1+t,r=" "+(" "+o).slice(-c)+" | ";if(o===this.line){let t=s(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+s(r)+e+"\n "+t+n("^")}return" "+s(r)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=s,s.default=s},1516:(e,t,n)=>{"use strict";let o=n(7490);class r extends o{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}e.exports=r,r.default=r},271:(e,t,n)=>{"use strict";let o,r,s=n(683);class i extends s{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new o(new r,this,e).stringify()}}i.registerLazyResult=e=>{o=e},i.registerProcessor=e=>{r=e},e.exports=i,i.default=i},8940:(e,t,n)=>{"use strict";let o=n(1516),r=n(5696),s=n(6589),i=n(1326),l=n(5380),a=n(9434),c=n(4092);function u(e,t){if(Array.isArray(e))return e.map((e=>u(e)));let{inputs:n,...d}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:l.prototype};n.map&&(n.map={...n.map,__proto__:r.prototype}),t.push(n)}}if(d.nodes&&(d.nodes=e.nodes.map((e=>u(e,t)))),d.source){let{inputId:e,...n}=d.source;d.source=n,null!=e&&(d.source.input=t[e])}if("root"===d.type)return new a(d);if("decl"===d.type)return new o(d);if("rule"===d.type)return new c(d);if("comment"===d.type)return new s(d);if("atrule"===d.type)return new i(d);throw new Error("Unknown node type: "+e.type)}e.exports=u,u.default=u},5380:(e,t,n)=>{"use strict";let{SourceMapConsumer:o,SourceMapGenerator:r}=n(1866),{fileURLToPath:s,pathToFileURL:i}=n(2739),{isAbsolute:l,resolve:a}=n(197),{nanoid:c}=n(5042),u=n(9746),d=n(356),p=n(5696),h=Symbol("fromOffsetCache"),g=Boolean(o&&r),m=Boolean(a&&l);class f{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!m||/^\w+:\/\//.test(t.from)||l(t.from)?this.file=t.from:this.file=a(t.from)),m&&g){let e=new p(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+c(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,o={}){let r,s,l;if(t&&"object"==typeof t){let e=t,o=n;if("number"==typeof e.offset){let o=this.fromOffset(e.offset);t=o.line,n=o.col}else t=e.line,n=e.column;if("number"==typeof o.offset){let e=this.fromOffset(o.offset);s=e.line,l=e.col}else s=o.line,l=o.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,s,l);return r=a?new d(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,o.plugin):new d(e,void 0===s?t:{column:n,line:t},void 0===s?n:{column:l,line:s},this.css,this.file,o.plugin),r.input={column:n,endColumn:l,endLine:s,line:t,source:this.css},this.file&&(i&&(r.input.url=i(this.file).toString()),r.input.file=this.file),r}fromOffset(e){let t,n;if(this[h])n=this[h];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let o=0,r=e.length;o<r;o++)n[o]=t,t+=e[o].length+1;this[h]=n}t=n[n.length-1];let o=0;if(e>=t)o=n.length-1;else{let t,r=n.length-2;for(;o<r;)if(t=o+(r-o>>1),e<n[t])r=t-1;else{if(!(e>=n[t+1])){o=t;break}o=t+1}}return{col:e-n[o]+1,line:o+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:a(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,o){if(!this.map)return!1;let r,a,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof n&&(r=c.originalPositionFor({column:o,line:n})),a=l(u.source)?i(u.source):new URL(u.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let d={column:u.column,endColumn:r&&r.column,endLine:r&&r.line,line:u.line,url:a.toString()};if("file:"===a.protocol){if(!s)throw new Error("file: protocol is not available in this PostCSS build");d.file=s(a)}let p=c.sourceContentFor(u.source);return p&&(d.source=p),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}e.exports=f,f.default=f,u&&u.registerInput&&u.registerInput(f)},448:(e,t,n)=>{"use strict";let{isClean:o,my:r}=n(1381),s=n(1670),i=n(633),l=n(683),a=n(271),c=(n(3122),n(9055)),u=n(4295),d=n(9434);const p={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},g={Once:!0,postcssPlugin:!0,prepare:!0},m=0;function f(e){return"object"==typeof e&&"function"==typeof e.then}function b(e){let t=!1,n=p[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,m,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,m,n+"Exit"]:[n,n+"Exit"]}function v(e){let t;return t="document"===e.type?["Document",m,"DocumentExit"]:"root"===e.type?["Root",m,"RootExit"]:b(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function k(e){return e[o]=!1,e.nodes&&e.nodes.forEach((e=>k(e))),e}let _={};class x{constructor(e,t,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof x||t instanceof c)o=k(t.root),t.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let e=u;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(t,n)}catch(e){this.processed=!0,this.error=e}o&&!o[r]&&l.rebuild(o)}else o=k(t);this.result=new c(e,o,n),this.helpers={..._,postcss:_,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!h[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!g[n])if("object"==typeof t[n])for(let o in t[n])e(t,"*"===o?n:n+"-"+o.toLowerCase(),t[n][o]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(f(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[o];){e[o]=!0;let t=[v(e)];for(;t.length>0;){let e=this.visitTick(t);if(f(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>n(e,this.helpers)));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new s(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(f(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[o];)e[o]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,o]of e){let e;this.result.lastPlugin=n;try{e=o(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(f(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,o]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return o(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,s=t.iterator;for(;r=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!r[o])return r[o]=!0,void e.push(v(r));t.iterator=0,delete n.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,e===m)return void(n.nodes&&n.nodes.length&&(n[o]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[o]=!0;let t=b(e);for(let n of t)if(n===m)e.nodes&&e.each((e=>{e[o]||this.walkSync(e)}));else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}x.registerPostcss=e=>{_=e},e.exports=x,x.default=x,d.registerLazyResult(x),a.registerLazyResult(x)},7374:e=>{"use strict";let t={comma:e=>t.split(e,[","],!0),space:e=>t.split(e,[" ","\n","\t"]),split(e,t,n){let o=[],r="",s=!1,i=0,l=!1,a="",c=!1;for(let n of e)c?c=!1:"\\"===n?c=!0:l?n===a&&(l=!1):'"'===n||"'"===n?(l=!0,a=n):"("===n?i+=1:")"===n?i>0&&(i-=1):0===i&&t.includes(n)&&(s=!0),s?(""!==r&&o.push(r.trim()),r="",s=!1):r+=n;return(n||""!==r)&&o.push(r.trim()),o}};e.exports=t,t.default=t},1670:(e,t,n)=>{"use strict";let{SourceMapConsumer:o,SourceMapGenerator:r}=n(1866),{dirname:s,relative:i,resolve:l,sep:a}=n(197),{pathToFileURL:c}=n(2739),u=n(5380),d=Boolean(o&&r),p=Boolean(s&&l&&i&&a);e.exports=class{constructor(e,t,n,o){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=o,this.originalCSS=o,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||s(e.file);!1===this.mapOpts.sourcesContent?(t=new o(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),p&&d&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=r.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new r({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new r({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,o=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((r,l,a)=>{if(this.css+=r,l&&"end"!==a&&(i.generated.line=n,i.generated.column=o-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=r.match(/\n/g),e?(n+=e.length,t=r.lastIndexOf("\n"),o=r.length-t):o+=r.length,l&&"start"!==a){let e=l.parent||{raws:{}};("decl"===l.type||"atrule"===l.type&&!l.nodes)&&l===e.last&&!e.raws.semicolon||(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=n,i.generated.column=o-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=o-1,this.map.addMapping(i)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?s(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=s(l(n,this.mapOpts.annotation)));let o=i(n,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new u(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let o=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(o,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(c){let t=c(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===a&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}},7661:(e,t,n)=>{"use strict";let o=n(1670),r=n(633),s=(n(3122),n(4295));const i=n(9055);class l{constructor(e,t,n){let s;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let l=r;this.result=new i(this._processor,s,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let c=new o(l,s,this._opts,t);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=s;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}e.exports=l,l.default=l},7490:(e,t,n)=>{"use strict";let{isClean:o,my:r}=n(1381),s=n(356),i=n(346),l=n(633);function a(e,t){let n=new e.constructor;for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;if("proxyCache"===o)continue;let r=e[o],s=typeof r;"parent"===o&&"object"===s?t&&(n[o]=t):"source"===o?n[o]=r:Array.isArray(r)?n[o]=r.map((e=>a(e,n))):("object"===s&&null!==r&&(r=a(r)),n[o]=r)}return n}class c{constructor(e={}){this.raws={},this[o]=!1,this[r]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:o}=this.rangeBy(t);return this.source.input.error(e,{column:o.column,line:o.line},{column:n.column,line:n.line},t)}return new s(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[o]){this[o]=!1;let e=this;for(;e=e.parent;)e[o]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let o=(t=this.toString()).indexOf(e.word);-1!==o&&(n=this.positionInside(o,t))}return n}positionInside(e,t){let n=t||this.toString(),o=this.source.start.column,r=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(o=1,r+=1):o+=1;return{column:o,line:r}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let o=this.toString(),r=o.indexOf(e.word);-1!==r&&(t=this.positionInside(r,o),n=this.positionInside(r+e.word.length,o))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new i).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let o of e)o===this?n=!0:n?(this.parent.insertAfter(t,o),t=o):this.parent.insertBefore(t,o);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},o=null==t;t=t||new Map;let r=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let o=this[e];if(Array.isArray(o))n[e]=o.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof o&&o.toJSON)n[e]=o.toJSON(null,t);else if("source"===e){let s=t.get(o.input);null==s&&(s=r,t.set(o.input,r),r++),n[e]={end:o.end,inputId:s,start:o.start}}else n[e]=o}return o&&(n.inputs=[...t.keys()].map((e=>e.toJSON()))),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=l){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,n){let o={node:this};for(let e in n)o[e]=n[e];return e.warn(t,o)}get proxyOf(){return this}}e.exports=c,c.default=c},4295:(e,t,n)=>{"use strict";let o=n(683),r=n(3937),s=n(5380);function i(e,t){let n=new s(e,t),o=new r(n);try{o.parse()}catch(e){throw e}return o.root}e.exports=i,i.default=i,o.registerParse(i)},3937:(e,t,n)=>{"use strict";let o=n(1516),r=n(2327),s=n(6589),i=n(1326),l=n(9434),a=n(4092);const c={empty:!0,space:!0};e.exports=class{constructor(e){this.input=e,this.root=new l,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,o,r=new i;r.name=e[1].slice(1),""===r.name&&this.unnamedAtrule(r,e),this.init(r,e[2]);let s=!1,l=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){r.source.end=this.getPosition(e[2]),r.source.end.offset++,this.semicolon=!0;break}if("{"===t){l=!0;break}if("}"===t){if(a.length>0){for(o=a.length-1,n=a[o];n&&"space"===n[0];)n=a[--o];n&&(r.source.end=this.getPosition(n[3]||n[2]),r.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),s&&(e=a[a.length-1],r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),l&&(r.nodes=[],this.current=r)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,o=0;for(let r=t-1;r>=0&&(n=e[r],"space"===n[0]||(o+=1,2!==o));r--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,o,r=0;for(let[s,i]of e.entries()){if(t=i,n=t[0],"("===n&&(r+=1),")"===n&&(r-=1),0===r&&":"===n){if(o){if("word"===o[0]&&"progid"===o[1])continue;return s}this.doubleColon(t)}o=t}return!1}comment(e){let t=new s;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=r(this.input)}decl(e,t){let n=new o;this.init(n,e[0][2]);let r,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],o=n[3]||n[2];if(o)return o}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,l=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)l.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let o=this.stringFrom(e,t);o=this.spacesFromEnd(e)+o," !important"!==o&&(n.raws.important=o);break}if("important"===r[1].toLowerCase()){let o=e.slice(0),r="";for(let e=t;e>0;e--){let t=o[e][0];if(0===r.trim().indexOf("!")&&"space"!==t)break;r=o.pop()[1]+r}0===r.trim().indexOf("!")&&(n.important=!0,n.raws.important=r,e=o)}if("space"!==r[0]&&"comment"!==r[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(n.raws.between+=l.map((e=>e[1])).join(""),l=[]),this.raw(n,"value",l.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,o=!1,r=null,s=[],i=e[1].startsWith("--"),l=[],a=e;for(;a;){if(n=a[0],l.push(a),"("===n||"["===n)r||(r=a),s.push("("===n?")":"]");else if(i&&o&&"{"===n)r||(r=a),s.push("}");else if(0===s.length){if(";"===n){if(o)return void this.decl(l,i);break}if("{"===n)return void this.rule(l);if("}"===n){this.tokenizer.back(l.pop()),t=!0;break}":"===n&&(o=!0)}else n===s[s.length-1]&&(s.pop(),0===s.length&&(r=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),s.length>0&&this.unclosedBracket(r),t&&o){if(!i)for(;l.length&&(a=l[l.length-1][0],"space"===a||"comment"===a);)this.tokenizer.back(l.pop());this.decl(l,i)}else this.unknownWord(l)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,o){let r,s,i,l,a=n.length,u="",d=!0;for(let e=0;e<a;e+=1)r=n[e],s=r[0],"space"!==s||e!==a-1||o?"comment"===s?(l=n[e-1]?n[e-1][0]:"empty",i=n[e+1]?n[e+1][0]:"empty",c[l]||c[i]||","===u.slice(-1)?d=!1:u+=r[1]):u+=r[1]:d=!1;if(!d){let o=n.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:o,value:u}}e[t]=u}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let o=t;o<e.length;o++)n+=e[o][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}},4529:(e,t,n)=>{"use strict";let o=n(356),r=n(1516),s=n(448),i=n(683),l=n(9656),a=n(633),c=n(8940),u=n(271),d=n(5776),p=n(6589),h=n(1326),g=n(9055),m=n(5380),f=n(4295),b=n(7374),v=n(4092),k=n(9434),_=n(7490);function x(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new l(e)}x.plugin=function(e,t){let n,o=!1;function r(...n){console&&console.warn&&!o&&(o=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let r=t(...n);return r.postcssPlugin=e,r.postcssVersion=(new l).version,r}return Object.defineProperty(r,"postcss",{get:()=>(n||(n=r()),n)}),r.process=function(e,t,n){return x([r(n)]).process(e,t)},r},x.stringify=a,x.parse=f,x.fromJSON=c,x.list=b,x.comment=e=>new p(e),x.atRule=e=>new h(e),x.decl=e=>new r(e),x.rule=e=>new v(e),x.root=e=>new k(e),x.document=e=>new u(e),x.CssSyntaxError=o,x.Declaration=r,x.Container=i,x.Processor=l,x.Document=u,x.Comment=p,x.Warning=d,x.AtRule=h,x.Result=g,x.Input=m,x.Rule=v,x.Root=k,x.Node=_,s.registerPostcss(x),e.exports=x,x.default=x},5696:(e,t,n)=>{"use strict";let{SourceMapConsumer:o,SourceMapGenerator:r}=n(1866),{existsSync:s,readFileSync:i}=n(9977),{dirname:l,join:a}=n(197);class c{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,o=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=l(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new o(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),o=e.indexOf("*/",n);n>-1&&o>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,o)))}loadFile(e){if(this.root=l(e),s(e))return this.mapFile=e,i(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof o)return r.fromSourceMap(t).toString();if(t instanceof r)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=a(l(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}e.exports=c,c.default=c},9656:(e,t,n)=>{"use strict";let o=n(7661),r=n(448),s=n(271),i=n(9434);class l{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new r(this,e,t):new o(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=l,l.default=l,i.registerProcessor(l),s.registerProcessor(l)},9055:(e,t,n)=>{"use strict";let o=n(5776);class r{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new o(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}}e.exports=r,r.default=r},9434:(e,t,n)=>{"use strict";let o,r,s=n(683);class i extends s{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let o=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of o)e.raws.before=t.raws.before;return o}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new o(new r,this,e).stringify()}}i.registerLazyResult=e=>{o=e},i.registerProcessor=e=>{r=e},e.exports=i,i.default=i,s.registerRoot(i)},4092:(e,t,n)=>{"use strict";let o=n(683),r=n(7374);class s extends o{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return r.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}e.exports=s,s.default=s,o.registerRule(s)},346:e=>{"use strict";const t={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:"    ",semicolon:!1};class n{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:o&&(n+=" "),e.nodes)this.block(e,n+o);else{let r=(e.raws.between||"")+(t?";":"");this.builder(n+o+r,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let o=e.parent,r=0;for(;o&&"root"!==o.type;)r+=1,o=o.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<r;e++)n+=t}return n}block(e,t){let n,o=this.raw(e,"between","beforeOpen");this.builder(t+o+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let o=0;o<e.nodes.length;o++){let r=e.nodes[o],s=this.raw(r,"before");s&&this.builder(s),this.stringify(r,t!==o||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),o=e.prop+n+this.rawValue(e,"value");e.important&&(o+=e.raws.important||" !important"),t&&(o+=";"),this.builder(o,e)}document(e){this.body(e)}raw(e,n,o){let r;if(o||(o=n),n&&(r=e.raws[n],void 0!==r))return r;let s=e.parent;if("before"===o){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return t[o];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[o])return i.rawCache[o];if("before"===o||"after"===o)return this.beforeAfter(e,o);{let t="raw"+((l=o)[0].toUpperCase()+l.slice(1));this[t]?r=this[t](i,e):i.walk((e=>{if(r=e.raws[n],void 0!==r)return!1}))}var l;return void 0===r&&(r=t[o]),i.rawCache[o]=r,r}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((n=>{let o=n.parent;if(o&&o!==e&&o.parent&&o.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let n=e[t],o=e.raws[t];return o&&o.value===n?o.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}e.exports=n,n.default=n},633:(e,t,n)=>{"use strict";let o=n(346);function r(e,t){new o(t).stringify(e)}e.exports=r,r.default=r},1381:e=>{"use strict";e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},2327:e=>{"use strict";const t="'".charCodeAt(0),n='"'.charCodeAt(0),o="\\".charCodeAt(0),r="/".charCodeAt(0),s="\n".charCodeAt(0),i=" ".charCodeAt(0),l="\f".charCodeAt(0),a="\t".charCodeAt(0),c="\r".charCodeAt(0),u="[".charCodeAt(0),d="]".charCodeAt(0),p="(".charCodeAt(0),h=")".charCodeAt(0),g="{".charCodeAt(0),m="}".charCodeAt(0),f=";".charCodeAt(0),b="*".charCodeAt(0),v=":".charCodeAt(0),k="@".charCodeAt(0),_=/[\t\n\f\r "#'()/;[\\\]{}]/g,x=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,y=/.[\r\n"'(/\\]/,S=/[\da-f]/i;e.exports=function(e,w={}){let C,B,I,j,E,T,M,P,R,N,A=e.css.valueOf(),L=w.ignoreErrors,O=A.length,D=0,z=[],V=[];function F(t){throw e.error("Unclosed "+t,D)}return{back:function(e){V.push(e)},endOfFile:function(){return 0===V.length&&D>=O},nextToken:function(e){if(V.length)return V.pop();if(D>=O)return;let w=!!e&&e.ignoreUnclosed;switch(C=A.charCodeAt(D),C){case s:case i:case a:case c:case l:B=D;do{B+=1,C=A.charCodeAt(B)}while(C===i||C===s||C===a||C===c||C===l);N=["space",A.slice(D,B)],D=B-1;break;case u:case d:case g:case m:case v:case f:case h:{let e=String.fromCharCode(C);N=[e,e,D];break}case p:if(P=z.length?z.pop()[1]:"",R=A.charCodeAt(D+1),"url"===P&&R!==t&&R!==n&&R!==i&&R!==s&&R!==a&&R!==l&&R!==c){B=D;do{if(T=!1,B=A.indexOf(")",B+1),-1===B){if(L||w){B=D;break}F("bracket")}for(M=B;A.charCodeAt(M-1)===o;)M-=1,T=!T}while(T);N=["brackets",A.slice(D,B+1),D,B],D=B}else B=A.indexOf(")",D+1),j=A.slice(D,B+1),-1===B||y.test(j)?N=["(","(",D]:(N=["brackets",j,D,B],D=B);break;case t:case n:I=C===t?"'":'"',B=D;do{if(T=!1,B=A.indexOf(I,B+1),-1===B){if(L||w){B=D+1;break}F("string")}for(M=B;A.charCodeAt(M-1)===o;)M-=1,T=!T}while(T);N=["string",A.slice(D,B+1),D,B],D=B;break;case k:_.lastIndex=D+1,_.test(A),B=0===_.lastIndex?A.length-1:_.lastIndex-2,N=["at-word",A.slice(D,B+1),D,B],D=B;break;case o:for(B=D,E=!0;A.charCodeAt(B+1)===o;)B+=1,E=!E;if(C=A.charCodeAt(B+1),E&&C!==r&&C!==i&&C!==s&&C!==a&&C!==c&&C!==l&&(B+=1,S.test(A.charAt(B)))){for(;S.test(A.charAt(B+1));)B+=1;A.charCodeAt(B+1)===i&&(B+=1)}N=["word",A.slice(D,B+1),D,B],D=B;break;default:C===r&&A.charCodeAt(D+1)===b?(B=A.indexOf("*/",D+2)+1,0===B&&(L||w?B=A.length:F("comment")),N=["comment",A.slice(D,B+1),D,B],D=B):(x.lastIndex=D+1,x.test(A),B=0===x.lastIndex?A.length-1:x.lastIndex-2,N=["word",A.slice(D,B+1),D,B],z.push(N),D=B)}return D++,N},position:function(){return D}}}},3122:e=>{"use strict";let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},5776:e=>{"use strict";class t{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}e.exports=t,t.default=t},628:(e,t,n)=>{"use strict";var o=n(4067);function r(){}function s(){}s.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,s,i){if(i!==o){var l=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 l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint: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:s,resetWarningCache:r};return n.PropTypes=n,n}},5826:(e,t,n)=>{e.exports=n(628)()},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4462:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var l=n(1609),a=n(5826),c=n(4306),u=n(461),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return l.createElement("textarea",s({},a,{onChange:this.onChange,style:u?s({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(l.Component);t.TextareaAutosize=l.forwardRef((function(e,t){return l.createElement(p,s({},e,{innerRef:t}))}))},4132:(e,t,n)=>{"use strict";var o=n(4462);t.A=o.TextareaAutosize},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"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"),r=new RegExp(n,"");function s(e){return t[e]}var i=function(e){return e.replace(o,s)};e.exports=i,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=i},1609:e=>{"use strict";e.exports=window.React},9746:()=>{},9977:()=>{},197:()=>{},1866:()=>{},2739:()=>{},5042:e=>{e.exports={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let o="",r=n;for(;r--;)o+=e[Math.random()*e.length|0];return o}}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var s=t[o]={exports:{}};return e[o].call(s.exports,s,s.exports,n),s.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:()=>Ih,AlignmentToolbar:()=>jh,Autocomplete:()=>zb,BlockAlignmentControl:()=>Pl,BlockAlignmentToolbar:()=>Rl,BlockBreadcrumb:()=>Wb,BlockCanvas:()=>XI,BlockColorsStyleSelector:()=>tj,BlockContextProvider:()=>qb,BlockControls:()=>Fs,BlockEdit:()=>rv,BlockEditorKeyboardShortcuts:()=>by,BlockEditorProvider:()=>ky,BlockFormatControls:()=>Vs,BlockIcon:()=>Tf,BlockInspector:()=>YM,BlockList:()=>FC,BlockMover:()=>cB,BlockNavigationDropdown:()=>Oj,BlockPopover:()=>ol,BlockPreview:()=>cS,BlockSelectionClearer:()=>xy,BlockSettingsMenu:()=>gI,BlockSettingsMenuControls:()=>Bf,BlockStyles:()=>Vj,BlockTitle:()=>$b,BlockToolbar:()=>AI,BlockTools:()=>HI,BlockVerticalAlignmentControl:()=>Ii,BlockVerticalAlignmentToolbar:()=>ji,ButtonBlockAppender:()=>eC,ButtonBlockerAppender:()=>Jw,ColorPalette:()=>pE,ColorPaletteControl:()=>hE,ContrastChecker:()=>tp,CopyHandler:()=>QM,DefaultBlockAppender:()=>Xw,FontSizePicker:()=>ob,HeadingLevelDropdown:()=>$j,HeightControl:()=>ng,InnerBlocks:()=>PC,Inserter:()=>qw,InspectorAdvancedControls:()=>ra,InspectorControls:()=>sa,JustifyContentControl:()=>Mi,JustifyToolbar:()=>Pi,LineHeightControl:()=>Sp,MediaPlaceholder:()=>fT,MediaReplaceFlow:()=>wc,MediaUpload:()=>ha,MediaUploadCheck:()=>ga,MultiSelectScrollIntoView:()=>nP,NavigableToolbar:()=>II,ObserveTyping:()=>LC,PanelColorSettings:()=>bT,PlainText:()=>YT,RecursionProvider:()=>cP,ReusableBlocksRenameHint:()=>bP,RichText:()=>KT,RichTextShortcut:()=>JT,RichTextToolbarButton:()=>eM,SETTINGS_DEFAULTS:()=>I,SkipToSelectedBlock:()=>bM,ToolSelector:()=>oM,Typewriter:()=>lP,URLInput:()=>Ca,URLInputButton:()=>lM,URLPopover:()=>pT,Warning:()=>tv,WritingFlow:()=>Vy,__experimentalBlockAlignmentMatrixControl:()=>Gb,__experimentalBlockFullHeightAligmentControl:()=>Fb,__experimentalBlockPatternSetup:()=>iE,__experimentalBlockPatternsList:()=>GS,__experimentalBlockVariationPicker:()=>Kj,__experimentalBlockVariationTransforms:()=>uE,__experimentalBorderRadiusControl:()=>Ku,__experimentalColorGradientControl:()=>zd,__experimentalColorGradientSettingsDropdown:()=>xE,__experimentalDateFormatPicker:()=>fE,__experimentalDuotoneControl:()=>$g,__experimentalFontAppearanceControl:()=>xp,__experimentalFontFamilyControl:()=>bp,__experimentalGetBorderClassesAndStyles:()=>zf,__experimentalGetColorClassesAndStyles:()=>Hf,__experimentalGetElementClassName:()=>kP,__experimentalGetGapCSSValue:()=>vi,__experimentalGetGradientClass:()=>Ed,__experimentalGetGradientObjectByGradientValue:()=>Md,__experimentalGetShadowClassesAndStyles:()=>Ff,__experimentalGetSpacingClassesAndStyles:()=>Uf,__experimentalImageEditor:()=>sT,__experimentalImageSizeControl:()=>aT,__experimentalImageURLInputUI:()=>gM,__experimentalInspectorPopoverHeader:()=>hP,__experimentalLetterSpacingControl:()=>wp,__experimentalLibrary:()=>tP,__experimentalLinkControl:()=>xc,__experimentalLinkControlSearchInput:()=>nc,__experimentalLinkControlSearchItem:()=>Fa,__experimentalLinkControlSearchResults:()=>Za,__experimentalListView:()=>Aj,__experimentalPanelColorGradientSettings:()=>CE,__experimentalPreviewOptions:()=>mM,__experimentalPublishDateTimePicker:()=>mP,__experimentalRecursionProvider:()=>dP,__experimentalResponsiveBlockControl:()=>QT,__experimentalSpacingSizesControl:()=>eg,__experimentalTextDecorationControl:()=>Hp,__experimentalTextTransformControl:()=>Dp,__experimentalUnitControl:()=>rM,__experimentalUseBlockOverlayActive:()=>Kb,__experimentalUseBlockPreview:()=>uS,__experimentalUseBorderProps:()=>Vf,__experimentalUseColorProps:()=>Gf,__experimentalUseCustomSides:()=>Pg,__experimentalUseGradient:()=>Rd,__experimentalUseHasRecursion:()=>pP,__experimentalUseMultipleOriginColorsAndGradients:()=>Ru,__experimentalUseResizeCanvas:()=>fM,__experimentalWritingModeControl:()=>Wp,__unstableBlockNameContext:()=>SI,__unstableBlockSettingsMenuFirstItem:()=>aI,__unstableBlockToolbarLastItem:()=>UB,__unstableEditorStyles:()=>nS,__unstableIframe:()=>$y,__unstableInserterMenuExtension:()=>Rw,__unstableRichTextInputEvent:()=>tM,__unstableUseBlockSelectionClearer:()=>_y,__unstableUseClipboardHandler:()=>XM,__unstableUseMouseMoveTypingReset:()=>NC,__unstableUseTypewriter:()=>iP,__unstableUseTypingObserver:()=>AC,createCustomColorsHOC:()=>tb,getColorClassName:()=>Pu,getColorObjectByAttributeValues:()=>Tu,getColorObjectByColorValue:()=>Mu,getComputedFluidTypographyValue:()=>ts,getCustomValueFromPreset:()=>hi,getFontSize:()=>bh,getFontSizeClass:()=>kh,getFontSizeObjectByValue:()=>vh,getGradientSlugByValue:()=>Pd,getGradientValueBySlug:()=>Td,getPxFromCssUnit:()=>_P,getSpacingPresetCssVar:()=>mi,getTypographyClassesAndStyles:()=>Wf,isValueSpacingPreset:()=>pi,privateApis:()=>bN,store:()=>$r,storeConfig:()=>Ur,transformStyles:()=>eS,useBlockCommands:()=>qI,useBlockDisplayInformation:()=>dm,useBlockEditContext:()=>_,useBlockEditingMode:()=>Nl,useBlockProps:()=>ty,useCachedTruthy:()=>Kf,useHasRecursion:()=>uP,useInnerBlocksProps:()=>MC,useSetting:()=>Zr,useSettings:()=>Kr,useZoomOut:()=>Zf,withColorContext:()=>dE,withColors:()=>nb,withFontSizes:()=>ib});var e={};n.r(e),n.d(e,{getAllPatterns:()=>Le,getBlockRemovalRules:()=>je,getBlockSettings:()=>_e,getBlockWithoutAttributes:()=>Se,getContentLockingParent:()=>Ge,getEnabledBlockParents:()=>Be,getEnabledClientIdsTree:()=>Ce,getExpandedBlock:()=>He,getInserterMediaCategories:()=>Pe,getLastFocus:()=>Ve,getLastInsertedBlocksClientIds:()=>ye,getOpenedBlockSettingsMenu:()=>Ee,getPatternBySlug:()=>Ae,getRegisteredInserterMediaCategories:()=>Me,getRemovalPromptData:()=>Ie,getReusableBlocks:()=>ze,getStyleOverrides:()=>Te,getTemporarilyEditingAsBlocks:()=>Ue,getTemporarilyEditingFocusModeToRevert:()=>$e,hasAllowedPatterns:()=>Re,isBlockInterfaceHidden:()=>xe,isBlockSubtreeDisabled:()=>we,isDragging:()=>Fe,isResolvingPatterns:()=>Oe});var t={};n.r(t),n.d(t,{__experimentalGetActiveBlockIdByBlockNames:()=>Yn,__experimentalGetAllowedBlocks:()=>jn,__experimentalGetAllowedPatterns:()=>Rn,__experimentalGetBlockListSettingsForBlocks:()=>Vn,__experimentalGetDirectInsertBlock:()=>Tn,__experimentalGetGlobalBlocksByName:()=>lt,__experimentalGetLastBlockAttributeChanges:()=>Gn,__experimentalGetParsedPattern:()=>Mn,__experimentalGetPatternTransformItems:()=>Ln,__experimentalGetPatternsByBlockTypes:()=>An,__experimentalGetReusableBlockTitle:()=>Fn,__unstableGetBlockWithoutInnerBlocks:()=>Je,__unstableGetClientIdWithClientIdsTree:()=>tt,__unstableGetClientIdsTree:()=>nt,__unstableGetContentLockingParent:()=>so,__unstableGetEditorMode:()=>$n,__unstableGetSelectedBlocksWithPartialSelection:()=>Ht,__unstableGetTemporarilyEditingAsBlocks:()=>io,__unstableGetTemporarilyEditingFocusModeToRevert:()=>lo,__unstableGetVisibleBlocks:()=>Jn,__unstableHasActiveBlockOverlayActive:()=>eo,__unstableIsFullySelected:()=>Dt,__unstableIsLastBlockChangeIgnored:()=>Hn,__unstableIsSelectionCollapsed:()=>zt,__unstableIsSelectionMergeable:()=>Ft,__unstableIsWithinBlockOverlay:()=>to,__unstableSelectionHasUnmergeableBlock:()=>Vt,areInnerBlocksControlled:()=>qn,canEditBlock:()=>vn,canInsertBlockType:()=>pn,canInsertBlocks:()=>hn,canLockBlockType:()=>kn,canMoveBlock:()=>fn,canMoveBlocks:()=>bn,canRemoveBlock:()=>gn,canRemoveBlocks:()=>mn,didAutomaticChange:()=>Kn,getAdjacentBlockClientId:()=>wt,getAllowedBlocks:()=>In,getBlock:()=>Qe,getBlockAttributes:()=>Xe,getBlockCount:()=>ut,getBlockEditingMode:()=>no,getBlockHierarchyRootClientId:()=>yt,getBlockIndex:()=>Ut,getBlockInsertionPoint:()=>sn,getBlockListSettings:()=>On,getBlockMode:()=>Qt,getBlockName:()=>qe,getBlockNamesByClientId:()=>ct,getBlockOrder:()=>Gt,getBlockParents:()=>_t,getBlockParentsByBlockName:()=>xt,getBlockRootClientId:()=>kt,getBlockSelectionEnd:()=>gt,getBlockSelectionStart:()=>ht,getBlockTransformItems:()=>Cn,getBlocks:()=>et,getBlocksByClientId:()=>at,getBlocksByName:()=>it,getClientIdsOfDescendants:()=>ot,getClientIdsWithDescendants:()=>rt,getDirectInsertBlock:()=>En,getDraggedBlockClientIds:()=>tn,getFirstMultiSelectedBlockClientId:()=>Mt,getGlobalBlockCount:()=>st,getInserterItems:()=>wn,getLastMultiSelectedBlockClientId:()=>Pt,getLowestCommonAncestorWithSelectedBlock:()=>St,getMultiSelectedBlockClientIds:()=>Et,getMultiSelectedBlocks:()=>Tt,getMultiSelectedBlocksEndClientId:()=>Ot,getMultiSelectedBlocksStartClientId:()=>Lt,getNextBlockClientId:()=>Bt,getPatternsByBlockTypes:()=>Nn,getPreviousBlockClientId:()=>Ct,getSelectedBlock:()=>vt,getSelectedBlockClientId:()=>bt,getSelectedBlockClientIds:()=>jt,getSelectedBlockCount:()=>mt,getSelectedBlocksInitialCaretPosition:()=>It,getSelectionEnd:()=>pt,getSelectionStart:()=>dt,getSettings:()=>Dn,getTemplate:()=>cn,getTemplateLock:()=>un,hasBlockMovingClientId:()=>Wn,hasDraggedInnerBlock:()=>Kt,hasInserterItems:()=>Bn,hasMultiSelection:()=>qt,hasSelectedBlock:()=>ft,hasSelectedInnerBlock:()=>Wt,isAncestorBeingDragged:()=>on,isAncestorMultiSelected:()=>At,isBlockBeingDragged:()=>nn,isBlockHighlighted:()=>Zn,isBlockInsertionPointVisible:()=>ln,isBlockMultiSelected:()=>Nt,isBlockSelected:()=>$t,isBlockValid:()=>Ye,isBlockVisible:()=>Qn,isBlockWithinSelection:()=>Zt,isCaretWithinFormattedText:()=>rn,isDraggingBlocks:()=>en,isFirstMultiSelectedBlock:()=>Rt,isGroupable:()=>ro,isLastBlockChangePersistent:()=>zn,isMultiSelecting:()=>Yt,isNavigationMode:()=>Un,isSelectionEnabled:()=>Xt,isTyping:()=>Jt,isUngroupable:()=>oo,isValidTemplate:()=>an,wasBlockJustInserted:()=>Xn});var r={};n.r(r),n.d(r,{__experimentalUpdateSettings:()=>uo,clearBlockRemovalPrompt:()=>bo,deleteStyleOverride:()=>xo,ensureDefaultBlock:()=>mo,expandBlock:()=>Io,hideBlockInterface:()=>po,modifyContentLockBlock:()=>jo,privateRemoveBlocks:()=>go,setBlockRemovalRules:()=>vo,setLastFocus:()=>So,setOpenedBlockSettingsMenu:()=>ko,setStyleOverride:()=>_o,showBlockInterface:()=>ho,startDragging:()=>Co,stopDragging:()=>Bo,stopEditingAsBlocks:()=>wo,syncDerivedUpdates:()=>yo});var s={};n.r(s),n.d(s,{__unstableDeleteSelection:()=>ar,__unstableExpandSelection:()=>ur,__unstableMarkAutomaticChange:()=>Er,__unstableMarkLastChangeAsPersistent:()=>Ir,__unstableMarkNextChangeAsNotPersistent:()=>jr,__unstableSaveReusableBlock:()=>Br,__unstableSetEditorMode:()=>Mr,__unstableSetTemporarilyEditingAsBlocks:()=>Vr,__unstableSplitSelection:()=>cr,clearSelectedBlock:()=>Ko,duplicateBlocks:()=>Rr,enterFormattedText:()=>_r,exitFormattedText:()=>xr,flashBlock:()=>Or,hideInsertionPoint:()=>sr,insertAfterBlock:()=>Ar,insertBeforeBlock:()=>Nr,insertBlock:()=>nr,insertBlocks:()=>or,insertDefaultBlock:()=>Sr,mergeBlocks:()=>dr,moveBlockToPosition:()=>tr,moveBlocksDown:()=>Qo,moveBlocksToPosition:()=>er,moveBlocksUp:()=>Jo,multiSelect:()=>Wo,receiveBlocks:()=>Do,registerInserterMediaCategory:()=>Fr,removeBlock:()=>hr,removeBlocks:()=>pr,replaceBlock:()=>Yo,replaceBlocks:()=>qo,replaceInnerBlocks:()=>gr,resetBlocks:()=>Ao,resetSelection:()=>Oo,selectBlock:()=>Fo,selectNextBlock:()=>Go,selectPreviousBlock:()=>Ho,selectionChange:()=>yr,setBlockEditingMode:()=>Hr,setBlockMovingClientId:()=>Pr,setBlockVisibility:()=>zr,setHasControlledInnerBlocks:()=>Dr,setNavigationMode:()=>Tr,setTemplateValidity:()=>ir,showInsertionPoint:()=>rr,startDraggingBlocks:()=>vr,startMultiSelect:()=>Uo,startTyping:()=>fr,stopDraggingBlocks:()=>kr,stopMultiSelect:()=>$o,stopTyping:()=>br,synchronizeTemplate:()=>lr,toggleBlockHighlight:()=>Lr,toggleBlockMode:()=>mr,toggleSelection:()=>Zo,unsetBlockEditingMode:()=>Gr,updateBlock:()=>Vo,updateBlockAttributes:()=>zo,updateBlockListSettings:()=>wr,updateSettings:()=>Cr,validateBlocksToTemplate:()=>Lo});var i={};n.r(i),n.d(i,{AdvancedPanel:()=>SP,BackgroundPanel:()=>Lc,BorderPanel:()=>gd,ColorPanel:()=>ep,DimensionsPanel:()=>xg,FiltersPanel:()=>rm,GlobalStylesContext:()=>ms,ImageSettingsPanel:()=>yP,TypographyPanel:()=>ah,areGlobalStyleConfigsEqual:()=>gs,getBlockCSSSelector:()=>qg,getBlockSelectors:()=>zm,getGlobalStylesChanges:()=>MP,getLayoutStyles:()=>Mm,toStyles:()=>Om,useGlobalSetting:()=>ks,useGlobalStyle:()=>_s,useGlobalStyleLinks:()=>xs,useGlobalStylesOutput:()=>Hm,useGlobalStylesOutputWithConfig:()=>Fm,useGlobalStylesReset:()=>vs,useHasBackgroundPanel:()=>jc,useHasBorderPanel:()=>sd,useHasBorderPanelControls:()=>id,useHasColorPanel:()=>Vd,useHasDimensionsPanel:()=>ag,useHasFiltersPanel:()=>Qg,useHasImageSettingsPanel:()=>xP,useHasTypographyPanel:()=>qp,useSettingsForBlockElement:()=>ys});const l=window.wp.blocks,a=window.wp.element,c=window.wp.data,u=window.wp.compose,d=window.wp.hooks,p=Symbol("mayDisplayControls"),h=Symbol("mayDisplayParentControls"),g=Symbol("blockEditingMode"),m=Symbol("blockBindings"),f=Symbol("isPreviewMode"),b={name:"",isSelected:!1},v=(0,a.createContext)(b),{Provider:k}=v;function _(){return(0,a.useContext)(v)}const x=window.wp.deprecated;var y=n.n(x),S=n(7734),w=n.n(S);const C=window.wp.i18n,B={insertUsage:{}},I={alignWide:!1,supportsLayout:!0,colors:[{name:(0,C.__)("Black"),slug:"black",color:"#000000"},{name:(0,C.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,C.__)("White"),slug:"white",color:"#ffffff"},{name:(0,C.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,C.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,C.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,C.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,C.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,C.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,C.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,C.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,C.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,C._x)("Small","font size name"),size:13,slug:"small"},{name:(0,C._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,C._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,C._x)("Large","font size name"),size:36,slug:"large"},{name:(0,C._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,C.__)("Thumbnail")},{slug:"medium",name:(0,C.__)("Medium")},{slug:"large",name:(0,C.__)("Large")},{slug:"full",name:(0,C.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,__unstableIsPreviewMode:!1,blockInspectorAnimation:{animationParent:"core/navigation","core/navigation":{enterDirection:"leftToRight"},"core/navigation-submenu":{enterDirection:"rightToLeft"},"core/navigation-link":{enterDirection:"rightToLeft"},"core/search":{enterDirection:"rightToLeft"},"core/social-links":{enterDirection:"rightToLeft"},"core/page-list":{enterDirection:"rightToLeft"},"core/spacer":{enterDirection:"rightToLeft"},"core/home-link":{enterDirection:"rightToLeft"},"core/site-title":{enterDirection:"rightToLeft"},"core/site-logo":{enterDirection:"rightToLeft"}},generateAnchors:!1,gradients:[{name:(0,C.__)("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,C.__)("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,C.__)("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,C.__)("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,C.__)("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,C.__)("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,C.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,C.__)("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,C.__)("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,C.__)("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,C.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,C.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function j(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function E(e,t,n,o=1){const r=[...e];return r.splice(t,o),j(r,e.slice(t,t+o),n)}const T=e=>e;function M(e,t=""){const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:r}=e;o.push(t),M(r,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function P(e,t=""){const n=[],o=[[t,e]];for(;o.length;){const[e,t]=o.shift();t.forEach((({innerBlocks:t,...r})=>{n.push([r.clientId,e]),t?.length&&o.push([r.clientId,t])}))}return n}function R(e,t=T){const n=[],o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n.push([r.clientId,t(r)])}return n}function N(e){return R(e,(e=>{const{attributes:t,...n}=e;return n}))}function A(e){return R(e,(e=>e.attributes))}function L(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&w()(e.clientIds,t.clientIds)&&function(e,t){return w()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function O(e,t){const n=e.tree,o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n.set(e.clientId,{});for(const t of r)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function D(e,t,n=!1){const o=e.tree,r=new Set([]),s=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){s.add(t);break}r.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of r)o.set(e,{...o.get(e)});for(const t of r)o.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>o.get(e)));for(const t of s)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const z=(0,u.pipe)(c.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=new Map(t.attributes),t.attributes.forEach(((n,r)=>{const{name:s}=t.byClientId.get(r);"core/block"===s&&n.ref===e&&t.attributes.set(r,{...n,ref:o})}))}return e(t,n)}),(e=>(t={},n)=>{const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":o.tree=new Map(o.tree),O(o,n.blocks),D(o,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":o.tree=new Map(o.tree),o.tree.set(n.clientId,{...o.tree.get(n.clientId),...o.byClientId.get(n.clientId),attributes:o.attributes.get(n.clientId)}),D(o,[n.clientId],!1);break;case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":o.tree=new Map(o.tree),n.clientIds.forEach((e=>{o.tree.set(e,{...o.tree.get(e),attributes:o.attributes.get(e)})})),D(o,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=function(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...o}=n.shift();n.push(...e),t[o.clientId]=!0}return t}(n.blocks);o.tree=new Map(o.tree),n.replacedClientIds.forEach((t=>{o.tree.delete(t),e[t]||o.tree.delete("controlled||"+t)})),O(o,n.blocks),D(o,n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds){const n=t.parents.get(e);void 0===n||""!==n&&!o.byClientId.get(n)||r.push(n)}D(o,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds){const n=t.parents.get(r);void 0===n||""!==n&&!o.byClientId.get(n)||e.push(n)}o.tree=new Map(o.tree),n.removedClientIds.forEach((e=>{o.tree.delete(e),o.tree.delete("controlled||"+e)})),D(o,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=new Map(o.tree),D(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),D(o,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];o.attributes.forEach(((t,r)=>{"core/block"===o.byClientId.get(r).name&&t.ref===n.updatedId&&e.push(r)})),o.tree=new Map(o.tree),e.forEach((e=>{o.tree.set(e,{...o.byClientId.get(e),attributes:o.attributes.get(e),innerBlocks:o.tree.get(e).innerBlocks})})),D(o,e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order.get(o[r])||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order.get(o[r])));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order.get(n.rootClientId)&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order.get(n.rootClientId)}));let s=r;if(n.blocks.length){s=e(s,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(s.order);Object.keys(o).forEach((e=>{t.order.get(e)&&r.set(e,t.order.get(e))})),s.order=r,s.tree=new Map(s.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&s.tree.set(n,t.tree.get(n))}))}return s}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(N(n.blocks)),attributes:new Map(A(n.blocks)),order:M(n.blocks),parents:new Map(P(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(t?.tree),O(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.clientId)))}),e}return e(t,n)}),(function(e){let t,n,o=!1;return(r,s)=>{let i,l=e(r,s);var a;"SET_EXPLICIT_PERSISTENT"===s.type&&(n=s.isPersistentChange,i=null===(a=r.isPersistentChange)||void 0===a||a);if(void 0!==n)return i=n,i===l.isPersistentChange?l:{...l,isPersistentChange:i};const c="MARK_LAST_CHANGE_AS_PERSISTENT"===s.type||o;var u;return r!==l||c?(l={...l,isPersistentChange:c?!o:!L(s,t)},t=s,o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===s.type,l):(o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===s.type,i=null===(u=r?.isPersistentChange)||void 0===u||u,r.isPersistentChange===i?r:{...l,isPersistentChange:i})}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return N(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...o}=t.updates;if(0===Object.values(o).length)return e;const r=new Map(e);return r.set(t.clientId,{...e.get(t.clientId),...o}),r}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),N(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return A(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let o=!1;const r=new Map(e);for(const s of t.clientIds){var n;const i=Object.entries(t.uniqueByBlock?t.attributes[s]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===i.length)continue;let l=!1;const a=e.get(s),c={};i.forEach((([e,t])=>{a[e]!==t&&(l=!0,c[e]=t)})),o=o||l,l&&r.set(s,{...a,...c})}return o?r:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),A(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{var n;const o=M(t.blocks),r=new Map(e);return o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(o[""])),r}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],r=M(t.blocks,n),{index:s=o.length}=t,i=new Map(e);return r.forEach(((e,t)=>{i.set(t,e)})),i.set(n,j(o,r.get(n),s)),i}case"MOVE_BLOCKS_TO_POSITION":{var o;const{fromRootClientId:n="",toRootClientId:r="",clientIds:s}=t,{index:i=e.get(r).length}=t;if(n===r){const t=e.get(r).indexOf(s[0]),n=new Map(e);return n.set(r,E(e.get(r),t,i,s.length)),n}const l=new Map(e);return l.set(n,null!==(o=e.get(n)?.filter((e=>!s.includes(e))))&&void 0!==o?o:[]),l.set(r,j(e.get(r),s,i)),l}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],s=e.get(o);if(!s.length||r===s[0])return e;const i=s.indexOf(r),l=new Map(e);return l.set(o,E(s,i,i-1,n.length)),l}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],s=n[n.length-1],i=e.get(o);if(!i.length||s===i[i.length-1])return e;const l=i.indexOf(r),a=new Map(e);return a.set(o,E(i,l,l+1,n.length)),a}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=M(t.blocks),r=new Map(e);return t.replacedClientIds.forEach((e=>{r.delete(e)})),o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.forEach(((e,t)=>{const s=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);r.set(t,s)})),r}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,o)=>{var r;const s=null!==(r=e?.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==r?r:[];s.length!==e.length&&n.set(o,s)})),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return P(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return P(t.blocks,t.rootClientId||"").forEach((([e,t])=>{n.set(e,t)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),P(t.blocks,e.get(t.clientIds[0])).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks:(e={},{type:t,clientId:n,hasControlledInnerBlocks:o})=>"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e});function V(e={},t){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 F=(0,c.combineReducers)({blocks:z,isDragging:function(e=!1,t){switch(t.type){case"START_DRAGGING":return!0;case"STOP_DRAGGING":return!1}return e},isTyping:function(e=!1,t){switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(e=!1,t){switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(e=[],t){switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(e={},t){switch(t.type){case"SELECTION_CHANGE":return t.clientId?{selectionStart:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.startOffset},selectionEnd:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.endOffset}}:{selectionStart:t.start||e.selectionStart,selectionEnd:t.end||e.selectionEnd};case"RESET_SELECTION":const{selectionStart:n,selectionEnd:o}=t;return{selectionStart:n,selectionEnd:o};case"MULTI_SELECT":const{start:r,end:s}=t;return r===e.selectionStart?.clientId&&s===e.selectionEnd?.clientId?e:{selectionStart:{clientId:r},selectionEnd:{clientId:s}};case"RESET_BLOCKS":const i=e?.selectionStart?.clientId,l=e?.selectionEnd?.clientId;if(!i&&!l)return e;if(!t.blocks.some((e=>e.clientId===i)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===l)))return{...e,selectionEnd:e.selectionStart}}const n=V(e.selectionStart,t),o=V(e.selectionEnd,t);return n===e.selectionStart&&o===e.selectionEnd?e:{selectionStart:n,selectionEnd:o}},isMultiSelecting:function(e=!1,t){switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(e=!0,t){return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(e=null,t){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(e={},t){if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:(e={},t)=>{switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.clientIds.includes(e))));case"UPDATE_BLOCK_LIST_SETTINGS":{const n="string"==typeof t.clientId?{[t.clientId]:t.settings}:t.clientId;for(const t in n)n[t]?w()(e[t],n[t])&&delete n[t]:e[t]||delete n[t];if(0===Object.keys(n).length)return e;const o={...e,...n};for(const e in n)n[e]||delete o[e];return o}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:o,__unstableWithInserter:r,operation:s,nearestSide:i}=t,l={rootClientId:n,index:o,__unstableWithInserter:r,operation:s,nearestSide:i};return w()(e,l)?e:l}case"HIDE_INSERTION_POINT":return null}return e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(e=I,t){return"UPDATE_SETTINGS"===t.type?t.reset?{...I,...t.settings}:{...e,...t.settings}:e},preferences:function(e=B,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":{const n=t.blocks.reduce(((e,n)=>{const{attributes:o,name:r}=n;let s=r;const i=(0,c.select)(l.store).getActiveBlockVariation(r,o);return i?.name&&(s+="/"+i.name),"core/block"===r&&(s+="/"+o.ref),{...e,[s]:{time:t.time,count:e[s]?e[s].count+1:1}}}),e.insertUsage);return{...e,insertUsage:n}}}return e},lastBlockAttributesChange:function(e=null,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 e},lastFocus:function(e=!1,t){return"LAST_FOCUS"===t.type?t.lastFocus:e},editorMode:function(e="edit",t){return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(e=null,t){return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},expandedBlock:function(e=null,t){switch(t.type){case"SET_BLOCK_EXPANDED_IN_LIST_VIEW":return t.clientId;case"SELECT_BLOCK":if(t.clientId!==e)return null}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(e={},t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":if(!t.blocks.length)return e;const n=t.blocks.map((e=>e.clientId)),o=t.meta?.source;return{clientIds:n,source:o};case"RESET_BLOCKS":return{}}return e},temporarilyEditingAsBlocks:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},temporarilyEditingFocusModeRevert:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.focusModeToRevert:e},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},blockEditingModes:function(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{const n=new Map(e);return n.delete(t.clientId),n}case"RESET_BLOCKS":return e.has("")?(new Map).set("",e.get("")):e}return e},styleOverrides:function(e=new Map,t){switch(t.type){case"SET_STYLE_OVERRIDE":return new Map(e).set(t.id,t.style);case"DELETE_STYLE_OVERRIDE":{const n=new Map(e);return n.delete(t.id),n}}return e},removalPromptData:function(e=!1,t){switch(t.type){case"DISPLAY_BLOCK_REMOVAL_PROMPT":const{clientIds:e,selectPrevious:n,message:o}=t;return{clientIds:e,selectPrevious:n,message:o};case"CLEAR_BLOCK_REMOVAL_PROMPT":return!1}return e},blockRemovalRules:function(e=!1,t){return"SET_BLOCK_REMOVAL_RULES"===t.type?t.rules:e},openedBlockSettingsMenu:function(e=null,t){var n;return"SET_OPENED_BLOCK_SETTINGS_MENU"===t.type?null!==(n=t?.clientId)&&void 0!==n?n:null:e},registeredInserterMediaCategories:function(e=[],t){return"REGISTER_INSERTER_MEDIA_CATEGORY"===t.type?[...e,t.category]:e}});const H=function(e){return(t,n)=>{const o=e(t,n);return t?(o.automaticChangeStatus=t.automaticChangeStatus,"MARK_AUTOMATIC_CHANGE"===n.type?{...o,automaticChangeStatus:"pending"}:"MARK_AUTOMATIC_CHANGE_FINAL"===n.type&&"pending"===t.automaticChangeStatus?{...o,automaticChangeStatus:"final"}:o.blocks===t.blocks&&o.selection===t.selection||"final"!==o.automaticChangeStatus&&o.selection!==t.selection?o:{...o,automaticChangeStatus:void 0}):o}}(F),G=window.wp.primitives,U=window.ReactJSXRuntime,$=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.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"})}),W=window.wp.richText,K=Symbol("globalStylesDataKey"),Z=Symbol("selectBlockPatternsKey"),q=Symbol("reusableBlocksSelect"),Y=window.wp.privateApis,{lock:X,unlock:Q}=(0,Y.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/block-editor"),J="core/block-editor",ee=Symbol("withRootClientId"),te=new WeakMap;function ne(e){let t=te.get(e);return t||(t=function(e){const t=(0,l.parse)(e.content,{__unstableSkipMigrationLogs:!0});return 1===t.length&&(t[0].attributes={...t[0].attributes,metadata:{...t[0].attributes.metadata||{},categories:e.categories,patternName:e.name,name:t[0].attributes.metadata?.name||e.title}}),{...e,blocks:t}}(e),te.set(e,t),t)}const oe=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,re=(e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!oe(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach((e=>{n.push(e)}))}return!0},se=e=>t=>[t.settings.__experimentalBlockPatterns,t.settings.__experimentalUserPatternCategories,t.settings.__experimentalReusableBlocks,t.settings[Z]?.(e),t.blockPatterns,Q(e(J)).getReusableBlocks()];function ie(e,t){return[e.blockListSettings[t],e.blocks.byClientId.get(t),e.settings.allowedBlockTypes,e.settings.templateLock,e.blockEditingModes]}const le=(e,t,n)=>(o,r)=>{let s,i;if("function"==typeof e?(s=e(o),i=e(r)):(s=o[e],i=r[e]),s>i)return"asc"===n?1:-1;if(i>s)return"asc"===n?-1:1;const l=t.findIndex((e=>e===o)),a=t.findIndex((e=>e===r));return l>a?1:a>l?-1:0};function ae(e,t,n="asc"){return e.concat().sort(le(t,e,n))}const ce={user:"user",theme:"theme",directory:"directory"},ue={full:"fully",unsynced:"unsynced"},de={name:"allPatterns",label:(0,C._x)("All","patterns")},pe={name:"myPatterns",label:(0,C.__)("My patterns")};function he(e,t,n){const o=e.name.startsWith("core/block"),r="core"===e.source||e.source?.startsWith("pattern-directory");return!(t!==ce.theme||!o&&!r)||(!(t!==ce.directory||!o&&r)||(t===ce.user&&e.type!==ce.user||(n===ue.full&&""!==e.syncStatus||!(n!==ue.unsynced||"unsynced"===e.syncStatus||!o))))}function ge(e,t,n){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const o=t.pop();let r=e;for(const e of t){const t=r[e];r=r[e]=Array.isArray(t)?[...t]:{...t}}return r[o]=n,e}const me=(e,t,n)=>{var o;const r=Array.isArray(t)?t:t.split(".");let s=e;return r.forEach((e=>{s=s?.[e]})),null!==(o=s)&&void 0!==o?o:n};const fe=["color","border","dimensions","typography","spacing"],be={"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},ve={"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"},ke=e=>ve[e]||e;function _e(e,t,...n){const o=qe(e,t),r=[];if(t){let n=t;do{const t=qe(e,n);(0,l.hasBlockSupport)(t,"__experimentalSettings",!1)&&r.push(n)}while(n=e.blocks.parents.get(n))}return n.map((n=>{if(fe.includes(n))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let s=(0,d.applyFilters)("blockEditor.useSetting.before",void 0,n,t,o);if(void 0!==s)return s;const i=ke(n);for(const t of r){var a;const n=Xe(e,t);if(s=null!==(a=me(n.settings?.blocks?.[o],i))&&void 0!==a?a:me(n.settings,i),void 0!==s)break}const c=Dn(e);var u,p;if(void 0===s&&o&&(s=me(c.__experimentalFeatures?.blocks?.[o],i)),void 0===s&&(s=me(c.__experimentalFeatures,i)),void 0!==s)return l.__EXPERIMENTAL_PATHS_WITH_OVERRIDE[i]?null!==(u=null!==(p=s.custom)&&void 0!==p?p:s.theme)&&void 0!==u?u:s.default:s;const h=be[i]?.(c);return void 0!==h?h:"typography.dropCap"===i||void 0}))}function xe(e){return e.isBlockInterfaceHidden}function ye(e){return e?.lastBlockInserted?.clientIds}function Se(e,t){return e.blocks.byClientId.get(t)}const we=(e,t)=>{const n=t=>"disabled"===no(e,t)&&Gt(e,t).every(n);return Gt(e,t).every(n)};const Ce=(0,c.createSelector)((function e(t,n){const o=Gt(t,n),r=[];for(const n of o){const o=e(t,n);"disabled"!==no(t,n)?r.push({clientId:n,innerBlocks:o}):r.push(...o)}return r}),(e=>[e.blocks.order,e.blockEditingModes,e.settings.templateLock,e.blockListSettings])),Be=(0,c.createSelector)(((e,t,n=!1)=>_t(e,t,n).filter((t=>"disabled"!==no(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function Ie(e){return e.removalPromptData}function je(e){return e.blockRemovalRules}function Ee(e){return e.openedBlockSettingsMenu}const Te=(0,c.createSelector)((e=>{const t=rt(e).reduce(((e,t,n)=>(e[t]=n,e)),{});return[...e.styleOverrides].sort(((e,n)=>{var o,r;const[,{clientId:s}]=e,[,{clientId:i}]=n;return(null!==(o=t[s])&&void 0!==o?o:-1)-(null!==(r=t[i])&&void 0!==r?r:-1)}))}),(e=>[e.blocks.order,e.styleOverrides]));function Me(e){return e.registeredInserterMediaCategories}const Pe=(0,c.createSelector)((e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:o},registeredInserterMediaCategories:r}=e;if(!t&&!r.length||!n)return;const s=t?.map((({name:e})=>e))||[];return[...t||[],...(r||[]).filter((({name:e})=>!s.includes(e)))].filter((e=>!(!o&&"openverse"===e.name)&&Object.values(n).some((t=>t.startsWith(`${e.mediaType}/`)))))}),(e=>[e.settings.inserterMediaCategories,e.settings.allowedMimeTypes,e.settings.enableOpenverseMediaCategory,e.registeredInserterMediaCategories])),Re=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n=null)=>{const{getAllPatterns:o}=Q(e(J)),r=o(),{allowedBlockTypes:s}=Dn(t);return r.some((e=>{const{inserter:o=!0}=e;if(!o)return!1;const{blocks:r}=ne(e);return re(r,s)&&r.every((({name:e})=>pn(t,e,n)))}))}),((t,n)=>[...se(e)(t),...ie(t,n)]))));function Ne(e,t=[]){return{name:`core/block/${e.id}`,id:e.id,type:ce.user,title:e.title.raw,categories:e.wp_pattern_category.map((e=>{const n=t.find((({id:t})=>t===e));return n?n.slug:e})),content:e.content.raw,syncStatus:e.wp_pattern_sync_status}}const Ae=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n)=>{var o,r;if(n?.startsWith("core/block/")){const o=parseInt(n.slice(11),10),r=Q(e(J)).getReusableBlocks().find((({id:e})=>e===o));return r?Ne(r,t.settings.__experimentalUserPatternCategories):null}return[...null!==(o=t.settings.__experimentalBlockPatterns)&&void 0!==o?o:[],...null!==(r=t.settings[Z]?.(e))&&void 0!==r?r:[]].find((({name:e})=>e===n))}),((t,n)=>n?.startsWith("core/block/")?[Q(e(J)).getReusableBlocks(),t.settings.__experimentalReusableBlocks]:[t.settings.__experimentalBlockPatterns,t.settings[Z]?.(e)])))),Le=(0,c.createRegistrySelector)((e=>(0,c.createSelector)((t=>{var n,o;return[...Q(e(J)).getReusableBlocks().map((e=>Ne(e,t.settings.__experimentalUserPatternCategories))),...null!==(n=t.settings.__experimentalBlockPatterns)&&void 0!==n?n:[],...null!==(o=t.settings[Z]?.(e))&&void 0!==o?o:[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))}),se(e)))),Oe=(0,c.createRegistrySelector)((e=>(0,c.createSelector)((t=>{const n=t.settings[Z],o=t.settings[q];return!!n&&void 0===n(e)||!!o&&void 0===o(e)}),se(e)))),De=[],ze=(0,c.createRegistrySelector)((e=>t=>{var n;const o=t.settings[q];return o?o(e):null!==(n=t.settings.__experimentalReusableBlocks)&&void 0!==n?n:De}));function Ve(e){return e.lastFocus}function Fe(e){return e.isDragging}function He(e){return e.expandedBlock}const Ge=(0,c.createSelector)(((e,t)=>{let n,o=t;for(;o=e.blocks.parents.get(o);)"core/block"!==qe(e,o)&&"contentOnly"!==un(e,o)||(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function Ue(e){return e.temporarilyEditingAsBlocks}function $e(e){return e.temporarilyEditingFocusModeRevert}const We=[],Ke=new Set,Ze={};function qe(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==a.Platform.OS&&n?.name===o){const n=e.blocks.attributes.get(t),{service:r}=null!=n?n:{};return r?`${o}-${r}`:o}return n?n.name:null}function Ye(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function Xe(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function Qe(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const Je=(0,c.createSelector)(((e,t)=>{const n=e.blocks.byClientId.get(t);return n?{...n,attributes:Xe(e,t)}:null}),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function et(e,t){const n=t&&qn(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||We}const tt=(0,c.createSelector)(((e,t)=>(y()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:nt(e,t)})),(e=>[e.blocks.order])),nt=(0,c.createSelector)(((e,t="")=>(y()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),Gt(e,t).map((t=>tt(e,t))))),(e=>[e.blocks.order])),ot=(0,c.createSelector)(((e,t)=>{t=Array.isArray(t)?[...t]:[t];const n=[];for(const o of t){const t=e.blocks.order.get(o);t&&n.push(...t)}let o=0;for(;o<n.length;){const t=n[o],r=e.blocks.order.get(t);r&&n.splice(o+1,0,...r),o++}return n}),(e=>[e.blocks.order])),rt=e=>ot(e,""),st=(0,c.createSelector)(((e,t)=>{const n=rt(e);if(!t)return n.length;let o=0;for(const r of n){e.blocks.byClientId.get(r).name===t&&o++}return o}),(e=>[e.blocks.order,e.blocks.byClientId])),it=(0,c.createSelector)(((e,t)=>{if(!t)return We;const n=Array.isArray(t)?t:[t],o=rt(e).filter((t=>{const o=e.blocks.byClientId.get(t);return n.includes(o.name)}));return o.length>0?o:We}),(e=>[e.blocks.order,e.blocks.byClientId]));function lt(e,t){return y()("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",{since:"6.5",alternative:"wp.data.select( 'core/block-editor' ).getBlocksByName"}),it(e,t)}const at=(0,c.createSelector)(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>Qe(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),ct=(0,c.createSelector)(((e,t)=>at(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>at(e,t)));function ut(e,t){return Gt(e,t).length}function dt(e){return e.selection.selectionStart}function pt(e){return e.selection.selectionEnd}function ht(e){return e.selection.selectionStart.clientId}function gt(e){return e.selection.selectionEnd.clientId}function mt(e){const t=Et(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function ft(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function bt(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function vt(e){const t=bt(e);return t?Qe(e,t):null}function kt(e,t){var n;return null!==(n=e.blocks.parents.get(t))&&void 0!==n?n:null}const _t=(0,c.createSelector)(((e,t,n=!1)=>{const o=[];let r=t;for(;r=e.blocks.parents.get(r);)o.push(r);return o.length?n?o:o.reverse():We}),(e=>[e.blocks.parents])),xt=(0,c.createSelector)(((e,t,n,o=!1)=>{const r=_t(e,t,o),s=Array.isArray(n)?e=>n.includes(e):e=>n===e;return r.filter((t=>s(qe(e,t))))}),(e=>[e.blocks.parents]));function yt(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function St(e,t){const n=bt(e),o=[..._t(e,t),t],r=[..._t(e,n),n];let s;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)s=o[e];return s}function wt(e,t,n=1){if(void 0===t&&(t=bt(e)),void 0===t&&(t=n<0?Mt(e):Pt(e)),!t)return null;const o=kt(e,t);if(null===o)return null;const{order:r}=e.blocks,s=r.get(o),i=s.indexOf(t)+1*n;return i<0||i===s.length?null:s[i]}function Ct(e,t){return wt(e,t,-1)}function Bt(e,t){return wt(e,t,1)}function It(e){return e.initialPosition}const jt=(0,c.createSelector)((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return We;if(t.clientId===n.clientId)return[t.clientId];const o=kt(e,t.clientId);if(null===o)return We;const r=Gt(e,o),s=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return s>i?r.slice(i,s+1):r.slice(s,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Et(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?We:jt(e)}const Tt=(0,c.createSelector)((e=>{const t=Et(e);return t.length?t.map((t=>Qe(e,t))):We}),(e=>[...jt.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Mt(e){return Et(e)[0]||null}function Pt(e){const t=Et(e);return t[t.length-1]||null}function Rt(e,t){return Mt(e)===t}function Nt(e,t){return-1!==Et(e).indexOf(t)}const At=(0,c.createSelector)(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=kt(e,n),o=Nt(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Lt(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Ot(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Dt(e){const t=dt(e),n=pt(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function zt(e){const t=dt(e),n=pt(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Vt(e){return jt(e).some((t=>{const n=qe(e,t);return!(0,l.getBlockType)(n).merge}))}function Ft(e,t){const n=dt(e),o=pt(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=kt(e,n.clientId);if(r!==kt(e,o.clientId))return!1;const s=Gt(e,r);let i,a;s.indexOf(n.clientId)>s.indexOf(o.clientId)?(i=o,a=n):(i=n,a=o);const c=t?a.clientId:i.clientId,u=t?i.clientId:a.clientId,d=qe(e,c);if(!(0,l.getBlockType)(d).merge)return!1;const p=Qe(e,u);if(p.name===d)return!0;const h=(0,l.switchToBlockType)(p,d);return h&&h.length}const Ht=e=>{const t=dt(e),n=pt(e);if(t.clientId===n.clientId)return We;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return We;const o=kt(e,t.clientId);if(o!==kt(e,n.clientId))return We;const r=Gt(e,o),s=r.indexOf(t.clientId),i=r.indexOf(n.clientId),[l,a]=s>i?[n,t]:[t,n],c=Qe(e,l.clientId),u=Qe(e,a.clientId),d=c.attributes[l.attributeKey],p=u.attributes[a.attributeKey];let h=(0,W.create)({html:d}),g=(0,W.create)({html:p});return h=(0,W.remove)(h,0,l.offset),g=(0,W.remove)(g,a.offset,g.text.length),[{...c,attributes:{...c.attributes,[l.attributeKey]:(0,W.toHTMLString)({value:h})}},{...u,attributes:{...u.attributes,[a.attributeKey]:(0,W.toHTMLString)({value:g})}}]};function Gt(e,t){return e.blocks.order.get(t||"")||We}function Ut(e,t){return Gt(e,kt(e,t)).indexOf(t)}function $t(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Wt(e,t,n=!1){const o=jt(e);return!!o.length&&(n?o.some((n=>_t(e,n,!0).includes(t))):o.some((n=>kt(e,n)===t)))}function Kt(e,t,n=!1){return Gt(e,t).some((t=>nn(e,t)||n&&Kt(e,t,n)))}function Zt(e,t){if(!t)return!1;const n=Et(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function qt(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Yt(e){return e.isMultiSelecting}function Xt(e){return e.isSelectionEnabled}function Qt(e,t){return e.blocksMode[t]||"visual"}function Jt(e){return e.isTyping}function en(e){return!!e.draggedBlocks.length}function tn(e){return e.draggedBlocks}function nn(e,t){return e.draggedBlocks.includes(t)}function on(e,t){if(!en(e))return!1;return _t(e,t).some((t=>nn(e,t)))}function rn(){return y()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const sn=(0,c.createSelector)((e=>{let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:s}=r;return s?(t=kt(e,s)||void 0,n=Ut(e,r.clientId)+1):n=Gt(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function ln(e){return null!==e.insertionPoint}function an(e){return e.template.isValid}function cn(e){return e.settings.template}function un(e,t){var n,o;return t?null!==(n=On(e,t)?.templateLock)&&void 0!==n&&n:null!==(o=e.settings.templateLock)&&void 0!==o&&o}const dn=(e,t,n=null)=>{let o;if(t&&"object"==typeof t?(o=t,t=o.name):o=(0,l.getBlockType)(t),!o)return!1;const{allowedBlockTypes:r}=Dn(e);if(!oe(r,t,!0))return!1;if(!!un(e,n))return!1;if("disabled"===no(e,null!=n?n:""))return!1;const s=On(e,n);if(n&&void 0===s)return!1;const i=qe(e,n),a=(0,l.getBlockType)(i),c=a?.allowedBlocks;let u=oe(c,t);if(!1!==u){const e=s?.allowedBlocks,n=oe(e,t);null!==n&&(u=n)}const p=o.parent,h=oe(p,i);let g=!0;const m=o.ancestor;if(m){g=[n,..._t(e,n)].some((t=>oe(m,qe(e,t))))}const f=g&&(null===u&&null===h||!0===u||!0===h);return f?(0,d.applyFilters)("blockEditor.__unstableCanInsertBlockType",f,o,n,{getBlock:Qe.bind(null,e),getBlockParentsByBlockName:xt.bind(null,e)}):f},pn=(0,c.createSelector)(dn,((e,t,n)=>ie(e,n)));function hn(e,t,n=null){return t.every((t=>pn(e,qe(e,t),n)))}function gn(e,t){const n=Xe(e,t);if(null===n)return!0;if(void 0!==n.lock?.remove)return!n.lock.remove;const o=kt(e,t);return!un(e,o)&&"disabled"!==no(e,o)}function mn(e,t){return t.every((t=>gn(e,t)))}function fn(e,t){const n=Xe(e,t);if(null===n)return!0;if(void 0!==n.lock?.move)return!n.lock.move;const o=kt(e,t);return"all"!==un(e,o)&&"disabled"!==no(e,o)}function bn(e,t){return t.every((t=>fn(e,t)))}function vn(e,t){const n=Xe(e,t);if(null===n)return!0;const{lock:o}=n;return!o?.edit}function kn(e,t){return!!(0,l.hasBlockSupport)(t,"lock",!0)&&!!e.settings?.canLockBlocks}function _n(e,t){var n;return null!==(n=e.preferences.insertUsage?.[t])&&void 0!==n?n:null}const xn=(e,t,n)=>!!(0,l.hasBlockSupport)(t,"inserter",!0)&&dn(e,t.name,n),yn=(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}},Sn=(e,{buildScope:t="inserter"})=>n=>{const o=n.name;let r=!1;(0,l.hasBlockSupport)(n.name,"multiple",!0)||(r=at(e,rt(e)).some((({name:e})=>e===n.name)));const{time:s,count:i=0}=_n(e,o)||{},a={id:o,name:n.name,title:n.title,icon:n.icon,isDisabled:r,frecency:yn(s,i)};if("transform"===t)return a;const c=(0,l.getBlockVariations)(n.name,"inserter");return{...a,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,variations:c,example:n.example,utility:1}},wn=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n=null,o=Ze)=>{const r=dn(t,"core/block",n)?Q(e(J)).getReusableBlocks().map((e=>{const n=e.wp_pattern_sync_status?$:{src:$,foreground:"var(--wp-block-synced-color)"},o=`core/block/${e.id}`,{time:r,count:s=0}=_n(t,o)||{},i=yn(r,s);return{id:o,name:"core/block",initialAttributes:{ref:e.id},title:e.title?.raw,icon:n,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:i,content:e.content?.raw,syncStatus:e.wp_pattern_sync_status}})):[],s=Sn(t,{buildScope:"inserter"});let i=(0,l.getBlockTypes)().filter((e=>(0,l.hasBlockSupport)(e,"inserter",!0))).map(s);i=o[ee]?i.reduce(((e,o)=>{for(o.rootClientId=null!=n?n:"";!dn(t,o.name,o.rootClientId);){if(!o.rootClientId){let e;try{e=Q(Dn(t)).sectionRootClientId}catch(e){}e&&dn(t,o.name,e)?o.rootClientId=e:delete o.rootClientId;break}{const e=kt(t,o.rootClientId);o.rootClientId=e}}return o.hasOwnProperty("rootClientId")&&e.push(o),e}),[]):i.filter((e=>xn(t,e,n)));const a=i.reduce(((e,n)=>{const{variations:o=[]}=n;if(o.some((({isDefault:e})=>e))||e.push(n),o.length){const r=((e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:s=0}=_n(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:yn(r,s)}})(t,n);e.push(...o.map(r))}return e}),[]),{core:c,noncore:u}=a.reduce(((e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e}),{core:[],noncore:[]});return[...[...c,...u],...r]}),((t,n)=>[(0,l.getBlockTypes)(),Q(e(J)).getReusableBlocks(),t.blocks.order,t.preferences.insertUsage,...ie(t,n)])))),Cn=(0,c.createSelector)(((e,t,n=null)=>{const o=Array.isArray(t)?t:[t],r=Sn(e,{buildScope:"transform"}),s=(0,l.getBlockTypes)().filter((t=>xn(e,t,n))).map(r),i=Object.fromEntries(Object.entries(s).map((([,e])=>[e.name,e]))),a=(0,l.getPossibleBlockTransformations)(o).reduce(((e,t)=>(i[t?.name]&&e.push(i[t.name]),e)),[]);return ae(a,(e=>i[e.name].frecency),"desc")}),((e,t,n)=>[(0,l.getBlockTypes)(),e.preferences.insertUsage,...ie(e,n)])),Bn=(0,c.createRegistrySelector)((e=>(t,n=null)=>{if((0,l.getBlockTypes)().some((e=>xn(t,e,n))))return!0;return dn(t,"core/block",n)&&Q(e(J)).getReusableBlocks().length>0})),In=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n=null)=>{if(!n)return;const o=(0,l.getBlockTypes)().filter((e=>xn(t,e,n)));return dn(t,"core/block",n)&&Q(e(J)).getReusableBlocks().length>0&&o.push("core/block"),o}),((t,n)=>[(0,l.getBlockTypes)(),Q(e(J)).getReusableBlocks(),...ie(t,n)])))),jn=(0,c.createSelector)(((e,t=null)=>(y()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),In(e,t))),((e,t)=>In.getDependants(e,t)));function En(e,t=null){var n;if(!t)return;const{defaultBlock:o,directInsert:r}=null!==(n=e.blockListSettings[t])&&void 0!==n?n:{};return o&&r?o:void 0}function Tn(e,t=null){return y()('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),En(e,t)}const Mn=(0,c.createRegistrySelector)((e=>(t,n)=>{const o=Q(e(J)).getPatternBySlug(n);return o?ne(o):null})),Pn=e=>(t,n)=>[...se(e)(t),...ie(t,n)],Rn=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n=null)=>{const{getAllPatterns:o}=Q(e(J)),r=o(),{allowedBlockTypes:s}=Dn(t),i=r.filter((({inserter:e=!0})=>!!e)).map(ne),l=i.filter((({blocks:e})=>re(e,s))),a=l.filter((({blocks:e})=>e.every((({name:e})=>pn(t,e,n)))));return a}),Pn(e)))),Nn=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n,o=null)=>{if(!n)return We;const r=e(J).__experimentalGetAllowedPatterns(o),s=Array.isArray(n)?n:[n],i=r.filter((e=>e?.blockTypes?.some?.((e=>s.includes(e)))));return 0===i.length?We:i}),((t,n,o)=>Pn(e)(t,o))))),An=(0,c.createRegistrySelector)((e=>(y()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),e(J).getPatternsByBlockTypes))),Ln=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n,o=null)=>{if(!n)return We;if(n.some((({clientId:e,innerBlocks:n})=>n.length||qn(t,e))))return We;const r=Array.from(new Set(n.map((({name:e})=>e))));return e(J).getPatternsByBlockTypes(r,o)}),((t,n,o)=>Pn(e)(t,o)))));function On(e,t){return e.blockListSettings[t]}function Dn(e){return e.settings}function zn(e){return e.blocks.isPersistentChange}const Vn=(0,c.createSelector)(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),Fn=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n)=>{y()("wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle",{since:"6.6",version:"6.8"});const o=Q(e(J)).getReusableBlocks().find((e=>e.id===n));return o?o.title?.raw:null}),(()=>[Q(e(J)).getReusableBlocks()]))));function Hn(e){return e.blocks.isIgnoredChange}function Gn(e){return e.lastBlockAttributesChange}function Un(e){return"navigation"===e.editorMode}function $n(e){return e.editorMode}function Wn(e){return e.hasBlockMovingClientId}function Kn(e){return!!e.automaticChangeStatus}function Zn(e,t){return e.highlightedBlock===t}function qn(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Yn=(0,c.createSelector)(((e,t)=>{if(!t.length)return null;const n=bt(e);if(t.includes(qe(e,n)))return n;const o=Et(e),r=xt(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Xn(e,t,n){const{lastBlockInserted:o}=e;return o.clientIds?.includes(t)&&o.source===n}function Qn(e,t){var n;return null===(n=e.blockVisibility?.[t])||void 0===n||n}const Jn=(0,c.createSelector)((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?Ke:t}),(e=>[e.blockVisibility]));function eo(e,t){if("default"!==no(e,t))return!1;if(!vn(e,t))return!0;const n=$n(e);if("zoom-out"===n){const{sectionRootClientId:n}=Q(Dn(e));if(n){const o=Gt(e,n);if(o?.includes(t))return!0}else if(t&&!kt(e,t))return!0}const o=(0,l.hasBlockSupport)(qe(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&qn(e,t))&&!$t(e,t)&&!Wt(e,t,!0)}function to(e,t){let n=e.blocks.parents.get(t);for(;n;){if(eo(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const no=(0,c.createRegistrySelector)((e=>(t,n="")=>{null===n&&(n="");if("zoom-out"===$n(t)){const{sectionRootClientId:e}=Q(Dn(t));if(""===n)return e?"disabled":"contentOnly";if(n===e)return"contentOnly";const o=Gt(t,e);if(!o?.includes(n))return"disabled"}const o=t.blockEditingModes.get(n);if(o)return o;if(!n)return"default";const r=kt(t,n);if("contentOnly"===un(t,r)){const o=qe(t,n);return e(l.store).__experimentalHasContentRoleAttribute(o)?"contentOnly":"disabled"}const s=no(t,r);return"contentOnly"===s?"default":s})),oo=(0,c.createRegistrySelector)((e=>(t,n="")=>{const o=n||bt(t);if(!o)return!1;const{getGroupingBlockName:r}=e(l.store),s=Qe(t,o),i=r();return s&&(s.name===i||(0,l.getBlockType)(s.name)?.transforms?.ungroup)&&!!s.innerBlocks.length&&gn(t,o)})),ro=(0,c.createRegistrySelector)((e=>(t,n=We)=>{const{getGroupingBlockName:o}=e(l.store),r=o(),s=n?.length?n:jt(t),i=s?.length?kt(t,s[0]):void 0;return pn(t,r,i)&&s.length&&mn(t,s)})),so=(e,t)=>(y()("wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent",{since:"6.1",version:"6.7"}),Ge(e,t));function io(e){return y()("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks",{since:"6.1",version:"6.7"}),Ue(e)}function lo(e){return y()("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingFocusModeToRevert",{since:"6.5",version:"6.7"}),$e(e)}const ao=new WeakSet,co=["inserterMediaCategories","blockInspectorAnimation"];function uo(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let o=e;if(t&&"web"===a.Platform.OS){o={};for(const t in e)co.includes(t)||(o[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:o,reset:n}}function po(){return{type:"HIDE_BLOCK_INTERFACE"}}function ho(){return{type:"SHOW_BLOCK_INTERFACE"}}const go=(e,t=!0,n=!1)=>({select:o,dispatch:r,registry:s})=>{if(!e||!e.length)return;var i;i=e,e=Array.isArray(i)?i:[i];if(!o.canRemoveBlocks(e))return;const l=!n&&o.getBlockRemovalRules();if(l){function a(e){const t=[],n=[...e];for(;n.length;){const{innerBlocks:e,...o}=n.shift();n.push(...e),t.push(o)}return t}const c=a(e.map(o.getBlock));let u;for(const d of l)if(u=d.callback(c),u)return void r(fo(e,t,u))}t&&r.selectPreviousBlock(e[0],t),s.batch((()=>{r({type:"REMOVE_BLOCKS",clientIds:e}),r(mo())}))},mo=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function fo(e,t,n){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,message:n}}function bo(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function vo(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function ko(e){return{type:"SET_OPENED_BLOCK_SETTINGS_MENU",clientId:e}}function _o(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function xo(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function yo(e){return({dispatch:t,select:n,registry:o})=>{o.batch((()=>{t({type:"SET_EXPLICIT_PERSISTENT",isPersistentChange:!1}),e(),t({type:"SET_EXPLICIT_PERSISTENT",isPersistentChange:void 0});const o=n.getBlocks();ao.add(o)}))}}function So(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function wo(e){return({select:t,dispatch:n,registry:o})=>{const r=Q(o.select($r)).getTemporarilyEditingFocusModeToRevert();n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:"contentOnly"}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:"contentOnly"}),n.updateSettings({focusMode:r}),n.__unstableSetTemporarilyEditingAsBlocks()}}function Co(){return{type:"START_DRAGGING"}}function Bo(){return{type:"STOP_DRAGGING"}}function Io(e){return{type:"SET_BLOCK_EXPANDED_IN_LIST_VIEW",clientId:e}}const jo=e=>({select:t,dispatch:n})=>{n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:void 0}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:!1});const o=t.getSettings().focusMode;n.updateSettings({focusMode:!0}),n.__unstableSetTemporarilyEditingAsBlocks(e,o)},Eo=window.wp.a11y,To=window.wp.notices,Mo="†";function Po(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return("string"==typeof n||n instanceof W.RichTextData)&&-1!==n.toString().indexOf(Mo)}))}function Ro(e){for(const[t,n]of Object.entries(e.attributes))if("rich-text"===n.source||"html"===n.source)return t}const No=e=>Array.isArray(e)?e:[e],Ao=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(Lo(e))},Lo=e=>({select:t,dispatch:n})=>{const o=t.getTemplate(),r=t.getTemplateLock(),s=!o||"all"!==r||(0,l.doBlocksMatchTemplate)(e,o);if(s!==t.isValidTemplate())return n.setTemplateValidity(s),s};function Oo(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Do(e){return y()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function zo(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:No(e),attributes:t,uniqueByBlock:n}}function Vo(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Fo(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Ho=(e,t=!1)=>({select:n,dispatch:o})=>{const r=n.getPreviousBlockClientId(e);if(r)o.selectBlock(r,-1);else if(t){const t=n.getBlockRootClientId(e);t&&o.selectBlock(t,-1)}},Go=e=>({select:t,dispatch:n})=>{const o=t.getNextBlockClientId(e);o&&n.selectBlock(o)};function Uo(){return{type:"START_MULTI_SELECT"}}function $o(){return{type:"STOP_MULTI_SELECT"}}const Wo=(e,t,n=0)=>({select:o,dispatch:r})=>{if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const s=o.getSelectedBlockCount();(0,Eo.speak)((0,C.sprintf)((0,C._n)("%s block selected.","%s blocks selected.",s),s),"assertive")};function Ko(){return{type:"CLEAR_SELECTED_BLOCK"}}function Zo(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}const qo=(e,t,n,o=0,r)=>({select:s,dispatch:i,registry:l})=>{e=No(e),t=No(t);const a=s.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!s.canInsertBlockType(n.name,a))return}l.batch((()=>{i({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),i.ensureDefaultBlock()}))};function Yo(e,t){return qo(e,t)}const Xo=e=>(t,n)=>({select:o,dispatch:r})=>{o.canMoveBlocks(t)&&r({type:e,clientIds:No(t),rootClientId:n})},Qo=Xo("MOVE_BLOCKS_DOWN"),Jo=Xo("MOVE_BLOCKS_UP"),er=(e,t="",n="",o)=>({select:r,dispatch:s})=>{if(r.canMoveBlocks(e)){if(t!==n){if(!r.canRemoveBlocks(e))return;if(!r.canInsertBlocks(e,n))return}s({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}};function tr(e,t="",n="",o){return er([e],t,n,o)}function nr(e,t,n,o,r){return or([e],t,n,o,0,r)}const or=(e,t,n,o=!0,r=0,s)=>({select:i,dispatch:l})=>{null!==r&&"object"==typeof r&&(s=r,r=0,y()("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=No(e);const a=[];for(const t of e){i.canInsertBlockType(t.name,n)&&a.push(t)}a.length&&l({type:"INSERT_BLOCKS",blocks:a,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:s})};function rr(e,t,n={}){const{__unstableWithInserter:o,operation:r,nearestSide:s}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:r,nearestSide:s}}const sr=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function ir(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const lr=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=e.getBlocks(),o=e.getTemplate(),r=(0,l.synchronizeBlocksWithTemplate)(n,o);t.resetBlocks(r)},ar=e=>({registry:t,select:n,dispatch:o})=>{const r=n.getSelectionStart(),s=n.getSelectionEnd();if(r.clientId===s.clientId)return;if(!r.attributeKey||!s.attributeKey||void 0===r.offset||void 0===s.offset)return!1;const i=n.getBlockRootClientId(r.clientId);if(i!==n.getBlockRootClientId(s.clientId))return;const a=n.getBlockOrder(i);let c,u;a.indexOf(r.clientId)>a.indexOf(s.clientId)?(c=s,u=r):(c=r,u=s);const d=e?u:c,p=n.getBlock(d.clientId),h=(0,l.getBlockType)(p.name);if(!h.merge)return;const g=c,m=u,f=n.getBlock(g.clientId),b=n.getBlock(m.clientId),v=f.attributes[g.attributeKey],k=b.attributes[m.attributeKey];let _=(0,W.create)({html:v}),x=(0,W.create)({html:k});_=(0,W.remove)(_,g.offset,_.text.length),x=(0,W.insert)(x,Mo,0,m.offset);const y=(0,l.cloneBlock)(f,{[g.attributeKey]:(0,W.toHTMLString)({value:_})}),S=(0,l.cloneBlock)(b,{[m.attributeKey]:(0,W.toHTMLString)({value:x})}),w=e?y:S,C=f.name===b.name?[w]:(0,l.switchToBlockType)(w,h.name);if(!C||!C.length)return;let B;if(e){const e=C.pop();B=h.merge(e.attributes,S.attributes)}else{const e=C.shift();B=h.merge(y.attributes,e.attributes)}const I=Po(B),j=B[I],E=(0,W.create)({html:j}),T=E.text.indexOf(Mo),M=(0,W.remove)(E,T,T+1),P=(0,W.toHTMLString)({value:M});B[I]=P;const R=n.getSelectedBlockClientIds(),N=[...e?C:[],{...p,attributes:{...p.attributes,...B}},...e?[]:C];t.batch((()=>{o.selectionChange(p.clientId,I,T,T),o.replaceBlocks(R,N,0,n.getSelectedBlocksInitialCaretPosition())}))},cr=(e=[])=>({registry:t,select:n,dispatch:o})=>{const r=n.getSelectionStart(),s=n.getSelectionEnd(),i=n.getBlockRootClientId(r.clientId),a=n.getBlockRootClientId(s.clientId);if(i!==a)return;const c=n.getBlockOrder(i);let u,d;c.indexOf(r.clientId)>c.indexOf(s.clientId)?(u=s,d=r):(u=r,d=s);const p=u,h=d,g=n.getBlock(p.clientId),m=n.getBlock(h.clientId),f=(0,l.getBlockType)(g.name),b=(0,l.getBlockType)(m.name),v="string"==typeof p.attributeKey?p.attributeKey:Ro(f),k="string"==typeof h.attributeKey?h.attributeKey:Ro(b),_=n.getBlockAttributes(p.clientId),x=_?.metadata?.bindings;if(x?.[v]){if(e.length){const{createWarningNotice:D}=t.dispatch(To.store);return void D((0,C.__)("Blocks can't be inserted into other blocks with bindings"),{type:"snackbar"})}return void o.insertAfterBlock(p.clientId)}if(!v||!k||void 0===r.offset||void 0===s.offset)return;if(p.clientId===h.clientId&&v===k&&p.offset===h.offset)if(e.length){if((0,l.isUnmodifiedDefaultBlock)(g))return void o.replaceBlocks([p.clientId],e,e.length-1,-1)}else if(!n.getBlockOrder(p.clientId).length){function z(){const e=(0,l.getDefaultBlockName)();return n.canInsertBlockType(e,i)?(0,l.createBlock)(e):(0,l.createBlock)(n.getBlockName(p.clientId))}const V=_[v].length;if(0===p.offset&&V)return void o.insertBlocks([z()],n.getBlockIndex(p.clientId),i,!1);if(p.offset===V)return void o.insertBlocks([z()],n.getBlockIndex(p.clientId)+1,i)}const y=g.attributes[v],S=m.attributes[k];let w=(0,W.create)({html:y}),B=(0,W.create)({html:S});w=(0,W.remove)(w,p.offset,w.text.length),B=(0,W.remove)(B,0,h.offset);let I={...g,innerBlocks:g.clientId===m.clientId?[]:g.innerBlocks,attributes:{...g.attributes,[v]:(0,W.toHTMLString)({value:w})}},j={...m,clientId:g.clientId===m.clientId?(0,l.createBlock)(m.name).clientId:m.clientId,attributes:{...m.attributes,[k]:(0,W.toHTMLString)({value:B})}};const E=(0,l.getDefaultBlockName)();if(g.clientId===m.clientId&&E&&j.name!==E&&n.canInsertBlockType(E,i)){const F=(0,l.switchToBlockType)(j,E);1===F?.length&&(j=F[0])}if(!e.length)return void o.replaceBlocks(n.getSelectedBlockClientIds(),[I,j]);let T;const M=[],P=[...e],R=P.shift(),N=(0,l.getBlockType)(I.name),A=N.merge&&R.name===N.name?[R]:(0,l.switchToBlockType)(R,N.name);if(A?.length){const H=A.shift();I={...I,attributes:{...I.attributes,...N.merge(I.attributes,H.attributes)}},M.push(I),T={clientId:I.clientId,attributeKey:v,offset:(0,W.create)({html:I.attributes[v]}).text.length},P.unshift(...A)}else(0,l.isUnmodifiedBlock)(I)||M.push(I),M.push(R);const L=P.pop(),O=(0,l.getBlockType)(j.name);if(P.length&&M.push(...P),L){const G=O.merge&&O.name===L.name?[L]:(0,l.switchToBlockType)(L,O.name);if(G?.length){const U=G.pop();M.push({...j,attributes:{...j.attributes,...O.merge(U.attributes,j.attributes)}}),M.push(...G),T={clientId:j.clientId,attributeKey:k,offset:(0,W.create)({html:U.attributes[k]}).text.length}}else M.push(L),(0,l.isUnmodifiedBlock)(j)||M.push(j)}else(0,l.isUnmodifiedBlock)(j)||M.push(j);t.batch((()=>{o.replaceBlocks(n.getSelectedBlockClientIds(),M,M.length-1,0),T&&o.selectionChange(T.clientId,T.attributeKey,T.offset,T.offset)}))},ur=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:o.clientId}})},dr=(e,t)=>({registry:n,select:o,dispatch:r})=>{const s=e,i=t,a=o.getBlock(s),c=(0,l.getBlockType)(a.name);if(!c)return;const u=o.getBlock(i);if(!c.merge&&(0,l.getBlockSupport)(a.name,"__experimentalOnMerge")){const e=(0,l.switchToBlockType)(u,c.name);if(1!==e?.length)return void r.selectBlock(a.clientId);const[t]=e;return t.innerBlocks.length<1?void r.selectBlock(a.clientId):void n.batch((()=>{r.insertBlocks(t.innerBlocks,void 0,s),r.removeBlock(i),r.selectBlock(t.innerBlocks[0].clientId);const e=o.getNextBlockClientId(s);if(e&&o.getBlockName(s)===o.getBlockName(e)){const t=o.getBlockAttributes(s),n=o.getBlockAttributes(e);Object.keys(t).every((e=>t[e]===n[e]))&&(r.moveBlocksToPosition(o.getBlockOrder(e),e,s),r.removeBlock(e,!1))}}))}if((0,l.isUnmodifiedDefaultBlock)(a))return void r.removeBlock(s,o.isBlockSelected(s));if((0,l.isUnmodifiedDefaultBlock)(u))return void r.removeBlock(i,o.isBlockSelected(i));if(!c.merge)return void r.selectBlock(a.clientId);const d=(0,l.getBlockType)(u.name),{clientId:p,attributeKey:h,offset:g}=o.getSelectionStart(),m=(p===s?c:d).attributes[h],f=(p===s||p===i)&&void 0!==h&&void 0!==g&&!!m;m||("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 b=(0,l.cloneBlock)(a),v=(0,l.cloneBlock)(u);if(f){const e=p===s?b:v,t=e.attributes[h],n=(0,W.insert)((0,W.create)({html:t}),Mo,g,g);e.attributes[h]=(0,W.toHTMLString)({value:n})}const k=a.name===u.name?[v]:(0,l.switchToBlockType)(v,a.name);if(!k||!k.length)return;const _=c.merge(b.attributes,k[0].attributes);if(f){const e=Po(_),t=_[e],n=(0,W.create)({html:t}),o=n.text.indexOf(Mo),s=(0,W.remove)(n,o,o+1),i=(0,W.toHTMLString)({value:s});_[e]=i,r.selectionChange(a.clientId,e,o,o)}r.replaceBlocks([a.clientId,u.clientId],[{...a,attributes:{...a.attributes,..._}},...k.slice(1)],0)},pr=(e,t=!0)=>go(e,t);function hr(e,t){return pr([e],t)}function gr(e,t,n=!1,o=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function mr(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function fr(){return{type:"START_TYPING"}}function br(){return{type:"STOP_TYPING"}}function vr(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function kr(){return{type:"STOP_DRAGGING_BLOCKS"}}function _r(){return y()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function xr(){return y()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function yr(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Sr=(e,t,n)=>({dispatch:o})=>{const r=(0,l.getDefaultBlockName)();if(!r)return;const s=(0,l.createBlock)(r,e);return o.insertBlock(s,n,t)};function wr(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Cr(e){return uo(e,{stripExperimentalSettings:!0})}function Br(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Ir(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function jr(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Er=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Tr=(e=!0)=>({dispatch:t})=>{t.__unstableSetEditorMode(e?"navigation":"edit")},Mr=e=>({dispatch:t,select:n,registry:o})=>{if("zoom-out"===e){const e=n.getBlockSelectionStart(),{sectionRootClientId:r}=Q(o.select(J).getSettings());if(e){let o;if(r){const t=n.getBlockOrder(r);o=n.getBlockParents(e).find((e=>t.includes(e)))}else o=n.getBlockHierarchyRootClientId(e);o?t.selectBlock(o):t.clearSelectedBlock()}}t({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,Eo.speak)((0,C.__)("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,Eo.speak)((0,C.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,Eo.speak)((0,C.__)("You are currently in zoom-out mode."))},Pr=(e=null)=>({dispatch:t})=>{t({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Eo.speak)((0,C.__)("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."))},Rr=(e,t=!0)=>({select:n,dispatch:o})=>{if(!e||!e.length)return;const r=n.getBlocksByClientId(e);if(r.some((e=>!e)))return;const s=r.map((e=>e.name));if(s.some((e=>!(0,l.hasBlockSupport)(e,"multiple",!0))))return;const i=n.getBlockRootClientId(e[0]),a=No(e),c=n.getBlockIndex(a[a.length-1]),u=r.map((e=>(0,l.__experimentalCloneSanitizedBlock)(e)));return o.insertBlocks(u,c+1,i,t),u.length>1&&t&&o.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))},Nr=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e),s=o?t.getDirectInsertBlock(o):null;if(!s)return n.insertDefaultBlock({},o,r);const i={};if(s.attributesToCopy){const n=t.getBlockAttributes(e);s.attributesToCopy.forEach((e=>{n[e]&&(i[e]=n[e])}))}const a=(0,l.createBlock)(s.name,{...s.attributes,...i});return n.insertBlock(a,r,o)},Ar=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e),s=o?t.getDirectInsertBlock(o):null;if(!s)return n.insertDefaultBlock({},o,r+1);const i={};if(s.attributesToCopy){const n=t.getBlockAttributes(e);s.attributesToCopy.forEach((e=>{n[e]&&(i[e]=n[e])}))}const a=(0,l.createBlock)(s.name,{...s.attributes,...i});return n.insertBlock(a,r+1,o)};function Lr(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Or=e=>async({dispatch:t})=>{t(Lr(e,!0)),await new Promise((e=>setTimeout(e,150))),t(Lr(e,!1))};function Dr(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function zr(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Vr(e,t){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e,focusModeToRevert:t}}const Fr=e=>({select:t,dispatch:n})=>{if(!e||"object"!=typeof e)return void console.error("Category should be an `InserterMediaCategory` object.");if(!e.name)return void console.error("Category should have a `name` that should be unique among all media categories.");if(!e.labels?.name)return void console.error("Category should have a `labels.name`.");if(!["image","audio","video"].includes(e.mediaType))return void console.error("Category should have `mediaType` property that is one of `image|audio|video`.");if(!e.fetch||"function"!=typeof e.fetch)return void console.error("Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise<InserterMediaItem[]>`.");const o=t.getRegisteredInserterMediaCategories();o.some((({name:t})=>t===e.name))?console.error(`A category is already registered with the same name: "${e.name}".`):o.some((({labels:{name:t}={}})=>t===e.labels?.name))?console.error(`A category is already registered with the same labels.name: "${e.labels.name}".`):n({type:"REGISTER_INSERTER_MEDIA_CATEGORY",category:{...e,isExternalResource:!0}})};function Hr(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function Gr(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}const Ur={reducer:H,selectors:t,actions:s},$r=(0,c.createReduxStore)(J,{...Ur,persist:["preferences"]}),Wr=(0,c.registerStore)(J,{...Ur,persist:["preferences"]});function Kr(...e){const{clientId:t=null}=_();return(0,c.useSelect)((n=>Q(n($r)).getBlockSettings(t,...e)),[t,...e])}function Zr(e){y()("wp.blockEditor.useSetting",{since:"6.5",alternative:"wp.blockEditor.useSettings",note:"The new useSettings function can retrieve multiple settings at once, with better performance."});const[t]=Kr(e);return t}Q(Wr).registerPrivateActions(r),Q(Wr).registerPrivateSelectors(e),Q($r).registerPrivateActions(r),Q($r).registerPrivateSelectors(e);const qr="1600px",Yr="320px",Xr=1,Qr=.25,Jr=.75,es="14px";function ts({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:o=Yr,maximumViewportWidth:r=qr,scaleFactor:s=Xr,minimumFontSizeLimit:i}){if(i=ns(i)?i:es,n){const o=ns(n);if(!o?.unit)return null;const r=ns(i,{coerceTo:o.unit});if(r?.value&&!e&&!t&&o?.value<=r?.value)return null;if(t||(t=`${o.value}${o.unit}`),!e){const t="px"===o.unit?o.value:16*o.value,n=Math.min(Math.max(1-.075*Math.log2(t),Qr),Jr),s=os(o.value*n,3);e=r?.value&&s<r?.value?`${r.value}${r.unit}`:`${s}${o.unit}`}}const l=ns(e),a=l?.unit||"rem",c=ns(t,{coerceTo:a});if(!l||!c)return null;const u=ns(e,{coerceTo:"rem"}),d=ns(r,{coerceTo:a}),p=ns(o,{coerceTo:a});if(!d||!p||!u)return null;const h=d.value-p.value;if(!h)return null;const g=os(p.value/100,3),m=os(g,3)+a,f=os(((c.value-l.value)/h*100||1)*s,3);return`clamp(${e}, ${`${u.value}${u.unit} + ((1vw - ${m}) * ${f})`}, ${t})`}function ns(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:o,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},s=r?.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${s}){1,1}$`),l=e.match(i);if(!l||l.length<3)return null;let[,a,c]=l,u=parseFloat(a);return"px"!==n||"em"!==c&&"rem"!==c||(u*=o,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=o,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:os(u,3),unit:c}}function os(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}function rs(e,t){const{size:n}=e;if(!ss(t?.typography))return n;if(!n||"0"===n||!1===e?.fluid)return n;let o=function(e){const t=e?.typography,n=e?.layout,o=ns(n?.wideSize)?n?.wideSize:null;return ss(t)&&o?{fluid:{maxViewportWidth:o,...t.fluid}}:{fluid:t?.fluid}}(t);o="object"==typeof o?.fluid?o?.fluid:{};const r=ts({minimumFontSize:e?.fluid?.min,maximumFontSize:e?.fluid?.max,fontSize:n,minimumFontSizeLimit:o?.minFontSize,maximumViewportWidth:o?.maxViewportWidth,minimumViewportWidth:o?.minViewportWidth});return r||n}function ss(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}const is="body",ls=":root",as=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:({slug:e})=>`url( '#wp-duotone-${e}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>rs(e,t),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]}],cs={"color.background":"color","color.text":"color","filter.duotone":"duotone","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.caption.color.text":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",shadow:"shadow","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function us(){return(0,u.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function ds(e,t,n,o,r){const s=[me(e,["blocks",t,...n]),me(e,n)];for(const i of s)if(i){const s=["custom","theme","default"];for(const l of s){const s=i[l];if(s){const i=s.find((e=>e[o]===r));if(i){if("slug"===o)return i;return ds(e,t,n,"slug",i.slug)[o]===i[o]?i:void 0}}}}}function ps(e,t,n){if(!n||"string"!=typeof n){if(!n?.ref||"string"!=typeof n?.ref)return n;{const t=n.ref.split(".");if(!(n=me(e,t))||n?.ref)return n}}const o="var:",r="var(--wp--";let s;if(n.startsWith(o))s=n.slice(4).split("|");else{if(!n.startsWith(r)||!n.endsWith(")"))return n;s=n.slice(10,-1).split("--")}const[i,...l]=s;return"preset"===i?function(e,t,n,[o,r]){const s=as.find((e=>e.cssVarInfix===o));if(!s)return n;const i=ds(e.settings,t,s.path,"slug",r);if(i){const{valueKey:n}=s;return ps(e,t,i[n])}return n}(e,t,n,l):"custom"===i?function(e,t,n,o){var r;const s=null!==(r=me(e.settings,["blocks",t,"custom",...o]))&&void 0!==r?r:me(e.settings,["custom",...o]);return s?ps(e,t,s):n}(e,t,n,l):n}function hs(e,t){if(!e||!t)return t;const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}function gs(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:w()(e?.styles,t?.styles)&&w()(e?.settings,t?.settings)}const ms=(0,a.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),fs={settings:{},styles:{}},bs=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","border.color","border.radius","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.minHeight","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.defaultSpacingSizes","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.defaultFontSizes","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textTransform","typography.writingMode"],vs=()=>{const{user:e,setUserConfig:t}=(0,a.useContext)(ms),n={settings:e.settings,styles:e.styles};return[!!n&&!w()(n,fs),(0,a.useCallback)((()=>t(fs)),[t])]};function ks(e,t,n="all"){const{setUserConfig:o,...r}=(0,a.useContext)(ms),s=t?".blocks."+t:"",i=e?"."+e:"",l=`settings${s}${i}`,c=`settings${i}`,u="all"===n?"merged":n;return[(0,a.useMemo)((()=>{const t=r[u];if(!t)throw"Unsupported source";var n;if(e)return null!==(n=me(t,l))&&void 0!==n?n:me(t,c);let o={};return bs.forEach((e=>{var n;const r=null!==(n=me(t,`settings${s}.${e}`))&&void 0!==n?n:me(t,`settings.${e}`);void 0!==r&&(o=ge(o,e.split("."),r))})),o}),[r,u,e,l,c,s]),e=>{o((t=>ge(t,l.split("."),e)))}]}function _s(e,t,n="all",{shouldDecodeEncode:o=!0}={}){const{merged:r,base:s,user:i,setUserConfig:l}=(0,a.useContext)(ms),c=e?"."+e:"",u=t?`styles.blocks.${t}${c}`:`styles${c}`;let d,p;switch(n){case"all":d=me(r,u),p=o?ps(r,t,d):d;break;case"user":d=me(i,u),p=o?ps(r,t,d):d;break;case"base":d=me(s,u),p=o?ps(s,t,d):d;break;default:throw"Unsupported source"}return[p,n=>{l((s=>ge(s,u.split("."),o?function(e,t,n,o){if(!o)return o;const r=cs[n],s=as.find((e=>e.cssVarInfix===r));if(!s)return o;const{valueKey:i,path:l}=s,a=ds(e,t,l,i,o);return a?`var:preset|${r}|${a.slug}`:o}(r.settings,t,e,n):n)))}]}function xs(){const{merged:e}=(0,a.useContext)(ms);return e?._links}function ys(e,t,n){const{supportedStyles:o,supports:r}=(0,c.useSelect)((e=>({supportedStyles:Q(e(l.store)).getSupportedStyles(t,n),supports:e(l.store).getBlockType(t)?.supports})),[t,n]);return(0,a.useMemo)((()=>{const t={...e};return o.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),o.includes("fontFamily")||(t.typography={...t.typography,fontFamilies:{}}),t.color={...t.color,text:t.color?.text&&o.includes("color"),background:t.color?.background&&(o.includes("background")||o.includes("backgroundColor")),button:t.color?.button&&o.includes("buttonColor"),heading:t.color?.heading&&o.includes("headingColor"),link:t.color?.link&&o.includes("linkColor"),caption:t.color?.caption&&o.includes("captionColor")},o.includes("background")||(t.color.gradients=[],t.color.customGradient=!1),o.includes("filter")||(t.color.defaultDuotone=!1,t.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textAlign","textTransform","textDecoration","writingMode"].forEach((e=>{o.includes(e)||(t.typography={...t.typography,[e]:!1})})),o.includes("columnCount")||(t.typography={...t.typography,textColumns:!1}),["contentSize","wideSize"].forEach((e=>{o.includes(e)||(t.layout={...t.layout,[e]:!1})})),["padding","margin","blockGap"].forEach((e=>{o.includes(e)||(t.spacing={...t.spacing,[e]:!1});const n=Array.isArray(r?.spacing?.[e])?r?.spacing?.[e]:r?.spacing?.[e]?.sides;n?.length&&t.spacing?.[e]&&(t.spacing={...t.spacing,[e]:{...t.spacing?.[e],sides:n}})})),["aspectRatio","minHeight"].forEach((e=>{o.includes(e)||(t.dimensions={...t.dimensions,[e]:!1})})),["radius","color","style","width"].forEach((e=>{o.includes("border"+e.charAt(0).toUpperCase()+e.slice(1))||(t.border={...t.border,[e]:!1})})),t.shadow=!!o.includes("shadow")&&t.shadow,n&&(t.typography.textAlign=!1),t}),[e,o,r,n])}function Ss(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,o=e?.color?.palette?.default,r=e?.color?.defaultPalette;return(0,a.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,C._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,C._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,C._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,o,r])}function ws(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,o=e?.color?.gradients?.default,r=e?.color?.defaultGradients;return(0,a.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,C._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&o&&o.length&&e.push({name:(0,C._x)("Default","Indicates this palette comes from WordPress."),gradients:o}),t&&t.length&&e.push({name:(0,C._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,o,r])}function Cs(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Cs(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}const Bs=function(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Cs(e))&&(o&&(o+=" "),o+=t);return o},Is=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,Is(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function js(e,t,n,o,r,s){if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===s.length&&n.innerBlocks.length===o.length)return n;let i=o[0]?.attributes;if(s.length>1&&o.length>1){if(!o[r])return n;i=o[r]?.attributes}let l=n;return Object.entries(e).forEach((([e,n])=>{n&&t[e].forEach((e=>{const t=me(i,e);t&&(l={...l,attributes:ge(l.attributes,e,t)})}))})),l}function Es(e,t,n){const o=(0,l.getBlockSupport)(e,t),r=o?.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}const Ts=new WeakMap;function Ms({id:e,css:t,assets:n,__unstableType:o,variation:r,clientId:s}={}){const{setStyleOverride:i,deleteStyleOverride:l}=Q((0,c.useDispatch)($r)),u=(0,c.useRegistry)(),d=(0,a.useId)();(0,a.useEffect)((()=>{if(!t&&!n)return;const a=e||d,c={id:e,css:t,assets:n,__unstableType:o,variation:r,clientId:s};return Ts.get(u)||Ts.set(u,[]),Ts.get(u).push([a,c]),window.queueMicrotask((()=>{Ts.get(u)?.length&&u.batch((()=>{Ts.get(u).forEach((e=>{i(...e)})),Ts.set(u,[])}))})),()=>{const e=Ts.get(u)?.find((([e])=>e===a));e?Ts.set(u,Ts.get(u).filter((([e])=>e!==a))):l(a)}}),[e,t,s,n,o,d,i,l,u])}function Ps(e,t){const[n,o,r,s,i,l,c,u,d,p,h,g,m,f,b,v,k,_,x,y,S,w,C,B,I,j,E,T,M,P,R,N,A,L,O,D,z,V,F,H,G,U,$,W,K,Z,q,Y,X,Q,J,ee,te,ne,oe,re]=Kr("background.backgroundImage","background.backgroundSize","typography.fontFamilies.custom","typography.fontFamilies.default","typography.fontFamilies.theme","typography.defaultFontSizes","typography.fontSizes.custom","typography.fontSizes.default","typography.fontSizes.theme","typography.customFontSize","typography.fontStyle","typography.fontWeight","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.writingMode","typography.textTransform","typography.letterSpacing","spacing.padding","spacing.margin","spacing.blockGap","spacing.defaultSpacingSizes","spacing.customSpacingSize","spacing.spacingSizes.custom","spacing.spacingSizes.default","spacing.spacingSizes.theme","spacing.units","dimensions.aspectRatio","dimensions.minHeight","layout","border.color","border.radius","border.style","border.width","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow");return ys((0,a.useMemo)((()=>({background:{backgroundImage:n,backgroundSize:o},color:{palette:{custom:z,theme:F,default:H},gradients:{custom:Z,theme:q,default:Y},duotone:{custom:$,theme:W,default:K},defaultGradients:X,defaultPalette:G,defaultDuotone:U,custom:D,customGradient:Q,customDuotone:V,background:J,link:ee,heading:ne,button:oe,text:te},typography:{fontFamilies:{custom:r,default:s,theme:i},fontSizes:{custom:c,default:u,theme:d},customFontSize:p,defaultFontSizes:l,fontStyle:h,fontWeight:g,lineHeight:m,textAlign:f,textColumns:b,textDecoration:v,textTransform:_,letterSpacing:x,writingMode:k},spacing:{spacingSizes:{custom:I,default:j,theme:E},customSpacingSize:B,defaultSpacingSizes:C,padding:y,margin:S,blockGap:w,units:T},border:{color:N,radius:A,style:L,width:O},dimensions:{aspectRatio:M,minHeight:P},layout:R,parentLayout:t,shadow:re})),[n,o,r,s,i,l,c,u,d,p,h,g,m,f,b,v,_,x,k,y,S,w,C,B,I,j,E,T,M,P,R,t,N,A,L,O,D,z,V,F,H,G,U,$,W,K,Z,q,Y,X,Q,J,ee,te,ne,oe,re]),e)}const Rs=(0,a.memo)((function({index:e,useBlockProps:t,setAllWrapperProps:n,...o}){const r=t(o),s=t=>n((n=>{const o=[...n];return o[e]=t,o}));return(0,a.useEffect)((()=>(s(r),()=>{s(void 0)}))),null}));(0,d.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 Ns=window.wp.components,As={default:(0,Ns.createSlotFill)("BlockControls"),block:(0,Ns.createSlotFill)("BlockControlsBlock"),inline:(0,Ns.createSlotFill)("BlockFormatControls"),other:(0,Ns.createSlotFill)("BlockControlsOther"),parent:(0,Ns.createSlotFill)("BlockControlsParent")};function Ls({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const r=function(e,t){const n=_();return n[p]?As[e]?.Fill:n[h]&&t?As.parent.Fill:null}(e,o);if(!r)return null;const s=(0,U.jsxs)(U.Fragment,{children:["default"===e&&(0,U.jsx)(Ns.ToolbarGroup,{controls:t}),n]});return(0,U.jsx)(Ns.__experimentalStyleProvider,{document,children:(0,U.jsx)(r,{children:e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,U.jsx)(t,{...n,children:e})),s)}})})}window.wp.warning;const{ComponentsContext:Os}=Q(Ns.privateApis);function Ds({group:e="default",...t}){const n=(0,a.useContext)(Ns.__experimentalToolbarContext),o=(0,a.useContext)(Os),r=(0,a.useMemo)((()=>({forwardedContext:[[Ns.__experimentalToolbarContext.Provider,{value:n}],[Os.Provider,{value:o}]]})),[n,o]),s=As[e]?.Slot,i=(0,Ns.__experimentalUseSlotFills)(s?.__unstableName);if(!s)return null;if(!i?.length)return null;const l=(0,U.jsx)(s,{...t,bubblesVirtually:!0,fillProps:r});return"default"===e?l:(0,U.jsx)(Ns.ToolbarGroup,{children:l})}const zs=Ls;zs.Slot=Ds;const Vs=e=>(0,U.jsx)(Ls,{group:"inline",...e});Vs.Slot=e=>(0,U.jsx)(Ds,{group:"inline",...e});const Fs=zs,Hs=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})}),Gs=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})}),Us=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})}),$s=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})}),Ws=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"})}),Ks=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),Zs=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})}),qs={default:{name:"default",slug:"flow",className:"is-layout-flow",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},flex:{name:"flex",slug:"flex",className:"is-layout-flex",displayMode:"flex",baseStyles:[{selector:"",rules:{"flex-wrap":"wrap","align-items":"center"}},{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}};function Ys(e,t=""){return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function Xs(e,t=qs,n,o){let r="";return t?.[n]?.spacingStyles?.length&&o&&t[n].spacingStyles.forEach((t=>{r+=`${Ys(e,t.selector.trim())} { `,r+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||o}`)).join("; "),r+="; }"})),r}function Qs(e){const{contentSize:t,wideSize:n,type:o="default"}=e,r={},s=/^(?!0)\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;return s.test(t)&&"constrained"===o&&(r.none=(0,C.sprintf)((0,C.__)("Max %s wide"),t)),s.test(n)&&(r.wide=(0,C.sprintf)((0,C.__)("Max %s wide"),n)),r}const Js=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z"})}),ei=(0,U.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,U.jsx)(G.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,U.jsx)(G.Path,{d:"m4.5 7.5v9h1.5v-9z"}),(0,U.jsx)(G.Path,{d:"m18 7.5v9h1.5v-9z"})]}),ti=(0,U.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,U.jsx)(G.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,U.jsx)(G.Path,{d:"m7.5 6h9v-1.5h-9z"}),(0,U.jsx)(G.Path,{d:"m7.5 19.5h9v-1.5h-9z"})]}),ni=(0,U.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,U.jsx)(G.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,U.jsx)(G.Path,{d:"m16.5 6h-9v-1.5h9z"})]}),oi=(0,U.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,U.jsx)(G.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,U.jsx)(G.Path,{d:"m18 16.5v-9h1.5v9z"})]}),ri=(0,U.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,U.jsx)(G.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,U.jsx)(G.Path,{d:"m16.5 19.5h-9v-1.5h9z",style:{fill:"#1e1e1e"}})]}),si=(0,U.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,U.jsx)(G.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,U.jsx)(G.Path,{d:"m4.5 16.5v-9h1.5v9z"})]}),ii=8,li=["top","right","bottom","left"],ai={top:void 0,right:void 0,bottom:void 0,left:void 0},ci={custom:Js,axial:Js,horizontal:ei,vertical:ti,top:ni,right:oi,bottom:ri,left:si},ui={default:(0,C.__)("Spacing control"),top:(0,C.__)("Top"),bottom:(0,C.__)("Bottom"),left:(0,C.__)("Left"),right:(0,C.__)("Right"),mixed:(0,C.__)("Mixed"),vertical:(0,C.__)("Vertical"),horizontal:(0,C.__)("Horizontal"),axial:(0,C.__)("Horizontal & vertical"),custom:(0,C.__)("Custom")},di={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function pi(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}function hi(e,t){if(!pi(e))return e;const n=fi(e),o=t.find((e=>String(e.slug)===n));return o?.size}function gi(e,t){if(!e||pi(e)||"0"===e)return e;const n=t.find((t=>String(t.size)===String(e)));return n?.slug?`var:preset|spacing|${n.slug}`:e}function mi(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function fi(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}function bi(e,t){if(!e||!e.length)return!1;const n=e.includes("horizontal")||e.includes("left")&&e.includes("right"),o=e.includes("vertical")||e.includes("top")&&e.includes("bottom");return"horizontal"===t?n:"vertical"===t?o:n||o}function vi(e,t="0"){const n=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!n)return null;const o=mi(n?.top)||t,r=mi(n?.left)||t;return o===r?o:`${o} ${r}`}const ki=(0,U.jsx)(Ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(Ns.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})}),_i=(0,U.jsx)(Ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(Ns.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})}),xi=(0,U.jsx)(Ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(Ns.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})}),yi=(0,U.jsx)(Ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(Ns.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})}),Si=(0,U.jsx)(Ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(Ns.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})}),wi={top:{icon:xi,title:(0,C._x)("Align top","Block vertical alignment setting")},center:{icon:_i,title:(0,C._x)("Align middle","Block vertical alignment setting")},bottom:{icon:ki,title:(0,C._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:yi,title:(0,C._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:Si,title:(0,C._x)("Space between","Block vertical alignment setting")}},Ci=["top","center","bottom"];const Bi=function({value:e,onChange:t,controls:n=Ci,isCollapsed:o=!0,isToolbar:r}){function s(n){return()=>t(e===n?void 0:n)}const i=wi[e],l=wi.top,a=r?Ns.ToolbarGroup:Ns.ToolbarDropdownMenu,c=r?{isCollapsed:o}:{};return(0,U.jsx)(a,{icon:i?i.icon:l.icon,label:(0,C._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((t=>({...wi[t],isActive:e===t,role:o?"menuitemradio":void 0,onClick:s(t)}))),...c})},Ii=e=>(0,U.jsx)(Bi,{...e,isToolbar:!1}),ji=e=>(0,U.jsx)(Bi,{...e,isToolbar:!0}),Ei={left:Hs,center:Gs,right:Us,"space-between":$s,stretch:Ws};const Ti=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:r,isToolbar:s}){const i=e=>{n(e===o?void 0:e)},l=o?Ei[o]:Ei.left,a=[{name:"left",icon:Hs,title:(0,C.__)("Justify items left"),isActive:"left"===o,onClick:()=>i("left")},{name:"center",icon:Gs,title:(0,C.__)("Justify items center"),isActive:"center"===o,onClick:()=>i("center")},{name:"right",icon:Us,title:(0,C.__)("Justify items right"),isActive:"right"===o,onClick:()=>i("right")},{name:"space-between",icon:$s,title:(0,C.__)("Space between items"),isActive:"space-between"===o,onClick:()=>i("space-between")},{name:"stretch",icon:Ws,title:(0,C.__)("Stretch items"),isActive:"stretch"===o,onClick:()=>i("stretch")}],c=s?Ns.ToolbarGroup:Ns.ToolbarDropdownMenu,u=s?{isCollapsed:t}:{};return(0,U.jsx)(c,{icon:l,popoverProps:r,label:(0,C.__)("Change items justification"),controls:a.filter((t=>e.includes(t.name))),...u})},Mi=e=>(0,U.jsx)(Ti,{...e,isToolbar:!1}),Pi=e=>(0,U.jsx)(Ti,{...e,isToolbar:!0}),Ri={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Ni={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},Ai={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},Li=["wrap","nowrap"],Oi={name:"flex",label:(0,C.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:o=!0}=n;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Ns.Flex,{children:[(0,U.jsx)(Ns.FlexItem,{children:(0,U.jsx)(Vi,{layout:e,onChange:t})}),(0,U.jsx)(Ns.FlexItem,{children:o&&(0,U.jsx)(Hi,{layout:e,onChange:t})})]}),(0,U.jsx)(Fi,{layout:e,onChange:t})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){if(n?.allowSwitching)return null;const{allowVerticalAlignment:o=!0}=n;return(0,U.jsxs)(Fs,{group:"block",__experimentalShareWithChildBlocks:!0,children:[(0,U.jsx)(Vi,{layout:e,onChange:t,isToolbar:!0}),o&&(0,U.jsx)(Di,{layout:e,onChange:t,isToolbar:!0})]})},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:s=qs}){const{orientation:i="horizontal"}=t,l=n?.spacing?.blockGap&&!Es(o,"spacing","blockGap")?vi(n?.spacing?.blockGap,"0.5em"):void 0,a=Ri[t.justifyContent],c=Li.includes(t.flexWrap)?t.flexWrap:"wrap",u=Ai[t.verticalAlignment],d=Ni[t.justifyContent]||Ni.left;let p="";const h=[];return c&&"wrap"!==c&&h.push(`flex-wrap: ${c}`),"horizontal"===i?(u&&h.push(`align-items: ${u}`),a&&h.push(`justify-content: ${a}`)):(u&&h.push(`justify-content: ${u}`),h.push("flex-direction: column"),h.push(`align-items: ${d}`)),h.length&&(p=`${Ys(e)} {\n\t\t\t\t${h.join("; ")};\n\t\t\t}`),r&&l&&(p+=Xs(e,s,"flex",l)),p},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Di({layout:e,onChange:t,isToolbar:n=!1}){const{orientation:o="horizontal"}=e,r="horizontal"===o?Ai.center:Ai.top,{verticalAlignment:s=r}=e,i=n=>{t({...e,verticalAlignment:n})};if(n)return(0,U.jsx)(Ii,{onChange:i,value:s,controls:"horizontal"===o?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const l=[{value:"flex-start",label:(0,C.__)("Align items top")},{value:"center",label:(0,C.__)("Align items center")},{value:"flex-end",label:(0,C.__)("Align items bottom")}];return(0,U.jsxs)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control",children:[(0,U.jsx)("legend",{children:(0,C.__)("Vertical alignment")}),(0,U.jsx)("div",{children:l.map(((e,t,n)=>(0,U.jsx)(Ns.Button,{label:n,icon:t,isPressed:s===e,onClick:()=>i(e)},e)))})]})}const zi={placement:"bottom-start"};function Vi({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:o="left",orientation:r="horizontal"}=e,s=n=>{t({...e,justifyContent:n})},i=["left","center","right"];if("horizontal"===r?i.push("space-between"):i.push("stretch"),n)return(0,U.jsx)(Mi,{allowedControls:i,value:o,onChange:s,popoverProps:zi});const l=[{value:"left",icon:Hs,label:(0,C.__)("Justify items left")},{value:"center",icon:Gs,label:(0,C.__)("Justify items center")},{value:"right",icon:Us,label:(0,C.__)("Justify items right")}];return"horizontal"===r?l.push({value:"space-between",icon:$s,label:(0,C.__)("Space between items")}):l.push({value:"stretch",icon:Ws,label:(0,C.__)("Stretch items")}),(0,U.jsx)(Ns.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Justification"),value:o,onChange:s,className:"block-editor-hooks__flex-layout-justification-controls",children:l.map((({value:e,icon:t,label:n})=>(0,U.jsx)(Ns.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:n},e)))})}function Fi({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,U.jsx)(Ns.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function Hi({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:o,justifyContent:r}=e;return(0,U.jsxs)(Ns.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,C.__)("Orientation"),value:n,onChange:n=>{let s=o,i=r;return"horizontal"===n?("space-between"===o&&(s="center"),"stretch"===r&&(i="left")):("stretch"===o&&(s="top"),"space-between"===r&&(i="left")),t({...e,orientation:n,verticalAlignment:s,justifyContent:i})},children:[(0,U.jsx)(Ns.__experimentalToggleGroupControlOptionIcon,{icon:Ks,value:"horizontal",label:(0,C.__)("Horizontal")}),(0,U.jsx)(Ns.__experimentalToggleGroupControlOptionIcon,{icon:Zs,value:"vertical",label:(0,C.__)("Vertical")})]})}const Gi={name:"default",label:(0,C.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:o,layoutDefinitions:r=qs}){const s=vi(t?.spacing?.blockGap);let i="";Es(n,"spacing","blockGap")||(s?.top?i=vi(s?.top):"string"==typeof s&&(i=vi(s)));let l="";return o&&i&&(l+=Xs(e,r,"default",i)),l},getOrientation:()=>"vertical",getAlignments(e,t){const n=Qs(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const o=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:r}=e;t&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:n.wide})}return o.unshift({name:"none",info:n.none}),o}};const Ui=(0,a.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,a.cloneElement)(e,{width:t,height:t,...n,ref:o})})),$i=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"})}),Wi=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z"})}),Ki=window.wp.styleEngine,Zi={name:"constrained",label:(0,C.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:o,contentSize:r,justifyContent:s="center"}=e,{allowJustification:i=!0,allowCustomContentAndWideSize:l=!0}=n,a=[{value:"left",icon:Hs,label:(0,C.__)("Justify items left")},{value:"center",icon:Gs,label:(0,C.__)("Justify items center")},{value:"right",icon:Us,label:(0,C.__)("Justify items right")}],[c]=Kr("spacing.units"),u=(0,Ns.__experimentalUseCustomUnits)({availableUnits:c||["%","px","em","rem","vw"]});return(0,U.jsxs)(U.Fragment,{children:[l&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"block-editor-hooks__layout-controls",children:[(0,U.jsxs)("div",{className:"block-editor-hooks__layout-controls-unit",children:[(0,U.jsx)(Ns.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,C.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:u}),(0,U.jsx)(Ui,{icon:$i})]}),(0,U.jsxs)("div",{className:"block-editor-hooks__layout-controls-unit",children:[(0,U.jsx)(Ns.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,C.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:u}),(0,U.jsx)(Ui,{icon:Wi})]})]}),(0,U.jsx)("p",{className:"block-editor-hooks__layout-controls-helptext",children:(0,C.__)("Customize the width for all elements that are assigned to the center or wide columns.")})]}),i&&(0,U.jsx)(Ns.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Justification"),value:s,onChange:n=>{t({...e,justifyContent:n})},children:a.map((({value:e,icon:t,label:n})=>(0,U.jsx)(Ns.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:n},e)))})]})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:s=qs}){const{contentSize:i,wideSize:l,justifyContent:a}=t,c=vi(n?.spacing?.blockGap);let u="";Es(o,"spacing","blockGap")||(c?.top?u=vi(c?.top):"string"==typeof c&&(u=vi(c)));const d="left"===a?"0 !important":"auto !important",p="right"===a?"0 !important":"auto !important";let h=i||l?`\n\t\t\t\t\t${Ys(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:l};\n\t\t\t\t\t\tmargin-left: ${d};\n\t\t\t\t\t\tmargin-right: ${p};\n\t\t\t\t\t}\n\t\t\t\t\t${Ys(e,"> .alignwide")}  {\n\t\t\t\t\t\tmax-width: ${null!=l?l:i};\n\t\t\t\t\t}\n\t\t\t\t\t${Ys(e,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";if("left"===a?h+=`${Ys(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===a&&(h+=`${Ys(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${p}; }`),n?.spacing?.padding){(0,Ki.getCSSRules)(n).forEach((t=>{if("paddingRight"===t.key){const n="0"===t.value?"0px":t.value;h+=`\n\t\t\t\t\t${Ys(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${n} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`}else if("paddingLeft"===t.key){const n="0"===t.value?"0px":t.value;h+=`\n\t\t\t\t\t${Ys(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${n} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`}}))}return r&&u&&(h+=Xs(e,s,"constrained",u)),h},getOrientation:()=>"vertical",getAlignments(e){const t=Qs(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},qi=(0,a.createContext)({refsMap:(0,u.observableMap)()});function Yi({children:e}){const t=(0,a.useMemo)((()=>({refsMap:(0,u.observableMap)()})),[]);return(0,U.jsx)(qi.Provider,{value:t,children:e})}function Xi(e){const{refsMap:t}=(0,a.useContext)(qi);return(0,u.useRefEffect)((n=>(t.set(e,n),()=>t.delete(e))),[e])}function Qi(e){const{refsMap:t}=(0,a.useContext)(qi),n=(0,a.useRef)();return n.current=e,(0,a.useMemo)((()=>({get current(){var e;return null!==(e=t.get(n.current))&&void 0!==e?e:null}})),[t])}function Ji(e){const{refsMap:t}=(0,a.useContext)(qi),[n,o]=(0,a.useState)(null);return(0,a.useLayoutEffect)((()=>(o(t.get(e)),t.subscribe(e,(()=>o(t.get(e)))))),[t,e]),n}const el=function(e){return(0,u.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])},tl=Number.MAX_SAFE_INTEGER;const nl=(0,a.forwardRef)((function({clientId:e,bottomClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,shift:s=!0,...i},l){const c=Ji(e),d=Ji(null!=t?t:e),p=(0,u.useMergeRefs)([l,el(r)]),[h,g]=(0,a.useReducer)((e=>(e+1)%tl),0);(0,a.useLayoutEffect)((()=>{if(!c)return;const e=new window.MutationObserver(g);return e.observe(c,{attributes:!0}),()=>{e.disconnect()}}),[c]);const m=(0,a.useMemo)((()=>{if(!(h<0||!c||t&&!d))return{getBoundingClientRect(){var e,t,n,o;const r=c.getBoundingClientRect(),s=d?.getBoundingClientRect(),i=Math.min(r.left,null!==(e=s?.left)&&void 0!==e?e:1/0),l=Math.min(r.top,null!==(t=s?.top)&&void 0!==t?t:1/0),a=Math.max(r.right,null!==(n=s.right)&&void 0!==n?n:-1/0)-i,u=Math.max(r.bottom,null!==(o=s.bottom)&&void 0!==o?o:-1/0)-l;return new window.DOMRect(i,l,a,u)},contextElement:c}}),[t,d,c,h]);return!c||t&&!d?null:(0,U.jsx)(Ns.Popover,{ref:p,animate:!1,focusOnMount:!1,anchor:m,__unstableSlotName:o,inline:!o,placement:"top-start",resize:!1,flip:!1,shift:s,...i,className:Bs("block-editor-block-popover",i.className),variant:"unstyled",children:n})})),ol=(0,a.forwardRef)((({clientId:e,bottomClientId:t,children:n,...o},r)=>(0,U.jsx)(nl,{...o,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:r,children:n})));function rl({selectedElement:e,additionalStyles:t={},children:n}){const[o,r]=(0,a.useState)(e.offsetWidth),[s,i]=(0,a.useState)(e.offsetHeight);(0,a.useEffect)((()=>{const t=new window.ResizeObserver((()=>{r(e.offsetWidth),i(e.offsetHeight)}));return t.observe(e,{box:"border-box"}),()=>t.disconnect()}),[e]);const l=(0,a.useMemo)((()=>({position:"absolute",width:o,height:s,...t})),[o,s,t]);return(0,U.jsx)("div",{style:l,children:n})}const sl=(0,a.forwardRef)((function({clientId:e,bottomClientId:t,children:n,shift:o=!1,additionalStyles:r,...s},i){var l;null!==(l=t)&&void 0!==l||(t=e);const a=Ji(e);return(0,U.jsx)(nl,{ref:i,clientId:e,bottomClientId:t,shift:o,...s,children:a&&e===t?(0,U.jsx)(rl,{selectedElement:a,additionalStyles:r,children:n}):n})}));function il(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function ll({clientId:e,contentRef:t}){const n=(0,c.useSelect)((e=>e($r).getSettings().isDistractionFree),[]),o=Ji(e);return n||!o?null:(0,U.jsx)(sl,{className:"block-editor-grid-visualizer",clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,U.jsx)(al,{ref:t,blockElement:o})})}const al=(0,a.forwardRef)((({blockElement:e},t)=>{const[n,o]=(0,a.useState)((()=>cl(e)));return(0,a.useEffect)((()=>{const t=[];for(const n of[e,...e.children]){const r=new window.ResizeObserver((()=>{o(cl(e))}));r.observe(n),t.push(r)}return()=>{for(const e of t)e.disconnect()}}),[e]),(0,U.jsx)("div",{ref:t,className:"block-editor-grid-visualizer__grid",style:n.style,children:Array.from({length:n.numItems},((e,t)=>(0,U.jsx)("div",{className:"block-editor-grid-visualizer__item",style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${n.currentColor} 20%, #0000)`}},t)))})}));function cl(e){const t=il(e,"grid-template-columns"),n=il(e,"grid-template-rows");return{numItems:t.split(" ").length*n.split(" ").length,currentColor:il(e,"color"),style:{gridTemplateColumns:t,gridTemplateRows:n,gap:il(e,"gap"),padding:il(e,"padding")}}}const ul={px:600,"%":100,vw:100,vh:100,em:38,rem:38,svw:100,lvw:100,dvw:100,svh:100,lvh:100,dvh:100,vi:100,svi:100,lvi:100,dvi:100,vb:100,svb:100,lvb:100,dvb:100,vmin:100,svmin:100,lvmin:100,dvmin:100,vmax:100,svmax:100,lvmax:100,dvmax:100},dl=[{value:"px",label:"px",default:0},{value:"rem",label:"rem",default:0},{value:"em",label:"em",default:0}],pl={name:"grid",label:(0,C.__)("Grid"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowSizingOnChildren:o=!1}=n;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ml,{layout:e,onChange:t}),e?.columnCount?(0,U.jsx)(gl,{layout:e,onChange:t,allowSizingOnChildren:o}):(0,U.jsx)(hl,{layout:e,onChange:t})]})},toolBarControls:function({clientId:e}){return(0,U.jsx)(ll,{clientId:e})},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:s=qs}){const{minimumColumnWidth:i="12rem",columnCount:l=null,rowCount:a=null}=t,c=n?.spacing?.blockGap&&!Es(o,"spacing","blockGap")?vi(n?.spacing?.blockGap,"0.5em"):void 0;let u="";const d=[];return l?(d.push(`grid-template-columns: repeat(${l}, minmax(0, 1fr))`),a&&d.push(`grid-template-rows: repeat(${a}, minmax(0, 1fr))`)):i&&d.push(`grid-template-columns: repeat(auto-fill, minmax(min(${i}, 100%), 1fr))`,"container-type: inline-size"),d.length&&(u=`${Ys(e)} { ${d.join("; ")}; }`),r&&c&&(u+=Xs(e,s,"grid",c)),u},getOrientation:()=>"horizontal",getAlignments:()=>[]};function hl({layout:e,onChange:t}){const{minimumColumnWidth:n="12rem"}=e,[o,r]=(0,Ns.__experimentalParseQuantityAndUnitFromRawValue)(n);return(0,U.jsxs)("fieldset",{children:[(0,U.jsx)(Ns.BaseControl.VisualLabel,{as:"legend",children:(0,C.__)("Minimum column width")}),(0,U.jsxs)(Ns.Flex,{gap:4,children:[(0,U.jsx)(Ns.FlexItem,{isBlock:!0,children:(0,U.jsx)(Ns.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:n})},onUnitChange:n=>{let s;["em","rem"].includes(n)&&"px"===r?s=(o/16).toFixed(2)+n:["em","rem"].includes(r)&&"px"===n&&(s=Math.round(16*o)+n),t({...e,minimumColumnWidth:s})},value:n,units:dl,min:0,label:(0,C.__)("Minimum column width"),hideLabelFromVision:!0})}),(0,U.jsx)(Ns.FlexItem,{isBlock:!0,children:(0,U.jsx)(Ns.RangeControl,{onChange:n=>{t({...e,minimumColumnWidth:[n,r].join("")})},value:o,min:0,max:ul[r]||600,withInputField:!1,label:(0,C.__)("Minimum column width"),hideLabelFromVision:!0})})]})]})}function gl({layout:e,onChange:t,allowSizingOnChildren:n}){const{columnCount:o=3,rowCount:r}=e;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("fieldset",{children:[(0,U.jsx)(Ns.BaseControl.VisualLabel,{as:"legend",children:(0,C.__)("Columns")}),(0,U.jsxs)(Ns.Flex,{gap:4,children:[(0,U.jsx)(Ns.FlexItem,{isBlock:!0,children:(0,U.jsx)(Ns.__experimentalNumberControl,{size:"__unstable-large",onChange:n=>{const o=""!==n?n:"1";t({...e,columnCount:o})},value:o,min:1,label:(0,C.__)("Columns"),hideLabelFromVision:!0})}),(0,U.jsx)(Ns.FlexItem,{isBlock:!0,children:(0,U.jsx)(Ns.RangeControl,{value:parseInt(o,10),onChange:n=>t({...e,columnCount:n}),min:1,max:16,withInputField:!1,label:(0,C.__)("Columns"),hideLabelFromVision:!0})})]})]}),n&&window.__experimentalEnableGridInteractivity&&(0,U.jsxs)("fieldset",{children:[(0,U.jsx)(Ns.BaseControl.VisualLabel,{as:"legend",children:(0,C.__)("Rows")}),(0,U.jsxs)(Ns.Flex,{gap:4,children:[(0,U.jsx)(Ns.FlexItem,{isBlock:!0,children:(0,U.jsx)(Ns.__experimentalNumberControl,{size:"__unstable-large",onChange:n=>{t({...e,rowCount:n})},value:r,min:1,label:(0,C.__)("Rows"),hideLabelFromVision:!0})}),(0,U.jsx)(Ns.FlexItem,{isBlock:!0,children:(0,U.jsx)(Ns.RangeControl,{value:parseInt(r,10),onChange:n=>t({...e,rowCount:n}),min:1,max:16,withInputField:!1,label:(0,C.__)("Rows"),hideLabelFromVision:!0})})]})]})]})}function ml({layout:e,onChange:t}){const{columnCount:n,minimumColumnWidth:o}=e,[r,s]=(0,a.useState)(n||3),[i,l]=(0,a.useState)(o||"12rem"),c=n?"manual":"auto";return(0,U.jsxs)(Ns.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Type"),value:c,onChange:a=>{"manual"===a?l(o||"12rem"):s(n||3),t({...e,columnCount:"manual"===a?r:null,minimumColumnWidth:"auto"===a?i:null})},isBlock:!0,children:[(0,U.jsx)(Ns.__experimentalToggleGroupControlOption,{value:"auto",label:(0,C.__)("Auto")},"auto"),(0,U.jsx)(Ns.__experimentalToggleGroupControlOption,{value:"manual",label:(0,C.__)("Manual")},"manual")]})}const fl=[Gi,Oi,Zi,pl];function bl(e="default"){return fl.find((t=>t.name===e))}const vl={type:"default"},kl=(0,a.createContext)(vl),_l=kl.Provider;function xl(){return(0,a.useContext)(kl)}const yl=[],Sl=["none","left","center","right","wide","full"],wl=["wide","full"];function Cl(e=Sl){e.includes("none")||(e=["none",...e]);const t=1===e.length&&"none"===e[0],[n,o,r]=(0,c.useSelect)((e=>{var n;if(t)return[!1,!1,!1];const o=e($r).getSettings();return[null!==(n=o.alignWide)&&void 0!==n&&n,o.supportsLayout,o.__unstableIsBlockBasedTheme]}),[t]),s=xl();if(t)return yl;const i=bl(s?.type);if(o){const t=i.getAlignments(s,r).filter((t=>e.includes(t.name)));return 1===t.length&&"none"===t[0].name?yl:t}if("default"!==i.name&&"constrained"!==i.name)return yl;const l=e.filter((e=>s.alignments?s.alignments.includes(e):!(!n&&wl.includes(e))&&Sl.includes(e))).map((e=>({name:e})));return 1===l.length&&"none"===l[0].name?yl:l}const Bl=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"})}),Il=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"})}),jl=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z"})}),El=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z"})}),Tl={none:{icon:Bl,title:(0,C._x)("None","Alignment option")},left:{icon:Il,title:(0,C.__)("Align left")},center:{icon:$i,title:(0,C.__)("Align center")},right:{icon:jl,title:(0,C.__)("Align right")},wide:{icon:Wi,title:(0,C.__)("Wide width")},full:{icon:El,title:(0,C.__)("Full width")}};const Ml=function({value:e,onChange:t,controls:n,isToolbar:o,isCollapsed:r=!0}){const s=Cl(n);if(!!!s.length)return null;function i(n){t([e,"none"].includes(n)?void 0:n)}const l=Tl[e],a=Tl.none,c=o?Ns.ToolbarGroup:Ns.ToolbarDropdownMenu,u={icon:l?l.icon:a.icon,label:(0,C.__)("Align")},d=o?{isCollapsed:r,controls:s.map((({name:t})=>({...Tl[t],isActive:e===t||!e&&"none"===t,role:r?"menuitemradio":void 0,onClick:()=>i(t)})))}:{toggleProps:{describedBy:(0,C.__)("Change alignment")},children:({onClose:t})=>(0,U.jsx)(U.Fragment,{children:(0,U.jsx)(Ns.MenuGroup,{className:"block-editor-block-alignment-control__menu-group",children:s.map((({name:n,info:o})=>{const{icon:r,title:s}=Tl[n],l=n===e||!e&&"none"===n;return(0,U.jsx)(Ns.MenuItem,{icon:r,iconPosition:"left",className:Bs("components-dropdown-menu__menu-item",{"is-active":l}),isSelected:l,onClick:()=>{i(n),t()},role:"menuitemradio",info:o,children:s},n)}))})})};return(0,U.jsx)(c,{...u,...d})},Pl=e=>(0,U.jsx)(Ml,{...e,isToolbar:!1}),Rl=e=>(0,U.jsx)(Ml,{...e,isToolbar:!0});function Nl(e){const t=_(),{clientId:n=""}=t,{setBlockEditingMode:o,unsetBlockEditingMode:r}=(0,c.useDispatch)($r),s=(0,c.useSelect)((e=>n?null:e($r).getBlockEditingMode()),[n]);return(0,a.useEffect)((()=>(e&&o(n,e),()=>{e&&r(n)})),[n,e,o,r]),n?t[g]:s}const Al=["left","center","right","wide","full"],Ll=["wide","full"];function Ol(e,t=!0,n=!0){let o;return o=Array.isArray(e)?Al.filter((t=>e.includes(t))):!0===e?[...Al]:[],!n||!0===e&&!t?o.filter((e=>!Ll.includes(e))):o}const Dl={shareWithChildBlocks:!0,edit:function({name:e,align:t,setAttributes:n}){const o=Cl(Ol((0,l.getBlockSupport)(e,"align"),(0,l.hasBlockSupport)(e,"alignWide",!0))).map((({name:e})=>e)),r=Nl();return o.length&&"default"===r?(0,U.jsx)(Fs,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,U.jsx)(Pl,{value:t,onChange:t=>{if(!t){const n=(0,l.getBlockType)(e),o=n?.attributes?.align?.default;o&&(t="")}n({align:t})},controls:o})}):null},useBlockProps:function({name:e,align:t}){const n=Ol((0,l.getBlockSupport)(e,"align"),(0,l.hasBlockSupport)(e,"alignWide",!0));if(Cl(n).some((e=>e.name===t)))return{"data-align":t};return{}},addSaveProps:function(e,t,n){const{align:o}=n,r=(0,l.getBlockSupport)(t,"align"),s=(0,l.hasBlockSupport)(t,"alignWide",!0),i=Ol(r,s).includes(o);i&&(e.className=Bs(`align${o}`,e.className));return e},attributeKeys:["align"],hasSupport:e=>(0,l.hasBlockSupport)(e,"align",!1)};(0,d.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.align)&&void 0!==t?t:{})||(0,l.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Al,""]}}),e}));const zl=(0,Ns.createSlotFill)("InspectorControls"),Vl=(0,Ns.createSlotFill)("InspectorAdvancedControls"),Fl=(0,Ns.createSlotFill)("InspectorControlsBackground"),Hl=(0,Ns.createSlotFill)("InspectorControlsBorder"),Gl=(0,Ns.createSlotFill)("InspectorControlsColor"),Ul=(0,Ns.createSlotFill)("InspectorControlsFilter"),$l=(0,Ns.createSlotFill)("InspectorControlsDimensions"),Wl=(0,Ns.createSlotFill)("InspectorControlsPosition"),Kl=(0,Ns.createSlotFill)("InspectorControlsTypography"),Zl=(0,Ns.createSlotFill)("InspectorControlsListView"),ql=(0,Ns.createSlotFill)("InspectorControlsStyles"),Yl={default:zl,advanced:Vl,background:Fl,border:Hl,color:Gl,dimensions:$l,effects:(0,Ns.createSlotFill)("InspectorControlsEffects"),filter:Ul,list:Zl,position:Wl,settings:zl,styles:ql,typography:Kl};function Xl({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:o}){n&&(y()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const r=_(),s=Yl[t]?.Fill;return s&&r[p]?(0,U.jsx)(Ns.__experimentalStyleProvider,{document,children:(0,U.jsx)(s,{children:t=>(0,U.jsx)(Jl,{fillProps:t,children:e,resetAllFilter:o})})}):null}function Ql({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:o}=(0,a.useContext)(Ns.__experimentalToolsPanelContext);return(0,a.useEffect)((()=>{if(e&&n&&o)return n(e),()=>{o(e)}}),[e,n,o]),t}function Jl({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:o=[]}=n,r=(0,U.jsx)(Ql,{resetAllFilter:t,children:e});return o.reduce(((e,[t,n])=>(0,U.jsx)(t,{...n,children:e})),r)}function ea({children:e,group:t,label:n}){const{updateBlockAttributes:o}=(0,c.useDispatch)($r),{getBlockAttributes:r,getMultiSelectedBlockClientIds:s,getSelectedBlockClientId:i,hasMultiSelection:l}=(0,c.useSelect)($r),u=us(),d=i(),p=(0,a.useCallback)(((e=[])=>{const t={},n=l()?s():[d];n.forEach((n=>{const{style:o}=r(n);let s={style:o};e.forEach((e=>{s={...s,...e(s)}})),s={...s,style:Is(s.style)},t[n]=s})),o(n,t,!0)}),[r,s,l,d,o]);return(0,U.jsx)(Ns.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:n,resetAll:p,panelId:d,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:u,children:e},d)}function ta({Slot:e,fillProps:t,...n}){const o=(0,a.useContext)(Ns.__experimentalToolsPanelContext),r=(0,a.useMemo)((()=>{var e;return{...null!=t?t:{},forwardedContext:[...null!==(e=t?.forwardedContext)&&void 0!==e?e:[],[Ns.__experimentalToolsPanelContext.Provider,{value:o}]]}}),[o,t]);return(0,U.jsx)(e,{...n,fillProps:r,bubblesVirtually:!0})}function na({__experimentalGroup:e,group:t="default",label:n,fillProps:o,...r}){e&&(y()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const s=Yl[t]?.Slot,i=(0,Ns.__experimentalUseSlotFills)(s?.__unstableName),l=(0,a.useContext)(Ns.__unstableMotionContext),c=(0,a.useMemo)((()=>{var e;return{...null!=o?o:{},forwardedContext:[...null!==(e=o?.forwardedContext)&&void 0!==e?e:[],[Ns.__unstableMotionContext.Provider,{value:l}]]}}),[l,o]);return s&&i?.length?n?(0,U.jsx)(ea,{group:t,label:n,children:(0,U.jsx)(ta,{...r,fillProps:c,Slot:s})}):(0,U.jsx)(s,{...r,fillProps:c,bubblesVirtually:!0}):null}const oa=Xl;oa.Slot=na;const ra=e=>(0,U.jsx)(Xl,{...e,group:"advanced"});ra.Slot=e=>(0,U.jsx)(na,{...e,group:"advanced"}),ra.slotName="InspectorAdvancedControls";const sa=oa,ia=window.wp.url,la=window.wp.dom,aa=window.wp.blob,ca=window.wp.keycodes,ua=(0,U.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,U.jsx)(G.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,U.jsx)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"})]}),da=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})}),pa=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})}),ha=(0,Ns.withFilters)("editor.MediaUpload")((()=>null));const ga=function({fallback:e=null,children:t}){const n=(0,c.useSelect)((e=>{const{getSettings:t}=e($r);return!!t().mediaUpload}),[]);return n?t:e},ma=window.wp.isShallowEqual;var fa=n.n(ma);const ba=window.wp.preferences,va=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.Path,{d:"m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734Z"})}),ka=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),_a=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})});const xa=function e({children:t,settingsOpen:n,setSettingsOpen:o}){const r=(0,u.useReducedMotion)(),s=r?a.Fragment:Ns.__unstableAnimatePresence,i=r?"div":Ns.__unstableMotion.div,l=`link-control-settings-drawer-${(0,u.useInstanceId)(e)}`;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.Button,{className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>o(!n),icon:(0,C.isRTL)()?ka:_a,"aria-controls":l,children:(0,C._x)("Advanced","Additional link settings")}),(0,U.jsx)(s,{children:n&&(0,U.jsx)(i,{className:"block-editor-link-control__drawer",hidden:!n,id:l,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1},children:(0,U.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:t})})})]})};var ya=n(1609);function Sa(e){return"function"==typeof e}class wa extends a.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,a.createRef)(),this.inputRef=(0,a.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&this.suggestionNodes[n].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.value===o||this.props.disableSuggestions||(o?.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){const{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:n}=this.props;if(!t)return;const o=!e?.length;if(e=e.trim(),!o&&(e.length<2||!n&&(0,ia.isURL)(e)))return this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});this.setState({selectedSuggestion:null,loading:!0});const r=t(e,{isInitialSuggestions:o});r.then((t=>{this.suggestionsRequest===r&&(this.setState({suggestions:t,suggestionsValue:e,loading:!1,showSuggestions:!!t.length}),t.length?this.props.debouncedSpeak((0,C.sprintf)((0,C._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length),"assertive"):this.props.debouncedSpeak((0,C.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===r&&this.setState({loading:!1})})).finally((()=>{this.suggestionsRequest===r&&(this.suggestionsRequest=null)})),this.suggestionsRequest=r}onChange(e){this.props.onChange(e.target.value)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||e&&e.length||null!==this.suggestionsRequest||this.updateSuggestions(n)}onKeyDown(e){this.props.onKeyDown?.(e);const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case ca.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case ca.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case ca.ENTER:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const s=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case ca.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case ca.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case ca.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(s),this.props.speak((0,C.__)("Link selected.")));break;case ca.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(s),this.props.onSubmit&&this.props.onSubmit(s,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:n,__experimentalShowInitialSuggestions:o=!1},{showSuggestions:r}){let s=r;const i=e&&e.length;return o||i||(s=!1),!0===n&&(s=!1),{showSuggestions:s,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,U.jsxs)(U.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){const{__nextHasNoMarginBottom:e=!1,label:t=null,className:n,isFullWidth:o,instanceId:r,placeholder:s=(0,C.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:l="",hideLabelFromVision:a=!1}=this.props,{loading:c,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:p,suggestionOptionIdPrefix:h}=this.state,g=`url-input-control-${r}`,m={id:g,label:t,className:Bs("block-editor-url-input",n,{"is-full-width":o}),hideLabelFromVision:a},f={id:g,value:l,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:s,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,C.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":p,"aria-activedescendant":null!==d?`${h}-${d}`:void 0,ref:this.inputRef};return i?i(m,f,c):(e||y()("Bottom margin styles for wp.blockEditor.URLInput",{since:"6.2",version:"6.5",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,U.jsxs)(Ns.BaseControl,{__nextHasNoMarginBottom:e,...m,children:[(0,U.jsx)("input",{...f}),c&&(0,U.jsx)(Ns.Spinner,{})]}))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:o,suggestionsValue:r,selectedSuggestion:s,suggestionsListboxId:i,suggestionOptionIdPrefix:l,loading:a}=this.state;if(!n||0===o.length)return null;const c={id:i,ref:this.autocompleteRef,role:"listbox"},u=(e,t)=>({role:"option",tabIndex:"-1",id:`${l}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===s||void 0});return Sa(t)?t({suggestions:o,selectedSuggestion:s,suggestionsListProps:c,buildSuggestionItemProps:u,isLoading:a,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!r?.length,currentInputValue:r}):(0,U.jsx)(Ns.Popover,{placement:"bottom",focusOnMount:!1,children:(0,U.jsx)("div",{...c,className:Bs("block-editor-url-input__suggestions",`${e}__suggestions`),children:o.map(((e,t)=>(0,ya.createElement)(Ns.Button,{...u(0,t),key:e.id,className:Bs("block-editor-url-input__suggestion",{"is-selected":t===s}),onClick:()=>this.handleOnClick(e)},e.title)))})})}}const Ca=(0,u.compose)(u.withSafeTimeout,Ns.withSpokenMessages,u.withInstanceId,(0,c.withSelect)(((e,t)=>{if(Sa(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e($r);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(wa),Ba=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),Ia=({searchTerm:e,onClick:t,itemProps:n,buttonText:o})=>{if(!e)return null;let r;return r=o?"function"==typeof o?o(e):o:(0,a.createInterpolateElement)((0,C.sprintf)((0,C.__)("Create: <mark>%s</mark>"),e),{mark:(0,U.jsx)("mark",{})}),(0,U.jsx)(Ns.MenuItem,{...n,iconPosition:"left",icon:Ba,className:"block-editor-link-control__search-item",onClick:t,children:r})},ja=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.Path,{d:"M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z"})}),Ea=(0,U.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,U.jsx)(G.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,U.jsx)(G.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]}),Ta=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),Ma=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"})}),Pa=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z"})}),Ra=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"})}),Na=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}),Aa=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})}),La={post:ja,page:Ea,post_tag:Ta,category:Ma,attachment:Pa};function Oa({isURL:e,suggestion:t}){let n=null;return e?n=Ra:t.type in La&&(n=La[t.type],"page"===t.type&&(t.isFrontPage&&(n=Na),t.isBlogHome&&(n=Aa))),n?(0,U.jsx)(Ui,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function Da(e){const t=e?.trim();return t?.length?e?.replace(/^\/?/,"/"):e}function za(e){const t=e?.trim();return t?.length?e?.replace(/\/$/,""):e}function Va(e){return e.isFrontPage?"front page":e.isBlogHome?"blog home":"post_tag"===e.type?"tag":e.type}const Fa=({itemProps:e,suggestion:t,searchTerm:n,onClick:o,isURL:r=!1,shouldShowType:s=!1})=>{const i=r?(0,C.__)("Press ENTER to add this link"):(l=t.url)?(0,u.pipe)(ia.safeDecodeURI,ia.getPath,(e=>t=>null==t||t!=t?e:t)(""),((e,...t)=>(...n)=>e(...n,...t))(ia.filterURLForDisplay,24),za,Da)(l):l;var l;return(0,U.jsx)(Ns.MenuItem,{...e,info:i,iconPosition:"left",icon:(0,U.jsx)(Oa,{suggestion:t,isURL:r}),onClick:o,shortcut:s&&Va(t),className:"block-editor-link-control__search-item",children:(0,U.jsx)(Ns.TextHighlight,{text:(0,la.__unstableStripHTML)(t.title),highlight:n})})},Ha="__CREATE__",Ga="link",Ua="mailto",$a="internal",Wa=[Ga,Ua,"tel",$a],Ka=[{id:"opensInNewTab",title:(0,C.__)("Open in new tab")}];function Za({instanceId:e,withCreateSuggestion:t,currentInputValue:n,handleSuggestionClick:o,suggestionsListProps:r,buildSuggestionItemProps:s,suggestions:i,selectedSuggestion:l,isLoading:a,isInitialSuggestions:c,createSuggestionButtonText:u,suggestionsQuery:d}){const p=Bs("block-editor-link-control__search-results",{"is-loading":a}),h=1===i.length&&Wa.includes(i[0].type),g=t&&!h&&!c,m=!d?.type,f=`block-editor-link-control-search-results-label-${e}`,b=c?(0,C.__)("Suggestions"):(0,C.sprintf)((0,C.__)('Search results for "%s"'),n),v=(0,U.jsx)(Ns.VisuallyHidden,{id:f,children:b});return(0,U.jsxs)("div",{className:"block-editor-link-control__search-results-wrapper",children:[v,(0,U.jsx)("div",{...r,className:p,"aria-labelledby":f,children:(0,U.jsx)(Ns.MenuGroup,{children:i.map(((e,t)=>g&&Ha===e.type?(0,U.jsx)(Ia,{searchTerm:n,buttonText:u,onClick:()=>o(e),itemProps:s(e,t),isSelected:t===l},e.type):Ha===e.type?null:(0,U.jsx)(Fa,{itemProps:s(e,t),suggestion:e,index:t,onClick:()=>{o(e)},isSelected:t===l,isURL:Wa.includes(e.type),searchTerm:n,shouldShowType:m,isFrontPage:e?.isFrontPage,isBlogHome:e?.isBlogHome},`${e.id}-${e.type}`)))})})]})}function qa(e){if(e.includes(" "))return!1;const t=(0,ia.getProtocol)(e),n=(0,ia.isValidProtocol)(t),o=function(e,t=6){const n=e.split(/[?#]/)[0];return new RegExp(`(?<=\\S)\\.(?:[a-zA-Z_]{2,${t}})(?:\\/|$)`).test(n)}(e),r=e?.startsWith("www."),s=e?.startsWith("#")&&(0,ia.isValidFragment)(e);return n||r||s||o}const Ya=()=>Promise.resolve([]),Xa=e=>{let t=Ga;const n=(0,ia.getProtocol)(e)||"";return n.includes("mailto")&&(t=Ua),n.includes("tel")&&(t="tel"),e?.startsWith("#")&&(t=$a),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,ia.prependHTTP)(e):e,type:t}])};function Qa(e,t,n){const{fetchSearchSuggestions:o,pageOnFront:r,pageForPosts:s}=(0,c.useSelect)((e=>{const{getSettings:t}=e($r);return{pageOnFront:t().pageOnFront,pageForPosts:t().pageForPosts,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?Xa:Ya;return(0,a.useCallback)(((t,{isInitialSuggestions:l})=>qa(t)?i(t,{isInitialSuggestions:l}):(async(e,t,n,o,r,s)=>{const{isInitialSuggestions:i}=t,l=await n(e,t);return l.map((e=>Number(e.id)===r?(e.isFrontPage=!0,e):Number(e.id)===s?(e.isBlogHome=!0,e):e)),i||qa(e)||!o?l:l.concat({title:e,url:e,type:Ha})})(t,{...e,isInitialSuggestions:l},o,n,r,s)),[i,o,r,s,e,n])}const Ja=()=>Promise.resolve([]),ec=()=>{},tc=(0,a.forwardRef)((({value:e,children:t,currentLink:n={},className:o=null,placeholder:r=null,withCreateSuggestion:s=!1,onCreateSuggestion:i=ec,onChange:l=ec,onSelect:c=ec,showSuggestions:d=!0,renderSuggestions:p=(e=>(0,U.jsx)(Za,{...e})),fetchSuggestions:h=null,allowDirectEntry:g=!0,showInitialSuggestions:m=!1,suggestionsQuery:f={},withURLSuggestion:b=!0,createSuggestionButtonText:v,hideLabelFromVision:k=!1},_)=>{const x=Qa(f,g,s),y=d?h||x:Ja,S=(0,u.useInstanceId)(tc),[w,B]=(0,a.useState)(),I=async e=>{let t=e;if(Ha!==e.type){if(g||t&&Object.keys(t).length>=1){const{id:e,url:o,...r}=null!=n?n:{};c({...r,...t},t)}}else try{t=await i(e.title),t?.url&&c(t)}catch(e){}};return(0,U.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,U.jsx)(Ca,{disableSuggestions:n?.url===e,__nextHasNoMarginBottom:!0,label:(0,C.__)("Link"),hideLabelFromVision:k,className:o,value:e,onChange:(e,t)=>{l(e),B(t)},placeholder:null!=r?r:(0,C.__)("Search or type URL"),__experimentalRenderSuggestions:d?e=>p({...e,instanceId:S,withCreateSuggestion:s,createSuggestionButtonText:v,suggestionsQuery:f,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),I(t)}}):null,__experimentalFetchLinkSuggestions:y,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:m,onSubmit:(t,n)=>{const o=t||w;o||e?.trim()?.length?I(o||{url:e}):n.preventDefault()},ref:_}),t]})})),nc=tc,oc=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})}),rc=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),sc=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})}),ic=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"})}),{Slot:lc,Fill:ac}=(0,Ns.createSlotFill)("BlockEditorLinkControlViewer");function cc(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}const uc=function(e){const[t,n]=(0,a.useReducer)(cc,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,c.useSelect)((e=>{const{getSettings:t}=e($r);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,a.useEffect)((()=>{if(e?.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function dc({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:o=!1,onRemove:r}){const s=(0,c.useSelect)((e=>e(ba.store).get("core","showIconLabels")),[]),i=n?e?.url:null,{richData:l,isFetching:a}=uc(i),d=l&&Object.keys(l).length,p=e&&(0,ia.filterURLForDisplay)((0,ia.safeDecodeURI)(e.url),24)||"",h=!e?.url?.length,g=!h&&(0,la.__unstableStripHTML)(l?.title||e?.title||p);let m;m=l?.icon?(0,U.jsx)("img",{src:l?.icon,alt:""}):h?(0,U.jsx)(Ui,{icon:oc,size:32}):(0,U.jsx)(Ui,{icon:Ra});const{createNotice:f}=(0,c.useDispatch)(To.store),b=(0,u.useCopyToClipboard)(e.url,(()=>{f("info",(0,C.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,U.jsx)("div",{"aria-label":(0,C.__)("Currently selected"),className:Bs("block-editor-link-control__search-item",{"is-current":!0,"is-rich":d,"is-fetching":!!a,"is-preview":!0,"is-error":h,"is-url-title":g===p}),children:(0,U.jsxs)("div",{className:"block-editor-link-control__search-item-top",children:[(0,U.jsxs)("span",{className:"block-editor-link-control__search-item-header",children:[(0,U.jsx)("span",{className:Bs("block-editor-link-control__search-item-icon",{"is-image":l?.icon}),children:m}),(0,U.jsx)("span",{className:"block-editor-link-control__search-item-details",children:h?(0,U.jsx)("span",{className:"block-editor-link-control__search-item-error-notice",children:(0,C.__)("Link is empty")}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.ExternalLink,{className:"block-editor-link-control__search-item-title",href:e.url,children:(0,U.jsx)(Ns.__experimentalTruncate,{numberOfLines:1,children:g})}),e?.url&&g!==p&&(0,U.jsx)("span",{className:"block-editor-link-control__search-item-info",children:(0,U.jsx)(Ns.__experimentalTruncate,{numberOfLines:1,children:p})})]})})]}),(0,U.jsx)(Ns.Button,{icon:rc,label:(0,C.__)("Edit link"),onClick:t,size:"compact"}),o&&(0,U.jsx)(Ns.Button,{icon:sc,label:(0,C.__)("Remove link"),onClick:r,size:"compact"}),(0,U.jsx)(Ns.Button,{icon:ic,label:(0,C.sprintf)((0,C.__)("Copy link%s"),h||s?"":": "+e.url),ref:b,__experimentalIsFocusable:!0,disabled:h,size:"compact"}),(0,U.jsx)(lc,{fillProps:e})]})})}const pc=()=>{},hc=({value:e,onChange:t=pc,settings:n})=>{if(!n||!n.length)return null;const o=n=>o=>{t({...e,[n.id]:o})},r=n.map((t=>(0,U.jsx)(Ns.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",label:t.title,onChange:o(t),checked:!!e&&!!e[t.id],help:t?.help},t.id)));return(0,U.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,U.jsx)(Ns.VisuallyHidden,{as:"legend",children:(0,C.__)("Currently selected link settings")}),r]})};const gc=e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}};var mc=n(5215),fc=n.n(mc);const bc=()=>{},vc="core/block-editor",kc="linkControlSettingsDrawer";function _c({searchInputPlaceholder:e,value:t,settings:n=Ka,onChange:o=bc,onRemove:r,onCancel:s,noDirectEntry:i=!1,showSuggestions:l=!0,showInitialSuggestions:u,forceIsEditingLink:d,createSuggestion:p,withCreateSuggestion:h,inputValue:g="",suggestionsQuery:m={},noURLSuggestion:f=!1,createSuggestionButtonText:b,hasRichPreviews:v=!1,hasTextControl:k=!1,renderControlBottom:_=null}){void 0===h&&p&&(h=!0);const[x,y]=(0,a.useState)(!1),{advancedSettingsPreference:S}=(0,c.useSelect)((e=>{var t;return{advancedSettingsPreference:null!==(t=e(ba.store).get(vc,kc))&&void 0!==t&&t}}),[]),{set:w}=(0,c.useDispatch)(ba.store),B=S||x,I=(0,a.useRef)(!0),j=(0,a.useRef)(),E=(0,a.useRef)(),T=(0,a.useRef)(!1),M=n.map((({id:e})=>e)),[P,R,N,A,L]=function(e){const[t,n]=(0,a.useState)(e||{}),[o,r]=(0,a.useState)(e);return fc()(e,o)||(r(e),n(e)),[t,n,e=>{n({...t,url:e})},e=>{n({...t,title:e})},e=>o=>{const r=Object.keys(o).reduce(((t,n)=>(e.includes(n)&&(t[n]=o[n]),t)),{});n({...t,...r})}]}(t),O=t&&!(0,ma.isShallowEqualObjects)(P,t),[D,z]=(0,a.useState)(void 0!==d?d:!t||!t.url),{createPage:V,isCreatingPage:F,errorMessage:H}=function(e){const t=(0,a.useRef)(),[n,o]=(0,a.useState)(!1),[r,s]=(0,a.useState)(null);return(0,a.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),s(null);try{return t.current=gc(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw s(e.message||(0,C.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(p);(0,a.useEffect)((()=>{void 0!==d&&z(d)}),[d]),(0,a.useEffect)((()=>{if(I.current)return;(la.focus.focusable.find(j.current)[0]||j.current).focus(),T.current=!1}),[D,F]),(0,a.useEffect)((()=>(I.current=!1,()=>{I.current=!0})),[]);const G=t?.url?.trim()?.length>0,$=()=>{T.current=!!j.current?.contains(j.current.ownerDocument.activeElement),z(!1)},W=()=>{O&&o({...t,...P,url:K}),$()},K=g||P?.url||"",Z=!K?.trim()?.length,q=r&&t&&!D&&!F,Y=D&&G,X=G&&k,Q=(D||!t)&&!F,J=!O||Z,ee=!!n?.length&&D&&G;return(0,U.jsxs)("div",{tabIndex:-1,ref:j,className:"block-editor-link-control",children:[F&&(0,U.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,U.jsx)(Ns.Spinner,{})," ",(0,C.__)("Creating"),"…"]}),Q&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:Bs({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":X,"has-actions":Y}),children:[X&&(0,U.jsx)(Ns.TextControl,{__nextHasNoMarginBottom:!0,ref:E,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,C.__)("Text"),value:P?.title,onChange:A,onKeyDown:e=>{const{keyCode:t}=e;t!==ca.ENTER||Z||(e.preventDefault(),W())},size:"__unstable-large"}),(0,U.jsx)(nc,{currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:K,withCreateSuggestion:h,onCreateSuggestion:V,onChange:N,onSelect:e=>{const t=Object.keys(e).reduce(((t,n)=>(M.includes(n)||(t[n]=e[n]),t)),{});o({...P,...t,title:P?.title||e?.title}),$()},showInitialSuggestions:u,allowDirectEntry:!i,showSuggestions:l,suggestionsQuery:m,withURLSuggestion:!f,createSuggestionButtonText:b,hideLabelFromVision:!X}),!Y&&(0,U.jsx)("div",{className:"block-editor-link-control__search-enter",children:(0,U.jsx)(Ns.Button,{onClick:J?bc:W,label:(0,C.__)("Submit"),icon:va,className:"block-editor-link-control__search-submit","aria-disabled":J})})]}),H&&(0,U.jsx)(Ns.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:H})]}),t&&!D&&!F&&(0,U.jsx)(dc,{value:t,onEditClick:()=>z(!0),hasRichPreviews:v,hasUnlinkControl:q,onRemove:()=>{r(),z(!0)}},t?.url),ee&&(0,U.jsx)("div",{className:"block-editor-link-control__tools",children:!Z&&(0,U.jsx)(xa,{settingsOpen:B,setSettingsOpen:e=>{w&&w(vc,kc,e),y(e)},children:(0,U.jsx)(hc,{value:P,settings:n,onChange:L(M)})})}),Y&&(0,U.jsxs)(Ns.__experimentalHStack,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,U.jsx)(Ns.Button,{variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),R(t),G?$():r?.(),s?.()},children:(0,C.__)("Cancel")}),(0,U.jsx)(Ns.Button,{variant:"primary",onClick:J?bc:W,className:"block-editor-link-control__search-submit","aria-disabled":J,children:(0,C.__)("Save")})]}),!F&&_&&_()]})}_c.ViewerFill=ac,_c.DEFAULT_LINK_SETTINGS=Ka;const xc=_c,yc=()=>{};let Sc=0;const wc=(0,u.compose)([(0,c.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(To.store);return{createNotice:t,removeNotice:n}})),(0,Ns.withFilters)("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:o,accept:r,onError:s,onSelect:i,onSelectURL:l,onToggleFeaturedImage:u,useFeaturedImage:d,onFilesUpload:p=yc,name:h=(0,C.__)("Replace"),createNotice:g,removeNotice:m,children:f,multiple:b=!1,addToGallery:v,handleUpload:k=!0,popoverProps:_})=>{const x=(0,c.useSelect)((e=>e($r).getSettings().mediaUpload),[]),y=!!x,S=(0,a.useRef)(),w="block-editor/media-replace-flow/error-notice/"+ ++Sc,B=e=>{const t=(0,la.__unstableStripHTML)(e);s?s(t):setTimeout((()=>{g("error",t,{speak:!0,id:w,isDismissible:!0})}),1e3)},I=(e,t)=>{d&&u&&u(),t(),i(e),(0,Eo.speak)((0,C.__)("The media file has been replaced")),m(w)},j=e=>{e.keyCode===ca.DOWN&&(e.preventDefault(),e.target.click())},E=b&&!(!o||0===o.length)&&o.every((e=>"image"===e||e.startsWith("image/")));return(0,U.jsx)(Ns.Dropdown,{popoverProps:_,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>(0,U.jsx)(Ns.ToolbarButton,{ref:S,"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:j,children:h}),renderContent:({onClose:s})=>(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Ns.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,U.jsxs)(ga,{children:[(0,U.jsx)(ha,{gallery:E,addToGallery:v,multiple:b,value:b?n:t,onSelect:e=>I(e,s),allowedTypes:o,render:({open:e})=>(0,U.jsx)(Ns.MenuItem,{icon:ua,onClick:e,children:(0,C.__)("Open Media Library")})}),(0,U.jsx)(Ns.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!k)return t(),i(n);p(n),x({allowedTypes:o,filesList:n,onFileChange:([e])=>{I(e,t)},onError:B})})(e,s)},accept:r,multiple:!!b,render:({openFileDialog:e})=>(0,U.jsx)(Ns.MenuItem,{icon:da,onClick:()=>{e()},children:(0,C.__)("Upload")})})]}),u&&(0,U.jsx)(Ns.MenuItem,{icon:pa,onClick:u,isPressed:d,children:(0,C.__)("Use featured image")}),f]}),l&&(0,U.jsxs)("form",{className:Bs("block-editor-media-flow__url-input",{"has-siblings":y||u}),children:[(0,U.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,C.__)("Current media URL:")}),(0,U.jsx)(xc,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{l(e),S.current.focus()}})]})]})})}));function Cc(e,t=[]){const n=t.find((t=>t.name===e));return n?.href?n?.href:e}const Bc="image",Ic={backgroundImage:!0,backgroundSize:!1};function jc(e){return"web"===a.Platform.OS&&e?.background?.backgroundImage}function Ec(e){return!!e?.background?.backgroundImage?.id||"string"==typeof e?.background?.backgroundImage||!!e?.background?.backgroundImage?.url}const Tc=e=>{if(!e||isNaN(e.x)&&isNaN(e.y))return;return`${100*(isNaN(e.x)?.5:e.x)}% ${100*(isNaN(e.y)?.5:e.y)}%`},Mc=e=>{if(!e)return{x:void 0,y:void 0};let[t,n]=e.split(" ").map((e=>parseFloat(e)/100));return t=isNaN(t)?void 0:t,n=isNaN(n)?t:n,{x:t,y:n}};function Pc({label:e,filename:t,url:n}){const o=e||(0,ia.getFilename)(n)||(0,C.__)("Add background image");return(0,U.jsx)(Ns.__experimentalItemGroup,{as:"span",children:(0,U.jsxs)(Ns.__experimentalHStack,{justify:n?"flex-start":"center",as:"span",children:[n&&(0,U.jsx)("span",{className:Bs("block-editor-global-styles-background-panel__inspector-image-indicator-wrapper",{"has-image":n}),"aria-hidden":!0,children:(0,U.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:`url(${n})`}})}),(0,U.jsxs)(Ns.FlexItem,{as:"span",children:[(0,U.jsx)(Ns.__experimentalTruncate,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:o}),(0,U.jsx)(Ns.VisuallyHidden,{as:"span",children:n?(0,C.sprintf)((0,C.__)("Background image: %s"),t||o):(0,C.__)("No background image selected")})]})]})})}function Rc({panelId:e,isShownByDefault:t,onChange:n,style:o,inheritedValue:r,themeFileURIs:s}){const i=(0,c.useSelect)((e=>e($r).getSettings().mediaUpload),[]),{id:l,title:u,url:d}=o?.background?.backgroundImage||{...r?.background?.backgroundImage},p=(0,a.useRef)(),{createErrorNotice:h}=(0,c.useDispatch)(To.store),g=e=>{h(e,{type:"snackbar"})},m=()=>n(ge(o,["background","backgroundImage"],void 0)),f=e=>{if(!e||!e.url)return void m();if((0,aa.isBlobURL)(e.url))return;if(e.media_type&&e.media_type!==Bc||!e.media_type&&e.type&&e.type!==Bc)return void g((0,C.__)("Only images can be used as a background image."));const t=o?.background?.backgroundSize,r=o?.background?.backgroundPosition;n(ge(o,["background"],{...o?.background,backgroundImage:{url:e.url,id:e.id,source:"file",title:e.title||void 0},backgroundPosition:r||"auto"!==t&&t?r:"50% 0"}))},b=(0,a.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]),v=Ec(o),k=()=>{const[e]=la.focus.tabbable.find(p.current);e?.focus(),e?.click()},_=!v&&Ec(r);return(0,U.jsx)(Ns.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>v,label:(0,C.__)("Background image"),onDeselect:m,isShownByDefault:t,resetAllFilter:b,panelId:e,children:(0,U.jsxs)("div",{className:"block-editor-global-styles-background-panel__inspector-media-replace-container",ref:p,children:[(0,U.jsxs)(wc,{mediaId:l,mediaURL:d,allowedTypes:[Bc],accept:"image/*",onSelect:f,name:(0,U.jsx)(Pc,{label:u,filename:u,url:Cc(d,s)}),variant:"secondary",children:[_&&(0,U.jsx)(Ns.MenuItem,{onClick:()=>{k(),n(ge(o,["background","backgroundImage"],"none"))},children:(0,C.__)("Remove")}),v&&(0,U.jsx)(Ns.MenuItem,{onClick:()=>{k(),m()},children:(0,C.__)("Reset ")})]}),(0,U.jsx)(Ns.DropZone,{onFilesDrop:e=>{i({allowedTypes:[Bc],filesList:e,onFileChange([e]){(0,aa.isBlobURL)(e?.url)||f(e)},onError:g})},label:(0,C.__)("Drop to upload")})]})})}function Nc({panelId:e,isShownByDefault:t,onChange:n,style:o,inheritedValue:r,defaultValues:s,themeFileURIs:i}){const l=o?.background?.backgroundSize||r?.background?.backgroundSize,c=o?.background?.backgroundRepeat||r?.background?.backgroundRepeat,u=o?.background?.backgroundImage?.url||r?.background?.backgroundImage?.url,d=o?.background?.backgroundPosition||r?.background?.backgroundPosition,p=void 0!==l&&"cover"!==l&&"contain"!==l||""===l?"auto":l||s?.backgroundSize,h=!("no-repeat"===c||"cover"===p&&void 0===c),g=function(e){return void 0!==e?.background?.backgroundPosition||void 0!==e?.background?.backgroundSize}(o),m=(0,a.useCallback)((e=>({...e,style:{...e.style,background:{...e.style?.background,backgroundRepeat:void 0,backgroundSize:void 0}}})),[]),f=e=>{let t=c,r=d;"contain"===e&&(t="no-repeat",r=void 0),"cover"===e&&(t=void 0,r=void 0),"cover"!==p&&"contain"!==p||"auto"!==e||(t=void 0,o?.background?.backgroundImage?.id&&(r="50% 0")),e||"auto"!==p||(e="auto"),n(ge(o,["background"],{...o?.background,backgroundPosition:r,backgroundRepeat:t,backgroundSize:e}))};return(0,U.jsxs)(Ns.__experimentalVStack,{as:Ns.__experimentalToolsPanelItem,spacing:2,className:"single-column",hasValue:()=>g,label:(0,C.__)("Size"),onDeselect:()=>n(ge(o,["background"],{...o?.background,backgroundPosition:void 0,backgroundRepeat:void 0,backgroundSize:void 0})),isShownByDefault:t,resetAllFilter:m,panelId:e,children:[(0,U.jsx)(Ns.FocalPointPicker,{__next40pxDefaultSize:!0,label:(0,C.__)("Position"),url:Cc(u,i),value:Mc(d),onChange:e=>{n(ge(o,["background","backgroundPosition"],Tc(e)))}}),(0,U.jsxs)(Ns.__experimentalToggleGroupControl,{size:"__unstable-large",label:(0,C.__)("Size"),value:p,onChange:f,isBlock:!0,help:(b=l||s?.backgroundSize,"cover"===b||void 0===b?(0,C.__)("Image covers the space evenly."):"contain"===b?(0,C.__)("Image is contained without distortion."):(0,C.__)("Image has a fixed width.")),children:[(0,U.jsx)(Ns.__experimentalToggleGroupControlOption,{value:"cover",label:(0,C._x)("Cover","Size option for background image control")},"cover"),(0,U.jsx)(Ns.__experimentalToggleGroupControlOption,{value:"contain",label:(0,C._x)("Contain","Size option for background image control")},"contain"),(0,U.jsx)(Ns.__experimentalToggleGroupControlOption,{value:"auto",label:(0,C._x)("Tile","Size option for background image control")},"tile")]}),(0,U.jsxs)(Ns.__experimentalHStack,{justify:"flex-start",spacing:2,as:"span",children:[void 0!==p&&"cover"!==p&&"contain"!==p?(0,U.jsx)(Ns.__experimentalUnitControl,{"aria-label":(0,C.__)("Background image width"),onChange:f,value:l,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,C.__)("Auto")}):null,"cover"!==p&&(0,U.jsx)(Ns.ToggleControl,{label:(0,C.__)("Repeat"),checked:h,onChange:()=>n(ge(o,["background","backgroundRepeat"],!0===h?"no-repeat":"repeat"))})]})]});var b}function Ac({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r,headerLabel:s}){const i=us();return(0,U.jsx)(Ns.__experimentalVStack,{as:Ns.__experimentalToolsPanel,spacing:4,label:s,resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:i,children:r})}function Lc({as:e=Ac,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,defaultControls:i=Ic,defaultValues:l={},headerLabel:c=(0,C.__)("Background image"),themeFileURIs:u}){const d=(0,a.useCallback)((e=>({...e,background:{}})),[]),p=r?.background?.backgroundSize;return(0,U.jsxs)(e,{resetAllFilter:d,value:t,onChange:n,panelId:s,headerLabel:c,children:[(0,U.jsx)(Rc,{onChange:n,panelId:s,isShownByDefault:i.backgroundImage,style:t,inheritedValue:o,themeFileURIs:u}),p&&(0,U.jsx)(Nc,{onChange:n,panelId:s,isShownByDefault:i.backgroundSize,style:t,inheritedValue:o,defaultValues:l,themeFileURIs:u})]})}const Oc="background",Dc={backgroundSize:"cover"};function zc(e,t="any"){const n=(0,l.getBlockSupport)(e,Oc);return!0===n||("any"===t?!!n?.backgroundImage||!!n?.backgroundSize||!!n?.backgroundRepeat:!!n?.[t])}function Vc(e){return Ec(e)?"has-background":""}function Fc({children:e}){const t=(0,a.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]);return(0,U.jsx)(sa,{group:"background",resetAllFilter:t,children:e})}function Hc({clientId:e,name:t,setAttributes:n,settings:o}){const r=(0,c.useSelect)((t=>t($r).getBlockAttributes(e)?.style),[e]);if(!jc(o)||!zc(t,"backgroundImage"))return null;const s=(0,l.getBlockSupport)(t,[Oc,"__experimentalDefaultControls"]),i={...o,background:{...o.background,backgroundSize:o?.background?.backgroundSize&&zc(t,"backgroundSize")}};return(0,U.jsx)(Lc,{as:Fc,panelId:e,defaultControls:s,defaultValues:Dc,settings:i,onChange:e=>{n({style:Is(e)})},value:r})}const Gc={useBlockProps:function({name:e,style:t}){if(!zc(e)||!t?.background?.backgroundImage)return;const n=function(e){if(!e)return;const t=e?.backgroundImage;let n;return t?.url&&(e?.backgroundSize||(n={backgroundSize:"cover"}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(n={backgroundPosition:"center"})),n}(t?.background);return n?{style:{...n}}:void 0},attributeKeys:["style"],hasSupport:zc};(0,d.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Uc=/[\s#]/g,$c={type:"string",source:"attribute",attribute:"id",selector:"*"};const Wc={addSaveProps:function(e,t,n){(0,l.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor);return e},edit:function({anchor:e,setAttributes:t}){if("default"!==Nl())return null;const n="web"===a.Platform.OS;return(0,U.jsx)(sa,{group:"advanced",children:(0,U.jsx)(Ns.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,C.__)("HTML anchor"),help:(0,U.jsxs)(U.Fragment,{children:[(0,C.__)("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,U.jsxs)(U.Fragment,{children:[" ",(0,U.jsx)(Ns.ExternalLink,{href:(0,C.__)("https://wordpress.org/documentation/article/page-jumps/"),children:(0,C.__)("Learn more about anchors")})]})]}),value:e||"",placeholder:n?null:(0,C.__)("Add an anchor"),onChange:e=>{e=e.replace(Uc,"-"),t({anchor:e})},autoCapitalize:"none",autoComplete:"off"})})},attributeKeys:["anchor"],hasSupport:e=>(0,l.hasBlockSupport)(e,"anchor")};(0,d.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.anchor)&&void 0!==t?t:{})||(0,l.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:$c}),e}));const Kc={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};const Zc={addSaveProps:function(e,t,n){return(0,l.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e},attributeKeys:["ariaLabel"],hasSupport:e=>(0,l.hasBlockSupport)(e,"ariaLabel")};(0,d.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){return e?.attributes?.ariaLabel?.type||(0,l.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Kc}),e}));const qc={edit:function({className:e,setAttributes:t}){return"default"!==Nl()?null:(0,U.jsx)(sa,{group:"advanced",children:(0,U.jsx)(Ns.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off",label:(0,C.__)("Additional CSS class(es)"),value:e||"",onChange:e=>{t({className:""!==e?e:void 0})},help:(0,C.__)("Separate multiple classes with spaces.")})})},addSaveProps:function(e,t,n){(0,l.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=Bs(e.className,n.className));return e},attributeKeys:["className"],hasSupport:e=>(0,l.hasBlockSupport)(e,"customClassName",!0)};(0,d.addFilter)("blocks.registerBlockType","core/editor/custom-class-name/attribute",(function(e){return(0,l.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,d.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]){const o=t[n]?.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,d.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}));var Yc={grad:.9,turn:360,rad:360/(2*Math.PI)},Xc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Qc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Jc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},eu=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},tu=function(e){return{r:Jc(e.r,0,255),g:Jc(e.g,0,255),b:Jc(e.b,0,255),a:Jc(e.a)}},nu=function(e){return{r:Qc(e.r),g:Qc(e.g),b:Qc(e.b),a:Qc(e.a,3)}},ou=/^#([0-9a-f]{3,8})$/i,ru=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},su=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,s=Math.max(t,n,o),i=s-Math.min(t,n,o),l=i?s===t?(n-o)/i:s===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(l<0?l+6:l),s:s?i/s*100:0,v:s/255*100,a:r}},iu=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var s=Math.floor(t),i=o*(1-n),l=o*(1-(t-s)*n),a=o*(1-(1-t+s)*n),c=s%6;return{r:255*[o,l,i,i,a,o][c],g:255*[a,o,o,l,i,i][c],b:255*[i,i,a,o,o,l][c],a:r}},lu=function(e){return{h:eu(e.h),s:Jc(e.s,0,100),l:Jc(e.l,0,100),a:Jc(e.a)}},au=function(e){return{h:Qc(e.h),s:Qc(e.s),l:Qc(e.l),a:Qc(e.a,3)}},cu=function(e){return iu((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},uu=function(e){return{h:(t=su(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},du=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,pu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,mu={string:[[function(e){var t=ou.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?Qc(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?Qc(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=hu.exec(e)||gu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:tu({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=du.exec(e)||pu.exec(e);if(!t)return null;var n,o,r=lu({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Yc[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return cu(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,s=void 0===r?1:r;return Xc(t)&&Xc(n)&&Xc(o)?tu({r:Number(t),g:Number(n),b:Number(o),a:Number(s)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,s=void 0===r?1:r;if(!Xc(t)||!Xc(n)||!Xc(o))return null;var i=lu({h:Number(t),s:Number(n),l:Number(o),a:Number(s)});return cu(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,s=void 0===r?1:r;if(!Xc(t)||!Xc(n)||!Xc(o))return null;var i=function(e){return{h:eu(e.h),s:Jc(e.s,0,100),v:Jc(e.v,0,100),a:Jc(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(s)});return iu(i)},"hsv"]]},fu=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]},bu=function(e){return"string"==typeof e?fu(e.trim(),mu.string):"object"==typeof e&&null!==e?fu(e,mu.object):[null,void 0]},vu=function(e,t){var n=uu(e);return{h:n.h,s:Jc(n.s+100*t,0,100),l:n.l,a:n.a}},ku=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},_u=function(e,t){var n=uu(e);return{h:n.h,s:n.s,l:Jc(n.l+100*t,0,100),a:n.a}},xu=function(){function e(e){this.parsed=bu(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 Qc(ku(this.rgba),2)},e.prototype.isDark=function(){return ku(this.rgba)<.5},e.prototype.isLight=function(){return ku(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=nu(this.rgba)).r,n=e.g,o=e.b,s=(r=e.a)<1?ru(Qc(255*r)):"","#"+ru(t)+ru(n)+ru(o)+s;var e,t,n,o,r,s},e.prototype.toRgb=function(){return nu(this.rgba)},e.prototype.toRgbString=function(){return t=(e=nu(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return au(uu(this.rgba))},e.prototype.toHslString=function(){return t=(e=au(uu(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=su(this.rgba),{h:Qc(e.h),s:Qc(e.s),v:Qc(e.v),a:Qc(e.a,3)};var e},e.prototype.invert=function(){return yu({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),yu(vu(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),yu(vu(this.rgba,-e))},e.prototype.grayscale=function(){return yu(vu(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),yu(_u(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),yu(_u(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?yu({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Qc(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=uu(this.rgba);return"number"==typeof e?yu({h:e,s:t.s,l:t.l,a:t.a}):Qc(t.h)},e.prototype.isEqual=function(e){return this.toHex()===yu(e).toHex()},e}(),yu=function(e){return e instanceof xu?e:new xu(e)},Su=[],wu=function(e){e.forEach((function(e){Su.indexOf(e)<0&&(e(xu,mu),Su.push(e))}))};function Cu(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var s={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,l=o[this.toHex()];if(l)return l;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!s.length)for(var d in n)s[d]=new e(n[d]).toRgb();for(var p in n){var h=(r=a,i=s[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));h<c&&(c=h,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var Bu=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Iu=function(e){return.2126*Bu(e.r)+.7152*Bu(e.g)+.0722*Bu(e.b)};function ju(e){e.prototype.luminance=function(){return e=Iu(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,s,i,l,a,c=t instanceof e?t:new e(t);return s=this.rgba,i=c.toRgb(),n=(l=Iu(s))>(a=Iu(i))?(l+.05)/(a+.05):(a+.05)/(l+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(s=(n=t).size)?"normal":s,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,s,i}}wu([Cu,ju]);const{kebabCase:Eu}=Q(Ns.privateApis),Tu=(e,t,n)=>{if(t){const n=e?.find((e=>e.slug===t));if(n)return n}return{color:n}},Mu=(e,t)=>e?.find((e=>e.color===t));function Pu(e,t){if(e&&t)return`has-${Eu(t)}-${e}`}function Ru(){const[e,t,n,o,r,s,i,l,c,u]=Kr("color.custom","color.palette.custom","color.palette.theme","color.palette.default","color.defaultPalette","color.customGradient","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients"),d={disableCustomColors:!e,disableCustomGradients:!s};return d.colors=(0,a.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,C._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,C._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,C._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[t,n,o,r]),d.gradients=(0,a.useMemo)((()=>{const e=[];return l&&l.length&&e.push({name:(0,C._x)("Theme","Indicates this palette comes from the theme."),gradients:l}),u&&c&&c.length&&e.push({name:(0,C._x)("Default","Indicates this palette comes from WordPress."),gradients:c}),i&&i.length&&e.push({name:(0,C._x)("Custom","Indicates this palette is created by the user."),gradients:i}),e}),[i,l,c,u]),d.hasColorsOrGradients=!!d.colors.length||!!d.gradients.length,d}function Nu(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Au(e={}){const{flat:t,...n}=e;return t||Nu(Object.values(n).filter(Boolean))||"px"}function Lu(e={}){if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,Ns.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",s=Nu(o);return 0===r||r?`${r}${s}`:void 0}function Ou(e={}){const t=Lu(e);return"string"!=typeof e&&isNaN(parseFloat(t))}function Du(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function zu({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){let s=Lu(o);void 0===s&&(s=Au(t));const i=Du(o)&&Ou(o),l=i?(0,C.__)("Mixed"):null;return(0,U.jsx)(Ns.__experimentalUnitControl,{...r,"aria-label":(0,C.__)("Border radius"),disableUnits:i,isOnly:!0,value:s,onChange:t=>{const n=!isNaN(parseFloat(t));e(n?t:void 0)},onUnitChange:e=>{n({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:l,size:"__unstable-large"})}const Vu={topLeft:(0,C.__)("Top left"),topRight:(0,C.__)("Top right"),bottomLeft:(0,C.__)("Bottom left"),bottomRight:(0,C.__)("Bottom right")};function Fu({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){const s=t=>n=>{if(!e)return;const o=!isNaN(parseFloat(n))?n:void 0;e({...i,[t]:o})},i="string"!=typeof o?o:{topLeft:o,topRight:o,bottomLeft:o,bottomRight:o};return(0,U.jsx)("div",{className:"components-border-radius-control__input-controls-wrapper",children:Object.entries(Vu).map((([e,o])=>{const[l,a]=(0,Ns.__experimentalParseQuantityAndUnitFromRawValue)(i[e]),c=i[e]?a:t[e]||t.flat;return(0,U.jsx)(Ns.Tooltip,{text:o,placement:"top",children:(0,U.jsx)("div",{className:"components-border-radius-control__tooltip-wrapper",children:(0,U.jsx)(Ns.__experimentalUnitControl,{...r,"aria-label":o,value:[l,c].join(""),onChange:s(e),onUnitChange:(u=e,e=>{const o={...t};o[u]=e,n(o)}),size:"__unstable-large"})})},e);var u}))})}const Hu=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})});function Gu({isLinked:e,...t}){const n=e?(0,C.__)("Unlink radii"):(0,C.__)("Link radii");return(0,U.jsx)(Ns.Tooltip,{text:n,children:(0,U.jsx)(Ns.Button,{...t,className:"component-border-radius-control__linked-button",size:"small",icon:e?Hu:sc,iconSize:24,"aria-label":n})})}const Uu={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},$u=0,Wu={px:100,em:20,rem:20};function Ku({onChange:e,values:t}){const[n,o]=(0,a.useState)(!Du(t)||!Ou(t)),[r,s]=(0,a.useState)({flat:"string"==typeof t?(0,Ns.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,Ns.__experimentalParseQuantityAndUnitFromRawValue)(t?.topLeft)[1],topRight:(0,Ns.__experimentalParseQuantityAndUnitFromRawValue)(t?.topRight)[1],bottomLeft:(0,Ns.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomLeft)[1],bottomRight:(0,Ns.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomRight)[1]}),[i]=Kr("spacing.units"),l=(0,Ns.__experimentalUseCustomUnits)({availableUnits:i||["px","em","rem"]}),c=Au(r),u=l&&l.find((e=>e.value===c)),d=u?.step||1,[p]=(0,Ns.__experimentalParseQuantityAndUnitFromRawValue)(Lu(t));return(0,U.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,U.jsx)(Ns.BaseControl.VisualLabel,{as:"legend",children:(0,C.__)("Radius")}),(0,U.jsxs)("div",{className:"components-border-radius-control__wrapper",children:[n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(zu,{className:"components-border-radius-control__unit-control",values:t,min:$u,onChange:e,selectedUnits:r,setSelectedUnits:s,units:l}),(0,U.jsx)(Ns.RangeControl,{label:(0,C.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=p?p:"",min:$u,max:Wu[c],initialPosition:0,withInputField:!1,onChange:t=>{e(void 0!==t?`${t}${c}`:void 0)},step:d,__nextHasNoMarginBottom:!0})]}):(0,U.jsx)(Fu,{min:$u,onChange:e,selectedUnits:r,setSelectedUnits:s,values:t||Uu,units:l}),(0,U.jsx)(Gu,{onClick:()=>o(!n),isLinked:n})]})]})}const Zu=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),qu=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.Path,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"})}),Yu=[],{CompositeItemV2:Xu,CompositeV2:Qu,useCompositeStoreV2:Ju}=Q(Ns.privateApis);function ed({shadow:e,onShadowChange:t,settings:n}){const o=rd(n);return(0,U.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,U.jsxs)(Ns.__experimentalVStack,{spacing:4,children:[(0,U.jsx)(Ns.__experimentalHeading,{level:5,children:(0,C.__)("Drop shadow")}),(0,U.jsx)(td,{presets:o,activeShadow:e,onSelect:t}),(0,U.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,U.jsx)(Ns.Button,{variant:"tertiary",onClick:()=>t(void 0),children:(0,C.__)("Clear")})})]})})}function td({presets:e,activeShadow:t,onSelect:n}){const o=Ju();return e?(0,U.jsx)(Qu,{store:o,role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,C.__)("Drop shadows"),children:e.map((({name:e,slug:o,shadow:r})=>(0,U.jsx)(nd,{label:e,isActive:r===t,type:"unset"===o?"unset":"preset",onSelect:()=>n(r===t?void 0:r),shadow:r},o)))}):null}function nd({type:e,label:t,isActive:n,onSelect:o,shadow:r}){return(0,U.jsx)(Xu,{role:"option","aria-label":t,"aria-selected":n,className:Bs("block-editor-global-styles__shadow__item",{"is-active":n}),render:(0,U.jsx)(Ns.Button,{className:Bs("block-editor-global-styles__shadow-indicator",{unset:"unset"===e}),onClick:o,label:t,style:{boxShadow:r},showTooltip:!0,children:n&&(0,U.jsx)(Ui,{icon:Zu})})})}function od({shadow:e,onShadowChange:t,settings:n}){return(0,U.jsx)(Ns.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:Bs({"is-open":t}),"aria-expanded":t};return(0,U.jsx)(Ns.Button,{...n,children:(0,U.jsxs)(Ns.__experimentalHStack,{justify:"flex-start",children:[(0,U.jsx)(Ui,{className:"block-editor-global-styles__toggle-icon",icon:qu,size:24}),(0,U.jsx)(Ns.FlexItem,{children:(0,C.__)("Drop shadow")})]})})},renderContent:()=>(0,U.jsx)(Ns.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,U.jsx)(ed,{shadow:e,onShadowChange:t,settings:n})})})}function rd(e){return(0,a.useMemo)((()=>{var t;if(!e?.shadow)return Yu;const n=e?.shadow?.defaultPresets,{default:o,theme:r,custom:s}=null!==(t=e?.shadow?.presets)&&void 0!==t?t:{},i={name:(0,C.__)("Unset"),slug:"unset",shadow:"none"},l=[...n&&o||Yu,...r||Yu,...s||Yu];return l.length&&l.unshift(i),l}),[e])}function sd(e){return Object.values(id(e)).some(Boolean)}function id(e){return{hasBorderColor:ld(e),hasBorderRadius:ad(e),hasBorderStyle:cd(e),hasBorderWidth:ud(e),hasShadow:dd(e)}}function ld(e){return e?.border?.color}function ad(e){return e?.border?.radius}function cd(e){return e?.border?.style}function ud(e){return e?.border?.width}function dd(e){const t=rd(e);return!!e?.shadow&&t.length>0}function pd({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r,label:s}){const i=us();return(0,U.jsx)(Ns.__experimentalToolsPanel,{label:s,resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:i,children:r})}const hd={radius:!0,color:!0,width:!0,shadow:!0};function gd({as:e=pd,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,name:i,defaultControls:l=hd}){var c,u,d,p;const h=Ss(r),g=(0,a.useCallback)((e=>ps({settings:r},"",e)),[r]),m=e=>{const t=h.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},f=(0,a.useMemo)((()=>{if((0,Ns.__experimentalHasSplitBorders)(o?.border)){const e={...o?.border};return["top","right","bottom","left"].forEach((t=>{e[t]={...e[t],color:g(e[t]?.color)}})),e}return{...o?.border,color:o?.border?.color?g(o?.border?.color):void 0}}),[o?.border,g]),b=e=>n({...t,border:e}),v=ld(r),k=cd(r),_=ud(r),x=ad(r),y=g(f?.radius),S=e=>b({...f,radius:e}),w=()=>{const e=t?.border?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},B=dd(r),I=g(o?.shadow),j=null!==(c=r?.shadow?.presets)&&void 0!==c?c:{},E=null!==(u=null!==(d=null!==(p=j.custom)&&void 0!==p?p:j.theme)&&void 0!==d?d:j.default)&&void 0!==u?u:[],T=e=>{const o=E?.find((({shadow:t})=>t===e))?.slug;n(ge(t,["shadow"],o?`var:preset|shadow|${o}`:e||void 0))},M=(0,a.useCallback)((e=>({...e,border:void 0,shadow:void 0})),[]),P=l?.color||l?.width,R=v||k||_||x,N=Cd({blockName:i,hasShadowControl:B,hasBorderControl:R});return(0,U.jsxs)(e,{resetAllFilter:M,value:t,onChange:n,panelId:s,label:N,children:[(_||v)&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{hasValue:()=>(0,Ns.__experimentalIsDefinedBorder)(t?.border),label:(0,C.__)("Border"),onDeselect:()=>(()=>{if(w())return b({radius:t?.border?.radius});b(void 0)})(),isShownByDefault:P,panelId:s,children:(0,U.jsx)(Ns.__experimentalBorderBoxControl,{colors:h,enableAlpha:!0,enableStyle:k,onChange:e=>{const t={...e};(0,Ns.__experimentalHasSplitBorders)(t)?["top","right","bottom","left"].forEach((e=>{t[e]&&(t[e]={...t[e],color:m(t[e]?.color)})})):t&&(t.color=m(t.color)),b({radius:f?.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:f,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!B,label:(0,C.__)("Border")})}),x&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{hasValue:w,label:(0,C.__)("Radius"),onDeselect:()=>S(void 0),isShownByDefault:l.radius,panelId:s,children:(0,U.jsx)(Ku,{values:y,onChange:e=>{S(e||void 0)}})}),B&&(0,U.jsxs)(Ns.__experimentalToolsPanelItem,{label:(0,C.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>T(void 0),isShownByDefault:l.shadow,panelId:s,children:[R?(0,U.jsx)(Ns.BaseControl.VisualLabel,{as:"legend",children:(0,C.__)("Shadow")}):null,(0,U.jsx)(Ns.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:(0,U.jsx)(od,{shadow:I,onShadowChange:T,settings:r})})]})]})}const md="__experimentalBorder",fd="shadow",bd=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},vd=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=bd(e,"slug",t);if(n)return n}if(!n)return{color:void 0};const o=bd(e,"color",n);return o||{color:n}};function kd(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function _d(e){if((0,Ns.__experimentalHasSplitBorders)(e?.border))return{style:e,borderColor:void 0};const t=e?.border?.color,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,o={...e};return o.border={...o.border,color:n?void 0:t},{style:Is(o),borderColor:n}}function xd(e){return(0,Ns.__experimentalHasSplitBorders)(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function yd({label:e,children:t,resetAllFilter:n}){const o=(0,a.useCallback)((e=>{const t=xd(e),o=n(t);return{...e,..._d(o)}}),[n]);return(0,U.jsx)(sa,{group:"border",resetAllFilter:o,label:e,children:t})}function Sd({clientId:e,name:t,setAttributes:n,settings:o}){const r=sd(o);const{style:s,borderColor:i}=(0,c.useSelect)((function(t){const{style:n,borderColor:o}=t($r).getBlockAttributes(e)||{};return{style:n,borderColor:o}}),[e]),u=(0,a.useMemo)((()=>xd({style:s,borderColor:i})),[s,i]);if(!r)return null;const d={...(0,l.getBlockSupport)(t,[md,"__experimentalDefaultControls"]),...(0,l.getBlockSupport)(t,[fd,"__experimentalDefaultControls"])};return(0,U.jsx)(gd,{as:yd,panelId:e,settings:o,value:u,onChange:e=>{n(_d(e))},defaultControls:d})}function wd(e,t="any"){if("web"!==a.Platform.OS)return!1;const n=(0,l.getBlockSupport)(e,md);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function Cd({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const o=id(Ps(e));return t||n||!e||(t=o?.hasBorderColor||o?.hasBorderStyle||o?.hasBorderWidth||o?.hasBorderRadius,n=o?.hasShadow),t&&n?(0,C.__)("Border & Shadow"):n?(0,C.__)("Shadow"):(0,C.__)("Border")}function Bd(e,t,n){if(!wd(t,"color")||Es(t,md,"color"))return e;const o=Id(n),r=Bs(e.className,o);return e.className=r||void 0,e}function Id(e){const{borderColor:t,style:n}=e,o=Pu("border-color",t);return Bs({"has-border-color":t||n?.border?.color,[o]:!!o})}const jd={useBlockProps:function({name:e,borderColor:t,style:n}){const{colors:o}=Ru();if(!wd(e,"color")||Es(e,md,"color"))return{};const{color:r}=vd({colors:o,namedColor:t}),{color:s}=vd({colors:o,namedColor:kd(n?.border?.top?.color)}),{color:i}=vd({colors:o,namedColor:kd(n?.border?.right?.color)}),{color:l}=vd({colors:o,namedColor:kd(n?.border?.bottom?.color)}),{color:a}=vd({colors:o,namedColor:kd(n?.border?.left?.color)});return Bd({style:Is({borderTopColor:s||r,borderRightColor:i||r,borderBottomColor:l||r,borderLeftColor:a||r})||{}},e,{borderColor:t,style:n})},addSaveProps:Bd,attributeKeys:["borderColor","style"],hasSupport:e=>wd(e,"color")};function Ed(e){if(e)return`has-${e}-gradient-background`}function Td(e,t){const n=e?.find((e=>e.slug===t));return n&&n.gradient}function Md(e,t){const n=e?.find((e=>e.gradient===t));return n}function Pd(e,t){const n=Md(e,t);return n&&n.slug}function Rd({gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}={}){const{clientId:n}=_(),[o,r,s]=Kr("color.gradients.custom","color.gradients.theme","color.gradients.default"),i=(0,a.useMemo)((()=>[...o||[],...r||[],...s||[]]),[o,r,s]),{gradient:l,customGradient:u}=(0,c.useSelect)((o=>{const{getBlockAttributes:r}=o($r),s=r(n)||{};return{customGradient:s[t],gradient:s[e]}}),[n,e,t]),{updateBlockAttributes:d}=(0,c.useDispatch)($r),p=(0,a.useCallback)((o=>{const r=Pd(i,o);d(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,d]),h=Ed(l);let g;return g=l?Td(i,l):u,{gradientClass:h,gradientValue:g,setGradient:p}}(0,d.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return wd(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e}));const{Tabs:Nd}=Q(Ns.privateApis),Ad=["colors","disableCustomColors","gradients","disableCustomGradients"],Ld={color:"color",gradient:"gradient"};function Od({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,className:s,label:i,onColorChange:l,onGradientChange:a,colorValue:c,gradientValue:u,clearable:d,showTitle:p=!0,enableAlpha:h,headingLevel:g}){const m=l&&(e&&e.length>0||!n),f=a&&(t&&t.length>0||!o);if(!m&&!f)return null;const b={[Ld.color]:(0,U.jsx)(Ns.ColorPalette,{value:c,onChange:f?e=>{l(e),a()}:l,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:r,clearable:d,enableAlpha:h,headingLevel:g}),[Ld.gradient]:(0,U.jsx)(Ns.GradientPicker,{value:u,onChange:m?e=>{a(e),l()}:a,gradients:t,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,clearable:d,headingLevel:g})},v=e=>(0,U.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:b[e]});return(0,U.jsx)(Ns.BaseControl,{__nextHasNoMarginBottom:!0,className:Bs("block-editor-color-gradient-control",s),children:(0,U.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,U.jsxs)(Ns.__experimentalVStack,{spacing:1,children:[p&&(0,U.jsx)("legend",{children:(0,U.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,U.jsx)(Ns.BaseControl.VisualLabel,{children:i})})}),m&&f&&(0,U.jsx)("div",{children:(0,U.jsxs)(Nd,{defaultTabId:u?Ld.gradient:!!m&&Ld.color,children:[(0,U.jsxs)(Nd.TabList,{children:[(0,U.jsx)(Nd.Tab,{tabId:Ld.color,children:(0,C.__)("Color")}),(0,U.jsx)(Nd.Tab,{tabId:Ld.gradient,children:(0,C.__)("Gradient")})]}),(0,U.jsx)(Nd.TabPanel,{tabId:Ld.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.color}),(0,U.jsx)(Nd.TabPanel,{tabId:Ld.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.gradient})]})}),!f&&v(Ld.color),!m&&v(Ld.gradient)]})})})}function Dd(e){const[t,n,o,r]=Kr("color.palette","color.gradients","color.custom","color.customGradient");return(0,U.jsx)(Od,{colors:t,gradients:n,disableCustomColors:!o,disableCustomGradients:!r,...e})}const zd=function(e){return Ad.every((t=>e.hasOwnProperty(t)))?(0,U.jsx)(Od,{...e}):(0,U.jsx)(Dd,{...e})};function Vd(e){const t=Fd(e),n=Wd(e),o=Hd(e),r=Ud(e),s=$d(e),i=Gd(e);return t||n||o||r||s||i}function Fd(e){const t=Ss(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function Hd(e){const t=Ss(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function Gd(e){const t=Ss(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function Ud(e){const t=Ss(e),n=ws(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function $d(e){const t=Ss(e),n=ws(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function Wd(e){const t=Ss(e),n=ws(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function Kd({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const s=us();return(0,U.jsx)(Ns.__experimentalToolsPanel,{label:(0,C.__)("Elements"),resetAll:()=>{const o=e(n);t(o)},panelId:o,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:(0,U.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:r})})}const Zd={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},qd={placement:"left-start",offset:36,shift:!0},{Tabs:Yd}=Q(Ns.privateApis),Xd=({indicators:e,label:t})=>(0,U.jsxs)(Ns.__experimentalHStack,{justify:"flex-start",children:[(0,U.jsx)(Ns.__experimentalZStack,{isLayered:!1,offset:-8,children:e.map(((e,t)=>(0,U.jsx)(Ns.Flex,{expanded:!1,children:(0,U.jsx)(Ns.ColorIndicator,{colorValue:e})},t)))}),(0,U.jsx)(Ns.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]});function Qd({isGradient:e,inheritedValue:t,userValue:n,setValue:o,colorGradientControlSettings:r}){return(0,U.jsx)(zd,{...r,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:o,onGradientChange:e?o:void 0,clearable:t===n,headingLevel:3})}function Jd({label:e,hasValue:t,resetValue:n,isShownByDefault:o,indicators:r,tabs:s,colorGradientControlSettings:i,panelId:l}){var a;const c=s.find((e=>void 0!==e.userValue)),{key:u,...d}=null!==(a=s[0])&&void 0!==a?a:{};return(0,U.jsx)(Ns.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:o,panelId:l,children:(0,U.jsx)(Ns.Dropdown,{popoverProps:qd,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:t,isOpen:n})=>{const o={onClick:t,className:Bs("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,"aria-label":(0,C.sprintf)((0,C.__)("Color %s styles"),e)};return(0,U.jsx)(Ns.Button,{...o,children:(0,U.jsx)(Xd,{indicators:r,label:e})})},renderContent:()=>(0,U.jsx)(Ns.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,U.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[1===s.length&&(0,U.jsx)(Qd,{...d,colorGradientControlSettings:i},u),s.length>1&&(0,U.jsxs)(Yd,{defaultTabId:c?.key,children:[(0,U.jsx)(Yd.TabList,{children:s.map((e=>(0,U.jsx)(Yd.Tab,{tabId:e.key,children:e.label},e.key)))}),s.map((e=>{const{key:t,...n}=e;return(0,U.jsx)(Yd.TabPanel,{tabId:t,focusable:!1,children:(0,U.jsx)(Qd,{...n,colorGradientControlSettings:i},t)},t)}))]})]})})})})}function ep({as:e=Kd,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,defaultControls:i=Zd,children:l}){const c=Ss(r),u=ws(r),d=r?.color?.custom,p=r?.color?.customGradient,h=c.length>0||d,g=u.length>0||p,m=e=>ps({settings:r},"",e),f=e=>{const t=c.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},b=e=>{const t=u.flatMap((({gradients:e})=>e)).find((({gradient:t})=>t===e));return t?"var:preset|gradient|"+t.slug:e},v=Wd(r),k=m(o?.color?.background),_=m(t?.color?.background),x=m(o?.color?.gradient),y=m(t?.color?.gradient),S=Hd(r),w=m(o?.elements?.link?.color?.text),B=m(t?.elements?.link?.color?.text),I=m(o?.elements?.link?.[":hover"]?.color?.text),j=m(t?.elements?.link?.[":hover"]?.color?.text),E=Fd(r),T=m(o?.color?.text),M=m(t?.color?.text),P=e=>{let o=ge(t,["color","text"],f(e));T===w&&(o=ge(o,["elements","link","color","text"],f(e))),n(o)},R=[{name:"caption",label:(0,C.__)("Captions"),showPanel:Gd(r)},{name:"button",label:(0,C.__)("Button"),showPanel:$d(r)},{name:"heading",label:(0,C.__)("Heading"),showPanel:Ud(r)},{name:"h1",label:(0,C.__)("H1"),showPanel:Ud(r)},{name:"h2",label:(0,C.__)("H2"),showPanel:Ud(r)},{name:"h3",label:(0,C.__)("H3"),showPanel:Ud(r)},{name:"h4",label:(0,C.__)("H4"),showPanel:Ud(r)},{name:"h5",label:(0,C.__)("H5"),showPanel:Ud(r)},{name:"h6",label:(0,C.__)("H6"),showPanel:Ud(r)}],N=(0,a.useCallback)((e=>({...e,color:void 0,elements:{...e?.elements,link:{...e?.elements?.link,color:void 0,":hover":{color:void 0}},...R.reduce(((t,n)=>({...t,[n.name]:{...e?.elements?.[n.name],color:void 0}})),{})}})),[]),A=[E&&{key:"text",label:(0,C.__)("Text"),hasValue:()=>!!M,resetValue:()=>P(void 0),isShownByDefault:i.text,indicators:[T],tabs:[{key:"text",label:(0,C.__)("Text"),inheritedValue:T,setValue:P,userValue:M}]},v&&{key:"background",label:(0,C.__)("Background"),hasValue:()=>!!_||!!y,resetValue:()=>{const e=ge(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:i.background,indicators:[null!=x?x:k],tabs:[h&&{key:"background",label:(0,C.__)("Color"),inheritedValue:k,setValue:e=>{const o=ge(t,["color","background"],f(e));o.color.gradient=void 0,n(o)},userValue:_},g&&{key:"gradient",label:(0,C.__)("Gradient"),inheritedValue:x,setValue:e=>{const o=ge(t,["color","gradient"],b(e));o.color.background=void 0,n(o)},userValue:y,isGradient:!0}].filter(Boolean)},S&&{key:"link",label:(0,C.__)("Link"),hasValue:()=>!!B||!!j,resetValue:()=>{let e=ge(t,["elements","link",":hover","color","text"],void 0);e=ge(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:i.link,indicators:[w,I],tabs:[{key:"link",label:(0,C.__)("Default"),inheritedValue:w,setValue:e=>{n(ge(t,["elements","link","color","text"],f(e)))},userValue:B},{key:"hover",label:(0,C.__)("Hover"),inheritedValue:I,setValue:e=>{n(ge(t,["elements","link",":hover","color","text"],f(e)))},userValue:j}]}].filter(Boolean);return R.forEach((({name:e,label:r,showPanel:s})=>{if(!s)return;const l=m(o?.elements?.[e]?.color?.background),a=m(o?.elements?.[e]?.color?.gradient),c=m(o?.elements?.[e]?.color?.text),u=m(t?.elements?.[e]?.color?.background),d=m(t?.elements?.[e]?.color?.gradient),p=m(t?.elements?.[e]?.color?.text),v="caption"!==e;A.push({key:e,label:r,hasValue:()=>!!(p||u||d),resetValue:()=>{const o=ge(t,["elements",e,"color","background"],void 0);o.elements[e].color.gradient=void 0,o.elements[e].color.text=void 0,n(o)},isShownByDefault:i[e],indicators:v?[c,null!=a?a:l]:[c],tabs:[h&&{key:"text",label:(0,C.__)("Text"),inheritedValue:c,setValue:o=>{n(ge(t,["elements",e,"color","text"],f(o)))},userValue:p},h&&v&&{key:"background",label:(0,C.__)("Background"),inheritedValue:l,setValue:o=>{const r=ge(t,["elements",e,"color","background"],f(o));r.elements[e].color.gradient=void 0,n(r)},userValue:u},g&&v&&{key:"gradient",label:(0,C.__)("Gradient"),inheritedValue:a,setValue:o=>{const r=ge(t,["elements",e,"color","gradient"],b(o));r.elements[e].color.background=void 0,n(r)},userValue:d,isGradient:!0}].filter(Boolean)})})),(0,U.jsxs)(e,{resetAllFilter:N,value:t,onChange:n,panelId:s,children:[A.map((e=>{const{key:t,...n}=e;return(0,U.jsx)(Jd,{...n,colorGradientControlSettings:{colors:c,disableCustomColors:!d,gradients:u,disableCustomGradients:!p},panelId:s},t)})),l]})}wu([Cu,ju]);const tp=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:o,fontSize:r,isLargeText:s,textColor:i,linkColor:l,enableAlphaChecker:a=!1}){const c=e||t;if(!c)return null;const u=i||n,d=l||o;if(!u&&!d)return null;const p=[{color:u,description:(0,C.__)("text color")},{color:d,description:(0,C.__)("link color")}],h=yu(c),g=h.alpha()<1,m=h.brightness(),f={level:"AA",size:s||!1!==s&&r>=24?"large":"small"};let b="",v="";for(const e of p){if(!e.color)continue;const t=yu(e.color),n=t.isReadable(h,f),o=t.alpha()<1;if(!n){if(g||o)continue;b=m<t.brightness()?(0,C.sprintf)((0,C.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,C.sprintf)((0,C.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),v=(0,C.__)("This color combination may be hard for people to read.");break}o&&a&&(b=(0,C.__)("Transparent text may be hard for people to read."),v=(0,C.__)("Transparent text may be hard for people to read."))}return b?((0,Eo.speak)(v),(0,U.jsx)("div",{className:"block-editor-contrast-checker",children:(0,U.jsx)(Ns.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:b})})):null};function np(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function op({clientId:e}){const[t,n]=(0,a.useState)(),[o,r]=(0,a.useState)(),[s,i]=(0,a.useState)(),l=Qi(e);return(0,a.useEffect)((()=>{if(!l.current)return;r(np(l.current).color);const e=l.current?.querySelector("a");e&&e.innerText&&i(np(e).color);let t=l.current,o=np(t).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&t.parentNode&&t.parentNode.nodeType===t.parentNode.ELEMENT_NODE;)t=t.parentNode,o=np(t).backgroundColor;n(o)})),(0,U.jsx)(tp,{backgroundColor:t,textColor:o,enableAlphaChecker:!0,linkColor:s})}const rp="color",sp=e=>{const t=(0,l.getBlockSupport)(e,rp);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},ip=e=>{if("web"!==a.Platform.OS)return!1;const t=(0,l.getBlockSupport)(e,rp);return null!==t&&"object"==typeof t&&!!t.link},lp=e=>{const t=(0,l.getBlockSupport)(e,rp);return null!==t&&"object"==typeof t&&!!t.gradients},ap=e=>{const t=(0,l.getBlockSupport)(e,rp);return t&&!1!==t.background},cp=e=>{const t=(0,l.getBlockSupport)(e,rp);return t&&!1!==t.text};function up(e,t,n){if(!sp(t)||Es(t,rp))return e;const o=lp(t),{backgroundColor:r,textColor:s,gradient:i,style:l}=n,a=e=>!Es(t,rp,e),c=a("text")?Pu("color",s):void 0,u=a("gradients")?Ed(i):void 0,d=a("background")?Pu("background-color",r):void 0,p=a("background")||a("gradients"),h=r||l?.color?.background||o&&(i||l?.color?.gradient),g=Bs(e.className,c,u,{[d]:!(o&&l?.color?.gradient||!d),"has-text-color":a("text")&&(s||l?.color?.text),"has-background":p&&h,"has-link-color":a("link")&&l?.elements?.link?.color});return e.className=g||void 0,e}function dp(e){const t=e?.color?.text,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,o=e?.color?.background,r=o?.startsWith("var:preset|color|")?o.substring(17):void 0,s=e?.color?.gradient,i=s?.startsWith("var:preset|gradient|")?s.substring(20):void 0,l={...e};return l.color={...l.color,text:n?void 0:t,background:r?void 0:o,gradient:i?void 0:s},{style:Is(l),textColor:n,backgroundColor:r,gradient:i}}function pp(e){return{...e.style,color:{...e.style?.color,text:e.textColor?"var:preset|color|"+e.textColor:e.style?.color?.text,background:e.backgroundColor?"var:preset|color|"+e.backgroundColor:e.style?.color?.background,gradient:e.gradient?"var:preset|gradient|"+e.gradient:e.style?.color?.gradient}}}function hp({children:e,resetAllFilter:t}){const n=(0,a.useCallback)((e=>{const n=pp(e),o=t(n);return{...e,...dp(o)}}),[t]);return(0,U.jsx)(sa,{group:"color",resetAllFilter:n,children:e})}function gp({clientId:e,name:t,setAttributes:n,settings:o}){const r=Vd(o);const{style:s,textColor:i,backgroundColor:u,gradient:d}=(0,c.useSelect)((function(t){const{style:n,textColor:o,backgroundColor:r,gradient:s}=t($r).getBlockAttributes(e)||{};return{style:n,textColor:o,backgroundColor:r,gradient:s}}),[e]),p=(0,a.useMemo)((()=>pp({style:s,textColor:i,backgroundColor:u,gradient:d})),[s,i,u,d]);if(!r)return null;const h=(0,l.getBlockSupport)(t,[rp,"__experimentalDefaultControls"]),g="web"===a.Platform.OS&&!p?.color?.gradient&&(o?.color?.text||o?.color?.link)&&!1!==(0,l.getBlockSupport)(t,[rp,"enableContrastChecker"]);return(0,U.jsx)(ep,{as:hp,panelId:e,settings:o,value:p,onChange:e=>{n(dp(e))},defaultControls:h,enableContrastChecker:!1!==(0,l.getBlockSupport)(t,[rp,"enableContrastChecker"]),children:g&&(0,U.jsx)(op,{clientId:e})})}const mp={useBlockProps:function({name:e,backgroundColor:t,textColor:n,gradient:o,style:r}){const[s,i,l]=Kr("color.palette.custom","color.palette.theme","color.palette.default"),c=(0,a.useMemo)((()=>[...s||[],...i||[],...l||[]]),[s,i,l]);if(!sp(e)||Es(e,rp))return{};const u={};n&&!Es(e,rp,"text")&&(u.color=Tu(c,n)?.color),t&&!Es(e,rp,"background")&&(u.backgroundColor=Tu(c,t)?.color);const d=up({style:u},e,{textColor:n,backgroundColor:t,gradient:o,style:r}),p=t||r?.color?.background||o||r?.color?.gradient;return{...d,className:Bs(d.className,!p&&Vc(r))}},addSaveProps:up,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:sp},fp={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function bp({value:e="",onChange:t,fontFamilies:n,...o}){const[r]=Kr("typography.fontFamilies");if(n||(n=r),!n||0===n.length)return null;const s=[{value:"",label:(0,C.__)("Default")},...n.map((({fontFamily:e,name:t})=>({value:e,label:t||e})))];return(0,U.jsx)(Ns.SelectControl,{label:(0,C.__)("Font"),options:s,value:e,onChange:t,labelPosition:"top",...o})}(0,d.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return sp(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),lp(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,d.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return js({linkColor:ip(r),textColor:cp(r),backgroundColor:ap(r),gradient:lp(r)},fp,e,t,n,o)}));const vp=[{name:(0,C._x)("Regular","font style"),value:"normal"},{name:(0,C._x)("Italic","font style"),value:"italic"}],kp=[{name:(0,C._x)("Thin","font weight"),value:"100"},{name:(0,C._x)("Extra Light","font weight"),value:"200"},{name:(0,C._x)("Light","font weight"),value:"300"},{name:(0,C._x)("Regular","font weight"),value:"400"},{name:(0,C._x)("Medium","font weight"),value:"500"},{name:(0,C._x)("Semi Bold","font weight"),value:"600"},{name:(0,C._x)("Bold","font weight"),value:"700"},{name:(0,C._x)("Extra Bold","font weight"),value:"800"},{name:(0,C._x)("Black","font weight"),value:"900"}],_p=(e,t)=>e?t?(0,C.__)("Appearance"):(0,C.__)("Font style"):(0,C.__)("Font weight");function xp(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:s},...i}=e,l=n||o,c=_p(n,o),u={key:"default",name:(0,C.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},d=(0,a.useMemo)((()=>n&&o?(()=>{const e=[u];return vp.forEach((({name:t,value:n})=>{kp.forEach((({name:o,value:r})=>{const s="normal"===n?o:(0,C.sprintf)((0,C.__)("%1$s %2$s"),o,t);e.push({key:`${n}-${r}`,name:s,style:{fontStyle:n,fontWeight:r}})}))})),e})():n?(()=>{const e=[u];return vp.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[u];return kp.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options]),p=d.find((e=>e.style.fontStyle===r&&e.style.fontWeight===s))||d[0];return l&&(0,U.jsx)(Ns.CustomSelectControl,{...i,className:"components-font-appearance-control",label:c,describedBy:p?n?o?(0,C.sprintf)((0,C.__)("Currently selected font appearance: %s"),p.name):(0,C.sprintf)((0,C.__)("Currently selected font style: %s"),p.name):(0,C.sprintf)((0,C.__)("Currently selected font weight: %s"),p.name):(0,C.__)("No selected font appearance"),options:d,value:p,onChange:({selectedItem:e})=>t(e.style)})}const yp=1.5;const Sp=({value:e,onChange:t,__nextHasNoMarginBottom:n=!1,__unstableInputWidth:o="60px",...r})=>{const s=function(e){return void 0!==e&&""!==e}(e),i=(e,t)=>{if(s)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return yp;default:return e}},l=s?e:"";n||y()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const a=n?void 0:{marginBottom:24};return(0,U.jsx)("div",{className:"block-editor-line-height-control",style:a,children:(0,U.jsx)(Ns.__experimentalNumberControl,{...r,__unstableInputWidth:o,__unstableStateReducer:(e,t)=>{const n=["insertText","insertFromPaste"].includes(t.payload.event.nativeEvent?.inputType),o=i(e.value,n);return{...e,value:o}},onChange:(e,{event:n})=>{""!==e?"click"!==n.type?t(`${e}`):t(i(`${e}`,!1)):t()},label:(0,C.__)("Line height"),placeholder:yp,step:.01,spinFactor:10,value:l,min:0,spinControls:"custom"})})};function wp({value:e,onChange:t,__unstableInputWidth:n="60px",...o}){const[r]=Kr("spacing.units"),s=(0,Ns.__experimentalUseCustomUnits)({availableUnits:r||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,U.jsx)(Ns.__experimentalUnitControl,{...o,label:(0,C.__)("Letter spacing"),value:e,__unstableInputWidth:n,units:s,onChange:t})}const Cp=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})}),Bp=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})}),Ip=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})}),jp=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z"})});function Ep({label:e,value:t,options:n,onChange:o,className:r}){return(0,U.jsxs)("fieldset",{className:Bs("block-editor-segmented-text-control",r),children:[(0,U.jsx)(Ns.BaseControl.VisualLabel,{as:"legend",children:e}),(0,U.jsx)("div",{className:"block-editor-segmented-text-control__buttons",children:n.map((e=>(0,U.jsx)(Ns.Button,{size:"compact",icon:e.icon,label:e.label,isPressed:e.value===t,onClick:()=>o(e.value)},e.value)))})]})}const Tp=[{label:(0,C.__)("Align text left"),value:"left",icon:Cp},{label:(0,C.__)("Align text center"),value:"center",icon:Bp},{label:(0,C.__)("Align text right"),value:"right",icon:Ip},{label:(0,C.__)("Justify text"),value:"justify",icon:jp}],Mp=["left","center","right"];function Pp({className:e,value:t,onChange:n,options:o=Mp}){const r=(0,a.useMemo)((()=>Tp.filter((e=>o.includes(e.value)))),[o]);return r.length?(0,U.jsx)(Ep,{label:(0,C.__)("Text alignment"),options:r,className:Bs("block-editor-text-alignment-control",e),value:t,onChange:e=>{n(e===t?void 0:e)}}):null}const Rp=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M7 11.5h10V13H7z"})}),Np=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.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"})}),Ap=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.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"})}),Lp=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.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"})}),Op=[{label:(0,C.__)("None"),value:"none",icon:Rp},{label:(0,C.__)("Uppercase"),value:"uppercase",icon:Np},{label:(0,C.__)("Lowercase"),value:"lowercase",icon:Ap},{label:(0,C.__)("Capitalize"),value:"capitalize",icon:Lp}];function Dp({className:e,value:t,onChange:n}){return(0,U.jsx)(Ep,{label:(0,C.__)("Letter case"),options:Op,className:Bs("block-editor-text-transform-control",e),value:t,onChange:e=>{n(e===t?void 0:e)}})}const zp=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.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"})}),Vp=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.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"})}),Fp=[{label:(0,C.__)("None"),value:"none",icon:Rp},{label:(0,C.__)("Underline"),value:"underline",icon:zp},{label:(0,C.__)("Strikethrough"),value:"line-through",icon:Vp}];function Hp({value:e,onChange:t,className:n}){return(0,U.jsx)(Ep,{label:(0,C.__)("Decoration"),options:Fp,className:Bs("block-editor-text-decoration-control",n),value:e,onChange:n=>{t(n===e?void 0:n)}})}const Gp=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M8.2 14.4h3.9L13 17h1.7L11 6.5H9.3L5.6 17h1.7l.9-2.6zm2-5.5 1.4 4H8.8l1.4-4zm7.4 7.5-1.3.8.8 1.4H5.5V20h14.3l-2.2-3.6z"})}),Up=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M7 5.6v1.7l2.6.9v3.9L7 13v1.7L17.5 11V9.3L7 5.6zm4.2 6V8.8l4 1.4-4 1.4zm-5.7 5.6V5.5H4v14.3l3.6-2.2-.8-1.3-1.3.9z"})}),$p=[{label:(0,C.__)("Horizontal"),value:"horizontal-tb",icon:Gp},{label:(0,C.__)("Vertical"),value:(0,C.isRTL)()?"vertical-lr":"vertical-rl",icon:Up}];function Wp({className:e,value:t,onChange:n}){return(0,U.jsx)(Ep,{label:(0,C.__)("Orientation"),options:$p,className:Bs("block-editor-writing-mode-control",e),value:t,onChange:e=>{n(e===t?void 0:e)}})}const Kp=1,Zp=6;function qp(e){const t=Xp(e),n=Qp(e),o=Jp(e),r=eh(e),s=nh(e),i=th(e),l=oh(e),a=rh(e),c=sh(e),u=Yp(e);return t||n||o||r||s||i||u||l||a||c}function Yp(e){return!1!==e?.typography?.defaultFontSizes&&e?.typography?.fontSizes?.default?.length||e?.typography?.fontSizes?.theme?.length||e?.typography?.fontSizes?.custom?.length||e?.typography?.customFontSize}function Xp(e){return["default","theme","custom"].some((t=>e?.typography?.fontFamilies?.[t]?.length))}function Qp(e){return e?.typography?.lineHeight}function Jp(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function eh(e){return e?.typography?.letterSpacing}function th(e){return e?.typography?.textTransform}function nh(e){return e?.typography?.textAlign}function oh(e){return e?.typography?.textDecoration}function rh(e){return e?.typography?.writingMode}function sh(e){return e?.typography?.textColumns}function ih({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const s=us();return(0,U.jsx)(Ns.__experimentalToolsPanel,{label:(0,C.__)("Typography"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:s,children:r})}const lh={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function ah({as:e=ih,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,defaultControls:i=lh}){const l=e=>ps({settings:r},"",e),c=Xp(r),u=r?.typography?.fontFamilies,d=(0,a.useMemo)((()=>["default","theme","custom"].flatMap((e=>{var t;return null!==(t=u?.[e])&&void 0!==t?t:[]}))),[u]),p=l(o?.typography?.fontFamily),h=e=>{const o=d?.find((({fontFamily:t})=>t===e))?.slug;n(ge(t,["typography","fontFamily"],o?`var:preset|font-family|${o}`:e||void 0))},g=Yp(r),m=!r?.typography?.customFontSize,f=function(e){var t,n,o;const r=e?.typography?.fontSizes,s=!!e?.typography?.defaultFontSizes;return[...null!==(t=r?.custom)&&void 0!==t?t:[],...null!==(n=r?.theme)&&void 0!==n?n:[],...s&&null!==(o=r?.default)&&void 0!==o?o:[]]}(r),b=l(o?.typography?.fontSize),v=(e,o)=>{n(ge(t,["typography","fontSize"],(o?.slug?`var:preset|font-size|${o?.slug}`:e)||void 0))},k=Jp(r),_=function(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,C.__)("Appearance"):(0,C.__)("Font style"):(0,C.__)("Font weight")}(r),x=r?.typography?.fontStyle,y=r?.typography?.fontWeight,S=l(o?.typography?.fontStyle),w=l(o?.typography?.fontWeight),B=({fontStyle:e,fontWeight:o})=>{n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:o||void 0}})},I=Qp(r),j=l(o?.typography?.lineHeight),E=e=>{n(ge(t,["typography","lineHeight"],e||void 0))},T=eh(r),M=l(o?.typography?.letterSpacing),P=e=>{n(ge(t,["typography","letterSpacing"],e||void 0))},R=sh(r),N=l(o?.typography?.textColumns),A=e=>{n(ge(t,["typography","textColumns"],e||void 0))},L=th(r),O=l(o?.typography?.textTransform),D=e=>{n(ge(t,["typography","textTransform"],e||void 0))},z=oh(r),V=l(o?.typography?.textDecoration),F=e=>{n(ge(t,["typography","textDecoration"],e||void 0))},H=rh(r),G=l(o?.typography?.writingMode),$=e=>{n(ge(t,["typography","writingMode"],e||void 0))},W=nh(r),K=l(o?.typography?.textAlign),Z=e=>{n(ge(t,["typography","textAlign"],e||void 0))},q=(0,a.useCallback)((e=>({...e,typography:{}})),[]);return(0,U.jsxs)(e,{resetAllFilter:q,value:t,onChange:n,panelId:s,children:[c&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{label:(0,C.__)("Font"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>h(void 0),isShownByDefault:i.fontFamily,panelId:s,children:(0,U.jsx)(bp,{fontFamilies:d,value:p,onChange:h,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),g&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{label:(0,C.__)("Size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>v(void 0),isShownByDefault:i.fontSize,panelId:s,children:(0,U.jsx)(Ns.FontSizePicker,{value:b,onChange:v,fontSizes:f,disableCustomFontSizes:m,withReset:!1,withSlider:!0,size:"__unstable-large"})}),k&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{className:"single-column",label:_,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:()=>{B({})},isShownByDefault:i.fontAppearance,panelId:s,children:(0,U.jsx)(xp,{value:{fontStyle:S,fontWeight:w},onChange:B,hasFontStyles:x,hasFontWeights:y,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),I&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{className:"single-column",label:(0,C.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>E(void 0),isShownByDefault:i.lineHeight,panelId:s,children:(0,U.jsx)(Sp,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:j,onChange:E,size:"__unstable-large"})}),T&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{className:"single-column",label:(0,C.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>P(void 0),isShownByDefault:i.letterSpacing,panelId:s,children:(0,U.jsx)(wp,{value:M,onChange:P,size:"__unstable-large",__unstableInputWidth:"auto"})}),R&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{className:"single-column",label:(0,C.__)("Columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>A(void 0),isShownByDefault:i.textColumns,panelId:s,children:(0,U.jsx)(Ns.__experimentalNumberControl,{label:(0,C.__)("Columns"),max:Zp,min:Kp,onChange:A,size:"__unstable-large",spinControls:"custom",value:N,initialPosition:1})}),z&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{className:"single-column",label:(0,C.__)("Decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>F(void 0),isShownByDefault:i.textDecoration,panelId:s,children:(0,U.jsx)(Hp,{value:V,onChange:F,size:"__unstable-large",__unstableInputWidth:"auto"})}),H&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{className:"single-column",label:(0,C.__)("Orientation"),hasValue:()=>!!t?.typography?.writingMode,onDeselect:()=>$(void 0),isShownByDefault:i.writingMode,panelId:s,children:(0,U.jsx)(Wp,{value:G,onChange:$,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),L&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{label:(0,C.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>D(void 0),isShownByDefault:i.textTransform,panelId:s,children:(0,U.jsx)(Dp,{value:O,onChange:D,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),W&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{label:(0,C.__)("Text alignment"),hasValue:()=>!!t?.typography?.textAlign,onDeselect:()=>Z(void 0),isShownByDefault:i.textAlign,panelId:s,children:(0,U.jsx)(Pp,{value:K,onChange:Z,size:"__unstable-large",__nextHasNoMarginBottom:!0})})]})}const ch="typography.lineHeight";const uh=window.wp.tokenList;var dh=n.n(uh);const ph="typography.__experimentalFontFamily",{kebabCase:hh}=Q(Ns.privateApis);function gh(e,t,n){if(!(0,l.hasBlockSupport)(t,ph))return e;if(Es(t,Lh,"fontFamily"))return e;if(!n?.fontFamily)return e;const o=new(dh())(e.className);o.add(`has-${hh(n?.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}const mh={useBlockProps:function({name:e,fontFamily:t}){return gh({},e,{fontFamily:t})},addSaveProps:gh,attributeKeys:["fontFamily"],hasSupport:e=>(0,l.hasBlockSupport)(e,ph)};(0,d.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,l.hasBlockSupport)(e,ph)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e}));const{kebabCase:fh}=Q(Ns.privateApis),bh=(e,t,n)=>{if(t){const n=e?.find((({slug:e})=>e===t));if(n)return n}return{size:n}};function vh(e,t){const n=e?.find((({size:e})=>e===t));return n||{size:t}}function kh(e){if(e)return`has-${fh(e)}-font-size`}const _h="typography.fontSize";function xh(e,t,n){if(!(0,l.hasBlockSupport)(t,_h))return e;if(Es(t,Lh,"fontSize"))return e;const o=new(dh())(e.className);o.add(kh(n.fontSize));const r=o.value;return e.className=r||void 0,e}const yh={useBlockProps:function({name:e,fontSize:t,style:n}){const[o,r,s]=Kr("typography.fontSizes","typography.fluid","layout");if(!(0,l.hasBlockSupport)(e,_h)||Es(e,Lh,"fontSize")||!t&&!n?.typography?.fontSize)return;let i;return n?.typography?.fontSize&&(i={style:{fontSize:rs({size:n.typography.fontSize},{typography:{fluid:r},layout:s})}}),t&&(i={style:{fontSize:bh(o,t,n?.typography?.fontSize).size}}),i?xh(i,e,{fontSize:t}):void 0},addSaveProps:xh,attributeKeys:["fontSize","style"],hasSupport:e=>(0,l.hasBlockSupport)(e,_h)},Sh={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,d.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,l.hasBlockSupport)(e,_h)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,d.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const r=e.name;return js({fontSize:(0,l.hasBlockSupport)(r,_h)},Sh,e,t,n,o)}));const wh=[{icon:Cp,title:(0,C.__)("Align text left"),align:"left"},{icon:Bp,title:(0,C.__)("Align text center"),align:"center"},{icon:Ip,title:(0,C.__)("Align text right"),align:"right"}],Ch={placement:"bottom-start"};const Bh=function({value:e,onChange:t,alignmentControls:n=wh,label:o=(0,C.__)("Align text"),describedBy:r=(0,C.__)("Change text alignment"),isCollapsed:s=!0,isToolbar:i}){function l(n){return()=>t(e===n?void 0:n)}const a=n.find((t=>t.align===e)),c=i?Ns.ToolbarGroup:Ns.ToolbarDropdownMenu,u=i?{isCollapsed:s}:{toggleProps:{describedBy:r},popoverProps:Ch};return(0,U.jsx)(c,{icon:a?a.icon:(0,C.isRTL)()?Ip:Cp,label:o,controls:n.map((t=>{const{align:n}=t,o=e===n;return{...t,isActive:o,role:s?"menuitemradio":void 0,onClick:l(n)}})),...u})},Ih=e=>(0,U.jsx)(Bh,{...e,isToolbar:!1}),jh=e=>(0,U.jsx)(Bh,{...e,isToolbar:!0}),Eh="typography.textAlign",Th=[{icon:Cp,title:(0,C.__)("Align text left"),align:"left"},{icon:Bp,title:(0,C.__)("Align text center"),align:"center"},{icon:Ip,title:(0,C.__)("Align text right"),align:"right"}],Mh=["left","center","right"],Ph=[];function Rh(e){return Array.isArray(e)?Mh.filter((t=>e.includes(t))):!0===e?Mh:Ph}const Nh={edit:function({style:e,name:t,setAttributes:n}){const o=Ps(t),r=o?.typography?.textAlign,s=Nl();if(!r||"default"!==s)return null;const i=Rh((0,l.getBlockSupport)(t,Eh));if(!i.length)return null;const a=Th.filter((e=>i.includes(e.align)));return(0,U.jsx)(Fs,{group:"block",children:(0,U.jsx)(Ih,{value:e?.typography?.textAlign,onChange:t=>{const o={...e,typography:{...e?.typography,textAlign:t}};n({style:Is(o)})},alignmentControls:a})})},useBlockProps:function({name:e,style:t}){if(!t?.typography?.textAlign)return null;if(!Rh((0,l.getBlockSupport)(e,Eh)).length)return null;if(Es(e,Lh,"textAlign"))return null;const n=t.typography.textAlign;return{className:Bs({[`has-text-align-${n}`]:n})}},addSaveProps:function(e,t,n){if(!n?.style?.typography?.textAlign)return e;const{textAlign:o}=n.style.typography,r=(0,l.getBlockSupport)(t,Eh);Rh(r).includes(o)&&!Es(t,Lh,"textAlign")&&(e.className=Bs(`has-text-align-${o}`,e.className));return e},attributeKeys:["style"],hasSupport:e=>(0,l.hasBlockSupport)(e,Eh,!1)};function Ah(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const Lh="typography",Oh=[ch,_h,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",ph,Eh,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function Dh(e){const t={...Ah(e,["fontFamily"])},n=e?.typography?.fontSize,o=e?.typography?.fontFamily,r=n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,s=o?.startsWith("var:preset|font-family|")?o.substring(23):void 0;return t.typography={...Ah(t.typography,["fontFamily"]),fontSize:r?void 0:n},{style:Is(t),fontFamily:s,fontSize:r}}function zh(e){return{...e.style,typography:{...e.style?.typography,fontFamily:e.fontFamily?"var:preset|font-family|"+e.fontFamily:void 0,fontSize:e.fontSize?"var:preset|font-size|"+e.fontSize:e.style?.typography?.fontSize}}}function Vh({children:e,resetAllFilter:t}){const n=(0,a.useCallback)((e=>{const n=zh(e),o=t(n);return{...e,...Dh(o)}}),[t]);return(0,U.jsx)(sa,{group:"typography",resetAllFilter:n,children:e})}function Fh({clientId:e,name:t,setAttributes:n,settings:o}){const{style:r,fontFamily:s,fontSize:i}=(0,c.useSelect)((function(t){const{style:n,fontFamily:o,fontSize:r}=t($r).getBlockAttributes(e)||{};return{style:n,fontFamily:o,fontSize:r}}),[e]),u=qp(o),d=(0,a.useMemo)((()=>zh({style:r,fontFamily:s,fontSize:i})),[r,i,s]);if(!u)return null;const p=(0,l.getBlockSupport)(t,[Lh,"__experimentalDefaultControls"]);return(0,U.jsx)(ah,{as:Vh,panelId:e,settings:o,value:d,onChange:e=>{n(Dh(e))},defaultControls:p})}const Hh=(0,U.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,U.jsx)(G.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,U.jsx)(G.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]}),Gh={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};function Uh({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:o,onMouseOut:r,onMouseOver:s,showSideInLabel:i=!0,side:l,spacingSizes:d,type:p,value:h}){var g,m;h=gi(h,d);let f=d;const b=d.length<=ii,v=(0,c.useSelect)((e=>{const t=e($r).getSettings();return t?.disableCustomSpacingSizes})),[k,_]=(0,a.useState)(!v&&void 0!==h&&!pi(h)),[x,y]=(0,a.useState)(n),S=(0,u.usePrevious)(h);h&&S!==h&&!pi(h)&&!0!==k&&_(!0);const[w]=Kr("spacing.units"),B=(0,Ns.__experimentalUseCustomUnits)({availableUnits:w||["px","em","rem"]});let I=null;!b&&!k&&void 0!==h&&(!pi(h)||pi(h)&&t)?(f=[...d,{name:t?(0,C.__)("Mixed"):(0,C.sprintf)((0,C.__)("Custom (%s)"),h),slug:"custom",size:h}],I=f.length-1):t||(I=k?hi(h,d):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":fi(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(h,d));const j=(0,a.useMemo)((()=>(0,Ns.__experimentalParseQuantityAndUnitFromRawValue)(I)),[I])[1]||B[0]?.value,E=parseFloat(I,10),T=(e,t)=>{const n=parseInt(e,10);if("selectList"===t){if(0===n)return;if(1===n)return"0"}else if(0===n)return"0";return`var:preset|spacing|${d[e]?.slug}`},M=t?(0,C.__)("Mixed"):null,P=f.map(((e,t)=>({key:t,name:e.name}))),R=d.map(((e,t)=>({value:t,label:void 0}))),N=li.includes(l)&&i?ui[l]:"",A=i?p?.toLowerCase():p,L=(0,C.sprintf)((0,C.__)("%1$s %2$s"),N,A).trim();return(0,U.jsxs)(Ns.__experimentalHStack,{className:"spacing-sizes-control__wrapper",children:[e&&(0,U.jsx)(Ns.Icon,{className:"spacing-sizes-control__icon",icon:e,size:24}),k&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.__experimentalUnitControl,{onMouseOver:s,onMouseOut:r,onFocus:s,onBlur:r,onChange:e=>o((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:I,units:B,min:x,placeholder:M,disableUnits:t,label:L,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large",onDragStart:()=>{"-"===h?.charAt(0)&&y(0)},onDrag:()=>{"-"===h?.charAt(0)&&y(0)},onDragEnd:()=>{y(n)}}),(0,U.jsx)(Ns.RangeControl,{onMouseOver:s,onMouseOut:r,onFocus:s,onBlur:r,value:E,min:0,max:null!==(g=Gh[j]?.max)&&void 0!==g?g:10,step:null!==(m=Gh[j]?.steps)&&void 0!==m?m:.1,withInputField:!1,onChange:e=>{o([e,j].join(""))},className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})]}),b&&!k&&(0,U.jsx)(Ns.RangeControl,{onMouseOver:s,onMouseOut:r,className:"spacing-sizes-control__range-control",value:I,onChange:e=>o(T(e)),onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===h&&o("0")},withInputField:!1,"aria-valuenow":I,"aria-valuetext":d[I]?.name,renderTooltipContent:e=>void 0===h?void 0:d[e]?.name,min:0,max:d.length-1,marks:R,label:L,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:s,onBlur:r}),!b&&!k&&(0,U.jsx)(Ns.CustomSelectControl,{className:"spacing-sizes-control__custom-select-control",value:P.find((e=>e.key===I))||"",onChange:e=>{o(T(e.selectedItem.key,"selectList"))},options:P,label:L,hideLabelFromVision:!0,size:"__unstable-large",onMouseOver:s,onMouseOut:r,onFocus:s,onBlur:r}),!v&&(0,U.jsx)(Ns.Button,{label:k?(0,C.__)("Use size preset"):(0,C.__)("Set custom size"),icon:Hh,onClick:()=>{_(!k)},isPressed:k,size:"small",className:"spacing-sizes-control__custom-toggle",iconSize:24})]})}const $h=["vertical","horizontal"];function Wh({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:s,type:i,values:l}){const a=e=>n=>{if(!t)return;const o={...Object.keys(l).reduce(((e,t)=>(e[t]=gi(l[t],s),e)),{})};"vertical"===e&&(o.top=n,o.bottom=n),"horizontal"===e&&(o.left=n,o.right=n),t(o)},c=r?.length?$h.filter((e=>bi(r,e))):$h;return(0,U.jsx)(U.Fragment,{children:c.map((t=>{const r="vertical"===t?l.top:l.left;return(0,U.jsx)(Uh,{icon:ci[t],label:ui[t],minimumCustomValue:e,onChange:a(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:s,type:i,value:r,withInputField:!1},`spacing-sizes-control-${t}`)}))})}function Kh({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:s,type:i,values:l}){const a=r?.length?li.filter((e=>r.includes(e))):li,c=e=>n=>{const o={...Object.keys(l).reduce(((e,t)=>(e[t]=gi(l[t],s),e)),{})};o[e]=n,t(o)};return(0,U.jsx)(U.Fragment,{children:a.map((t=>(0,U.jsx)(Uh,{icon:ci[t],label:ui[t],minimumCustomValue:e,onChange:c(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:s,type:i,value:l[t],withInputField:!1},`spacing-sizes-control-${t}`)))})}function Zh({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:s,spacingSizes:i,type:l,values:a}){return(0,U.jsx)(Uh,{label:ui[s],minimumCustomValue:e,onChange:(c=s,e=>{const n={...Object.keys(a).reduce(((e,t)=>(e[t]=gi(a[t],i),e)),{})};n[c]=e,t(n)}),onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:s,spacingSizes:i,type:l,value:a[s],withInputField:!1});var c}const qh=(0,U.jsx)(Ns.Icon,{icon:Zu,size:24});function Yh({label:e,onChange:t,sides:n,value:o}){if(!n||!n.length)return;const r=function(e){if(!e||!e.length)return{};const t={},n=bi(e,"horizontal"),o=bi(e,"vertical");n&&o?t.axial={label:ui.axial,icon:ci.axial}:n?t.axial={label:ui.horizontal,icon:ci.horizontal}:o&&(t.axial={label:ui.vertical,icon:ci.vertical});let r=0;return li.forEach((n=>{e.includes(n)&&(r+=1,t[n]={label:ui[n],icon:ci[n]})})),r>1&&(t.custom={label:ui.custom,icon:ci.custom}),t}(n),s=r[o].icon,{custom:i,...l}=r;return(0,U.jsx)(Ns.DropdownMenu,{icon:s,label:e,className:"spacing-sizes-control__dropdown",toggleProps:{size:"small"},children:({onClose:e})=>(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.MenuGroup,{children:Object.entries(l).map((([n,{label:r,icon:s}])=>{const i=o===n;return(0,U.jsx)(Ns.MenuItem,{icon:s,iconPosition:"left",isSelected:i,role:"menuitemradio",onClick:()=>{t(n),e()},suffix:i?qh:void 0,children:r},n)}))}),!!i&&(0,U.jsx)(Ns.MenuGroup,{children:(0,U.jsx)(Ns.MenuItem,{icon:i.icon,iconPosition:"left",isSelected:o===di.custom,role:"menuitemradio",onClick:()=>{t(di.custom),e()},suffix:o===di.custom?qh:void 0,children:i.label})})]})})}const Xh=[],Qh=new Intl.Collator("und",{numeric:!0}).compare;function Jh(){const[e,t,n,o]=Kr("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),r=null!=e?e:Xh,s=null!=t?t:Xh,i=n&&!1!==o?n:Xh;return(0,a.useMemo)((()=>{const e=[{name:(0,C.__)("None"),slug:"0",size:0},...r,...s,...i];return e.every((({slug:e})=>/^[0-9]/.test(e)))&&e.sort(((e,t)=>Qh(e.slug,t.slug))),e.length>ii?[{name:(0,C.__)("Default"),slug:"default",size:void 0},...e]:e}),[r,s,i])}function eg({inputProps:e,label:t,minimumCustomValue:n=0,onChange:o,onMouseOut:r,onMouseOver:s,showSideInLabel:i=!0,sides:l=li,useSelect:c,values:u}){const d=Jh(),p=u||ai,h=1===l?.length,g=l?.includes("horizontal")&&l?.includes("vertical")&&2===l?.length,[m,f]=(0,a.useState)(function(e={},t){const{top:n,right:o,bottom:r,left:s}=e,i=[n,o,r,s].filter(Boolean),l=!(n!==r||s!==o||!n&&!s),a=!i.length&&function(e=[]){const t={top:0,right:0,bottom:0,left:0};return e.forEach((e=>t[e]+=1)),(t.top+t.bottom)%2==0&&(t.left+t.right)%2==0}(t);if(bi(t)&&(l||a))return di.axial;if(1===i.length){let t;return Object.entries(e).some((([e,n])=>(t=e,void 0!==n))),t}return 1!==t?.length||i.length?di.custom:t[0]}(p,l)),b={...e,minimumCustomValue:n,onChange:e=>{const t={...u,...e};o(t)},onMouseOut:r,onMouseOver:s,sides:l,spacingSizes:d,type:t,useSelect:c,values:p},v=li.includes(m)&&i?ui[m]:"",k=(0,C.sprintf)((0,C.__)("%1$s %2$s"),t,v).trim(),_=(0,C.sprintf)((0,C._x)("%s options","Button label to reveal side configuration options"),t);return(0,U.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,U.jsxs)(Ns.__experimentalHStack,{className:"spacing-sizes-control__header",children:[(0,U.jsx)(Ns.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:k}),!h&&!g&&(0,U.jsx)(Yh,{label:_,onChange:f,sides:l,value:m})]}),(0,U.jsx)(Ns.__experimentalVStack,{spacing:.5,children:m===di.axial?(0,U.jsx)(Wh,{...b}):m===di.custom?(0,U.jsx)(Kh,{...b}):(0,U.jsx)(Zh,{side:m,...b,showSideInLabel:i})})]})}const tg={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}};function ng({label:e=(0,C.__)("Height"),onChange:t,value:n}){var o,r;const s=parseFloat(n),[i]=Kr("spacing.units"),l=(0,Ns.__experimentalUseCustomUnits)({availableUnits:i||["%","px","em","rem","vh","vw"]}),c=(0,a.useMemo)((()=>(0,Ns.__experimentalParseQuantityAndUnitFromRawValue)(n)),[n])[1]||l[0]?.value||"px";return(0,U.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,U.jsx)(Ns.BaseControl.VisualLabel,{as:"legend",children:e}),(0,U.jsxs)(Ns.Flex,{children:[(0,U.jsx)(Ns.FlexItem,{isBlock:!0,children:(0,U.jsx)(Ns.__experimentalUnitControl,{value:n,units:l,onChange:t,onUnitChange:e=>{const[o,r]=(0,Ns.__experimentalParseQuantityAndUnitFromRawValue)(n);["em","rem"].includes(e)&&"px"===r?t((o/16).toFixed(2)+e):["em","rem"].includes(r)&&"px"===e?t(Math.round(16*o)+e):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(e)&&o>100&&t(100+e)},min:0,size:"__unstable-large",label:e,hideLabelFromVision:!0})}),(0,U.jsx)(Ns.FlexItem,{isBlock:!0,children:(0,U.jsx)(Ns.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,U.jsx)(Ns.RangeControl,{value:s,min:0,max:null!==(o=tg[c]?.max)&&void 0!==o?o:100,step:null!==(r=tg[c]?.step)&&void 0!==r?r:.1,withInputField:!1,onChange:e=>{t([e,c].join(""))},__nextHasNoMarginBottom:!0,label:e,hideLabelFromVision:!0})})})]})]})}function og(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,C.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,C.__)("Specify a fixed width."):"fixed"===e?(0,C.__)("Specify a fixed height."):(0,C.__)("Fit contents.")}function rg({value:e={},onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}){const{selfStretch:s,flexSize:i,columnStart:l,rowStart:c,columnSpan:u,rowSpan:d}=e,{type:p,default:{type:h="default"}={},orientation:g="horizontal"}=null!=n?n:{},m=p||h,f="horizontal"===g?(0,C.__)("Width"):(0,C.__)("Height");return(0,a.useEffect)((()=>{"fixed"!==s||i||t({...e,selfStretch:"fit"})}),[]),(0,U.jsxs)(U.Fragment,{children:["flex"===m&&(0,U.jsxs)(Ns.__experimentalVStack,{as:Ns.__experimentalToolsPanelItem,spacing:2,hasValue:()=>!!s,label:f,onDeselect:()=>{t({selfStretch:void 0,flexSize:void 0})},isShownByDefault:o,panelId:r,children:[(0,U.jsxs)(Ns.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:sg(n),value:s||"fit",help:og(s,n),onChange:e=>{t({selfStretch:e,flexSize:"fixed"!==e?null:i})},isBlock:!0,children:[(0,U.jsx)(Ns.__experimentalToggleGroupControlOption,{value:"fit",label:(0,C.__)("Fit")},"fit"),(0,U.jsx)(Ns.__experimentalToggleGroupControlOption,{value:"fill",label:(0,C.__)("Fill")},"fill"),(0,U.jsx)(Ns.__experimentalToggleGroupControlOption,{value:"fixed",label:(0,C.__)("Fixed")},"fixed")]}),"fixed"===s&&(0,U.jsx)(Ns.__experimentalUnitControl,{size:"__unstable-large",onChange:e=>{t({selfStretch:s,flexSize:e})},value:i})]}),"grid"===m&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Ns.__experimentalHStack,{as:Ns.__experimentalToolsPanelItem,hasValue:()=>!!u||!!d,label:(0,C.__)("Grid span"),onDeselect:()=>{t({columnSpan:void 0,rowSpan:void 0})},isShownByDefault:o,panelId:r,children:[(0,U.jsx)(Ns.__experimentalInputControl,{size:"__unstable-large",label:(0,C.__)("Column span"),type:"number",onChange:e=>{t({columnStart:l,rowStart:c,rowSpan:d,columnSpan:e})},value:u,min:1}),(0,U.jsx)(Ns.__experimentalInputControl,{size:"__unstable-large",label:(0,C.__)("Row span"),type:"number",onChange:e=>{t({columnStart:l,rowStart:c,columnSpan:u,rowSpan:e})},value:d,min:1})]}),window.__experimentalEnableGridInteractivity&&(0,U.jsxs)(Ns.Flex,{as:Ns.__experimentalToolsPanelItem,hasValue:()=>!!l||!!c,label:(0,C.__)("Grid placement"),onDeselect:()=>{t({columnStart:void 0,rowStart:void 0})},isShownByDefault:!1,panelId:r,children:[(0,U.jsx)(Ns.FlexItem,{style:{width:"50%"},children:(0,U.jsx)(Ns.__experimentalInputControl,{size:"__unstable-large",label:(0,C.__)("Column"),type:"number",onChange:e=>{t({columnStart:e,rowStart:c,columnSpan:u,rowSpan:d})},value:l,min:1,max:n?.columnCount?n.columnCount-(null!=u?u:1)+1:void 0})}),(0,U.jsx)(Ns.FlexItem,{style:{width:"50%"},children:(0,U.jsx)(Ns.__experimentalInputControl,{size:"__unstable-large",label:(0,C.__)("Row"),type:"number",onChange:e=>{t({columnStart:l,rowStart:e,columnSpan:u,rowSpan:d})},value:c,min:1,max:n?.rowCount?n.rowCount-(null!=d?d:1)+1:void 0})})]})]})]})}function sg(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,C.__)("Width"):(0,C.__)("Height")}function ig({panelId:e,value:t,onChange:n=(()=>{}),options:o,defaultValue:r="auto",hasValue:s,isShownByDefault:i=!0}){const l=null!=t?t:"auto",[a,c,u]=Kr("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),d=c?.map((({name:e,ratio:t})=>({label:e,value:t}))),p=a?.map((({name:e,ratio:t})=>({label:e,value:t}))),h=[{label:(0,C._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...u?p:[],...d||[],{label:(0,C._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,U.jsx)(Ns.__experimentalToolsPanelItem,{hasValue:s||(()=>l!==r),label:(0,C.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:i,panelId:e,children:(0,U.jsx)(Ns.SelectControl,{label:(0,C.__)("Aspect ratio"),value:l,options:null!=o?o:h,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0})})}const lg=["horizontal","vertical"];function ag(e){const t=cg(e),n=ug(e),o=dg(e),r=pg(e),s=hg(e),i=gg(e),l=mg(e),c=fg(e);return"web"===a.Platform.OS&&(t||n||o||r||s||i||l||c)}function cg(e){return e?.layout?.contentSize}function ug(e){return e?.layout?.wideSize}function dg(e){return e?.spacing?.padding}function pg(e){return e?.spacing?.margin}function hg(e){return e?.spacing?.blockGap}function gg(e){return e?.dimensions?.minHeight}function mg(e){return e?.dimensions?.aspectRatio}function fg(e){var t;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=null!==(t=e?.parentLayout)&&void 0!==t?t:{},s=("flex"===o||"flex"===n||"grid"===o||"grid"===n)&&r;return!!e?.layout&&s}function bg(e,t){if(!t||!e)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e?.[t]})),n}function vg(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function kg({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const s=us();return(0,U.jsx)(Ns.__experimentalToolsPanel,{label:(0,C.__)("Dimensions"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:s,children:r})}const _g={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,aspectRatio:!0,childLayout:!0};function xg({as:e=kg,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,defaultControls:i=_g,onVisualize:l=(()=>{}),includeLayoutControls:c=!1}){var u,d,p,h,g,m,f,b;const{dimensions:v,spacing:k}=r,_=e=>e&&"object"==typeof e?Object.keys(e).reduce(((t,n)=>(t[n]=ps({settings:{dimensions:v,spacing:k}},"",e[n]),t)),{}):ps({settings:{dimensions:v,spacing:k}},"",e),x=function(e){const{defaultSpacingSizes:t,spacingSizes:n}=e?.spacing||{};return!1!==t&&n?.default?.length>0||n?.theme?.length>0||n?.custom?.length>0}(r),y=(0,Ns.__experimentalUseCustomUnits)({availableUnits:r?.spacing?.units||["%","px","em","rem","vw"]}),S=-1/0,[w,B]=(0,a.useState)(S),I=cg(r)&&c,j=_(o?.layout?.contentSize),E=e=>{n(ge(t,["layout","contentSize"],e||void 0))},T=ug(r)&&c,M=_(o?.layout?.wideSize),P=e=>{n(ge(t,["layout","wideSize"],e||void 0))},R=dg(r),N=vg(_(o?.spacing?.padding)),A=Array.isArray(r?.spacing?.padding)?r?.spacing?.padding:r?.spacing?.padding?.sides,L=A&&A.some((e=>lg.includes(e))),O=e=>{const o=bg(e,A);n(ge(t,["spacing","padding"],o))},D=()=>l("padding"),z=pg(r),V=vg(_(o?.spacing?.margin)),F=Array.isArray(r?.spacing?.margin)?r?.spacing?.margin:r?.spacing?.margin?.sides,H=F&&F.some((e=>lg.includes(e))),G=e=>{const o=bg(e,F);n(ge(t,["spacing","margin"],o))},$=()=>l("margin"),W=hg(r),K=_(o?.spacing?.blockGap),Z=function(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:e?.left,bottom:e?.top}:e}(K),q=Array.isArray(r?.spacing?.blockGap)?r?.spacing?.blockGap:r?.spacing?.blockGap?.sides,Y=q&&q.some((e=>lg.includes(e))),X=e=>{n(ge(t,["spacing","blockGap"],e))},Q=e=>{e||X(null),!Y&&e?.hasOwnProperty("top")?X(e.top):X({top:e?.top,left:e?.left})},J=gg(r),ee=_(o?.dimensions?.minHeight),te=e=>{const o=ge(t,["dimensions","minHeight"],e);n(ge(o,["dimensions","aspectRatio"],void 0))},ne=mg(r),oe=_(o?.dimensions?.aspectRatio),re=fg(r),se=o?.layout,ie=(0,a.useCallback)((e=>({...e,layout:Is({...e?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0,columnStart:void 0,rowStart:void 0,columnSpan:void 0,rowSpan:void 0}),spacing:{...e?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...e?.dimensions,minHeight:void 0,aspectRatio:void 0}})),[]),le=()=>l(!1),ae={min:w,onDragStart:()=>{B(0)},onDragEnd:()=>{B(S)}};return(0,U.jsxs)(e,{resetAllFilter:ie,value:t,onChange:n,panelId:s,children:[(I||T)&&(0,U.jsx)("span",{className:"span-columns",children:(0,C.__)("Set the width of the main content area.")}),I&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{className:"single-column",label:(0,C.__)("Content size"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>E(void 0),isShownByDefault:null!==(u=i.contentSize)&&void 0!==u?u:_g.contentSize,panelId:s,children:(0,U.jsxs)(Ns.__experimentalHStack,{alignment:"flex-end",justify:"flex-start",children:[(0,U.jsx)(Ns.__experimentalUnitControl,{label:(0,C.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:j||"",onChange:e=>{E(e)},units:y}),(0,U.jsx)(Ns.__experimentalView,{children:(0,U.jsx)(Ui,{icon:$i})})]})}),T&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{className:"single-column",label:(0,C.__)("Wide size"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>P(void 0),isShownByDefault:null!==(d=i.wideSize)&&void 0!==d?d:_g.wideSize,panelId:s,children:(0,U.jsxs)(Ns.__experimentalHStack,{alignment:"flex-end",justify:"flex-start",children:[(0,U.jsx)(Ns.__experimentalUnitControl,{label:(0,C.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:M||"",onChange:e=>{P(e)},units:y}),(0,U.jsx)(Ns.__experimentalView,{children:(0,U.jsx)(Ui,{icon:Wi})})]})}),R&&(0,U.jsxs)(Ns.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,C.__)("Padding"),onDeselect:()=>O(void 0),isShownByDefault:null!==(p=i.padding)&&void 0!==p?p:_g.padding,className:Bs({"tools-panel-item-spacing":x}),panelId:s,children:[!x&&(0,U.jsx)(Ns.__experimentalBoxControl,{values:N,onChange:O,label:(0,C.__)("Padding"),sides:A,units:y,allowReset:!1,splitOnAxis:L,onMouseOver:D,onMouseOut:le}),x&&(0,U.jsx)(eg,{values:N,onChange:O,label:(0,C.__)("Padding"),sides:A,units:y,allowReset:!1,onMouseOver:D,onMouseOut:le})]}),z&&(0,U.jsxs)(Ns.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,C.__)("Margin"),onDeselect:()=>G(void 0),isShownByDefault:null!==(h=i.margin)&&void 0!==h?h:_g.margin,className:Bs({"tools-panel-item-spacing":x}),panelId:s,children:[!x&&(0,U.jsx)(Ns.__experimentalBoxControl,{values:V,onChange:G,inputProps:ae,label:(0,C.__)("Margin"),sides:F,units:y,allowReset:!1,splitOnAxis:H,onMouseOver:$,onMouseOut:le}),x&&(0,U.jsx)(eg,{values:V,onChange:G,minimumCustomValue:-1/0,label:(0,C.__)("Margin"),sides:F,units:y,allowReset:!1,onMouseOver:$,onMouseOut:le})]}),W&&(0,U.jsxs)(Ns.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,C.__)("Block spacing"),onDeselect:()=>X(void 0),isShownByDefault:null!==(g=i.blockGap)&&void 0!==g?g:_g.blockGap,className:Bs({"tools-panel-item-spacing":x}),panelId:s,children:[!x&&(Y?(0,U.jsx)(Ns.__experimentalBoxControl,{label:(0,C.__)("Block spacing"),min:0,onChange:Q,units:y,sides:q,values:Z,allowReset:!1,splitOnAxis:Y}):(0,U.jsx)(Ns.__experimentalUnitControl,{label:(0,C.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:X,units:y,value:K})),x&&(0,U.jsx)(eg,{label:(0,C.__)("Block spacing"),min:0,onChange:Q,showSideInLabel:!1,sides:Y?q:["top"],values:Z,allowReset:!1})]}),re&&(0,U.jsx)(rg,{value:se,onChange:e=>{n({...t,layout:{...e}})},parentLayout:r?.parentLayout,panelId:s,isShownByDefault:null!==(m=i.childLayout)&&void 0!==m?m:_g.childLayout}),J&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,C.__)("Minimum height"),onDeselect:()=>{te(void 0)},isShownByDefault:null!==(f=i.minHeight)&&void 0!==f?f:_g.minHeight,panelId:s,children:(0,U.jsx)(ng,{label:(0,C.__)("Minimum height"),value:ee,onChange:te})}),ne&&(0,U.jsx)(ig,{hasValue:()=>!!t?.dimensions?.aspectRatio,value:oe,onChange:e=>{const o=ge(t,["dimensions","aspectRatio"],e);n(ge(o,["dimensions","minHeight"],void 0))},panelId:s,isShownByDefault:null!==(b=i.aspectRatio)&&void 0!==b?b:_g.aspectRatio})]})}function yg({clientId:e,value:t,computeStyle:n,forceShow:o}){const r=Ji(e),[s,i]=(0,a.useReducer)((()=>n(r)));(0,a.useLayoutEffect)((()=>{r&&window.requestAnimationFrame((()=>window.requestAnimationFrame(i)))}),[r,t]);const l=(0,a.useRef)(t),[c,u]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{if(fa()(t,l.current)||o)return;u(!0),l.current=t;const e=setTimeout((()=>{u(!1)}),400);return()=>{u(!1),clearTimeout(e)}}),[t,o]),c||o?(0,U.jsx)(sl,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,U.jsx)("div",{className:"block-editor__spacing-visualizer",style:s})}):null}function Sg(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function wg({clientId:e,value:t,forceShow:n}){return(0,U.jsx)(yg,{clientId:e,value:t?.spacing?.margin,computeStyle:e=>{const t=Sg(e,"margin-top"),n=Sg(e,"margin-right"),o=Sg(e,"margin-bottom"),r=Sg(e,"margin-left");return{borderTopWidth:t,borderRightWidth:n,borderBottomWidth:o,borderLeftWidth:r,top:t?`-${t}`:0,right:n?`-${n}`:0,bottom:o?`-${o}`:0,left:r?`-${r}`:0}},forceShow:n})}function Cg({clientId:e,value:t,forceShow:n}){return(0,U.jsx)(yg,{clientId:e,value:t?.spacing?.padding,computeStyle:e=>({borderTopWidth:Sg(e,"padding-top"),borderRightWidth:Sg(e,"padding-right"),borderBottomWidth:Sg(e,"padding-bottom"),borderLeftWidth:Sg(e,"padding-left")}),forceShow:n})}const Bg="dimensions",Ig="spacing";function jg({children:e,resetAllFilter:t}){const n=(0,a.useCallback)((e=>{const n=e.style,o=t(n);return{...e,style:o}}),[t]);return(0,U.jsx)(sa,{group:"dimensions",resetAllFilter:n,children:e})}function Eg({clientId:e,name:t,setAttributes:n,settings:o}){const r=ag(o),s=(0,c.useSelect)((t=>t($r).getBlockAttributes(e)?.style),[e]),[i,u]=function(){const[e,t]=(0,a.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=Q((0,c.useDispatch)($r));return(0,a.useEffect)((()=>{e?n():o()}),[e,o,n]),[e,t]}();if(!r)return null;const d={...(0,l.getBlockSupport)(t,[Bg,"__experimentalDefaultControls"]),...(0,l.getBlockSupport)(t,[Ig,"__experimentalDefaultControls"])};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(xg,{as:jg,panelId:e,settings:o,value:s,onChange:e=>{n({style:Is(e)})},defaultControls:d,onVisualize:u}),!!o?.spacing?.padding&&(0,U.jsx)(Cg,{forceShow:"padding"===i,clientId:e,value:s}),!!o?.spacing?.margin&&(0,U.jsx)(wg,{forceShow:"margin"===i,clientId:e,value:s})]})}function Tg(e,t="any"){if("web"!==a.Platform.OS)return!1;const n=(0,l.getBlockSupport)(e,Bg);return!0===n||("any"===t?!(!n?.aspectRatio&&!n?.minHeight):!!n?.[t])}const Mg={useBlockProps:function({name:e,minHeight:t,style:n}){if(!Tg(e,"aspectRatio")||Es(e,Bg,"aspectRatio"))return{};const o=Bs({"has-aspect-ratio":!!n?.dimensions?.aspectRatio}),r={};n?.dimensions?.aspectRatio?r.minHeight="unset":(t||n?.dimensions?.minHeight)&&(r.aspectRatio="unset");return{className:o,style:r}},attributeKeys:["minHeight","style"],hasSupport:e=>Tg(e,"aspectRatio")};function Pg(){y()("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}const Rg=[...Oh,md,rp,Bg,Oc,Ig,fd],Ng=e=>Rg.some((t=>(0,l.hasBlockSupport)(e,t)));function Ag(e={}){const t={};return(0,Ki.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const Lg={[`${md}.__experimentalSkipSerialization`]:["border"],[`${rp}.__experimentalSkipSerialization`]:[rp],[`${Lh}.__experimentalSkipSerialization`]:[Lh],[`${Bg}.__experimentalSkipSerialization`]:[Bg],[`${Ig}.__experimentalSkipSerialization`]:[Ig],[`${fd}.__experimentalSkipSerialization`]:[fd]},Og={...Lg,[`${Bg}.aspectRatio`]:[`${Bg}.aspectRatio`],[`${Oc}`]:[Oc]},Dg={[`${Bg}.aspectRatio`]:!0,[`${Oc}`]:!0},zg={gradients:"gradient"};function Vg(e,t,n=!1){if(!e)return e;let o=e;return n||(o=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;Vg(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function Fg(e,t,n,o=Og){if(!Ng(t))return e;let{style:r}=n;return Object.entries(o).forEach((([e,n])=>{const o=Dg[e]||(0,l.getBlockSupport)(t,e);!0===o&&(r=Vg(r,n)),Array.isArray(o)&&o.forEach((e=>{const t=zg[e]||e;r=Vg(r,[[...n,t]])}))})),e.style={...Ag(r),...e.style},e}const Hg={edit:function({clientId:e,name:t,setAttributes:n,__unstableParentLayout:o}){const r=Ps(t,o),s=Nl(),i={clientId:e,name:t,setAttributes:n,settings:{...r,typography:{...r.typography,textAlign:!1}}};return"default"!==s?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(gp,{...i}),(0,U.jsx)(Hc,{...i}),(0,U.jsx)(Fh,{...i}),(0,U.jsx)(Sd,{...i}),(0,U.jsx)(Eg,{...i})]})},hasSupport:Ng,addSaveProps:Fg,attributeKeys:["style"],useBlockProps:function e({name:t,style:n}){const o=`wp-elements-${(0,u.useInstanceId)(e)}`,r=`.editor-styles-wrapper .${o}`,s=n?.elements,i=(0,a.useMemo)((()=>{if(!s)return;const e=[];return Gg.forEach((({elementType:n,pseudo:o,elements:i})=>{if(Es(t,rp,n))return;const a=s?.[n];if(a){const t=hs(r,l.__EXPERIMENTAL_ELEMENTS[n]);e.push((0,Ki.compileCSS)(a,{selector:t})),o&&o.forEach((t=>{a[t]&&e.push((0,Ki.compileCSS)(a[t],{selector:hs(r,`${l.__EXPERIMENTAL_ELEMENTS[n]}${t}`)}))}))}i&&i.forEach((t=>{s[t]&&e.push((0,Ki.compileCSS)(s[t],{selector:hs(r,l.__EXPERIMENTAL_ELEMENTS[t])}))}))})),e.length>0?e.join(""):void 0}),[r,s,t]);return Ms({css:i}),Fg({className:o},t,{style:n},Lg)}},Gg=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}];(0,d.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Ng(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e}));(0,d.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){return t=e,(0,l.hasBlockSupport)(t,"__experimentalSettings",!1)?(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e;var t}));const Ug=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})});const $g=function e({id:t,colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:s,value:i,onChange:l}){let a;a="unset"===i?(0,U.jsx)(Ns.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,U.jsx)(Ns.DuotoneSwatch,{values:i}):(0,U.jsx)(Ui,{icon:Ug});const c=(0,C.__)("Apply duotone filter"),d=`${(0,u.useInstanceId)(e,"duotone-control",t)}__description`;return(0,U.jsx)(Ns.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,C.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,U.jsx)(Ns.ToolbarButton,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==ca.DOWN||(n.preventDefault(),t())},label:c,icon:a}),renderContent:()=>(0,U.jsxs)(Ns.MenuGroup,{label:(0,C.__)("Duotone"),children:[(0,U.jsx)("p",{children:(0,C.__)("Create a two-tone color effect without losing your original image.")}),(0,U.jsx)(Ns.DuotonePicker,{"aria-label":c,"aria-describedby":d,colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:s,value:i,onChange:l})]})})};function Wg(e){return`${e}{filter:none}`}function Kg(e,t){return`${e}{filter:url(#${t})}`}function Zg(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=yu(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}(t);return`\n<svg\n\txmlns:xlink="http://www.w3.org/1999/xlink"\n\tviewBox="0 0 0 0"\n\twidth="0"\n\theight="0"\n\tfocusable="false"\n\trole="none"\n\taria-hidden="true"\n\tstyle="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"\n>\n\t<defs>\n\t\t<filter id="${e}">\n\t\t\t\x3c!--\n\t\t\t\tUse sRGB instead of linearRGB so transparency looks correct.\n\t\t\t\tUse perceptual brightness to convert to grayscale.\n\t\t\t--\x3e\n\t\t\t<feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix>\n\t\t\t\x3c!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. --\x3e\n\t\t\t<feComponentTransfer color-interpolation-filters="sRGB">\n\t\t\t\t<feFuncR type="table" tableValues="${n.r.join(" ")}"></feFuncR>\n\t\t\t\t<feFuncG type="table" tableValues="${n.g.join(" ")}"></feFuncG>\n\t\t\t\t<feFuncB type="table" tableValues="${n.b.join(" ")}"></feFuncB>\n\t\t\t\t<feFuncA type="table" tableValues="${n.a.join(" ")}"></feFuncA>\n\t\t\t</feComponentTransfer>\n\t\t\t\x3c!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. --\x3e\n\t\t\t<feComposite in2="SourceGraphic" operator="in"></feComposite>\n\t\t</filter>\n\t</defs>\n</svg>`}function qg(e,t="root",n={}){if(!t)return null;const{fallback:o=!1}=n,{name:r,selectors:s,supports:i}=e,l=s&&Object.keys(s).length>0,a=Array.isArray(t)?t.join("."):t;let c=null;if(c=l&&s.root?s?.root:i?.__experimentalSelector?i.__experimentalSelector:".wp-block-"+r.replace("core/","").replace("/","-"),"root"===a)return c;const u=Array.isArray(t)?t:t.split(".");if(1===u.length){const e=o?c:null;if(l){return me(s,`${a}.root`,null)||me(s,a,null)||e}const t=me(i,`${a}.__experimentalSelector`,null);return t?hs(c,t):e}let d;return l&&(d=me(s,a,null)),d||(o?qg(e,u[0],n):null)}const Yg=[];function Xg(e,{presetSetting:t,defaultSetting:n}){const o=!e?.color?.[n],r=e?.color?.[t]?.custom||Yg,s=e?.color?.[t]?.theme||Yg,i=e?.color?.[t]?.default||Yg;return(0,a.useMemo)((()=>[...r,...s,...o?Yg:i]),[o,r,s,i])}function Qg(e){return Jg(e)}function Jg(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function em({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const s=us();return(0,U.jsx)(Ns.__experimentalToolsPanel,{label:(0,C._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:s,children:r})}const tm={duotone:!0},nm={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,C.__)("Duotone")},om=({indicator:e,label:t})=>(0,U.jsxs)(Ns.__experimentalHStack,{justify:"flex-start",children:[(0,U.jsx)(Ns.__experimentalZStack,{isLayered:!1,offset:-8,children:(0,U.jsx)(Ns.Flex,{expanded:!1,children:"unset"!==e&&e?(0,U.jsx)(Ns.DuotoneSwatch,{values:e}):(0,U.jsx)(Ns.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"})})}),(0,U.jsx)(Ns.FlexItem,{title:t,children:t})]});function rm({as:e=em,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:s,defaultControls:i=tm}){const l=Jg(r),c=Xg(r,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),u=Xg(r,{presetSetting:"palette",defaultSetting:"defaultPalette"}),d=(p=o?.filter?.duotone,ps({settings:r},"",p));var p;const h=e=>{const o=c.find((({colors:t})=>t===e)),r=o?`var:preset|duotone|${o.slug}`:e;n(ge(t,["filter","duotone"],r))},g=(0,a.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,U.jsx)(e,{resetAllFilter:g,value:t,onChange:n,panelId:s,children:l&&(0,U.jsx)(Ns.__experimentalToolsPanelItem,{label:(0,C.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:()=>h(void 0),isShownByDefault:i.duotone,panelId:s,children:(0,U.jsx)(Ns.Dropdown,{popoverProps:nm,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:Bs({"is-open":t}),"aria-expanded":t};return(0,U.jsx)(Ns.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:(0,U.jsx)(Ns.Button,{...n,children:(0,U.jsx)(om,{indicator:d,label:(0,C.__)("Duotone")})})})},renderContent:()=>(0,U.jsx)(Ns.__experimentalDropdownContentWrapper,{paddingSize:"small",children:(0,U.jsxs)(Ns.MenuGroup,{label:(0,C.__)("Duotone"),children:[(0,U.jsx)("p",{children:(0,C.__)("Create a two-tone color effect without losing your original image.")}),(0,U.jsx)(Ns.DuotonePicker,{colorPalette:u,duotonePalette:c,disableCustomColors:!0,disableCustomDuotone:!0,value:d,onChange:h})]})})})})})}const sm=[],im=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function lm({presetSetting:e,defaultSetting:t}){const[n,o,r,s]=Kr(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,a.useMemo)((()=>[...o||sm,...r||sm,...n&&s||sm]),[n,o,r,s])}function am(e,t){if(!e)return;const n=t?.find((({slug:t})=>e===`var:preset|duotone|${t}`));return n?n.colors:void 0}wu([Cu]);const cm={shareWithChildBlocks:!0,edit:function({style:e,setAttributes:t,name:n}){const o=e?.color?.duotone,r=Ps(n),s=Nl(),i=lm({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),l=lm({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[a,c]=Kr("color.custom","color.customDuotone"),u=!a,d=!c||0===l?.length&&u;if(0===i?.length&&d)return null;if("default"!==s)return null;const p=Array.isArray(o)?o:am(o,i);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(sa,{group:"filter",children:(0,U.jsx)(rm,{value:{filter:{duotone:p}},onChange:n=>{const o={...e,color:{...n?.filter}};t({style:o})},settings:r})}),(0,U.jsx)(Fs,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,U.jsx)($g,{duotonePalette:i,colorPalette:l,disableCustomDuotone:d,disableCustomColors:u,value:p,onChange:n=>{const o=function(e,t){if(!e||!Array.isArray(e))return;const n=t?.find((t=>t?.colors?.every(((t,n)=>t===e[n]))));return n?`var:preset|duotone|${n.slug}`:void 0}(n,i),r={...e,color:{...e?.color,duotone:null!=o?o:n}};t({style:r})},settings:r})})]})},useBlockProps:function e({clientId:t,name:n,style:o}){const r=(0,u.useInstanceId)(e),s=(0,a.useMemo)((()=>{const e=(0,l.getBlockType)(n);if(e){if(!(0,l.getBlockSupport)(e,"filter.duotone",!1))return null;const t=(0,l.getBlockSupport)(e,"color.__experimentalDuotone",!1);if(t){const n=qg(e);return"string"==typeof t?hs(n,t):n}return qg(e,"filter.duotone",{fallback:!0})}}),[n]),i=o?.color?.duotone,c=`wp-duotone-${r}`,d=s&&i;return um({clientId:t,id:c,selector:s,attribute:i}),{className:d?c:""}},attributeKeys:["style"],hasSupport:e=>(0,l.hasBlockSupport)(e,"filter.duotone")};function um({clientId:e,id:t,selector:n,attribute:o}){const r=lm({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),s=Array.isArray(o),i=s?void 0:am(o,r),l="string"==typeof o&&i;let c=null;l?c=i:("string"==typeof o&&!l||s)&&(c=o);const u=n.split(",").map((e=>`.${t}${e.trim()}`)).join(", "),d=Array.isArray(c)||"unset"===c;Ms(d?{css:"unset"!==c?Kg(u,t):Wg(u),__unstableType:"presets"}:void 0),Ms(d?{assets:"unset"!==c?Zg(t,c):"",__unstableType:"svgs"}:void 0);const p=Ji(e);(0,a.useEffect)((()=>{if(d&&p&&im){const e=p.style.display;p.style.display="inline-block",p.offsetHeight,p.style.display=e}}),[d,p,c])}function dm(e){return(0,c.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t($r),{getBlockType:r,getActiveBlockVariation:s}=t(l.store),i=n(e),a=r(i);if(!a)return null;const c=o(e),u=s(i,c),d=(0,l.isReusableBlock)(a)||(0,l.isTemplatePart)(a),p=(d?(0,l.__experimentalGetBlockLabel)(a,c):void 0)||a.title,h=function(e){const t=e?.style?.position?.type;return"sticky"===t?(0,C.__)("Sticky"):"fixed"===t?(0,C.__)("Fixed"):null}(c),g={isSynced:d,title:p,icon:a.icon,description:a.description,anchor:c?.anchor,positionLabel:h,positionType:c?.style?.position?.type,name:c?.metadata?.name};return u?{isSynced:d,title:u.title||a.title,icon:u.icon||a.icon,description:u.description||a.description,anchor:c?.anchor,positionLabel:h,positionType:c?.style?.position?.type,name:c?.metadata?.name}:g}),[e])}(0,d.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,l.hasBlockSupport)(e,"filter.duotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e}));const{CustomSelectControl:pm}=Q(Ns.privateApis),hm="position",gm="block-editor-hooks__position-selection__select-control__option",mm={key:"default",value:"",name:(0,C.__)("Default"),className:gm},fm={key:"sticky",value:"sticky",name:(0,C._x)("Sticky","Name for the value of the CSS position property"),className:gm,__experimentalHint:(0,C.__)("The block will stick to the top of the window instead of scrolling.")},bm={key:"fixed",value:"fixed",name:(0,C._x)("Fixed","Name for the value of the CSS position property"),className:gm,__experimentalHint:(0,C.__)("The block will not move when the page is scrolled.")},vm=["top","right","bottom","left"],km=["sticky","fixed"];function _m(e){const t=e?.style?.position?.type;return"sticky"===t||"fixed"===t}function xm({name:e}={}){const[t,n]=Kr("position.fixed","position.sticky"),o=!t&&!n;return r=e,!(0,l.getBlockSupport)(r,hm)||o;var r}function ym({style:e={},clientId:t,name:n,setAttributes:o}){const r=function(e){const t=(0,l.getBlockSupport)(e,hm);return!(!0!==t&&!t?.fixed)}(n),s=function(e){const t=(0,l.getBlockSupport)(e,hm);return!(!0!==t&&!t?.sticky)}(n),i=e?.position?.type,{firstParentClientId:u}=(0,c.useSelect)((e=>{const{getBlockParents:n}=e($r),o=n(t);return{firstParentClientId:o[o.length-1]}}),[t]),d=dm(u),p=s&&i===fm.value&&d?(0,C.sprintf)((0,C.__)("The block will stick to the scrollable area of the parent %s block."),d.title):null,h=(0,a.useMemo)((()=>{const e=[mm];return(s||i===fm.value)&&e.push(fm),(r||i===bm.value)&&e.push(bm),e}),[r,s,i]),g=i&&h.find((e=>e.value===i))||mm;return a.Platform.select({web:h.length>1?(0,U.jsx)(sa,{group:"position",children:(0,U.jsx)(Ns.BaseControl,{className:"block-editor-hooks__position-selection",__nextHasNoMarginBottom:!0,help:p,children:(0,U.jsx)(pm,{__next40pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,C.__)("Position"),hideLabelFromVision:!0,describedBy:(0,C.sprintf)((0,C.__)("Currently selected position: %s"),g.name),options:h,value:g,__experimentalShowSelectedHint:!0,onChange:({selectedItem:t})=>{(t=>{const n={...e,position:{...e?.position,type:t,top:"sticky"===t||"fixed"===t?"0px":void 0}};o({style:Is(n)})})(t.value)},size:"__unstable-large"})})}):null,native:null})}const Sm={edit:function(e){return xm(e)?null:(0,U.jsx)(ym,{...e})},useBlockProps:function e({name:t,style:n}){const o=(0,l.hasBlockSupport)(t,hm),r=xm({name:t}),s=o&&!r,i=(0,u.useInstanceId)(e),a=`.wp-container-${i}.wp-container-${i}`;let c;s&&(c=function({selector:e,style:t}){let n="";const{type:o}=t?.position||{};return km.includes(o)?(n+=`${e} {`,n+=`position: ${o};`,vm.forEach((e=>{void 0!==t?.position?.[e]&&(n+=`${e}: ${t.position[e]};`)})),"sticky"!==o&&"fixed"!==o||(n+="z-index: 10"),n+="}",n):n}({selector:a,style:n})||"");const d=Bs({[`wp-container-${i}`]:s&&!!c,[`is-position-${n?.position?.type}`]:s&&!!c&&!!n?.position?.type});return Ms({css:c}),{className:d}},attributeKeys:["style"],hasSupport:e=>(0,l.hasBlockSupport)(e,hm)};const wm={button:"wp-element-button",caption:"wp-element-caption"},Cm={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"},{kebabCase:Bm}=Q(Ns.privateApis);function Im(e){const t="var:";if(e?.startsWith?.(t)){return`var(--wp--${e.slice(4).split("|").join("--")})`}return e}function jm(e={},t,n){let o=[];return Object.keys(e).forEach((r=>{const s=t+Bm(r.replace("/","-")),i=e[r];if(i instanceof Object){const e=s+n;o=[...o,...jm(i,e,n)]}else o.push(`${s}: ${i}`)})),o}const Em=(e,t)=>{const n={};return Object.entries(e).forEach((([e,o])=>{if("root"===e||!t?.[e])return;const r="string"==typeof o;if(r||Object.entries(o).forEach((([o,r])=>{if("root"===o||!t?.[e][o])return;const s=Tm({[e]:{[o]:t[e][o]}});n[r]=[...n[r]||[],...s],delete t[e][o]})),r||o.root){const s=r?o:o.root,i=Tm({[e]:t[e]});n[s]=[...n[s]||[],...i],delete t[e]}})),n};function Tm(e={},t="",n,o={},r=!1){const s=is===t,i=Object.entries(l.__EXPERIMENTAL_STYLE_PROPERTY).reduce(((t,[o,{value:r,properties:i,useEngine:l,rootOnly:a}])=>{if(a&&!s)return t;const c=r;if("elements"===c[0]||l)return t;const u=me(e,c);if("--wp--style--root--padding"===o&&("string"==typeof u||!n))return t;if(i&&"string"!=typeof u)Object.entries(i).forEach((e=>{const[n,o]=e;if(!me(u,[o],!1))return;const r=n.startsWith("--")?n:Bm(n);t.push(`${r}: ${Im(me(u,[o]))}`)}));else if(me(e,c,!1)){const n=o.startsWith("--")?o:Bm(o);t.push(`${n}: ${Im(me(e,c))}`)}return t}),[]);return(0,Ki.getCSSRules)(e).forEach((e=>{if(s&&(n||r)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:Bm(e.key);let l=e.value;if("string"!=typeof l&&l?.ref){const e=l.ref.split(".");if(l=Im(me(o,e)),!l||l?.ref)return}"font-size"===t&&(l=rs({size:l},o?.settings)),"aspect-ratio"===t&&i.push("min-height: unset"),i.push(`${t}: ${l}`)})),i}function Mm({layoutDefinitions:e=qs,style:t,selector:n,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:s}){let i="",l=o?vi(t?.spacing?.blockGap):"";if(r&&(n===is?l=l||"0.5em":!o&&s&&(l=s)),l&&e&&(Object.values(e).forEach((({className:e,name:t,spacingStyles:r})=>{(o||"flex"===t||"grid"===t)&&r?.length&&r.forEach((t=>{const r=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{r.push(`${e}: ${t||l}`)})),r.length){let s="";s=o?n===is?`:root :where(.${e})${t?.selector||""}`:`:root :where(${n}-${e})${t?.selector||""}`:n===is?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,i+=`${s} { ${r.join("; ")}; }`}}))})),n===is&&o&&(i+=`${ls} { --wp--style--block-gap: ${l}; }`)),n===is&&e){const t=["block","flex","grid"];Object.values(e).forEach((({className:e,displayMode:o,baseStyles:r})=>{o&&t.includes(o)&&(i+=`${n} .${e} { display:${o}; }`),r?.length&&r.forEach((t=>{const n=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{n.push(`${e}: ${t}`)})),n.length){i+=`${`.${e}${t?.selector||""}`} { ${n.join("; ")}; }`}}))}))}return i}const Pm=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function Rm(e){if(!e)return{};const t=Object.entries(e).filter((([e])=>Pm.includes(e))).map((([e,t])=>[e,JSON.parse(JSON.stringify(t))]));return Object.fromEntries(t)}const Nm=(e,t)=>{var n;const o=[];if(!e?.styles)return o;const r=Rm(e.styles);return r&&o.push({styles:r,selector:is,skipSelectorWrapper:!0}),Object.entries(l.__EXPERIMENTAL_ELEMENTS).forEach((([t,n])=>{e.styles?.elements?.[t]&&o.push({styles:e.styles?.elements?.[t],selector:n,skipSelectorWrapper:!wm[t]})})),Object.entries(null!==(n=e.styles?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{var r;const s=Rm(n);if(n?.variations){const r={};Object.entries(n.variations).forEach((([n,s])=>{var i,a;r[n]=Rm(s),s?.css&&(r[n].css=s.css);const c=t[e]?.styleVariationSelectors?.[n];Object.entries(null!==(i=s?.elements)&&void 0!==i?i:{}).forEach((([e,t])=>{t&&l.__EXPERIMENTAL_ELEMENTS[e]&&o.push({styles:t,selector:hs(c,l.__EXPERIMENTAL_ELEMENTS[e])})})),Object.entries(null!==(a=s?.blocks)&&void 0!==a?a:{}).forEach((([e,n])=>{var r;const s=hs(c,t[e]?.selector),i=hs(c,t[e]?.duotoneSelector),a=function(e,t){if(!e||!t)return;const n={};return Object.entries(t).forEach((([t,o])=>{"string"==typeof o&&(n[t]=hs(e,o)),"object"==typeof o&&(n[t]={},Object.entries(o).forEach((([o,r])=>{n[t][o]=hs(e,r)})))})),n}(c,t[e]?.featureSelectors),u=Rm(n);n?.css&&(u.css=n.css),o.push({selector:s,duotoneSelector:i,featureSelectors:a,fallbackGapValue:t[e]?.fallbackGapValue,hasLayoutSupport:t[e]?.hasLayoutSupport,styles:u}),Object.entries(null!==(r=n.elements)&&void 0!==r?r:{}).forEach((([e,t])=>{t&&l.__EXPERIMENTAL_ELEMENTS[e]&&o.push({styles:t,selector:hs(s,l.__EXPERIMENTAL_ELEMENTS[e])})}))}))})),s.variations=r}t?.[e]?.selector&&o.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:s,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors}),Object.entries(null!==(r=n?.elements)&&void 0!==r?r:{}).forEach((([n,r])=>{r&&t?.[e]&&l.__EXPERIMENTAL_ELEMENTS[n]&&o.push({styles:r,selector:t[e]?.selector.split(",").map((e=>l.__EXPERIMENTAL_ELEMENTS[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),o},Am=(e,t)=>{var n;const o=[];if(!e?.settings)return o;const r=e=>{let t={};return as.forEach((({path:n})=>{const o=me(e,n,!1);!1!==o&&(t=ge(t,n,o))})),t},s=r(e.settings),i=e.settings?.custom;return(Object.keys(s).length>0||i)&&o.push({presets:s,custom:i,selector:ls}),Object.entries(null!==(n=e.settings?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{const s=r(n),i=n.custom;(Object.keys(s).length>0||i)&&o.push({presets:s,custom:i,selector:t[e]?.selector})})),o},Lm=(e,t)=>{const n=Am(e,t);let o="";return n.forEach((({presets:t,custom:n,selector:r})=>{const s=function(e={},t){return as.reduce(((n,{path:o,valueKey:r,valueFunc:s,cssVarInfix:i})=>{const l=me(e,o,[]);return["default","theme","custom"].forEach((e=>{l[e]&&l[e].forEach((e=>{r&&!s?n.push(`--wp--preset--${i}--${Bm(e.slug)}: ${e[r]}`):s&&"function"==typeof s&&n.push(`--wp--preset--${i}--${Bm(e.slug)}: ${s(e,t)}`)}))})),n}),[])}(t,e?.settings),i=jm(n,"--wp--custom--","--");i.length>0&&s.push(...i),s.length>0&&(o+=`${r}{${s.join(";")};}`)})),o},Om=(e,t,n,o,r=!1,s=!1,i=void 0)=>{const l={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...i},a=Nm(e,t),c=Am(e,t),u=e?.settings?.useRootPaddingAwareAlignments,{contentSize:d,wideSize:p}=e?.settings?.layout||{},h=l.marginReset||l.rootPadding||l.layoutStyles;let g="";if(l.presets&&(d||p)&&(g+=`${ls} {`,g=d?g+` --wp--style--global--content-size: ${d};`:g,g=p?g+` --wp--style--global--wide-size: ${p};`:g,g+="}"),h&&(g+=":where(body) {margin: 0;",l.rootPadding&&u&&(g+="padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t"),g+="}"),l.blockStyles&&a.forEach((({selector:t,duotoneSelector:i,styles:a,fallbackGapValue:c,hasLayoutSupport:d,featureSelectors:p,styleVariationSelectors:h,skipSelectorWrapper:m})=>{if(p){const e=Em(p,a);Object.entries(e).forEach((([e,t])=>{if(t.length){const n=t.join(";");g+=`:root :where(${e}){${n};}`}}))}if(i){const e={};a?.filter&&(e.filter=a.filter,delete a.filter);const t=Tm(e);t.length&&(g+=`${i}{${t.join(";")};}`)}r||is!==t&&!d||(g+=Mm({style:a,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:c}));const f=Tm(a,t,u,e,s);if(f?.length){g+=`${m?t:`:root :where(${t})`}{${f.join(";")};}`}a?.css&&(g+=Vm(a.css,`:root :where(${t})`)),l.variationStyles&&h&&Object.entries(h).forEach((([t,n])=>{const o=a?.variations?.[t];if(o){if(p){const e=Em(p,o);Object.entries(e).forEach((([e,t])=>{if(t.length){const o=function(e,t){const n=e.split(","),o=[];return n.forEach((e=>{o.push(`${t.trim()}${e.trim()}`)})),o.join(", ")}(e,n),r=t.join(";");g+=`:root :where(${o}){${r};}`}}))}const t=Tm(o,n,u,e);t.length&&(g+=`:root :where(${n}){${t.join(";")};}`),o?.css&&(g+=Vm(o.css,`:root :where(${n})`))}}));const b=Object.entries(a).filter((([e])=>e.startsWith(":")));b?.length&&b.forEach((([e,n])=>{const o=Tm(n);if(!o?.length)return;const r=`:root :where(${t.split(",").map((t=>t+e)).join(",")}){${o.join(";")};}`;g+=r}))})),l.layoutStyles&&(g+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",g+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",g+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),l.blockGap&&n){const t=vi(e?.styles?.spacing?.blockGap)||"0.5em";g+=`:root :where(.wp-site-blocks) > * { margin-block-start: ${t}; margin-block-end: 0; }`,g+=":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",g+=":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return l.presets&&c.forEach((({selector:e,presets:t})=>{is!==e&&ls!==e||(e="");const n=function(e="*",t={}){return as.reduce(((n,{path:o,cssVarInfix:r,classes:s})=>{if(!s)return n;const i=me(t,o,[]);return["default","theme","custom"].forEach((t=>{i[t]&&i[t].forEach((({slug:t})=>{s.forEach((({classSuffix:o,propertyName:s})=>{const i=`.has-${Bm(t)}-${o}`,l=e.split(",").map((e=>`${e}${i}`)).join(","),a=`var(--wp--preset--${r}--${Bm(t)})`;n+=`${l}{${s}: ${a} !important;}`}))}))})),n}),"")}(e,t);n.length>0&&(g+=n)})),g};function Dm(e,t){return Am(e,t).flatMap((({presets:e})=>function(e={}){return as.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=me(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>Zg(`wp-duotone-${e.slug}`,e.colors))))).join("")}))}(e)))}const zm=(e,t,n)=>{const o={};return e.forEach((e=>{const r=e.name,s=qg(e);let i=qg(e,"filter.duotone");if(!i){const t=qg(e),n=(0,l.getBlockSupport)(e,"color.__experimentalDuotone",!1);i=n&&hs(t,n)}const a=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,c=e?.supports?.spacing?.blockGap?.__experimentalDefault,u=t(r),d={};u?.forEach((e=>{const t=n?`-${n}`:"",o=`${e.name}${t}`,r=function(e,t){const n=`.is-style-${e}`;if(!t)return n;const o=/((?::\([^)]+\))?\s*)([^\s:]+)/,r=(e,t,o)=>t+o+n;return t.split(",").map((e=>e.replace(o,r))).join(",")}(o,s);d[o]=r}));const p=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(Cm).forEach((([t,o])=>{const r=qg(e,t);r&&(n[o]=r)})),n})(e,s);o[r]={duotoneSelector:i,fallbackGapValue:c,featureSelectors:Object.keys(p).length?p:void 0,hasLayoutSupport:a,name:r,selector:s,styleVariationSelectors:u?.length?d:void 0}})),o};function Vm(e,t){let n="";if(!e||""===e.trim())return n;return e.split("&").forEach((e=>{if(!e||""===e.trim())return;if(!e.includes("{"))n+=`:root :where(${t}){${e.trim()}}`;else{const o=e.replace("}","").split("{");if(2!==o.length)return;const[r,s]=o,i=r.match(/([>+~\s]*::[a-zA-Z-]+)/),l=i?i[1]:"",a=i?r.replace(l,"").trim():r.trim();let c;c=""===a?t:r.startsWith(" ")?hs(t,a):function(e,t){return e.includes(",")?e.split(",").map((e=>e+t)).join(","):e+t}(t,a),n+=`:root :where(${c})${l}{${s.trim()}}`}})),n}function Fm(e={},t){const[n]=ks("spacing.blockGap");var o,r;o=e,r=e?._links?.["wp:theme-file"],e=o?.styles&&r?(r.forEach((({name:e,href:t,target:n})=>{me(o,n)===e&&(o=function(e,t,n){const o=(t=t.split(".")).pop();let r=e;for(const e of t)r=r[e];return r[o]=n,e}(o,n,t))})),o):o;const s=null!==n,i=!s,u=(0,c.useSelect)((e=>{const{getSettings:t}=e($r);return!!t().disableLayoutStyles})),{getBlockStyles:d}=(0,c.useSelect)(l.store);return(0,a.useMemo)((()=>{var n;if(!e?.styles||!e?.settings)return[];const o=(r=e,r.styles?.blocks?.["core/separator"]&&r.styles?.blocks?.["core/separator"].color?.background&&!r.styles?.blocks?.["core/separator"].color?.text&&!r.styles?.blocks?.["core/separator"].border?.color?{...r,styles:{...r.styles,blocks:{...r.styles.blocks,"core/separator":{...r.styles.blocks["core/separator"],color:{...r.styles.blocks["core/separator"].color,text:r.styles?.blocks["core/separator"].color.background}}}}}:r);var r;const a=zm((0,l.getBlockTypes)(),d),c=Lm(o,a),p=Om(o,a,s,i,u,t),h=Dm(o,a),g=[{css:c,isGlobalStyles:!0},{css:p,isGlobalStyles:!0},{css:null!==(n=o.styles.css)&&void 0!==n?n:"",isGlobalStyles:!0},{assets:h,__unstableType:"svg",isGlobalStyles:!0}];return(0,l.getBlockTypes)().forEach((e=>{if(o.styles.blocks[e.name]?.css){const t=a[e.name].selector;g.push({css:Vm(o.styles.blocks[e.name]?.css,t),isGlobalStyles:!0})}})),[g,o.settings]}),[s,i,e,u,t,d])}function Hm(e=!1){const{merged:t}=(0,a.useContext)(ms);return Fm(t,e)}const Gm="is-style-";function Um(e){return e?e.split(/\s+/).reduce(((e,t)=>{if(t.startsWith(Gm)){const n=t.slice(Gm.length);"default"!==n&&e.push(n)}return e}),[]):[]}function $m({override:e}){Ms(e)}function Wm(e,t,n){const{merged:o}=(0,a.useContext)(ms),{globalSettings:r,globalStyles:s}=(0,c.useSelect)((e=>{const t=e($r).getSettings();return{globalSettings:t.__experimentalFeatures,globalStyles:t[K]}}),[]);return(0,a.useMemo)((()=>{var i,l,a;const c=function(e,t,n){if(!e?.styles?.blocks?.[t]?.variations?.[n])return;const o=t=>{Object.keys(t).forEach((n=>{const r=t[n];if("object"==typeof r&&null!==r)if(void 0!==r.ref)if("string"!=typeof r.ref||""===r.ref.trim())delete t[n];else{const o=me(e,r.ref);o?t[n]=o:delete t[n]}else o(r),0===Object.keys(r).length&&delete t[n]}))},r=JSON.parse(JSON.stringify(e.styles.blocks[t].variations[n]));return o(r),r}({settings:null!==(i=o?.settings)&&void 0!==i?i:r,styles:null!==(l=o?.styles)&&void 0!==l?l:s},e,t);return{settings:null!==(a=o?.settings)&&void 0!==a?a:r,styles:{blocks:{[e]:{variations:{[`${t}-${n}`]:c}}}}}}),[o,r,s,t,n,e])}const Km={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>Um(e).length>0,useBlockProps:function({name:e,className:t,clientId:n}){const{getBlockStyles:o}=(0,c.useSelect)(l.store),r=function(e,t=[]){const n=Um(e);if(!n)return null;for(const e of n)if(t.some((t=>t.name===e)))return e;return null}(t,o(e)),s=`${Gm}${r}-${n}`,{settings:i,styles:u}=Wm(e,r,n),d=(0,a.useMemo)((()=>{if(!r)return;const e={settings:i,styles:u},t=zm((0,l.getBlockTypes)(),o,n);return Om(e,t,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})}),[r,i,u,o,n]);return Ms({id:`variation-${n}`,css:d,__unstableType:"variation",variation:r,clientId:n}),r?{className:s}:{}}},Zm="layout",{kebabCase:qm}=Q(Ns.privateApis);function Ym(e){return(0,l.hasBlockSupport)(e,"layout")||(0,l.hasBlockSupport)(e,"__experimentalLayout")}function Xm(e={},t=""){const{layout:n}=e,{default:o}=(0,l.getBlockSupport)(t,Zm)||{},r=n?.inherit||n?.contentSize||n?.wideSize?{...n,type:"constrained"}:n||o||{},s=[];if(qs[r?.type||"default"]?.className){const e=qs[r?.type||"default"]?.className,n=t.split("/"),o=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;s.push(e,o)}return(0,c.useSelect)((e=>(r?.inherit||r?.contentSize||"constrained"===r?.type)&&e($r).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments),[r?.contentSize,r?.inherit,r?.type])&&s.push("has-global-padding"),r?.orientation&&s.push(`is-${qm(r.orientation)}`),r?.justifyContent&&s.push(`is-content-justification-${qm(r.justifyContent)}`),r?.flexWrap&&"nowrap"===r.flexWrap&&s.push("is-nowrap"),s}const Qm={shareWithChildBlocks:!0,edit:function({layout:e,setAttributes:t,name:n,clientId:o}){const r=Ps(n),{layout:s}=r,{themeSupportsLayout:i}=(0,c.useSelect)((e=>{const{getSettings:t}=e($r);return{themeSupportsLayout:t().supportsLayout}}),[]);if("default"!==Nl())return null;const a=(0,l.getBlockSupport)(n,Zm,{}),u={...s,...a},{allowSwitching:d,allowEditing:p=!0,allowInheriting:h=!0,default:g}=u;if(!p)return null;const m={...a,...e},{type:f,default:{type:b="default"}={}}=m,v=f||b,k=!(!h||v&&"default"!==v&&"constrained"!==v&&!m.inherit),_=e||g||{},{inherit:x=!1,contentSize:y=null}=_;if(("default"===v||"constrained"===v)&&!i)return null;const S=bl(v),w=bl("constrained"),B=!_.type&&(y||x),I=!!x||!!y,j=e=>t({layout:e});return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(sa,{children:(0,U.jsxs)(Ns.PanelBody,{title:(0,C.__)("Layout"),children:[k&&(0,U.jsx)(U.Fragment,{children:(0,U.jsx)(Ns.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__toggle-control",label:(0,C.__)("Inner blocks use content width"),checked:"constrained"===S?.name||I,onChange:()=>t({layout:{type:"constrained"===S?.name||I?"default":"constrained"}}),help:"constrained"===S?.name||I?(0,C.__)("Nested blocks use content width with options for full and wide widths."):(0,C.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})}),!x&&d&&(0,U.jsx)(Jm,{type:v,onChange:e=>t({layout:{type:e}})}),S&&"default"!==S.name&&(0,U.jsx)(S.inspectorControls,{layout:_,onChange:j,layoutBlockSupport:u,name:n,clientId:o}),w&&B&&(0,U.jsx)(w.inspectorControls,{layout:_,onChange:j,layoutBlockSupport:u,name:n,clientId:o})]})}),!x&&S&&(0,U.jsx)(S.toolBarControls,{layout:_,onChange:j,layoutBlockSupport:a,name:n,clientId:o})]})},attributeKeys:["layout"],hasSupport:e=>Ym(e)};function Jm({type:e,onChange:t}){return(0,U.jsx)(Ns.ButtonGroup,{children:fl.map((({name:n,label:o})=>(0,U.jsx)(Ns.Button,{isPressed:e===n,onClick:()=>t(n),children:o},n)))})}function ef({block:e,props:t,blockGapSupport:n,layoutClasses:o}){const{name:r,attributes:s}=t,i=(0,u.useInstanceId)(e),{layout:a}=s,{default:c}=(0,l.getBlockSupport)(r,Zm)||{},d=a?.inherit||a?.contentSize||a?.wideSize?{...a,type:"constrained"}:a||c||{},p=`wp-container-${qm(r)}-is-layout-`,h=`.${p}${i}`,g=null!==n,m=bl(d?.type||"default"),f=m?.getLayoutStyle?.({blockName:r,selector:h,layout:d,style:s?.style,hasBlockGapSupport:g}),b=Bs({[`${p}${i}`]:!!f},o);return Ms({css:f}),(0,U.jsx)(e,{...t,__unstableLayoutClassNames:b})}const tf=(0,u.createHigherOrderComponent)((e=>t=>{const{clientId:n,name:o,attributes:r}=t,s=Ym(o),i=Xm(r,o),l=(0,c.useSelect)((e=>{if(!s)return;const{getSettings:t,getBlockSettings:o}=Q(e($r)),{disableLayoutStyles:r}=t();if(r)return;const[i]=o(n,"spacing.blockGap");return{blockGapSupport:i}}),[s,n]);return l?(0,U.jsx)(ef,{block:e,props:t,layoutClasses:i,...l}):(0,U.jsx)(e,{...t,__unstableLayoutClassNames:s?i:void 0})}),"withLayoutStyles");function nf({clientId:e,bounds:t,onChange:n}){const o=Ji(e),r=o?.parentElement;return o&&r?(0,U.jsx)(of,{clientId:e,bounds:t,blockElement:o,rootBlockElement:r,onChange:n}):null}function of({clientId:e,bounds:t,blockElement:n,rootBlockElement:o,onChange:r}){const[s,i]=(0,a.useState)(null),[l,c]=(0,a.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,a.useEffect)((()=>{const e=new window.ResizeObserver((()=>{const e=n.getBoundingClientRect(),t=o.getBoundingClientRect();c({top:e.top>t.top,bottom:e.bottom<t.bottom,left:e.left>t.left,right:e.right<t.right})}));return e.observe(n),()=>e.disconnect()}),[n,o]);const u={right:"flex-start",left:"flex-end"},d={top:"flex-end",bottom:"flex-start"},p={display:"flex",justifyContent:"center",alignItems:"center",...u[s]&&{justifyContent:u[s]},...d[s]&&{alignItems:d[s]}};return(0,U.jsx)(sl,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"block-toolbar",additionalStyles:p,children:(0,U.jsx)(Ns.ResizableBox,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:l.bottom,bottomLeft:!1,bottomRight:!1,left:l.left,right:l.right,top:l.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onResizeStart:(e,t)=>{i(t),n.ownerDocument.addEventListener("mouseup",(()=>{e.target.dispatchEvent(new Event("mouseup",{bubbles:!0}))}),{once:!0})},onResizeStop:(e,t,s)=>{const i=parseFloat(il(o,"column-gap")),l=parseFloat(il(o,"row-gap")),a=rf(il(o,"grid-template-columns"),i),c=rf(il(o,"grid-template-rows"),l),u=new window.DOMRect(n.offsetLeft+s.offsetLeft,n.offsetTop+s.offsetTop,s.offsetWidth,s.offsetHeight),d=sf(a,u.left)+1,p=sf(c,u.top)+1,h=sf(a,u.right,"end")+1,g=sf(c,u.bottom,"end")+1;r({columnSpan:h-d+1,rowSpan:g-p+1})}})})}function rf(e,t){const n=[];for(const o of e.split(" ")){const e=n[n.length-1],r=e?e.end+t:0,s=r+parseFloat(o);n.push({start:r,end:s})}return n}function sf(e,t,n="start"){return e.reduce(((o,r,s)=>Math.abs(r[n]-t)<Math.abs(e[o][n]-t)?s:o),0)}(0,d.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.layout)&&void 0!==t?t:{})||Ym(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,d.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",tf);const lf={useBlockProps:function e({style:t}){var n;const o=(0,c.useSelect)((e=>!e($r).getSettings().disableLayoutStyles)),r=null!==(n=t?.layout)&&void 0!==n?n:{},{selfStretch:s,flexSize:i,columnStart:l,rowStart:a,columnSpan:d,rowSpan:p}=r,h=xl()||{},{columnCount:g,minimumColumnWidth:m}=h,f=(0,u.useInstanceId)(e),b=`.wp-container-content-${f}`;let v="";if(o){if("fixed"===s&&i?v=`${b} {\n\t\t\t\tflex-basis: ${i};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===s?v=`${b} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`:l&&d?v=`${b} {\n\t\t\t\tgrid-column: ${l} / span ${d};\n\t\t\t}`:l?v=`${b} {\n\t\t\t\tgrid-column: ${l};\n\t\t\t}`:d&&(v=`${b} {\n\t\t\t\tgrid-column: span ${d};\n\t\t\t}`),(d||l)&&(m||!g)){const e=d?parseInt(d):null,t=l?parseInt(l):null,n=Math.max(e,t);let o=parseFloat(m);isNaN(o)&&(o=12);let r=m?.replace(o,"");["px","rem","em"].includes(r)||(r="rem");v+=`@container (max-width: ${n*o+(n-1)*("px"===r?24:1.5)}${r}) {\n\t\t\t\t${b} {\n\t\t\t\t\tgrid-column: ${d?"1/-1":"auto"};\n\t\t\t\t}\n\t\t\t}`}a&&p?v+=`${b} {\n\t\t\t\tgrid-row: ${a} / span ${p};\n\t\t\t}`:a?v+=`${b} {\n\t\t\t\tgrid-row: ${a};\n\t\t\t}`:p&&(v+=`${b} {\n\t\t\t\tgrid-row: span ${p};\n\t\t\t}`)}if(Ms({css:v}),v)return{className:`wp-container-content-${f}`}},edit:function({clientId:e,style:t,setAttributes:n}){const{type:o="default",allowSizingOnChildren:r=!1}=xl()||{},s=(0,c.useSelect)((t=>t($r).getBlockRootClientId(e)),[e]),[i,l]=(0,a.useState)();return"grid"!==o?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ll,{clientId:s,contentRef:l}),r&&(0,U.jsx)(nf,{clientId:e,bounds:i,onChange:({columnSpan:e,rowSpan:o})=>{n({style:{...t,layout:{...t?.layout,columnSpan:e,rowSpan:o}}})}})]})},attributeKeys:["style"],hasSupport:()=>!0};function af(e){return(0,c.useSelect)((t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:o,isUngroupable:r,isGroupable:s}=t($r),{getGroupingBlockName:i,getBlockType:a}=t(l.store),c=e?.length?e:o(),u=n(c),[d]=u,p=1===c.length&&r(c[0]);return{clientIds:c,isGroupable:s(c),isUngroupable:p,blocksSelection:u,groupingBlockName:i(),onUngroup:p&&a(d.name)?.transforms?.ungroup}}),[e])}function cf({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:o,blocksSelection:r,groupingBlockName:s,onClose:i=(()=>{})}){const{getSelectedBlockClientIds:a}=(0,c.useSelect)($r),{replaceBlocks:u}=(0,c.useDispatch)($r);if(!t&&!n)return null;const d=a();return(0,U.jsxs)(U.Fragment,{children:[t&&(0,U.jsx)(Ns.MenuItem,{shortcut:d.length>1?ca.displayShortcut.primary("g"):void 0,onClick:()=>{(()=>{const t=(0,l.switchToBlockType)(r,s);t&&u(e,t)})(),i()},children:(0,C._x)("Group","verb")}),n&&(0,U.jsx)(Ns.MenuItem,{onClick:()=>{(()=>{let t=r[0].innerBlocks;t.length&&(o&&(t=o(r[0].attributes,r[0].innerBlocks)),u(e,t))})(),i()},children:(0,C._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor ")})]})}function uf(e){return(0,c.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:s,getBlockName:i,getTemplateLock:l}=t($r),a=n(e),c=o(e),u=r(e);return{canEdit:a,canMove:c,canRemove:u,canLock:s(i(e)),isContentLocked:"contentOnly"===l(e),isLocked:!a||!c||!u}}),[e])}const df=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.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"})}),pf=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.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-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"})}),hf=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.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"})}),gf=["core/block","core/navigation"];function mf(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function ff({clientId:e,onClose:t}){const[n,o]=(0,a.useState)({move:!1,remove:!1}),{canEdit:r,canMove:s,canRemove:i}=uf(e),{allowsEditLocking:d,templateLock:p,hasTemplateLock:h}=(0,c.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t($r),r=n(e),s=(0,l.getBlockType)(r);return{allowsEditLocking:gf.includes(r),templateLock:o(e)?.templateLock,hasTemplateLock:!!s?.attributes?.templateLock}}),[e]),[g,m]=(0,a.useState)(!!p),{updateBlockAttributes:f}=(0,c.useDispatch)($r),b=dm(e),v=(0,u.useInstanceId)(ff,"block-editor-block-lock-modal__options-title");(0,a.useEffect)((()=>{o({move:!s,remove:!i,...d?{edit:!r}:{}})}),[r,s,i,d]);const k=Object.values(n).every(Boolean),_=Object.values(n).some(Boolean)&&!k;return(0,U.jsxs)(Ns.Modal,{title:(0,C.sprintf)((0,C.__)("Lock %s"),b.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,children:[(0,U.jsx)("p",{children:(0,C.__)("Choose specific attributes to restrict or lock all available options.")}),(0,U.jsxs)("form",{onSubmit:o=>{o.preventDefault(),f([e],{lock:n,templateLock:g?mf(n):void 0}),t()},children:[(0,U.jsxs)("div",{role:"group","aria-labelledby":v,className:"block-editor-block-lock-modal__options",children:[(0,U.jsx)(Ns.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,U.jsx)("span",{id:v,children:(0,C.__)("Lock all")}),checked:k,indeterminate:_,onChange:e=>o({move:e,remove:e,...d?{edit:e}:{}})}),(0,U.jsxs)("ul",{className:"block-editor-block-lock-modal__checklist",children:[d&&(0,U.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,U.jsx)(Ns.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Restrict editing"),checked:!!n.edit,onChange:e=>o((t=>({...t,edit:e})))}),(0,U.jsx)(Ns.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?hf:df})]}),(0,U.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,U.jsx)(Ns.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Disable movement"),checked:n.move,onChange:e=>o((t=>({...t,move:e})))}),(0,U.jsx)(Ns.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?hf:df})]}),(0,U.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,U.jsx)(Ns.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Prevent removal"),checked:n.remove,onChange:e=>o((t=>({...t,remove:e})))}),(0,U.jsx)(Ns.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?hf:df})]})]}),h&&(0,U.jsx)(Ns.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,C.__)("Apply to all blocks inside"),checked:g,disabled:n.move&&!n.remove,onChange:()=>m(!g)})]}),(0,U.jsxs)(Ns.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,U.jsx)(Ns.FlexItem,{children:(0,U.jsx)(Ns.Button,{variant:"tertiary",onClick:t,children:(0,C.__)("Cancel")})}),(0,U.jsx)(Ns.FlexItem,{children:(0,U.jsx)(Ns.Button,{variant:"primary",type:"submit",children:(0,C.__)("Apply")})})]})]})]})}function bf({clientId:e}){const{canLock:t,isLocked:n}=uf(e),[o,r]=(0,a.useReducer)((e=>!e),!1);if(!t)return null;const s=n?(0,C.__)("Unlock"):(0,C.__)("Lock");return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.MenuItem,{icon:n?df:pf,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog",children:s}),o&&(0,U.jsx)(ff,{clientId:e,onClose:r})]})}const vf=()=>{};const kf=(0,u.compose)([(0,c.withSelect)(((e,{clientId:t})=>{const{getBlock:n,getBlockMode:o,getSettings:r}=e($r),s=n(t),i=r().codeEditingEnabled;return{mode:o(t),blockType:s?(0,l.getBlockType)(s.name):null,isCodeEditingEnabled:i}})),(0,c.withDispatch)(((e,{onToggle:t=vf,clientId:n})=>({onToggleMode(){e($r).toggleBlockMode(n),t()}})))])((function({blockType:e,mode:t,onToggleMode:n,small:o=!1,isCodeEditingEnabled:r=!0}){if(!e||!(0,l.hasBlockSupport)(e,"html",!0)||!r)return null;const s="visual"===t?(0,C.__)("Edit as HTML"):(0,C.__)("Edit visually");return(0,U.jsx)(Ns.MenuItem,{onClick:n,children:!o&&s})}));function _f(e){return 0===e?.trim()?.length}function xf({blockName:e,originalBlockName:t,onClose:n,onSave:o,hasOverridesWarning:r}){const[s,i]=(0,a.useState)(e),l=(0,a.useId)(),c=s!==e,u=s===t,d=_f(s),p=c||u;return(0,U.jsx)(Ns.Modal,{title:(0,C.__)("Rename"),onRequestClose:n,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",aria:{describedby:l},size:"small",children:(0,U.jsxs)("form",{onSubmit:e=>{e.preventDefault(),p&&(()=>{const e=u||d?(0,C.sprintf)((0,C.__)('Block name reset to: "%s".'),s):(0,C.sprintf)((0,C.__)('Block name changed to: "%s".'),s);(0,Eo.speak)(e,"assertive"),o(s),n()})()},children:[(0,U.jsx)("p",{id:l,children:(0,C.__)("Enter a custom name for this block.")}),(0,U.jsxs)(Ns.__experimentalVStack,{spacing:"3",children:[(0,U.jsx)(Ns.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:s,label:(0,C.__)("Block name"),hideLabelFromVision:!0,help:r?(0,C.__)("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:t,onChange:i,onFocus:e=>e.target.select()}),(0,U.jsxs)(Ns.__experimentalHStack,{justify:"right",children:[(0,U.jsx)(Ns.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n,children:(0,C.__)("Cancel")}),(0,U.jsx)(Ns.Button,{__next40pxDefaultSize:!0,"aria-disabled":!p,variant:"primary",type:"submit",children:(0,C.__)("Save")})]})]})]})})}function yf({clientId:e}){const[t,n]=(0,a.useState)(!1),{metadata:o}=(0,c.useSelect)((t=>{const{getBlockAttributes:n}=t($r),o=n(e)?.metadata;return{metadata:o}}),[e]),{updateBlockAttributes:r}=(0,c.useDispatch)($r),s=o?.name,i=!!s&&!!o?.bindings&&Object.values(o.bindings).some((e=>"core/pattern-overrides"===e.source));const l=dm(e);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.MenuItem,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog",children:(0,C.__)("Rename")}),t&&(0,U.jsx)(xf,{blockName:s||"",originalBlockName:l?.title,hasOverridesWarning:i,onClose:()=>n(!1),onSave:t=>{(t===l?.title||_f(t))&&(t=void 0),function(t){r([e],{metadata:{...o,name:t}})}(t)}})]})}const{Fill:Sf,Slot:wf}=(0,Ns.createSlotFill)("BlockSettingsMenuControls");function Cf({...e}){return(0,U.jsx)(Ns.__experimentalStyleProvider,{document,children:(0,U.jsx)(Sf,{...e})})}Cf.Slot=({fillProps:e,clientIds:t=null})=>{const{selectedBlocks:n,selectedClientIds:o,isContentOnly:r}=(0,c.useSelect)((e=>{const{getBlockNamesByClientId:n,getSelectedBlockClientIds:o,getBlockEditingMode:r}=e($r),s=null!==t?t:o();return{selectedBlocks:n(s),selectedClientIds:s,isContentOnly:"contentOnly"===r(s[0])}}),[t]),{canLock:s}=uf(o[0]),{canRename:i}=(a=n[0],{canRename:(0,l.getBlockSupport)(a,"renaming",!0)});var a;const d=1===o.length&&s&&!r,p=1===o.length&&i&&!r,h=af(o),{isGroupable:g,isUngroupable:m}=h,f=g||m;return(0,U.jsx)(wf,{fillProps:{...e,selectedBlocks:n,selectedClientIds:o},children:t=>!t?.length>0&&!f&&!d?null:(0,U.jsxs)(Ns.MenuGroup,{children:[f&&(0,U.jsx)(cf,{...h,onClose:e?.onClose}),d&&(0,U.jsx)(bf,{clientId:o[0]}),p&&(0,U.jsx)(yf,{clientId:o[0]}),t,e?.canMove&&!e?.onlyBlock&&!r&&(0,U.jsx)(Ns.MenuItem,{onClick:(0,u.pipe)(e?.onClose,e?.onMoveTo),children:(0,C.__)("Move to")}),1===e?.count&&!r&&(0,U.jsx)(kf,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};const Bf=Cf;const If={edit:function({clientId:e,isSelected:t}){const{templateLock:n,isLockedByParent:o,isEditingAsBlocks:r}=(0,c.useSelect)((t=>{const{getContentLockingParent:n,getTemplateLock:o,getTemporarilyEditingAsBlocks:r}=Q(t($r));return{templateLock:o(e),isLockedByParent:!!n(e),isEditingAsBlocks:r()===e}}),[e]),{stopEditingAsBlocks:s,modifyContentLockBlock:i}=Q((0,c.useDispatch)($r)),l=!o&&"contentOnly"===n,u=(0,a.useCallback)((()=>{s(e)}),[e,s]);if(!l&&!r)return null;const d=r&&!l,p=!r&&l&&t;return(0,U.jsxs)(U.Fragment,{children:[d&&(0,U.jsx)(U.Fragment,{children:(0,U.jsx)(Fs,{group:"other",children:(0,U.jsx)(Ns.ToolbarButton,{onClick:u,children:(0,C.__)("Done")})})}),p&&(0,U.jsx)(Bf,{children:({selectedClientIds:t,onClose:n})=>1===t.length&&t[0]===e&&(0,U.jsx)(Ns.MenuItem,{onClick:()=>{i(e),n()},children:(0,C.__)("Modify")})})]})},hasSupport:()=>!0},jf="metadata";(0,d.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){return e?.attributes?.[jf]?.type||(e.attributes={...e.attributes,[jf]:{type:"object"}}),e}));const Ef=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.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"})});const Tf=(0,a.memo)((function({icon:e,showColors:t=!1,className:n,context:o}){"block-default"===e?.src&&(e={src:Ef});const r=(0,U.jsx)(Ns.Icon,{icon:e&&e.src?e.src:e,context:o}),s=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,U.jsx)("span",{style:s,className:Bs("block-editor-block-icon",n,{"has-colors":t}),children:r})})),Mf={};const Pf={edit:function({name:e,clientId:t,metadata:{ignoredHookedBlocks:n=[]}={}}){const o=(0,c.useSelect)((e=>e(l.store).getBlockTypes()),[]),r=(0,a.useMemo)((()=>o?.filter((({name:t,blockHooks:o})=>o&&e in o||n.includes(t)))),[o,e,n]),{blockIndex:s,rootClientId:i,innerBlocksLength:u}=(0,c.useSelect)((e=>{const{getBlocks:n,getBlockIndex:o,getBlockRootClientId:r}=e($r);return{blockIndex:o(t),innerBlocksLength:n(t)?.length,rootClientId:r(t)}}),[t]),d=(0,c.useSelect)((n=>{const{getBlocks:o,getGlobalBlockCount:s}=n($r),l=r.reduce(((n,r)=>{if(0===s(r.name))return n;const l=r?.blockHooks?.[e];let a;switch(l){case"before":case"after":a=o(i);break;case"first_child":case"last_child":a=o(t);break;case void 0:a=[...o(i),...o(t)]}const c=a?.find((e=>e.name===r.name));return c?{...n,[r.name]:c.clientId}:n}),{});return Object.values(l).length>0?l:Mf}),[r,e,t,i]),{insertBlock:p,removeBlock:h}=(0,c.useDispatch)($r);if(!r.length)return null;const g=r.reduce(((e,t)=>{const[n]=t.name.split("/");return e[n]||(e[n]=[]),e[n].push(t),e}),{});return(0,U.jsx)(sa,{children:(0,U.jsxs)(Ns.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,C.__)("Plugins"),initialOpen:!0,children:[(0,U.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,C.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(g).map((n=>(0,U.jsxs)(a.Fragment,{children:[(0,U.jsx)("h3",{children:n}),g[n].map((n=>{const o=n.name in d;return(0,U.jsx)(Ns.ToggleControl,{checked:o,label:(0,U.jsxs)(Ns.__experimentalHStack,{justify:"flex-start",children:[(0,U.jsx)(Tf,{icon:n.icon}),(0,U.jsx)("span",{children:n.title})]}),onChange:()=>{if(o)h(d[n.name],!1);else{const o=n.blockHooks[e];((e,n)=>{switch(n){case"before":case"after":p(e,"after"===n?s+1:s,i,!1);break;case"first_child":case"last_child":p(e,"first_child"===n?0:u,t,!1);break;case void 0:p(e,s+1,i,!1)}})((0,l.createBlock)(n.name),o)}}},n.title)}))]},n)))]})})},attributeKeys:["metadata"],hasSupport:()=>!0},Rf={"core/paragraph":["content"],"core/heading":["content"],"core/image":["id","url","title","alt"],"core/button":["url","text","linkTarget","rel"]},Nf="__default";function Af(e){return e in Rf}function Lf(e,t){return Af(e)&&Rf[e].includes(t)}const Of=(0,u.createHigherOrderComponent)((e=>t=>{const n=(0,c.useRegistry)(),o=(0,c.useSelect)((e=>Q(e(l.store)).getAllBlockBindingsSources())),{name:r,clientId:s,context:i}=t,u=!!t.context["pattern/overrides"],d="core/pattern-overrides"===t.attributes.metadata?.bindings?.[Nf]?.source,p=(0,a.useMemo)((()=>function(e,t){if("core/pattern-overrides"===t?.[Nf]?.source){const n=Rf[e],o={};for(const e of n){const n=t[e]?t[e]:{source:"core/pattern-overrides"};o[e]=n}return o}return t}(r,t.attributes.metadata?.bindings)),[t.attributes.metadata?.bindings,r]),h=(0,c.useSelect)((()=>{if(!p)return;const e={};for(const[t,l]of Object.entries(p)){const a=o[l.source];if(!a?.getValue||!Lf(r,t))continue;const c={registry:n,context:i,clientId:s,attributeName:t,args:l.args};e[t]=a.getValue(c),void 0===e[t]&&(e[t]="url"===t?null:a.getPlaceholder?.(c))}return e}),[p,r,s,i,n,o]),{setAttributes:g}=t,m=(0,a.useCallback)((e=>{n.batch((()=>{if(!p)return void g(e);const t={...e},l=new Map;for(const[e,n]of Object.entries(t)){if(!p[e]||!Lf(r,e))continue;const s=p[e],i=o[s?.source];(i?.setValue||i?.setValues)&&(l.set(i,{...l.get(i),[e]:n}),delete t[e])}if(l.size)for(const[e,t]of l)if(e.setValues)e.setValues({registry:n,context:i,clientId:s,attributes:t});else for(const[o,r]of Object.entries(t)){const t=p[o];e.setValue({registry:n,context:i,clientId:s,attributeName:o,args:t.args,value:r})}d&&u||!Object.keys(t).length||(d&&(delete t?.caption,delete t?.href),g(t))}))}),[n,p,r,s,i,g,o,d,u]);return(0,U.jsx)(U.Fragment,{children:(0,U.jsx)(e,{...t,attributes:{...t.attributes,...h},setAttributes:m})})}),"withBlockBindingSupport");(0,d.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e,t){return Af(t)?{...e,edit:Of(e.edit)}:e}));const Df={edit:({name:e,metadata:t})=>{const{bindings:n}=t||{},{sources:o}=(0,c.useSelect)((e=>({sources:Q(e(l.store)).getAllBlockBindingsSources()})),[]);if(!n)return null;const r={...n};return Object.keys(r).forEach((t=>{Lf(e,t)&&"core/pattern-overrides"!==r[t].source||delete r[t]})),0===Object.keys(r).length?null:(0,U.jsx)(sa,{children:(0,U.jsx)(Ns.PanelBody,{title:(0,C.__)("Attributes"),className:"components-panel__block-bindings-panel",children:(0,U.jsx)(Ns.BaseControl,{help:(0,C.__)("Attributes connected to various sources."),children:(0,U.jsx)(Ns.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,size:"large",children:Object.keys(r).map((e=>(0,U.jsx)(Ns.__experimentalItem,{children:(0,U.jsxs)(Ns.__experimentalHStack,{children:[(0,U.jsx)("span",{children:e}),(0,U.jsx)("span",{className:"components-item__block-bindings-source",children:o[r[e].source]?o[r[e].source].label:r[e].source})]})},e)))})})})})},attributeKeys:["metadata"],hasSupport:()=>!0};function zf(e){const t=e.style?.border||{};return{className:Id(e)||void 0,style:Ag({border:t})}}function Vf(e){const{colors:t}=Ru(),n=zf(e),{borderColor:o}=e;if(o){const e=vd({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function Ff(e){return{style:Ag({shadow:e.style?.shadow||""})}}function Hf(e){const{backgroundColor:t,textColor:n,gradient:o,style:r}=e,s=Pu("background-color",t),i=Pu("color",n),l=Ed(o);return{className:Bs(i,l,{[s]:!(l||r?.color?.gradient)&&!!s,"has-text-color":n||r?.color?.text,"has-background":t||r?.color?.background||o||r?.color?.gradient,"has-link-color":r?.elements?.link?.color})||void 0,style:Ag({color:r?.color||{}})}}function Gf(e){const{backgroundColor:t,textColor:n,gradient:o}=e,[r,s,i,l,c,u]=Kr("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),d=(0,a.useMemo)((()=>[...r||[],...s||[],...i||[]]),[r,s,i]),p=(0,a.useMemo)((()=>[...l||[],...c||[],...u||[]]),[l,c,u]),h=Hf(e);if(t){const e=Tu(d,t);h.style.backgroundColor=e.color}if(o&&(h.style.background=Td(p,o)),n){const e=Tu(d,n);h.style.color=e.color}return h}function Uf(e){const{style:t}=e;return{style:Ag({spacing:t?.spacing||{}})}}(0,d.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||(0,l.hasBlockSupport)(e,"renaming",!0)&&(e.__experimentalLabel=(e,{context:t})=>{const{metadata:n}=e;if("list-view"===t&&n?.name)return n.name}),e}));const{kebabCase:$f}=Q(Ns.privateApis);function Wf(e,t){let n=e?.style?.typography||{};n={...n,fontSize:rs({size:e?.style?.typography?.fontSize},t)};const o=Ag({typography:n}),r=e?.fontFamily?`has-${$f(e.fontFamily)}-font-family`:"";return{className:Bs(r,e?.style?.typography?.textAlign?`has-text-align-${e?.style?.typography?.textAlign}`:"",kh(e?.fontSize)),style:o}}function Kf(e){const[t,n]=(0,a.useState)(e);return(0,a.useEffect)((()=>{e&&n(e)}),[e]),t}function Zf(e=!0){const{__unstableSetEditorMode:t}=(0,c.useDispatch)($r),{__unstableGetEditorMode:n}=(0,c.useSelect)($r),o=(0,a.useRef)(null),r=n();(0,a.useEffect)((()=>(o.current||(o.current=r),()=>{"zoom-out"===n()&&n()!==o.current&&t(o.current)})),[]),(0,a.useEffect)((()=>{e&&"zoom-out"!==r?t("zoom-out"):e||"zoom-out"!==n()||o.current===r||t(o.current)}),[t,e,r])}var qf;!function(e){e=e.map((e=>({...e,Edit:(0,a.memo)(e.edit)})));const t=(0,u.createHigherOrderComponent)((t=>n=>{const o=_();return[...e.map(((e,t)=>{const{Edit:r,hasSupport:s,attributeKeys:i=[],shareWithChildBlocks:l}=e;if(!(o[p]||o[h]&&l)||!s(n.name))return null;const a={};for(const e of i)n.attributes[e]&&(a[e]=n.attributes[e]);return(0,U.jsx)(r,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...a},t)})),(0,U.jsx)(t,{...n},"edit")]}),"withBlockEditHooks");(0,d.addFilter)("editor.BlockEdit","core/editor/hooks",t)}([Df,Dl,Nh,Wc,qc,Hg,cm,Sm,Qm,If,Pf,lf].filter(Boolean)),function(e){const t=(0,u.createHigherOrderComponent)((t=>n=>{const[o,r]=(0,a.useState)(Array(e.length).fill(void 0));return[...e.map(((e,t)=>{const{hasSupport:o,attributeKeys:s=[],useBlockProps:i,isMatch:l}=e,a={};for(const e of s)n.attributes[e]&&(a[e]=n.attributes[e]);return!Object.keys(a).length||!o(n.name)||l&&!l(a)?null:(0,U.jsx)(Rs,{index:t,useBlockProps:i,setAllWrapperProps:r,name:n.name,clientId:n.clientId,...a},t)})),(0,U.jsx)(t,{...n,wrapperProps:o.filter(Boolean).reduce(((e,t)=>({...e,...t,className:Bs(e.className,t.className),style:{...e.style,...t.style}})),n.wrapperProps||{})},"edit")]}),"withBlockListBlockHooks");(0,d.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}([Dl,Nh,Gc,Hg,mp,Mg,cm,mh,yh,jd,Sm,Km,lf]),qf=[Dl,Nh,Wc,Zc,qc,jd,mp,Hg,mh,yh],(0,d.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(function(e,t,n){return qf.reduce(((e,o)=>{const{hasSupport:r,attributeKeys:s=[],addSaveProps:i}=o,l={};for(const e of s)n[e]&&(l[e]=n[e]);return Object.keys(l).length&&r(t)?i(e,t,l):e}),e)}),0),(0,d.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(e=>(e.hasOwnProperty("className")&&!e.className&&delete e.className,e)));const{kebabCase:Yf}=Q(Ns.privateApis),Xf=([e,...t])=>e.toUpperCase()+t.join(""),Qf=e=>(0,u.createHigherOrderComponent)((t=>n=>(0,U.jsx)(t,{...n,colors:e})),"withCustomColorPalette"),Jf=()=>(0,u.createHigherOrderComponent)((e=>t=>{const[n,o,r]=Kr("color.palette.custom","color.palette.theme","color.palette.default"),s=(0,a.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,U.jsx)(e,{...t,colors:s})}),"withEditorColorPalette");function eb(e,t){const n=e.reduce(((e,t)=>({...e,..."string"==typeof t?{[t]:Yf(t)}:t})),{});return(0,u.compose)([t,e=>class extends a.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=yu(t),o=({color:e})=>n.contrast(e),r=Math.max(...e.map(o));return e.find((e=>o(e)===r)).color}(t,e)}createSetters(){return Object.keys(n).reduce(((e,t)=>{const n=Xf(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=Mu(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,colors:t},o){return Object.entries(n).reduce(((n,[r,s])=>{const i=Tu(t,e[r],e[`custom${Xf(r)}`]),l=o[r],a=l?.color;return a===i.color&&l?n[r]=l:n[r]={...i,class:Pu(s,i.slug)},n}),{})}render(){return(0,U.jsx)(e,{...this.props,colors:void 0,...this.state,...this.setters,colorUtils:this.colorUtils})}}])}function tb(e){return(...t)=>{const n=Qf(e);return(0,u.createHigherOrderComponent)(eb(t,n),"withCustomColors")}}function nb(...e){const t=Jf();return(0,u.createHigherOrderComponent)(eb(e,t),"withColors")}const ob=function(e){const[t,n]=Kr("typography.fontSizes","typography.customFontSize");return(0,U.jsx)(Ns.FontSizePicker,{...e,fontSizes:t,disableCustomFontSizes:!n})},rb=[],sb=([e,...t])=>e.toUpperCase()+t.join(""),ib=(...e)=>{const t=e.reduce(((e,t)=>(e[t]=`custom${sb(t)}`,e)),{});return(0,u.createHigherOrderComponent)((0,u.compose)([(0,u.createHigherOrderComponent)((e=>t=>{const[n]=Kr("typography.fontSizes");return(0,U.jsx)(e,{...t,fontSizes:n||rb})}),"withFontSizes"),e=>class extends a.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object.entries(t).reduce(((e,[t,n])=>(e[`set${sb(t)}`]=this.createSetFontSize(t,n),e)),{})}createSetFontSize(e,t){return n=>{const o=this.props.fontSizes?.find((({size:e})=>e===Number(n)));this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,fontSizes:n},o){const r=(t,n)=>!o[n]||(e[n]?e[n]!==o[n].slug:o[n].size!==e[t]);if(!Object.values(t).some(r))return null;const s=Object.entries(t).filter((([e,t])=>r(t,e))).reduce(((t,[o,r])=>{const s=e[o],i=bh(n,s,e[r]);return t[o]={...i,class:kh(s)},t}),{});return{...o,...s}}render(){return(0,U.jsx)(e,{...this.props,fontSizes:void 0,...this.state,...this.setters})}}]),"withFontSizes")};var lb=n(9681),ab=n.n(lb);function cb(e){return e.toLowerCase()}var ub=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],db=/[^A-Z0-9]+/gi;function pb(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}const hb=e=>e.name||"",gb=e=>e.title,mb=e=>e.description||"",fb=e=>e.keywords||[],bb=e=>e.category,vb=()=>null,kb=[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],_b=/(\p{C}|\p{P}|\p{S})+/giu,xb=new Map,yb=new Map;function Sb(e=""){if(xb.has(e))return xb.get(e);const t=function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?ub:n,r=t.stripRegexp,s=void 0===r?db:r,i=t.transform,l=void 0===i?cb:i,a=t.delimiter,c=void 0===a?" ":a,u=pb(pb(e,o,"$1\0$2"),s,"\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(l).join(c)}(e,{splitRegexp:kb,stripRegexp:_b}).split(" ").filter(Boolean);return xb.set(e,t),t}function wb(e=""){if(yb.has(e))return yb.get(e);let t=ab()(e);return t=t.replace(/^\//,""),t=t.toLowerCase(),yb.set(e,t),t}const Cb=(e="")=>Sb(wb(e)),Bb=(e,t,n,o)=>{if(0===Cb(o).length)return e;return Ib(e,o,{getCategory:e=>t.find((({slug:t})=>t===e.category))?.title,getCollection:e=>n[e.name.split("/")[0]]?.title})},Ib=(e=[],t="",n={})=>{if(0===Cb(t).length)return e;const o=e.map((e=>[e,jb(e,t,n)])).filter((([,e])=>e>0));return o.sort((([,e],[,t])=>t-e)),o.map((([e])=>e))};function jb(e,t,n={}){const{getName:o=hb,getTitle:r=gb,getDescription:s=mb,getKeywords:i=fb,getCategory:l=bb,getCollection:a=vb}=n,c=o(e),u=r(e),d=s(e),p=i(e),h=l(e),g=a(e),m=wb(t),f=wb(u);let b=0;if(m===f)b+=30;else if(f.startsWith(m))b+=20;else{const e=[c,u,d,...p,h,g].join(" ");0===((e,t)=>e.filter((e=>!Cb(t).some((t=>t.includes(e))))))(Sb(m),e).length&&(b+=10)}if(0!==b&&c.startsWith("core/")){b+=c!==e.id?1:2}return b}const Eb=(e,t,n)=>{const o=(0,a.useMemo)((()=>({[ee]:!n})),[n]),[r]=(0,c.useSelect)((t=>[t($r).getInserterItems(e,o)]),[e,o]),[s,i]=(0,c.useSelect)((e=>{const{getCategories:t,getCollections:n}=e(l.store);return[t(),n()]}),[]);return[r,s,i,(0,a.useCallback)((({name:e,initialAttributes:n,innerBlocks:o,syncStatus:r,content:s,rootClientId:i},a)=>{const c="unsynced"===r?(0,l.parse)(s,{__unstableSkipMigrationLogs:!0}):(0,l.createBlock)(e,n,(0,l.createBlocksFromInnerBlocksTemplate)(o));t(c,void 0,a,i)}),[t])]},Tb=(e,t)=>t?(e.sort((({id:e},{id:n})=>{let o=t.indexOf(e),r=t.indexOf(n);return o<0&&(o=t.length),r<0&&(r=t.length),o-r})),e):e,Mb=()=>{};const Pb={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n,prioritizedBlocks:o}=(0,c.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockListSettings:o,getBlockRootClientId:r}=e($r),s=t(),i=r(s);return{selectedBlockName:s?n(s):null,rootClientId:i,prioritizedBlocks:o(i)?.prioritizedInserterBlocks}}),[]),[r,s,i]=Eb(t,Mb,!0),l=(0,a.useMemo)((()=>(e.trim()?Bb(r,s,i,e):Tb(ae(r,"frecency","desc"),o)).filter((e=>e.name!==n)).slice(0,9)),[e,n,r,s,i,o]);return[(0,a.useMemo)((()=>l.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Tf,{icon:n,showColors:!0},"icon"),t]}),isDisabled:o}}))),[l])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o,syncStatus:r,content:s}=e;return{action:"replace",value:"unsynced"===r?(0,l.parse)(s,{__unstableSkipMigrationLogs:!0}):(0,l.createBlock)(t,n,(0,l.createBlocksFromInnerBlocksTemplate)(o))}}},Rb=window.wp.apiFetch;var Nb=n.n(Rb);const Ab=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.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"})});const Lb={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await Nb()({path:(0,ia.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ui,{icon:"page"===e.subtype?Ea:Ab},"icon"),e.title]}),getOptionCompletion:e=>(0,U.jsx)("a",{href:e.url,children:e.title})},Ob=[];function Db({completers:e=Ob}){const{name:t}=_();return(0,a.useMemo)((()=>{let n=[...e,Lb];return(t===(0,l.getDefaultBlockName)()||(0,l.getBlockSupport)(t,"__experimentalSlashInserter",!1))&&(n=[...n,Pb]),(0,d.hasFilter)("editor.Autocomplete.completers")&&(n===e&&(n=n.map((e=>({...e})))),n=(0,d.applyFilters)("editor.Autocomplete.completers",n,t)),n}),[e,t])}const zb=function(e){return(0,U.jsx)(Ns.Autocomplete,{...e,completers:Db(e)})},Vb=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"})});const Fb=function({isActive:e,label:t=(0,C.__)("Toggle full height"),onToggle:n,isDisabled:o}){return(0,U.jsx)(Ns.ToolbarButton,{isActive:e,icon:Vb,label:t,onClick:()=>n(!e),disabled:o})},Hb=()=>{};const Gb=function(e){const{label:t=(0,C.__)("Change matrix alignment"),onChange:n=Hb,value:o="center",isDisabled:r}=e,s=(0,U.jsx)(Ns.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,U.jsx)(Ns.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e,isOpen:n})=>(0,U.jsx)(Ns.ToolbarButton,{onClick:e,"aria-haspopup":"true","aria-expanded":n,onKeyDown:t=>{n||t.keyCode!==ca.DOWN||(t.preventDefault(),e())},label:t,icon:s,showTooltip:!0,disabled:r}),renderContent:()=>(0,U.jsx)(Ns.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};function Ub({clientId:e,maximumLength:t,context:n}){const o=(0,c.useSelect)((t=>{if(!e)return null;const{getBlockName:o,getBlockAttributes:r}=t($r),{getBlockType:s,getActiveBlockVariation:i}=t(l.store),a=o(e),c=s(a);if(!c)return null;const u=r(e),d=(0,l.__experimentalGetBlockLabel)(c,u,n);if(d!==c.title)return d;const p=i(a,u);return p?.title||c.title}),[e,n]);if(!o)return null;if(t&&t>0&&o.length>t){const e="...";return o.slice(0,t-e.length)+e}return o}function $b({clientId:e,maximumLength:t,context:n}){return Ub({clientId:e,maximumLength:t,context:n})}const Wb=function({rootLabelText:e}){const{selectBlock:t,clearSelectedBlock:n}=(0,c.useDispatch)($r),{clientId:o,parents:r,hasSelection:s}=(0,c.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getEnabledBlockParents:o}=Q(e($r)),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),i=e||(0,C.__)("Document");return(0,U.jsxs)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,C.__)("Block breadcrumb"),children:[(0,U.jsxs)("li",{className:s?void 0:"block-editor-block-breadcrumb__current","aria-current":s?void 0:"true",children:[s&&(0,U.jsx)(Ns.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:n,children:i}),!s&&i,!!o&&(0,U.jsx)(Ui,{icon:_a,className:"block-editor-block-breadcrumb__separator"})]}),r.map((e=>(0,U.jsxs)("li",{children:[(0,U.jsx)(Ns.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>t(e),children:(0,U.jsx)($b,{clientId:e,maximumLength:35})}),(0,U.jsx)(Ui,{icon:_a,className:"block-editor-block-breadcrumb__separator"})]},e))),!!o&&(0,U.jsx)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true",children:(0,U.jsx)($b,{clientId:o,maximumLength:35})})]})};function Kb(e){return(0,c.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t($r);return n(e)}),[e])}const Zb=(0,a.createContext)({});function qb({value:e,children:t}){const n=(0,a.useContext)(Zb),o=(0,a.useMemo)((()=>({...n,...e})),[n,e]);return(0,U.jsx)(Zb.Provider,{value:o,children:t})}const Yb=Zb,Xb={},Qb=(0,Ns.withFilters)("editor.BlockEdit")((e=>{const{name:t}=e,n=(0,l.getBlockType)(t);if(!n)return null;const o=n.edit||n.save;return(0,U.jsx)(o,{...e})})),Jb=e=>{const{attributes:t={},name:n}=e,o=(0,l.getBlockType)(n),r=(0,a.useContext)(Yb),s=(0,a.useMemo)((()=>o&&o.usesContext?Object.fromEntries(Object.entries(r).filter((([e])=>o.usesContext.includes(e)))):Xb),[o,r]);if(!o)return null;if(o.apiVersion>1)return(0,U.jsx)(Qb,{...e,context:s});const i=(0,l.hasBlockSupport)(o,"className",!0)?(0,l.getBlockDefaultClassName)(n):null,c=Bs(i,t.className,e.className);return(0,U.jsx)(Qb,{...e,context:s,className:c})},ev=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});const tv=function({className:e,actions:t,children:n,secondaryActions:o}){return(0,U.jsx)("div",{style:{display:"contents",all:"initial"},children:(0,U.jsx)("div",{className:Bs(e,"block-editor-warning"),children:(0,U.jsxs)("div",{className:"block-editor-warning__contents",children:[(0,U.jsx)("p",{className:"block-editor-warning__message",children:n}),(a.Children.count(t)>0||o)&&(0,U.jsxs)("div",{className:"block-editor-warning__actions",children:[a.Children.count(t)>0&&a.Children.map(t,((e,t)=>(0,U.jsx)("span",{className:"block-editor-warning__action",children:e},t))),o&&(0,U.jsx)(Ns.DropdownMenu,{className:"block-editor-warning__secondary",icon:ev,label:(0,C.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0,children:()=>(0,U.jsx)(Ns.MenuGroup,{children:o.map(((e,t)=>(0,U.jsx)(Ns.MenuItem,{onClick:e.onClick,children:e.title},t)))})})]})]})})})};function nv({originalBlockClientId:e,name:t,onReplace:n}){const{selectBlock:o}=(0,c.useDispatch)($r),r=(0,l.getBlockType)(t);return(0,U.jsxs)(tv,{actions:[(0,U.jsx)(Ns.Button,{variant:"secondary",onClick:()=>o(e),children:(0,C.__)("Find original")},"find-original"),(0,U.jsx)(Ns.Button,{variant:"secondary",onClick:()=>n([]),children:(0,C.__)("Remove")},"remove")],children:[(0,U.jsxs)("strong",{children:[r?.title,": "]}),(0,C.__)("This block can only be used once.")]})}const ov=(0,a.createContext)({});function rv({mayDisplayControls:e,mayDisplayParentControls:t,blockEditingMode:n,isPreviewMode:o,...r}){const{name:s,isSelected:i,clientId:c,attributes:u={},__unstableLayoutClassNames:d}=r,{layout:b=null,metadata:v={}}=u,{bindings:_}=v,x=(0,l.hasBlockSupport)(s,"layout",!1)||(0,l.hasBlockSupport)(s,"__experimentalLayout",!1),{originalBlockClientId:y}=(0,a.useContext)(ov);return(0,U.jsxs)(k,{value:(0,a.useMemo)((()=>({name:s,isSelected:i,clientId:c,layout:x?b:null,__unstableLayoutClassNames:d,[p]:e,[h]:t,[g]:n,[m]:_,[f]:o})),[s,i,c,x,b,d,e,t,n,_,o]),children:[(0,U.jsx)(Jb,{...r}),y&&(0,U.jsx)(nv,{originalBlockClientId:y,name:s,onReplace:r.onReplace})]})}var sv=n(8021);function iv({title:e,rawContent:t,renderedContent:n,action:o,actionText:r,className:s}){return(0,U.jsxs)("div",{className:s,children:[(0,U.jsxs)("div",{className:"block-editor-block-compare__content",children:[(0,U.jsx)("h2",{className:"block-editor-block-compare__heading",children:e}),(0,U.jsx)("div",{className:"block-editor-block-compare__html",children:t}),(0,U.jsx)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor",children:(0,U.jsx)(a.RawHTML,{children:(0,la.safeHTML)(n)})})]}),(0,U.jsx)("div",{className:"block-editor-block-compare__action",children:(0,U.jsx)(Ns.Button,{variant:"secondary",tabIndex:"0",onClick:o,children:r})})]})}const lv=function({block:e,onKeep:t,onConvert:n,convertor:o,convertButtonText:r}){const s=(i=o(e),(Array.isArray(i)?i:[i]).map((e=>(0,l.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var i;const a=(c=e.originalContent,u=s,(0,sv.JJ)(c,u).map(((e,t)=>{const n=Bs({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,U.jsx)("span",{className:n,children:e.value},t)})));var c,u;return(0,U.jsxs)("div",{className:"block-editor-block-compare__wrapper",children:[(0,U.jsx)(iv,{title:(0,C.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,C.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,U.jsx)(iv,{title:(0,C.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:r,rawContent:a,renderedContent:s})]})},av=e=>(0,l.rawHandler)({HTML:e.originalContent});function cv({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:o}=(0,c.useSelect)((t=>{const{canInsertBlockType:n,getBlock:o,getBlockRootClientId:r}=t($r),s=r(e);return{block:o(e),canInsertHTMLBlock:n("core/html",s),canInsertClassicBlock:n("core/freeform",s)}}),[e]),{replaceBlock:r}=(0,c.useDispatch)($r),[s,i]=(0,a.useState)(!1),u=(0,a.useCallback)((()=>i(!1)),[]),d=(0,a.useMemo)((()=>({toClassic(){const e=(0,l.createBlock)("core/freeform",{content:t.originalContent});return r(t.clientId,e)},toHTML(){const e=(0,l.createBlock)("core/html",{content:t.originalContent});return r(t.clientId,e)},toBlocks(){const e=av(t);return r(t.clientId,e)},toRecoveredBlock(){const e=(0,l.createBlock)(t.name,t.attributes,t.innerBlocks);return r(t.clientId,e)}})),[t,r]),p=(0,a.useMemo)((()=>[{title:(0,C._x)("Resolve","imperative verb"),onClick:()=>i(!0)},n&&{title:(0,C.__)("Convert to HTML"),onClick:d.toHTML},o&&{title:(0,C.__)("Convert to Classic Block"),onClick:d.toClassic}].filter(Boolean)),[n,o,d]);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(tv,{actions:[(0,U.jsx)(Ns.Button,{onClick:d.toRecoveredBlock,variant:"primary",children:(0,C.__)("Attempt Block Recovery")},"recover")],secondaryActions:p,children:(0,C.__)("This block contains unexpected or invalid content.")}),s&&(0,U.jsx)(Ns.Modal,{title:(0,C.__)("Resolve Block"),onRequestClose:u,className:"block-editor-block-compare",children:(0,U.jsx)(lv,{block:t,onKeep:d.toHTML,onConvert:d.toBlocks,convertor:av,convertButtonText:(0,C.__)("Convert to Blocks")})})]})}const uv=(0,U.jsx)(tv,{className:"block-editor-block-list__block-crash-warning",children:(0,C.__)("This block has encountered an error and cannot be previewed.")}),dv=()=>uv;class pv extends a.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 hv=pv;var gv=n(4132);const mv=function({clientId:e}){const[t,n]=(0,a.useState)(""),o=(0,c.useSelect)((t=>t($r).getBlock(e)),[e]),{updateBlock:r}=(0,c.useDispatch)($r);return(0,a.useEffect)((()=>{n((0,l.getBlockContent)(o))}),[o]),(0,U.jsx)(gv.A,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const s=(0,l.getBlockType)(o.name);if(!s)return;const i=(0,l.getBlockAttributes)(s,t,o.attributes),a=t||(0,l.getSaveContent)(s,i),[c]=t?(0,l.validateBlock)({...o,attributes:i,originalContent:a}):[!0];r(e,{attributes:i,originalContent:a,isValid:c}),t||n(a)},onChange:e=>n(e.target.value)})};var fv=Pv(),bv=e=>jv(e,fv),vv=Pv();bv.write=e=>jv(e,vv);var kv=Pv();bv.onStart=e=>jv(e,kv);var _v=Pv();bv.onFrame=e=>jv(e,_v);var xv=Pv();bv.onFinish=e=>jv(e,xv);var yv=[];bv.setTimeout=(e,t)=>{let n=bv.now()+t,o=()=>{let e=yv.findIndex((e=>e.cancel==o));~e&&yv.splice(e,1),Bv-=~e?1:0},r={time:n,handler:e,cancel:o};return yv.splice(Sv(n),0,r),Bv+=1,Ev(),r};var Sv=e=>~(~yv.findIndex((t=>t.time>e))||~yv.length);bv.cancel=e=>{kv.delete(e),_v.delete(e),xv.delete(e),fv.delete(e),vv.delete(e)},bv.sync=e=>{Iv=!0,bv.batchedUpdates(e),Iv=!1},bv.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,bv.onStart(n)}return o.handler=e,o.cancel=()=>{kv.delete(n),t=null},o};var wv=typeof window<"u"?window.requestAnimationFrame:()=>{};bv.use=e=>wv=e,bv.now=typeof performance<"u"?()=>performance.now():Date.now,bv.batchedUpdates=e=>e(),bv.catch=console.error,bv.frameLoop="always",bv.advance=()=>{"demand"!==bv.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Mv()};var Cv=-1,Bv=0,Iv=!1;function jv(e,t){Iv?(t.delete(e),e(0)):(t.add(e),Ev())}function Ev(){Cv<0&&(Cv=0,"demand"!==bv.frameLoop&&wv(Tv))}function Tv(){~Cv&&(wv(Tv),bv.batchedUpdates(Mv))}function Mv(){let e=Cv;Cv=bv.now();let t=Sv(Cv);t&&(Rv(yv.splice(0,t),(e=>e.handler())),Bv-=t),Bv?(kv.flush(),fv.flush(e?Math.min(64,Cv-e):16.667),_v.flush(),vv.flush(),xv.flush()):Cv=-1}function Pv(){let e=new Set,t=e;return{add(n){Bv+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Bv-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Bv-=t.size,Rv(t,(t=>t(n)&&e.add(t))),Bv+=e.size,t=e)}}}function Rv(e,t){e.forEach((e=>{try{t(e)}catch(e){bv.catch(e)}}))}var Nv=Object.defineProperty,Av={};function Lv(){}((e,t)=>{for(var n in t)Nv(e,n,{get:t[n],enumerable:!0})})(Av,{assign:()=>Yv,colors:()=>Kv,createStringInterpolator:()=>Gv,skipAnimation:()=>Zv,to:()=>Uv,willAdvance:()=>qv});var Ov={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 Dv(e,t){if(Ov.arr(e)){if(!Ov.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}var zv=(e,t)=>e.forEach(t);function Vv(e,t,n){if(Ov.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(let o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}var Fv=e=>Ov.und(e)?[]:Ov.arr(e)?e:[e];function Hv(e,t){if(e.size){let n=Array.from(e);e.clear(),zv(n,t)}}var Gv,Uv,$v=(e,...t)=>Hv(e,(e=>e(...t))),Wv=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Kv=null,Zv=!1,qv=Lv,Yv=e=>{e.to&&(Uv=e.to),e.now&&(bv.now=e.now),void 0!==e.colors&&(Kv=e.colors),null!=e.skipAnimation&&(Zv=e.skipAnimation),e.createStringInterpolator&&(Gv=e.createStringInterpolator),e.requestAnimationFrame&&bv.use(e.requestAnimationFrame),e.batchedUpdates&&(bv.batchedUpdates=e.batchedUpdates),e.willAdvance&&(qv=e.willAdvance),e.frameLoop&&(bv.frameLoop=e.frameLoop)},Xv=new Set,Qv=[],Jv=[],ek=0,tk={get idle(){return!Xv.size&&!Qv.length},start(e){ek>e.priority?(Xv.add(e),bv.onStart(nk)):(ok(e),bv(sk))},advance:sk,sort(e){if(ek)bv.onFrame((()=>tk.sort(e)));else{let t=Qv.indexOf(e);~t&&(Qv.splice(t,1),rk(e))}},clear(){Qv=[],Xv.clear()}};function nk(){Xv.forEach(ok),Xv.clear(),bv(sk)}function ok(e){Qv.includes(e)||rk(e)}function rk(e){Qv.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(Qv,(t=>t.priority>e.priority)),0,e)}function sk(e){let t=Jv;for(let n=0;n<Qv.length;n++){let o=Qv[n];ek=o.priority,o.idle||(qv(o),o.advance(e),o.idle||t.push(o))}return ek=0,(Jv=Qv).length=0,(Qv=t).length>0}var ik="[-+]?\\d*\\.?\\d+",lk=ik+"%";function ak(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var ck=new RegExp("rgb"+ak(ik,ik,ik)),uk=new RegExp("rgba"+ak(ik,ik,ik,ik)),dk=new RegExp("hsl"+ak(ik,lk,lk)),pk=new RegExp("hsla"+ak(ik,lk,lk,ik)),hk=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,gk=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,mk=/^#([0-9a-fA-F]{6})$/,fk=/^#([0-9a-fA-F]{8})$/;function bk(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 vk(e,t,n){let o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,s=bk(r,o,e+1/3),i=bk(r,o,e),l=bk(r,o,e-1/3);return Math.round(255*s)<<24|Math.round(255*i)<<16|Math.round(255*l)<<8}function kk(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function _k(e){return(parseFloat(e)%360+360)%360/360}function xk(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function yk(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function Sk(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=mk.exec(e))?parseInt(t[1]+"ff",16)>>>0:Kv&&void 0!==Kv[e]?Kv[e]:(t=ck.exec(e))?(kk(t[1])<<24|kk(t[2])<<16|kk(t[3])<<8|255)>>>0:(t=uk.exec(e))?(kk(t[1])<<24|kk(t[2])<<16|kk(t[3])<<8|xk(t[4]))>>>0:(t=hk.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=fk.exec(e))?parseInt(t[1],16)>>>0:(t=gk.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=dk.exec(e))?(255|vk(_k(t[1]),yk(t[2]),yk(t[3])))>>>0:(t=pk.exec(e))?(vk(_k(t[1]),yk(t[2]),yk(t[3]))|xk(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})`)}var wk=(e,t,n)=>{if(Ov.fun(e))return e;if(Ov.arr(e))return wk({range:e,output:t,extrapolate:n});if(Ov.str(e.output[0]))return Gv(e);let o=e,r=o.output,s=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",l=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,s);return function(e,t,n,o,r,s,i,l,a){let c=a?a(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===l)return c;"clamp"===l&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=s(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,s[t],s[t+1],r[t],r[t+1],a,i,l,o.map)}};var Ck=1.70158,Bk=1.525*Ck,Ik=Ck+1,jk=2*Math.PI/3,Ek=2*Math.PI/4.5,Tk=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Mk={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>Ik*e*e*e-Ck*e*e,easeOutBack:e=>1+Ik*Math.pow(e-1,3)+Ck*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(Bk+1)*e-Bk)/2:(Math.pow(2*e-2,2)*((Bk+1)*(2*e-2)+Bk)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*jk),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*jk)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Ek)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Ek)/2+1,easeInBounce:e=>1-Tk(1-e),easeOutBounce:Tk,easeInOutBounce:e=>e<.5?(1-Tk(1-2*e))/2:(1+Tk(2*e-1))/2,steps:(e,t="end")=>n=>{let o=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,e),t))(0,1,("end"===t?Math.floor(o):Math.ceil(o))/e)}},Pk=Symbol.for("FluidValue.get"),Rk=Symbol.for("FluidValue.observers"),Nk=e=>Boolean(e&&e[Pk]),Ak=e=>e&&e[Pk]?e[Pk]():e,Lk=e=>e[Rk]||null;function Ok(e,t){let n=e[Rk];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var Dk=class{[Pk];[Rk];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");zk(this,e)}},zk=(e,t)=>Gk(e,Pk,t);function Vk(e,t){if(e[Pk]){let n=e[Rk];n||Gk(e,Rk,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Fk(e,t){let n=e[Rk];if(n&&n.has(t)){let o=n.size-1;o?n.delete(t):e[Rk]=null,e.observerRemoved&&e.observerRemoved(o,t)}}var Hk,Gk=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Uk=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,$k=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Wk=new RegExp(`(${Uk.source})(%|[a-z]+)`,"i"),Kk=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Zk=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,qk=e=>{let[t,n]=Yk(e);if(!t||Wv())return e;let 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&&Zk.test(n)?qk(n):n||e},Yk=e=>{let t=Zk.exec(e);if(!t)return[,];let[,n,o]=t;return[n,o]},Xk=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Qk=e=>{Hk||(Hk=Kv?new RegExp(`(${Object.keys(Kv).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>Ak(e).replace(Zk,qk).replace($k,Sk).replace(Hk,Sk))),n=t.map((e=>e.match(Uk).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=>wk({...e,output:t})));return e=>{let n=!Wk.test(t[0])&&t.find((e=>Wk.test(e)))?.replace(Uk,""),r=0;return t[0].replace(Uk,(()=>`${o[r++](e)}${n||""}`)).replace(Kk,Xk)}},Jk="react-spring: ",e_=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${Jk}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},t_=e_(console.warn);e_(console.warn);function n_(e){return Ov.str(e)&&("#"==e[0]||/\d/.test(e)||!Wv()&&Zk.test(e)||e in(Kv||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var o_=Wv()?ya.useEffect:ya.useLayoutEffect;function r_(){let e=(0,ya.useState)()[1],t=(()=>{let e=(0,ya.useRef)(!1);return o_((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}var s_=[];var i_=Symbol.for("Animated:node"),l_=e=>e&&e[i_],a_=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,i_,t),c_=e=>e&&e[i_]&&e[i_].getPayload(),u_=class{payload;constructor(){a_(this,this)}getPayload(){return this.payload||[]}},d_=class extends u_{constructor(e){super(),this._value=e,Ov.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new d_(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Ov.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(){let{done:e}=this;this.done=!1,Ov.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},p_=class extends d_{_string=null;_toString;constructor(e){super(0),this._toString=wk({output:[e,e]})}static create(e){return new p_(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(Ov.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=wk({output:[this.getValue(),e]})),this._value=0,super.reset()}},h_={dependencies:null},g_=class extends u_{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return Vv(this.source,((n,o)=>{(e=>!!e&&e[i_]===e)(n)?t[o]=n.getValue(e):Nk(n)?t[o]=Ak(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&zv(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return Vv(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){h_.dependencies&&Nk(e)&&h_.dependencies.add(e);let t=c_(e);t&&zv(t,(e=>this.add(e)))}},m_=class extends g_{constructor(e){super(e)}static create(e){return new m_(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(f_)),!0)}};function f_(e){return(n_(e)?p_:d_).create(e)}function b_(e){let t=l_(e);return t?t.constructor:Ov.arr(e)?m_:n_(e)?p_:d_}var v_=(e,t)=>{let n=!Ov.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,ya.forwardRef)(((o,r)=>{let s=(0,ya.useRef)(null),i=n&&(0,ya.useCallback)((e=>{s.current=function(e,t){return e&&(Ov.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[l,a]=function(e,t){let n=new Set;return h_.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new g_(e),h_.dependencies=null,[e,n]}(o,t),c=r_(),u=()=>{let e=s.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,l.getValue(!0)))&&c()},d=new k_(u,a),p=(0,ya.useRef)();o_((()=>(p.current=d,zv(a,(e=>Vk(e,d))),()=>{p.current&&(zv(p.current.deps,(e=>Fk(e,p.current))),bv.cancel(p.current.update))}))),(0,ya.useEffect)(u,[]),(e=>{(0,ya.useEffect)(e,s_)})((()=>()=>{let e=p.current;zv(e.deps,(t=>Fk(t,e)))}));let h=t.getComponentProps(l.getValue());return ya.createElement(e,{...h,ref:i})}))},k_=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&bv.write(this.update)}};var __=Symbol.for("AnimatedComponent"),x_=e=>Ov.str(e)?e:e&&Ov.str(e.displayName)?e.displayName:Ov.fun(e)&&e.name||null;function y_(e,...t){return Ov.fun(e)?e(...t):e}var S_=(e,t)=>!0===e||!!(t&&e&&(Ov.fun(e)?e(t):Fv(e).includes(t))),w_=(e,t)=>Ov.obj(e)?t&&e[t]:e,C_=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,B_=e=>e,I_=(e,t=B_)=>{let n=j_;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let o={};for(let r of n){let n=t(e[r],r);Ov.und(n)||(o[r]=n)}return o},j_=["config","onProps","onStart","onChange","onPause","onResume","onRest"],E_={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 T_(e){let t=function(e){let t={},n=0;if(Vv(e,((e,o)=>{E_[o]||(t[o]=e,n++)})),n)return t}(e);if(t){let n={to:t};return Vv(e,((e,o)=>o in t||(n[o]=e))),n}return{...e}}function M_(e){return e=Ak(e),Ov.arr(e)?e.map(M_):n_(e)?Av.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function P_(e){return Ov.fun(e)||Ov.arr(e)&&Ov.obj(e[0])}var R_={tension:170,friction:26,mass:1,damping:1,easing:Mk.linear,clamp:!1},N_=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,R_)}};function A_(e,t){if(Ov.und(t.decay)){let n=!Ov.und(t.tension)||!Ov.und(t.friction);(n||!Ov.und(t.frequency)||!Ov.und(t.damping)||!Ov.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var L_=[],O_=class{changed=!1;values=L_;toValues=null;fromValues=L_;to;from;config=new N_;immediate=!1};function D_(e,{key:t,props:n,defaultProps:o,state:r,actions:s}){return new Promise(((i,l)=>{let a,c,u=S_(n.cancel??o?.cancel,t);if(u)h();else{Ov.und(n.pause)||(r.paused=S_(n.pause,t));let e=o?.pause;!0!==e&&(e=r.paused||S_(e,t)),a=y_(n.delay||0,t),e?(r.resumeQueue.add(p),s.pause()):(s.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),a=c.time-bv.now()}function p(){a>0&&!Av.skipAnimation?(r.delayed=!0,c=bv.setTimeout(h,a),r.pauseQueue.add(d),r.timeouts.add(c)):h()}function h(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),e<=(r.cancelId||0)&&(u=!0);try{s.start({...n,callId:e,cancel:u},i)}catch(e){l(e)}}}))}var z_=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?H_(e.get()):t.every((e=>e.noop))?V_(e.get()):F_(e.get(),t.every((e=>e.finished))),V_=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),F_=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),H_=e=>({value:e,cancelled:!0,finished:!1});function G_(e,t,n,o){let{callId:r,parentId:s,onRest:i}=t,{asyncTo:l,promise:a}=n;return s||e!==l||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;let c,u,d,p=I_(t,((e,t)=>"onRest"===t?void 0:e)),h=new Promise(((e,t)=>(c=e,u=t))),g=e=>{let t=r<=(n.cancelId||0)&&H_(o)||r!==n.asyncId&&F_(o,!1);if(t)throw e.result=t,u(e),e},m=(e,t)=>{let s=new $_,i=new W_;return(async()=>{if(Av.skipAnimation)throw U_(n),i.result=F_(o,!1),u(i),i;g(s);let l=Ov.obj(e)?{...e}:{...t,to:e};l.parentId=r,Vv(p,((e,t)=>{Ov.und(l[t])&&(l[t]=e)}));let a=await o.start(l);return g(s),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};if(Av.skipAnimation)return U_(n),F_(o,!1);try{let t;t=Ov.arr(e)?(async e=>{for(let t of e)await m(t)})(e):Promise.resolve(e(m,o.stop.bind(o))),await Promise.all([t.then(c),h]),d=F_(o.get(),!0,!1)}catch(e){if(e instanceof $_)d=e.result;else{if(!(e instanceof W_))throw e;d=e.result}}finally{r==n.asyncId&&(n.asyncId=s,n.asyncTo=s?l:void 0,n.promise=s?a:void 0)}return Ov.fun(i)&&bv.batchedUpdates((()=>{i(d,o,o.item)})),d})():a}function U_(e,t){Hv(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var $_=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},W_=class extends Error{result;constructor(){super("SkipAnimationSignal")}},K_=e=>e instanceof q_,Z_=1,q_=class extends Dk{id=Z_++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=l_(this);return e&&e.getValue()}to(...e){return Av.to(this,e)}interpolate(...e){return t_(`${Jk}The "interpolate" function is deprecated in v9 (use "to" instead)`),Av.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){Ok(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||tk.sort(this),Ok(this,{type:"priority",parent:this,priority:e})}},Y_=Symbol.for("SpringPhase"),X_=e=>(1&e[Y_])>0,Q_=e=>(2&e[Y_])>0,J_=e=>(4&e[Y_])>0,ex=(e,t)=>t?e[Y_]|=3:e[Y_]&=-3,tx=(e,t)=>t?e[Y_]|=4:e[Y_]&=-5,nx=class extends q_{key;animation=new O_;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!Ov.und(e)||!Ov.und(t)){let n=Ov.obj(e)?{...e}:{...t,from:e};Ov.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Q_(this)||this._state.asyncTo)||J_(this)}get goal(){return Ak(this.animation.to)}get velocity(){let e=l_(this);return e instanceof d_?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return X_(this)}get isAnimating(){return Q_(this)}get isPaused(){return J_(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,o=this.animation,{config:r,toValues:s}=o,i=c_(o.to);!i&&Nk(o.to)&&(s=Fv(Ak(o.to))),o.values.forEach(((l,a)=>{if(l.done)return;let c=l.constructor==p_?1:i?i[a].lastPosition:s[a],u=o.immediate,d=c;if(!u){if(d=l.lastPosition,r.tension<=0)return void(l.done=!0);let t,n=l.elapsedTime+=e,s=o.fromValues[a],i=null!=l.v0?l.v0:l.v0=Ov.arr(r.velocity)?r.velocity[a]:r.velocity,p=r.precision||(s==c?.005:Math.min(1,.001*Math.abs(c-s)));if(Ov.und(r.duration))if(r.decay){let e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*n);d=s+i/(1-e)*(1-o),u=Math.abs(l.lastPosition-d)<=p,t=i*o}else{t=null==l.lastVelocity?i:l.lastVelocity;let n,o=r.restVelocity||p/10,a=r.clamp?0:r.bounce,h=!Ov.und(a),g=s==c?l.v0>0:s<c,m=!1,f=1,b=Math.ceil(e/f);for(let e=0;e<b&&(n=Math.abs(t)>o,n||(u=Math.abs(c-d)<=p,!u));++e){h&&(m=d==c||d>c==g,m&&(t=-t*a,d=c)),t+=(1e-6*-r.tension*(d-c)+.001*-r.friction*t)/r.mass*f,d+=t*f}}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,l.durationProgress>0&&(l.elapsedTime=r.duration*l.durationProgress,n=l.elapsedTime+=e)),o=(r.progress||0)+n/this._memoizedDuration,o=o>1?1:o<0?0:o,l.durationProgress=o),d=s+r.easing(o)*(c-s),t=(d-l.lastPosition)/e,u=1==o}l.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?l.done=!0:t=!1,l.setValue(d,r.round)&&(n=!0)}));let l=l_(this),a=l.getValue();if(t){let e=Ak(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(l.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return bv.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Q_(this)){let{to:e,config:t}=this.animation;bv.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 Ov.und(e)?(n=this.queue||[],this.queue=[]):n=[Ov.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>z_(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),U_(this._state,e&&this._lastCallId),bv.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){let t=this.key||"",{to:n,from:o}=e;n=Ov.obj(n)?n[t]:n,(null==n||P_(n))&&(n=void 0),o=Ov.obj(o)?o[t]:o,null==o&&(o=void 0);let r={to:n,from:o};return X_(this)||(e.reverse&&([n,o]=[o,n]),o=Ak(o),Ov.und(o)?l_(this)||this._set(n):this._set(o)),r}_update({...e},t){let{key:n,defaultProps:o}=this;e.default&&Object.assign(o,I_(e,((e,t)=>/^on/.test(t)?w_(e,n):e))),ax(this,e,"onProps"),cx(this,"onProps",e,this);let r=this._prepareNode(e);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?");let s=this._state;return D_(++this._lastCallId,{key:n,props:e,defaultProps:o,state:s,actions:{pause:()=>{J_(this)||(tx(this,!0),$v(s.pauseQueue),cx(this,"onPause",F_(this,ox(this,this.animation.to)),this))},resume:()=>{J_(this)&&(tx(this,!1),Q_(this)&&this._resume(),$v(s.resumeQueue),cx(this,"onResume",F_(this,ox(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=rx(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(H_(this));let o=!Ov.und(e.to),r=!Ov.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(H_(this));this._lastToId=t.callId}let{key:s,defaultProps:i,animation:l}=this,{to:a,from:c}=l,{to:u=a,from:d=c}=e;r&&!o&&(!t.default||Ov.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let p=!Dv(d,c);p&&(l.from=d),d=Ak(d);let h=!Dv(u,a);h&&this._focus(u);let g=P_(t.to),{config:m}=l,{decay:f,velocity:b}=m;(o||r)&&(m.velocity=0),t.config&&!g&&function(e,t,n){n&&(A_(n={...n},t),t={...n,...t}),A_(e,t),Object.assign(e,t);for(let t in R_)null==e[t]&&(e[t]=R_[t]);let{mass:o,frequency:r,damping:s}=e;Ov.und(r)||(r<.01&&(r=.01),s<0&&(s=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*s*o/r)}(m,y_(t.config,s),t.config!==i.config?y_(i.config,s):void 0);let v=l_(this);if(!v||Ov.und(u))return n(F_(this,!0));let k=Ov.und(t.reset)?r&&!t.default:!Ov.und(d)&&S_(t.reset,s),_=k?d:this.get(),x=M_(u),y=Ov.num(x)||Ov.arr(x)||n_(x),S=!g&&(!y||S_(i.immediate||t.immediate,s));if(h){let e=b_(u);if(e!==v.constructor){if(!S)throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`);v=this._set(x)}}let w=v.constructor,C=Nk(u),B=!1;if(!C){let e=k||!X_(this)&&p;(h||e)&&(B=Dv(M_(_),x),C=!B),(!Dv(l.immediate,S)&&!S||!Dv(m.decay,f)||!Dv(m.velocity,b))&&(C=!0)}if(B&&Q_(this)&&(l.changed&&!k?C=!0:C||this._stop(a)),!g&&((C||Nk(a))&&(l.values=v.getPayload(),l.toValues=Nk(u)?null:w==p_?[1]:Fv(x)),l.immediate!=S&&(l.immediate=S,!S&&!k&&this._set(a)),C)){let{onRest:e}=l;zv(lx,(e=>ax(this,t,e)));let o=F_(this,ox(this,a));$v(this._pendingCalls,o),this._pendingCalls.add(n),l.changed&&bv.batchedUpdates((()=>{l.changed=!k,e?.(o,this),k?y_(i.onRest,o):l.onStart?.(o,this)}))}k&&this._set(_),g?n(G_(t.to,t,this._state,this)):C?this._start():Q_(this)&&!h?this._pendingCalls.add(n):n(V_(_))}_focus(e){let t=this.animation;e!==t.to&&(Lk(this)&&this._detach(),t.to=e,Lk(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;Nk(t)&&(Vk(t,this),K_(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Nk(e)&&Fk(e,this)}_set(e,t=!0){let n=Ak(e);if(!Ov.und(n)){let e=l_(this);if(!e||!Dv(n,e.getValue())){let o=b_(n);e&&e.constructor==o?e.setValue(n):a_(this,o.create(n)),e&&bv.batchedUpdates((()=>{this._onChange(n,t)}))}}return l_(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,cx(this,"onStart",F_(this,ox(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),y_(this.animation.onChange,e,this)),y_(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;l_(this).reset(Ak(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Q_(this)||(ex(this,!0),J_(this)||this._resume())}_resume(){Av.skipAnimation?this.finish():tk.start(this)}_stop(e,t){if(Q_(this)){ex(this,!1);let n=this.animation;zv(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ok(this,{type:"idle",parent:this});let o=t?H_(this.get()):F_(this.get(),ox(this,e??n.to));$v(this._pendingCalls,o),n.changed&&(n.changed=!1,cx(this,"onRest",o,this))}}};function ox(e,t){let n=M_(t);return Dv(M_(e.get()),n)}function rx(e,t=e.loop,n=e.to){let o=y_(t);if(o){let r=!0!==o&&T_(o),s=(r||e).reverse,i=!r||r.reset;return sx({...e,loop:t,default:!1,pause:void 0,to:!s||P_(n)?n:void 0,from:i?e.from:void 0,reset:i,...r})}}function sx(e){let{to:t,from:n}=e=T_(e),o=new Set;return Ov.obj(t)&&ix(t,o),Ov.obj(n)&&ix(n,o),e.keys=o.size?Array.from(o):null,e}function ix(e,t){Vv(e,((e,n)=>null!=e&&t.add(n)))}var lx=["onStart","onRest","onChange","onPause","onResume"];function ax(e,t,n){e.animation[n]=t[n]!==C_(t,n)?w_(t[n],e.key):void 0}function cx(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var ux=["onStart","onChange","onRest"],dx=1,px=class{id=dx++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({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(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];Ov.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(sx(e)),this}start(e){let{queue:t}=this;return e?t=Fv(e).map(sx):this.queue=[],this._flush?this._flush(this,t):(bx(this,t),hx(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;zv(Fv(t),(t=>n[t].stop(!!e)))}else U_(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Ov.und(e))this.start({pause:!0});else{let t=this.springs;zv(Fv(e),(e=>t[e].pause()))}return this}resume(e){if(Ov.und(e))this.start({pause:!1});else{let t=this.springs;zv(Fv(e),(e=>t[e].resume()))}return this}each(e){Vv(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,Hv(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let s=!o&&this._started,i=r||s&&n.size?this.get():null;r&&t.size&&Hv(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),s&&(this._started=!1,Hv(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)}bv.onFrame(this._onFrame)}};function hx(e,t){return Promise.all(t.map((t=>gx(e,t)))).then((t=>z_(e,t)))}async function gx(e,t,n){let{keys:o,to:r,from:s,loop:i,onRest:l,onResolve:a}=t,c=Ov.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===s&&(t.from=null);let u=Ov.arr(r)||Ov.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):zv(ux,(n=>{let o=t[n];if(Ov.fun(o)){let r=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,$v(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),h=!0===t.cancel||!0===C_(t,"cancel");(u||h&&d.asyncId)&&p.push(D_(++e._lastAsyncId,{props:t,state:d,actions:{pause:Lv,resume:Lv,start(t,n){h?(U_(d,e._lastAsyncId),n(H_(e))):(t.onRest=l,n(G_(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let g=z_(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){let n=rx(t,i,r);if(n)return bx(e,[n]),gx(e,n,!0)}return a&&bv.batchedUpdates((()=>a(g,e,e.item))),g}function mx(e,t){let n=new nx;return n.key=e,t&&Vk(n,t),n}function fx(e,t,n){t.keys&&zv(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function bx(e,t){zv(t,(t=>{fx(e.springs,t,(t=>mx(t,e)))}))}var vx=({children:e,...t})=>{let n=(0,ya.useContext)(kx),o=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,ya.useState)((()=>({inputs:t,result:e()}))),o=(0,ya.useRef)(),r=o.current,s=r;return s?Boolean(t&&s.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,s.inputs))||(s={inputs:t,result:e()}):s=n,(0,ya.useEffect)((()=>{o.current=s,r==n&&(n.inputs=n.result=void 0)}),[s]),s.result}((()=>({pause:o,immediate:r})),[o,r]);let{Provider:s}=kx;return ya.createElement(s,{value:t},e)},kx=function(e,t){return Object.assign(e,ya.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(vx,{});vx.Provider=kx.Provider,vx.Consumer=kx.Consumer;var _x=class extends q_{constructor(e,t){super(),this.source=e,this.calc=wk(...t);let n=this._get(),o=b_(n);a_(this,o.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();Dv(t,this.get())||(l_(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&yx(this._active)&&Sx(this)}_get(){let e=Ov.arr(this.source)?this.source.map(Ak):Fv(Ak(this.source));return this.calc(...e)}_start(){this.idle&&!yx(this._active)&&(this.idle=!1,zv(c_(this),(e=>{e.done=!1})),Av.skipAnimation?(bv.batchedUpdates((()=>this.advance())),Sx(this)):tk.start(this))}_attach(){let e=1;zv(Fv(this.source),(t=>{Nk(t)&&Vk(t,this),K_(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){zv(Fv(this.source),(e=>{Nk(e)&&Fk(e,this)})),this._active.clear(),Sx(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=Fv(this.source).reduce(((e,t)=>Math.max(e,(K_(t)?t.priority:0)+1)),0))}};function xx(e){return!1!==e.idle}function yx(e){return!e.size||Array.from(e).every(xx)}function Sx(e){e.idle||(e.idle=!0,zv(c_(e),(e=>{e.done=!0})),Ok(e,{type:"idle",parent:e}))}Av.assign({createStringInterpolator:Qk,to:(e,t)=>new _x(e,t)});tk.advance;const wx=window.ReactDOM;var Cx=/^--/;function Bx(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Cx.test(e)||jx.hasOwnProperty(e)&&jx[e]?(""+t).trim():t+"px"}var Ix={};var jx={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},Ex=["Webkit","Ms","Moz","O"];jx=Object.keys(jx).reduce(((e,t)=>(Ex.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),jx);var Tx=/^(matrix|translate|scale|rotate|skew)/,Mx=/^(translate)/,Px=/^(rotate|skew)/,Rx=(e,t)=>Ov.num(e)&&0!==e?e+t:e,Nx=(e,t)=>Ov.arr(e)?e.every((e=>Nx(e,t))):Ov.num(e)?e===t:parseFloat(e)===t,Ax=class extends g_{constructor({x:e,y:t,z:n,...o}){let r=[],s=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),s.push((e=>[`translate3d(${e.map((e=>Rx(e,"px"))).join(",")})`,Nx(e,0)]))),Vv(o,((e,t)=>{if("transform"===t)r.push([e||""]),s.push((e=>[e,""===e]));else if(Tx.test(t)){if(delete o[t],Ov.und(e))return;let n=Mx.test(t)?"px":Px.test(t)?"deg":"";r.push(Fv(e)),s.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Rx(r,n)})`,Nx(r,0)]:e=>[`${t}(${e.map((e=>Rx(e,n))).join(",")})`,Nx(e,t.startsWith("scale")?1:0)])}})),r.length&&(o.transform=new Lx(r,s)),super(o)}},Lx=class extends Dk{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return zv(this.inputs,((n,o)=>{let r=Ak(n[0]),[s,i]=this.transforms[o](Ov.arr(r)?r:n.map(Ak));e+=" "+s,t=t&&i})),t?"none":e}observerAdded(e){1==e&&zv(this.inputs,(e=>zv(e,(e=>Nk(e)&&Vk(e,this)))))}observerRemoved(e){0==e&&zv(this.inputs,(e=>zv(e,(e=>Nk(e)&&Fk(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Ok(this,e)}};Av.assign({batchedUpdates:wx.unstable_batchedUpdates,createStringInterpolator:Qk,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}});var Ox=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new g_(e)),getComponentProps:o=(e=>e)}={})=>{let r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},s=e=>{let t=x_(e)||"Anonymous";return(e=Ov.str(e)?s[e]||(s[e]=v_(e,r)):e[__]||(e[__]=v_(e,r))).displayName=`Animated(${t})`,e};return Vv(e,((t,n)=>{Ov.arr(e)&&(n=x_(t)),s[n]=s(t)})),{animated:s}})(["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;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:o,children:r,scrollTop:s,scrollLeft:i,viewBox:l,...a}=t,c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Ix[t]||(Ix[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(let t in o)if(o.hasOwnProperty(t)){let n=Bx(t,o[t]);Cx.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==s&&(e.scrollTop=s),void 0!==i&&(e.scrollLeft=i),void 0!==l&&e.setAttribute("viewBox",l)},createAnimatedStyle:e=>new Ax(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),Dx=Ox.animated;function zx(e){return{top:e.offsetTop,left:e.offsetLeft}}const Vx=function({triggerAnimationOnChange:e,clientId:t}){const n=(0,a.useRef)(),{isTyping:o,getGlobalBlockCount:r,isBlockSelected:s,isFirstMultiSelectedBlock:i,isBlockMultiSelected:l,isAncestorMultiSelected:u}=(0,c.useSelect)($r),{previous:d,prevRect:p}=(0,a.useMemo)((()=>({previous:n.current&&zx(n.current),prevRect:n.current&&n.current.getBoundingClientRect()})),[e]);return(0,a.useLayoutEffect)((()=>{if(!d||!n.current)return;const e=(0,la.getScrollContainer)(n.current),a=s(t),c=a||i(t);function h(){if(c&&p){const t=n.current.getBoundingClientRect().top-p.top;t&&(e.scrollTop+=t)}}if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||o()||r()>200)return void h();const g=a||l(t)||u(t)?"1":"",m=new px({x:0,y:0,config:{mass:5,tension:2e3,friction:200},onChange({value:e}){if(!n.current)return;let{x:t,y:o}=e;t=Math.round(t),o=Math.round(o);const r=0===t&&0===o;n.current.style.transformOrigin="center center",n.current.style.transform=r?null:`translate3d(${t}px,${o}px,0)`,n.current.style.zIndex=g,h()}});n.current.style.transform=void 0;const f=zx(n.current),b=Math.round(d.left-f.left),v=Math.round(d.top-f.top);return m.start({x:0,y:0,from:{x:b,y:v}}),()=>{m.stop(),m.set({x:0,y:0})}}),[d,p,t,o,r,s,i,l,u]),n},Fx=".block-editor-block-list__block",Hx=".block-list-appender",Gx=".block-editor-button-block-appender";function Ux(e,t){return e.closest(Fx)===t.closest(Fx)}function $x(e,t){return t.closest([Fx,Hx,Gx].join(","))===e}function Wx(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Fx);return t?t.id.slice(6):void 0}function Kx({clientId:e,initialPosition:t}){const n=(0,a.useRef)(),{isBlockSelected:o,isMultiSelecting:r,__unstableGetEditorMode:s}=(0,c.useSelect)($r);return(0,a.useEffect)((()=>{if(!o(e)||r()||"zoom-out"===s())return;if(null==t)return;if(!n.current)return;const{ownerDocument:i}=n.current;if($x(n.current,i.activeElement))return;const l=la.focus.tabbable.find(n.current).filter((e=>(0,la.isTextField)(e))),a=-1===t,c=l[a?l.length-1:0]||n.current;if($x(n.current,c)){if(!n.current.getAttribute("contenteditable")){const e=la.focus.tabbable.findNext(n.current);if(e&&$x(n.current,e)&&(0,la.isFormElement)(e))return void e.focus()}(0,la.placeCaretAtHorizontalEdge)(c,a)}else n.current.focus()}),[t,e]),n}function Zx(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function qx(e){const{isBlockSelected:t}=(0,c.useSelect)($r),{selectBlock:n,selectionChange:o}=(0,c.useDispatch)($r);return(0,u.useRefEffect)((r=>{function s(s){r.parentElement.closest('[contenteditable="true"]')||(t(e)?s.target.isContentEditable||o(e):$x(r,s.target)&&n(e))}return r.addEventListener("focusin",s),()=>{r.removeEventListener("focusin",s)}}),[t,n])}function Yx({clientId:e,isSelected:t}){const{getBlockRootClientId:n,getBlockIndex:o}=(0,c.useSelect)($r),{insertAfterBlock:r,removeBlock:s}=(0,c.useDispatch)($r);return(0,u.useRefEffect)((n=>{if(t)return n.addEventListener("keydown",o),n.addEventListener("dragstart",i),()=>{n.removeEventListener("keydown",o),n.removeEventListener("dragstart",i)};function o(t){const{keyCode:o,target:i}=t;o!==ca.ENTER&&o!==ca.BACKSPACE&&o!==ca.DELETE||i!==n||(0,la.isTextField)(i)||(t.preventDefault(),o===ca.ENTER?r(e):s(e))}function i(e){e.preventDefault()}}),[e,t,n,o,r,s])}function Xx(e){const{isNavigationMode:t,isBlockSelected:n}=(0,c.useSelect)($r),{setNavigationMode:o,selectBlock:r}=(0,c.useDispatch)($r);return(0,u.useRefEffect)((s=>{function i(s){t()&&!s.defaultPrevented&&(s.preventDefault(),n(e)?o(!1):r(e))}return s.addEventListener("mousedown",i),()=>{s.removeEventListener("mousedown",i)}}),[e,t,n,o])}function Qx(){const e=(0,a.useContext)(OC);return(0,u.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Jx({isSelected:e}){const t=(0,u.useReducedMotion)();return(0,u.useRefEffect)((n=>{if(e){const{ownerDocument:e}=n,{defaultView:o}=e;if(!o.IntersectionObserver)return;const r=new o.IntersectionObserver((e=>{e[0].isIntersecting||n.scrollIntoView({behavior:t?"instant":"smooth"}),r.disconnect()}));return r.observe(n),()=>{r.disconnect()}}}),[e])}function ey({clientId:e="",isEnabled:t=!0}={}){const{getEnabledClientIdsTree:n}=Q((0,c.useSelect)($r));return(0,u.useRefEffect)((o=>{if(!t)return;const r=t=>{(t.target===o||t.target.classList.contains("is-root-container"))&&(t.defaultPrevented||(t.preventDefault(),n(e).forEach((({clientId:e})=>{const t=o.querySelector(`[data-block="${e}"]`);t&&(t.classList.remove("has-editable-outline"),t.offsetWidth,t.classList.add("has-editable-outline"))}))))};return o.addEventListener("click",r),()=>o.removeEventListener("click",r)}),[t])}function ty(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:o,wrapperProps:r={},isAligned:s,index:i,mode:l,name:c,blockApiVersion:d,blockTitle:p,isSelected:h,isSubtreeDisabled:g,hasOverlay:f,initialPosition:b,blockEditingMode:v,isHighlighted:k,isMultiSelected:x,isPartiallySelected:y,isReusable:S,isDragging:w,hasChildSelected:B,isBlockMovingMode:I,canInsertMovingBlock:j,isEditingDisabled:E,hasEditableOutline:T,isTemporarilyEditingAsBlocks:M,defaultClassName:P,templateLock:R}=(0,a.useContext)(ov),N=(0,C.sprintf)((0,C.__)("Block: %s"),p),A="html"!==l||t?"":"-visual",L=(0,u.useMergeRefs)([e.ref,Kx({clientId:n,initialPosition:b}),Xi(n),qx(n),Yx({clientId:n,isSelected:h}),Xx(n),(0,u.useRefEffect)((e=>(e.addEventListener("mouseout",Zx),e.addEventListener("mouseover",Zx),()=>{e.removeEventListener("mouseout",Zx),e.removeEventListener("mouseover",Zx),e.classList.remove("is-hovered")})),[]),Qx(),Vx({triggerAnimationOnChange:i,clientId:n}),(0,u.useDisabled)({isDisabled:!f}),ey({clientId:n,isEnabled:"core/block"===c||"contentOnly"===R}),Jx({isSelected:h})]),O=_(),D=!!O[m]&&Af(c)?{"--wp-admin-theme-color":"var(--wp-block-synced-color)","--wp-admin-theme-color--rgb":"var(--wp-block-synced-color--rgb)"}:{};d<2&&O.clientId;let z=!1;return"-"!==r?.style?.marginTop?.charAt(0)&&"-"!==r?.style?.marginBottom?.charAt(0)&&"-"!==r?.style?.marginLeft?.charAt(0)&&"-"!==r?.style?.marginRight?.charAt(0)||(z=!0),{tabIndex:"disabled"===v?-1:0,...r,...e,ref:L,id:`block-${n}${A}`,role:"document","aria-label":N,"data-block":n,"data-type":c,"data-title":p,inert:g?"true":void 0,className:Bs("block-editor-block-list__block",{"wp-block":!s,"has-block-overlay":f,"is-selected":h,"is-highlighted":k,"is-multi-selected":x,"is-partially-selected":y,"is-reusable":S,"is-dragging":w,"has-child-selected":B,"is-block-moving-mode":I,"can-insert-moving-block":j,"is-editing-disabled":E,"has-editable-outline":T,"has-negative-margin":z,"is-content-locked-temporarily-editing-as-blocks":M},o,e.className,r.className,P),style:{...r.style,...e.style,...D}}}function ny({children:e,isHtml:t,...n}){return(0,U.jsx)("div",{...ty(n,{__unstableIsHtml:t}),children:e})}function oy({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:o,clientId:r,isSelected:s,isSelectionEnabled:i,className:u,__unstableLayoutClassNames:d,name:p,isValid:h,attributes:g,wrapperProps:m,setAttributes:f,onReplace:b,onInsertBlocksAfter:v,onMerge:k,toggleSelection:_}){var x;const{mayDisplayControls:y,mayDisplayParentControls:S,themeSupportsLayout:w,...C}=(0,a.useContext)(ov),{removeBlock:B}=(0,c.useDispatch)($r),I=(0,a.useCallback)((()=>B(r)),[r,B]),j=xl()||{};let E=(0,U.jsx)(rv,{name:p,isSelected:s,attributes:g,setAttributes:f,insertBlocksAfter:n?void 0:v,onReplace:o?b:void 0,onRemove:o?I:void 0,mergeBlocks:o?k:void 0,clientId:r,isSelectionEnabled:i,toggleSelection:_,__unstableLayoutClassNames:d,__unstableParentLayout:Object.keys(j).length?j:void 0,mayDisplayControls:y,mayDisplayParentControls:S,blockEditingMode:C.blockEditingMode,isPreviewMode:C.isPreviewMode});const T=(0,l.getBlockType)(p);T?.getEditWrapperProps&&(m=function(e,t){const n={...e,...t};return e?.hasOwnProperty("className")&&t?.hasOwnProperty("className")&&(n.className=Bs(e.className,t.className)),e?.hasOwnProperty("style")&&t?.hasOwnProperty("style")&&(n.style={...e.style,...t.style}),n}(m,T.getEditWrapperProps(g)));const M=m&&!!m["data-align"]&&!w,P=u?.includes("is-position-sticky");let R;if(M&&(E=(0,U.jsx)("div",{className:Bs("wp-block",P&&u),"data-align":m["data-align"],children:E})),h)R="html"===t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("div",{style:{display:"none"},children:E}),(0,U.jsx)(ny,{isHtml:!0,children:(0,U.jsx)(mv,{clientId:r})})]}):T?.apiVersion>1?E:(0,U.jsx)(ny,{children:E});else{const t=e?(0,l.serializeRawBlock)(e):(0,l.getSaveContent)(T,g);R=(0,U.jsxs)(ny,{className:"has-warning",children:[(0,U.jsx)(cv,{clientId:r}),(0,U.jsx)(a.RawHTML,{children:(0,la.safeHTML)(t)})]})}const{"data-align":N,...A}=null!==(x=m)&&void 0!==x?x:{},L={...A,className:Bs(A.className,N&&w&&`align${N}`,!(N&&P)&&u)};return(0,U.jsx)(ov.Provider,{value:{wrapperProps:L,isAligned:M,...C},children:(0,U.jsx)(hv,{fallback:(0,U.jsx)(ny,{className:"has-warning",children:(0,U.jsx)(dv,{})}),children:R})})}ty.save=l.__unstableGetBlockProps;const ry=(0,c.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:s,replaceBlocks:i,toggleSelection:a,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d,selectBlock:p}=e($r);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select($r),s=r(),{clientId:i}=t,l=s.length?s:[i];o(l,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:s}=t,{getBlockIndex:i}=n.select($r),l=i(o);r(e,l+1,s)},onMerge(e){const{clientId:o,rootClientId:a}=t,{getPreviousBlockClientId:c,getNextBlockClientId:h,getBlock:g,getBlockAttributes:m,getBlockName:f,getBlockOrder:b,getBlockIndex:v,getBlockRootClientId:k,canInsertBlockType:_}=n.select($r);function x(){const e=g(o),t=(0,l.getDefaultBlockName)();if(f(o)!==t){const n=(0,l.switchToBlockType)(e,t);n&&n.length&&i(o,n)}else if((0,l.isUnmodifiedDefaultBlock)(e)){const e=h(o);e&&n.batch((()=>{d(o),p(e)}))}}function y(e,t=!0){const o=k(e),s=b(e),[i]=s;1===s.length&&(0,l.isUnmodifiedBlock)(g(i))?d(e):n.batch((()=>{if(_(f(i),o))u([i],e,o,v(e));else{const n=(0,l.switchToBlockType)(g(i),(0,l.getDefaultBlockName)());n&&n.length&&n.every((e=>_(e.name,o)))?(r(n,v(e),o,t),d(i,!1)):x()}!b(e).length&&(0,l.isUnmodifiedBlock)(g(e))&&d(e,!1)}))}if(e){if(a){const e=h(a);if(e){if(f(a)!==f(e))return void s(a,e);{const t=m(a),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(b(e),e,a),d(e,!1)}))}}}const e=h(o);if(!e)return;b(e).length?y(e,!1):s(o,e)}else{const e=c(o);if(e)s(e,o);else if(a){const e=c(a);if(e&&f(a)===f(e)){const t=m(a),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(b(a),a,e),d(a,!1)}))}y(a)}else x()}},onReplace(e,n,o){e.length&&!(0,l.isUnmodifiedDefaultBlock)(e[e.length-1])&&c();const r=1===e?.length&&Array.isArray(e[0])?e[0]:e;i([t.clientId],r,n,o)},toggleSelection(e){a(e)}}}));oy=(0,u.compose)(ry,(0,Ns.withFilters)("editor.BlockListBlock"))(oy);const sy=(0,a.memo)((function(e){const{clientId:t,rootClientId:n}=e,o=(0,c.useSelect)((e=>{const{isBlockSelected:o,getBlockMode:r,isSelectionEnabled:s,getTemplateLock:i,getBlockWithoutAttributes:a,getBlockAttributes:c,canRemoveBlock:u,canMoveBlock:d,getSettings:p,getTemporarilyEditingAsBlocks:h,getBlockEditingMode:g,getBlockName:m,isFirstMultiSelectedBlock:f,getMultiSelectedBlockClientIds:b,hasSelectedInnerBlock:v,getBlocksByName:k,getBlockIndex:_,isBlockMultiSelected:x,isBlockSubtreeDisabled:y,isBlockHighlighted:S,__unstableIsFullySelected:w,__unstableSelectionHasUnmergeableBlock:C,isBlockBeingDragged:B,isDragging:I,hasBlockMovingClientId:j,canInsertBlockType:E,__unstableHasActiveBlockOverlayActive:T,__unstableGetEditorMode:M,getSelectedBlocksInitialCaretPosition:P}=Q(e($r)),R=a(t);if(!R)return;const{hasBlockSupport:N,getActiveBlockVariation:A}=e(l.store),L=c(t),{name:O,isValid:D}=R,z=(0,l.getBlockType)(O),{supportsLayout:V,__unstableIsPreviewMode:F}=p(),H=z?.apiVersion>1,G={isPreviewMode:F,blockWithoutAttributes:R,name:O,attributes:L,isValid:D,themeSupportsLayout:V,index:_(t),isReusable:(0,l.isReusableBlock)(z),className:H?L.className:void 0,defaultClassName:H?(0,l.getBlockDefaultClassName)(O):void 0,blockTitle:z?.title};if(F)return G;const U=o(t),$=u(t),W=d(t),K=A(O,L),Z=x(t),q=v(t,!0),Y=j(),X=g(t),J=(0,l.hasBlockSupport)(O,"multiple",!0)?[]:k(O),ee=J.length&&J[0]!==t;return{...G,mode:r(t),isSelectionEnabled:s(),isLocked:!!i(n),templateLock:i(t),canRemove:$,canMove:W,isSelected:U,isTemporarilyEditingAsBlocks:h()===t,blockEditingMode:X,mayDisplayControls:U||f(t)&&b().every((e=>m(e)===O)),mayDisplayParentControls:N(m(t),"__experimentalExposeControlsToChildren",!1)&&v(t),blockApiVersion:z?.apiVersion||1,blockTitle:K?.title||z?.title,isSubtreeDisabled:"disabled"===X&&y(t),hasOverlay:T(t)&&!I(),initialPosition:!U||"edit"!==M()&&"zoom-out"!==M()?void 0:P(),isHighlighted:S(t),isMultiSelected:Z,isPartiallySelected:Z&&!w()&&!C(),isDragging:B(t),hasChildSelected:q,isBlockMovingMode:!!Y,canInsertMovingBlock:Y&&E(m(Y),n),isEditingDisabled:"disabled"===X,hasEditableOutline:"disabled"!==X&&"disabled"===g(n),originalBlockClientId:!!ee&&J[0]}}),[t,n]),{isPreviewMode:r,mode:s="visual",isSelectionEnabled:i=!1,isLocked:u=!1,canRemove:d=!1,canMove:p=!1,blockWithoutAttributes:h,name:g,attributes:m,isValid:f,isSelected:b=!1,themeSupportsLayout:v,isTemporarilyEditingAsBlocks:k,blockEditingMode:_,mayDisplayControls:x,mayDisplayParentControls:y,index:S,blockApiVersion:w,blockTitle:C,isSubtreeDisabled:B,hasOverlay:I,initialPosition:j,isHighlighted:E,isMultiSelected:T,isPartiallySelected:M,isReusable:P,isDragging:R,hasChildSelected:N,isBlockMovingMode:A,canInsertMovingBlock:L,templateLock:O,isEditingDisabled:D,hasEditableOutline:z,className:V,defaultClassName:F,originalBlockClientId:H}=o,G=(0,a.useMemo)((()=>({...h,attributes:m})),[h,m]);if(!o)return null;const $={isPreviewMode:r,clientId:t,className:V,index:S,mode:s,name:g,blockApiVersion:w,blockTitle:C,isSelected:b,isSubtreeDisabled:B,hasOverlay:I,initialPosition:j,blockEditingMode:_,isHighlighted:E,isMultiSelected:T,isPartiallySelected:M,isReusable:P,isDragging:R,hasChildSelected:N,isBlockMovingMode:A,canInsertMovingBlock:L,templateLock:O,isEditingDisabled:D,hasEditableOutline:z,isTemporarilyEditingAsBlocks:k,defaultClassName:F,mayDisplayControls:x,mayDisplayParentControls:y,originalBlockClientId:H,themeSupportsLayout:v};return(0,U.jsx)(ov.Provider,{value:$,children:(0,U.jsx)(oy,{...e,mode:s,isSelectionEnabled:i,isLocked:u,canRemove:d,canMove:p,block:G,name:g,attributes:m,isValid:f,isSelected:b})})})),iy=window.wp.htmlEntities,ly=[(0,a.createInterpolateElement)((0,C.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,U.jsx)("kbd",{})}),(0,a.createInterpolateElement)((0,C.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,U.jsx)("kbd",{})}),(0,a.createInterpolateElement)((0,C.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,U.jsx)("kbd",{})}),(0,C.__)("Drag files into the editor to automatically insert media blocks."),(0,C.__)("Change a block's type by pressing the block icon on the toolbar.")];const ay=function(){const[e]=(0,a.useState)(Math.floor(Math.random()*ly.length));return(0,U.jsx)(Ns.Tip,{children:ly[e]})},cy=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),uy=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})});const dy=function({title:e,icon:t,description:n,blockType:o,className:r}){o&&(y()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=o));const{parentNavBlockClientId:s}=(0,c.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e($r);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:i}=(0,c.useDispatch)($r);return(0,U.jsxs)("div",{className:Bs("block-editor-block-card",r),children:[s&&(0,U.jsx)(Ns.Button,{onClick:()=>i(s),label:(0,C.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,C.isRTL)()?cy:uy,size:"small"}),(0,U.jsx)(Tf,{icon:t,showColors:!0}),(0,U.jsxs)(Ns.__experimentalVStack,{spacing:1,children:[(0,U.jsx)("h2",{className:"block-editor-block-card__title",children:e}),n&&(0,U.jsx)(Ns.__experimentalText,{className:"block-editor-block-card__description",children:n})]})]})};const py=(0,u.createHigherOrderComponent)((e=>({useSubRegistry:t=!0,...n})=>{const o=(0,c.useRegistry)(),[r]=(0,a.useState)((()=>new WeakMap)),s=function(e,t,n){if(!n)return t;let o=e.get(t);return o||(o=(0,c.createRegistry)({},t),o.registerStore(J,Ur),e.set(t,o)),o}(r,o,t);return s===o?(0,U.jsx)(e,{registry:o,...n}):(0,U.jsx)(c.RegistryProvider,{value:s,children:(0,U.jsx)(e,{registry:s,...n})})}),"withRegistryProvider"),hy=()=>{};function gy({clientId:e=null,value:t,selection:n,onChange:o=hy,onInput:r=hy}){const s=(0,c.useRegistry)(),{resetBlocks:i,resetSelection:u,replaceInnerBlocks:d,setHasControlledInnerBlocks:p,__unstableMarkNextChangeAsNotPersistent:h}=s.dispatch($r),{getBlockName:g,getBlocks:m,getSelectionStart:f,getSelectionEnd:b}=s.select($r),v=(0,c.useSelect)((t=>!e||t($r).areInnerBlocksControlled(e)),[e]),k=(0,a.useRef)({incoming:null,outgoing:[]}),_=(0,a.useRef)(!1),x=()=>{t&&(h(),e?s.batch((()=>{p(e,!0);const n=t.map((e=>(0,l.cloneBlock)(e)));_.current&&(k.current.incoming=n),h(),d(e,n)})):(_.current&&(k.current.incoming=t),i(t)))},y=(0,a.useRef)(r),S=(0,a.useRef)(o);(0,a.useEffect)((()=>{y.current=r,S.current=o}),[r,o]),(0,a.useEffect)((()=>{k.current.outgoing.includes(t)?k.current.outgoing[k.current.outgoing.length-1]===t&&(k.current.outgoing=[]):m(e)!==t&&(k.current.outgoing=[],x(),n&&u(n.selectionStart,n.selectionEnd,n.initialPosition))}),[t,e]);const w=(0,a.useRef)(!1);(0,a.useEffect)((()=>{w.current?v||(k.current.outgoing=[],x()):w.current=!0}),[v]),(0,a.useEffect)((()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:o,areInnerBlocksControlled:r}=s.select($r);let i=m(e),l=n(),a=!1;_.current=!0;const c=s.subscribe((()=>{if(null!==e&&null===g(e))return;if(!(!e||r(e)))return;const s=n(),c=m(e),u=c!==i;if(i=c,u&&(k.current.incoming||o()))return k.current.incoming=null,void(l=s);if(u||a&&!u&&s&&!l){l=s,k.current.outgoing.push(i);const e=l?S.current:y.current,n=ao.has(i);n&&ao.delete(i),e(i,{selection:{selectionStart:f(),selectionEnd:b(),initialPosition:t()},undoIgnore:n})}a=u}),$r);return()=>{_.current=!1,c()}}),[s,e]),(0,a.useEffect)((()=>()=>{h(),e?(p(e,!1),h(),d(e,[])):i([])}),[])}const my=window.wp.keyboardShortcuts;function fy(){return null}fy.Register=function(){const{registerShortcut:e}=(0,c.useDispatch)(my.store);return(0,a.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,C.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,C.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,C.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,C.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,C.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,C.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,C.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,C.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,C.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,C.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,C.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}}),e({name:"core/block-editor/collapse-list-view",category:"list-view",description:(0,C.__)("Collapse all other items."),keyCombination:{modifier:"alt",character:"l"}}),e({name:"core/block-editor/group",category:"block",description:(0,C.__)("Create a group block from the selected multiple blocks."),keyCombination:{modifier:"primary",character:"g"}})}),[e]),null};const by=fy,vy=py((e=>{const{children:t,settings:n,stripExperimentalSettings:o=!1}=e,{__experimentalUpdateSettings:r}=Q((0,c.useDispatch)($r));return(0,a.useEffect)((()=>{r({...n,__internalIsInitialized:!0},{stripExperimentalSettings:o,reset:!0})}),[n,o,r]),gy(e),(0,U.jsxs)(Ns.SlotFillProvider,{passthrough:!0,children:[!n?.__unstableIsPreviewMode&&(0,U.jsx)(by.Register,{}),(0,U.jsx)(Yi,{children:t})]})})),ky=e=>(0,U.jsx)(vy,{...e,stripExperimentalSettings:!0,children:e.children});function _y(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,c.useSelect)($r),{clearSelectedBlock:o}=(0,c.useDispatch)($r),{clearBlockSelection:r}=e();return(0,u.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",s),()=>{e.removeEventListener("mousedown",s)};function s(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function xy(e){return(0,U.jsx)("div",{ref:_y(),...e})}function yy(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:s,__unstableIsFullySelected:i}=e($r);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:s(),isFullSelection:i()}}function Sy(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:s}=(0,c.useSelect)(yy,[]);return(0,u.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:l}=i;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||s&&(r.contentEditable=!0,r.focus(),l.getSelection().removeAllRanges())}),[o,t,n,r,e,s])}function wy(e,t,n,o){let r,s=la.focus.focusable.find(n);return t&&s.reverse(),s=s.slice(s.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),s.find((function(e){if(!(e.closest("[inert]")||1===e.children.length&&Ux(e,e.firstElementChild)&&"true"===e.firstElementChild.getAttribute("contenteditable"))){if(!la.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}}))}function Cy(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,c.useSelect)($r),{selectBlock:s}=(0,c.useDispatch)($r);return(0,u.useRefEffect)((i=>{let l;function a(){l=null}function c(a){if(a.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:h,metaKey:g}=a,m=c===ca.UP,f=c===ca.DOWN,b=c===ca.LEFT,v=c===ca.RIGHT,k=m||b,_=b||v,x=m||f,y=_||x,S=d||p||h||g,w=x?la.isVerticalEdge:la.isHorizontalEdge,{ownerDocument:C}=i,{defaultView:B}=C;if(!y)return;if(o()){if(d)return;if(!r())return;return a.preventDefault(),void(k?s(e()):s(t(),-1))}if(!function(e,t,n){const o=t===ca.UP||t===ca.DOWN,{tagName:r}=e,s=e.getAttribute("type");if(o&&!n)return"INPUT"!==r||!["date","datetime-local","month","number","range","time","week"].includes(s);if("INPUT"===r)return["button","checkbox","number","color","file","image","radio","reset","submit"].includes(s);return"TEXTAREA"!==r}(u,c,S))return;x?l||(l=(0,la.computeCaretRect)(B)):l=null;const I=(0,la.isRTL)(u)?!k:k,{keepCaretInsideBlock:j}=n();if(d)(function(e,t){const n=wy(e,t,i);return n&&Wx(n)})(u,k)&&w(u,k)&&(i.contentEditable=!0,i.focus());else if(!x||!(0,la.isVerticalEdge)(u,k)||h&&!(0,la.isHorizontalEdge)(u,I)||j){if(_&&B.getSelection().isCollapsed&&(0,la.isHorizontalEdge)(u,I)&&!j){const e=wy(u,I,i);(0,la.placeCaretAtHorizontalEdge)(e,k),a.preventDefault()}}else{const e=wy(u,k,i,!0);e&&((0,la.placeCaretAtVerticalEdge)(e,h?!k:k,h?void 0:l),a.preventDefault())}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}function By(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,c.useSelect)($r),{multiSelect:o,selectBlock:r}=(0,c.useDispatch)($r),s=(0,my.__unstableUseShortcutEventMatch)();return(0,u.useRefEffect)((i=>{function l(l){if(!s("core/block-editor/select-all",l))return;const a=t();if(a.length<2&&!(0,la.isEntirelySelected)(l.target))return;l.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(),r(u))}return i.addEventListener("keydown",l),()=>{i.removeEventListener("keydown",l)}}),[])}function Iy(e,t){e.contentEditable=t,t&&e.focus()}function jy(){const{startMultiSelect:e,stopMultiSelect:t}=(0,c.useDispatch)($r),{isSelectionEnabled:n,hasSelectedBlock:o,isDraggingBlocks:r,isMultiSelecting:s}=(0,c.useSelect)($r);return(0,u.useRefEffect)((i=>{const{ownerDocument:l}=i,{defaultView:a}=l;let c,u;function d(){t(),a.removeEventListener("mouseup",d),u=a.requestAnimationFrame((()=>{if(!o())return;Iy(i,!1);const e=a.getSelection();if(e.rangeCount){const t=e.getRangeAt(0),{commonAncestorContainer:n}=t,o=t.cloneRange();c.contains(n)&&(c.focus(),e.removeAllRanges(),e.addRange(o))}}))}function p({buttons:t,target:o,relatedTarget:l}){o.contains(l)||r()||1===t&&(s()||i!==o&&"true"===o.getAttribute("contenteditable")&&n()&&(c=o,e(),a.addEventListener("mouseup",d),Iy(i,!0)))}return i.addEventListener("mouseout",p),()=>{i.removeEventListener("mouseout",p),a.removeEventListener("mouseup",d),a.cancelAnimationFrame(u)}}),[e,t,n,o])}function Ey(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function Ty(e){const t=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;return t?.closest("[data-wp-block-attribute-key]")}function My(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,c.useDispatch)($r),{getBlockParents:o,getBlockSelectionStart:r,isMultiSelecting:s}=(0,c.useSelect)($r);return(0,u.useRefEffect)((i=>{const{ownerDocument:l}=i,{defaultView:a}=l;function c(l){const c=a.getSelection();if(!c.rangeCount)return;const u=function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(c),d=function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(c);if(!i.contains(u)||!i.contains(d))return;const p=l.shiftKey&&"mouseup"===l.type;if(c.isCollapsed&&!p){if("true"===i.contentEditable&&!s()){Ey(i,!1);let e=u.nodeType===u.ELEMENT_NODE?u:u.parentElement;e=e?.closest("[contenteditable]"),e?.focus()}return}let h=Wx(u),g=Wx(d);if(p){const e=r(),t=Wx(l.target),n=t!==g;(h===g&&c.isCollapsed||!g||n)&&(g=t),h!==e&&(h=e)}if(void 0===h&&void 0===g)return void Ey(i,!1);if(h===g)s()?e(h,h):t(h);else{const t=[...o(h),h],r=[...o(g),g],s=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,r);if(t[s]!==h||r[s]!==g)return void e(t[s],r[s]);const i=Ty(u),l=Ty(d);if(i&&l){var m,f;const e=c.getRangeAt(0),t=(0,W.create)({element:i,range:e,__unstableIsEditableTree:!0}),o=(0,W.create)({element:l,range:e,__unstableIsEditableTree:!0}),r=null!==(m=t.start)&&void 0!==m?m:t.end,s=null!==(f=o.start)&&void 0!==f?f:o.end;n({start:{clientId:h,attributeKey:i.dataset.wpBlockAttributeKey,offset:r},end:{clientId:g,attributeKey:l.dataset.wpBlockAttributeKey,offset:s}})}else e(h,g)}}return l.addEventListener("selectionchange",c),a.addEventListener("mouseup",c),()=>{l.removeEventListener("selectionchange",c),a.removeEventListener("mouseup",c)}}),[e,t,n,o])}function Py(){const{selectBlock:e}=(0,c.useDispatch)($r),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,c.useSelect)($r);return(0,u.useRefEffect)((r=>{function s(s){if(!t()||0!==s.button)return;const i=n(),l=Wx(s.target);s.shiftKey?i!==l&&(r.contentEditable=!0,r.focus()):o()&&e(l)}return r.addEventListener("mousedown",s),()=>{r.removeEventListener("mousedown",s)}}),[e,t,n,o])}function Ry(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,getSelectedBlockClientId:n,__unstableIsSelectionMergeable:o,hasMultiSelection:r,getBlockName:s,canInsertBlockType:i,getBlockRootClientId:a,getSelectionStart:d,getSelectionEnd:p,getBlockAttributes:h}=(0,c.useSelect)($r),{replaceBlocks:g,__unstableSplitSelection:m,removeBlocks:f,__unstableDeleteSelection:b,__unstableExpandSelection:v,__unstableMarkAutomaticChange:k}=(0,c.useDispatch)($r);return(0,u.useRefEffect)((c=>{function u(e){"true"===c.contentEditable&&e.preventDefault()}function _(u){if(!u.defaultPrevented)if(r())u.keyCode===ca.ENTER?(c.contentEditable=!1,u.preventDefault(),e()?g(t(),(0,l.createBlock)((0,l.getDefaultBlockName)())):m()):u.keyCode===ca.BACKSPACE||u.keyCode===ca.DELETE?(c.contentEditable=!1,u.preventDefault(),e()?f(t()):o()?b(u.keyCode===ca.DELETE):v()):1!==u.key.length||u.metaKey||u.ctrlKey||(c.contentEditable=!1,o()?b(u.keyCode===ca.DELETE):(u.preventDefault(),c.ownerDocument.defaultView.getSelection().removeAllRanges()));else if(u.keyCode===ca.ENTER){if(u.shiftKey||e())return;const t=n(),o=s(t),r=d(),c=p();if(r.attributeKey===c.attributeKey){const e=h(t)[r.attributeKey],n=(0,l.getBlockTransforms)("from").filter((({type:e})=>"enter"===e)),o=(0,l.findTransform)(n,(t=>t.regExp.test(e)));if(o)return g(t,o.transform({content:e})),void k()}if(!(0,l.hasBlockSupport)(o,"splitting",!1)&&!u.__deprecatedOnSplit)return;i(o,a(t))&&(m(),u.preventDefault())}}function x(e){r()&&(c.contentEditable=!1,o()?b():(e.preventDefault(),c.ownerDocument.defaultView.getSelection().removeAllRanges()))}return c.addEventListener("beforeinput",u),c.addEventListener("keydown",_),c.addEventListener("compositionstart",x),()=>{c.removeEventListener("beforeinput",u),c.removeEventListener("keydown",_),c.removeEventListener("compositionstart",x)}}),[])}function Ny(){const{getBlockName:e}=(0,c.useSelect)($r),{getBlockType:t}=(0,c.useSelect)(l.store),{createSuccessNotice:n}=(0,c.useDispatch)(To.store);return(0,a.useCallback)(((o,r)=>{let s="";if(1===r.length){const n=r[0],i=t(e(n))?.title;s="copy"===o?(0,C.sprintf)((0,C.__)('Copied "%s" to clipboard.'),i):(0,C.sprintf)((0,C.__)('Moved "%s" to clipboard.'),i)}else s="copy"===o?(0,C.sprintf)((0,C._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,C.sprintf)((0,C._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(s,{type:"snackbar"})}),[])}function Ay({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch(t){try{n=e.getData("Text")}catch(e){return}}n=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;const o=(e=e.substring(n+20)).indexOf("\x3c!--EndFragment--\x3e");return o>-1&&(e=e.substring(0,o)),e}(n),n=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(22):e}(n);const o=(0,la.getFilesFromDataTransfer)(e);return o.length&&!function(e,t){if(t&&1===e?.length&&0===e[0].type.indexOf("image/")){const e=/<\s*img\b/gi;if(1!==t.match(e)?.length)return!0;const n=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(n))return!0}return!1}(o,n)?{files:o}:{html:n,plainText:t,files:[]}}const Ly=Symbol("requiresWrapperOnCopy");function Oy(e,t,n){let o=t;const[r]=t;if(r){if(n.select(l.store).getBlockType(r.name)[Ly]){const{getBlockRootClientId:e,getBlockName:t,getBlockAttributes:s}=n.select($r),i=e(r.clientId),a=t(i);a&&(o=(0,l.createBlock)(a,s(i),o))}}const s=(0,l.serialize)(o);e.clipboardData.setData("text/plain",function(e){e=e.replace(/<br>/g,"\n");return(0,la.__unstableStripHTML)(e).trim().replace(/\n\n+/g,"\n\n")}(s)),e.clipboardData.setData("text/html",s)}function Dy(){const e=(0,c.useRegistry)(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:o,getSettings:r,getBlockName:s,__unstableIsFullySelected:i,__unstableIsSelectionCollapsed:a,__unstableIsSelectionMergeable:d,__unstableGetSelectedBlocksWithPartialSelection:p,canInsertBlockType:h,getBlockRootClientId:g}=(0,c.useSelect)($r),{flashBlock:m,removeBlocks:f,replaceBlocks:b,__unstableDeleteSelection:v,__unstableExpandSelection:k,__unstableSplitSelection:_}=(0,c.useDispatch)($r),x=Ny();return(0,u.useRefEffect)((c=>{function u(u){if(u.defaultPrevented)return;const y=n();if(0===y.length)return;if(!o()){const{target:e}=u,{ownerDocument:t}=e;if("copy"===u.type||"cut"===u.type?(0,la.documentHasUncollapsedSelection)(t):(0,la.documentHasSelection)(t)&&!t.activeElement.isContentEditable)return}const{activeElement:S}=u.target.ownerDocument;if(!c.contains(S))return;const w=d(),C=a()||i(),B=!C&&!w;if("copy"===u.type||"cut"===u.type)if(u.preventDefault(),1===y.length&&m(y[0]),B)k();else{let n;if(x(u.type,y),C)n=t(y);else{const[e,o]=p();n=[e,...t(y.slice(1,y.length-1)),o]}Oy(u,n,e)}if("cut"===u.type)C&&!B?f(y):(u.target.ownerDocument.activeElement.contentEditable=!1,v());else if("paste"===u.type){const{__experimentalCanUserUseUnfilteredHTML:e}=r();if("true"===u.clipboardData.getData("rich-text"))return;const{plainText:t,html:n,files:a}=Ay(u),c=i();let d=[];if(a.length){const e=(0,l.getBlockTransforms)("from");d=a.reduce(((t,n)=>{const o=(0,l.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else d=(0,l.pasteHandler)({HTML:n,plainText:t,mode:c?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:e});if("string"==typeof d)return;if(c)return b(y,d,d.length-1,-1),void u.preventDefault();if(!o()&&!(0,l.hasBlockSupport)(s(y[0]),"splitting",!1)&&!u.__deprecatedOnSplit)return;const[p]=y,m=g(p),f=[];for(const e of d)if(h(e.name,m))f.push(e);else{const t=s(m),n=e.name!==t?(0,l.switchToBlockType)(e,t):[e];if(!n)return;for(const e of n)for(const t of e.innerBlocks)f.push(t)}_(f),u.preventDefault()}}return c.ownerDocument.addEventListener("copy",u),c.ownerDocument.addEventListener("cut",u),c.ownerDocument.addEventListener("paste",u),()=>{c.ownerDocument.removeEventListener("copy",u),c.ownerDocument.removeEventListener("cut",u),c.ownerDocument.removeEventListener("paste",u)}}),[])}function zy(){const[e,t,n]=function(){const e=(0,a.useRef)(),t=(0,a.useRef)(),n=(0,a.useRef)(),{hasMultiSelection:o,getSelectedBlockClientId:r,getBlockCount:s}=(0,c.useSelect)($r),{setNavigationMode:i,setLastFocus:l}=Q((0,c.useDispatch)($r)),d=(0,c.useSelect)((e=>e($r).isNavigationMode()),[]),{getLastFocus:p}=Q((0,c.useSelect)($r)),h=d?void 0:"0",g=(0,a.useRef)();function m(t){if(g.current)g.current=null;else if(o())e.current.focus();else if(r())p()?.current?p().current.focus():e.current.querySelector(`[data-block="${r()}"]`).focus();else{i(!0);const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement,o=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,r=la.focus.tabbable.find(e.current);r.length&&(o?r[0]:r[r.length-1]).focus()}}const f=(0,U.jsx)("div",{ref:t,tabIndex:h,onFocus:m}),b=(0,U.jsx)("div",{ref:n,tabIndex:h,onFocus:m}),v=(0,u.useRefEffect)((a=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===ca.ESCAPE&&!o())return e.preventDefault(),void i(!0);if(e.keyCode!==ca.TAB)return;const s=e.shiftKey,l=s?"findPrevious":"findNext";if(!o()&&!r())return void(e.target===a&&i(!0));const c=la.focus.tabbable[l](e.target),u=e.target.closest("[data-block]"),d=u&&c&&(Ux(u,c)||$x(u,c));if((0,la.isFormElement)(c)&&d)return;const p=s?t:n;g.current=!0,p.current.focus({preventScroll:!0})}function u(e){l({...p(),current:e.target});const{ownerDocument:t}=a;e.relatedTarget||t.activeElement!==t.body||0!==s()||a.focus()}function d(o){if(o.keyCode!==ca.TAB)return;if("region"===o.target?.getAttribute("role"))return;if(e.current===o.target)return;const r=o.shiftKey?"findPrevious":"findNext",s=la.focus.tabbable[r](o.target);s!==t.current&&s!==n.current||(o.preventDefault(),s.focus({preventScroll:!0}))}const{ownerDocument:h}=a,{defaultView:m}=h;return m.addEventListener("keydown",d),a.addEventListener("keydown",c),a.addEventListener("focusout",u),()=>{m.removeEventListener("keydown",d),a.removeEventListener("keydown",c),a.removeEventListener("focusout",u)}}),[]);return[f,(0,u.useMergeRefs)([e,v]),b]}(),o=(0,c.useSelect)((e=>e($r).hasMultiSelection()),[]);return[e,(0,u.useMergeRefs)([t,Dy(),Ry(),jy(),My(),Py(),Sy(),By(),Cy(),(0,u.useRefEffect)((e=>{if(e.tabIndex=0,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,C.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}const Vy=(0,a.forwardRef)((function({children:e,...t},n){const[o,r,s]=zy();return(0,U.jsxs)(U.Fragment,{children:[o,(0,U.jsx)("div",{...t,ref:(0,u.useMergeRefs)([r,n]),className:Bs(t.className,"block-editor-writing-flow"),children:e}),s]})}));let Fy=null;function Hy(e,t,n){const o={};for(const t in e)o[t]=e[t];if(e instanceof n.contentDocument.defaultView.MouseEvent){const e=n.getBoundingClientRect();o.clientX+=e.left,o.clientY+=e.top}const r=new t(e.type,o);o.defaultPrevented&&r.preventDefault();!n.dispatchEvent(r)&&e.preventDefault()}function Gy(e){return(0,u.useRefEffect)((()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,o=e.documentElement,r=["dragover","mousemove"],s={};for(const e of r)s[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;Hy(e,window[t],n)},o.addEventListener(e,s[e]);return()=>{for(const e of r)o.removeEventListener(e,s[e])}}))}function Uy({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:r=0,readonly:s,forwardedRef:i,title:l=(0,C.__)("Editor canvas"),...d}){const{resolvedAssets:p,isPreviewMode:h}=(0,c.useSelect)((e=>{const{getSettings:t}=e($r),n=t();return{resolvedAssets:n.__unstableResolvedAssets,isPreviewMode:n.__unstableIsPreviewMode}}),[]),{styles:g="",scripts:m=""}=p,[f,b]=(0,a.useState)(),v=(0,a.useRef)(),[k,_]=(0,a.useState)([]),x=_y(),[y,S,w]=zy(),[B,{height:I}]=(0,u.useResizeObserver)(),[j,{width:E}]=(0,u.useResizeObserver)(),T=(0,u.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:r}=e,{documentElement:s}=o;t=o,s.classList.add("block-editor-iframe__html"),x(s),_(Array.from(r.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=r.dir;for(const e of Fy||(Fy=Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:o}=t;if(null===n)return e;if(!o)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(!n.id)return e;if(function e(t){return Array.from(t).find((({selectorText:t,conditionText:n,cssRules:o})=>n?e(o):t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block"))))}(o)){const t="STYLE"===n.tagName;if(t){const t=n.id.replace("-inline-css","-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!t){const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}}return e}),[]),Fy))o.getElementById(e.id)||(o.head.appendChild(e.cloneNode(!0)),h||console.warn(`${e.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,e));t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1)}return e._load=()=>{b(e.contentDocument)},e.addEventListener("load",o),()=>{delete e._load,e.removeEventListener("load",o),t?.removeEventListener("dragover",n),t?.removeEventListener("drop",n)}}),[]),[M,P]=(0,a.useState)(),R=(0,u.useRefEffect)((e=>{const t=e.ownerDocument.defaultView;P(t.innerHeight);const n=()=>{P(t.innerHeight)};return t.addEventListener("resize",n),()=>{t.removeEventListener("resize",n)}}),[]),[N,A]=(0,a.useState)(),L=(0,u.useRefEffect)((e=>{const t=e.ownerDocument.defaultView;A(t.innerWidth);const n=()=>{A(t.innerWidth)};return t.addEventListener("resize",n),()=>{t.removeEventListener("resize",n)}}),[]),O=1!==o;(0,a.useEffect)((()=>{O||(v.current=E)}),[E,O]);const D=(0,u.useDisabled)({isDisabled:!s}),z=(0,u.useMergeRefs)([Gy(f),e,x,S,D,O?R:null]),V=`<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset="utf-8">\n\t\t<script>window.frameElement._load()<\/script>\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${g}\n\t\t${m}\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()<\/script>\n\t</body>\n</html>`,[F,H]=(0,a.useMemo)((()=>{const e=URL.createObjectURL(new window.Blob([V],{type:"text/html"}));return[e,()=>URL.revokeObjectURL(e)]}),[V]);(0,a.useEffect)((()=>H),[H]),(0,a.useEffect)((()=>{if(!f||!O)return;f.documentElement.classList.add("is-zoomed-out");return f.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale","default"===o?Math.min(E,800)/v.current:o),f.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size","number"==typeof r?`${r}px`:r),f.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-content-height",`${I}px`),f.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-inner-height",`${M}px`),f.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-container-width",`${E}px`),f.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-prev-container-width",`${v.current}px`),()=>{f.documentElement.classList.remove("is-zoomed-out"),f.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scale"),f.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-frame-size"),f.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-content-height"),f.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-inner-height"),f.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-container-width"),f.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-prev-container-width")}}),[o,r,f,M,I,E,N,O]);const G=n>=0&&!h,$=(0,U.jsxs)(U.Fragment,{children:[G&&y,(0,U.jsx)("iframe",{...d,style:{border:0,...d.style,height:d.style?.height,transition:"all .3s"},ref:(0,u.useMergeRefs)([i,T]),tabIndex:n,src:F,title:l,onKeyDown:e=>{if(d.onKeyDown&&d.onKeyDown(e),e.currentTarget.ownerDocument!==e.target.ownerDocument){const{stopPropagation:t}=e.nativeEvent;e.nativeEvent.stopPropagation=()=>{},e.stopPropagation(),e.nativeEvent.stopPropagation=t,Hy(e,window.KeyboardEvent,e.currentTarget)}},children:f&&(0,a.createPortal)((0,U.jsxs)("body",{ref:z,className:Bs("block-editor-iframe__body","editor-styles-wrapper",...k),children:[B,(0,U.jsx)(Ns.__experimentalStyleProvider,{document:f,children:t})]}),f.documentElement)}),G&&w]});return(0,U.jsxs)("div",{className:"block-editor-iframe__container",ref:L,children:[j,(0,U.jsx)("div",{className:Bs("block-editor-iframe__scale-container",O&&"is-zoomed-out"),style:{"--wp-block-editor-iframe-zoom-out-container-width":O&&`${E}px`,"--wp-block-editor-iframe-zoom-out-prev-container-width":O&&`${v.current}px`},children:$})]})}const $y=(0,a.forwardRef)((function(e,t){return(0,c.useSelect)((e=>e($r).getSettings().__internalIsInitialized),[])?(0,U.jsx)(Uy,{...e,forwardedRef:t}):null}));var Wy=n(4529);const Ky=Wy,Zy=(Wy.stringify,Wy.fromJSON,Wy.plugin,Wy.parse,Wy.list,Wy.document,Wy.comment,Wy.atRule,Wy.rule,Wy.decl,Wy.root,Wy.CssSyntaxError);Wy.Declaration,Wy.Container,Wy.Processor,Wy.Document,Wy.Comment,Wy.Warning,Wy.AtRule,Wy.Result,Wy.Input,Wy.Rule,Wy.Root,Wy.Node;var qy=n(8036),Yy=n.n(qy),Xy=n(5404),Qy=n.n(Xy);const Jy=new Map;const eS=(e,t="")=>{let n=Jy.get(t);return n||(n=new WeakMap,Jy.set(t,n)),e.map((e=>{let o=n.get(e);return o||(o=function({css:e,ignoredSelectors:t=[],baseURL:n},o=""){if(!o&&!n)return e;const r=e.replace(/:root :where\(body\)/g,"body").replace(/:where\(body\)/g,"body");try{return Ky([o&&Yy()(o,{ignoredSelectors:[...t,o]}),n&&Qy()({rootUrl:n})].filter(Boolean)).process(r,{}).css}catch(e){return e instanceof Zy?console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",e.message+"\n"+e.showSourceCode(!1)):console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",e),null}}(e,t),n.set(e,o)),o}))};function tS(e,t){return(0,a.useCallback)((e=>{if(!e)return;const{ownerDocument:n}=e,{defaultView:o,body:r}=n,s=t?n.querySelector(t):r;let i;if(s)i=o?.getComputedStyle(s,null).getPropertyValue("background-color");else{const e=n.createElement("div");e.classList.add("editor-styles-wrapper"),r.appendChild(e),i=o?.getComputedStyle(e,null).getPropertyValue("background-color"),r.removeChild(e)}const l=yu(i);l.luminance()>.5||0===l.alpha()?r.classList.remove("is-dark-theme"):r.classList.add("is-dark-theme")}),[e,t])}wu([Cu,ju]);const nS=(0,a.memo)((function({styles:e,scope:t}){const n=(0,c.useSelect)((e=>Q(e($r)).getStyleOverrides()),[]),[o,r]=(0,a.useMemo)((()=>{const o=Object.values(null!=e?e:[]);for(const[e,t]of n){const n=o.findIndex((({id:t})=>e===t)),r={...t,id:e};-1===n?o.push(r):o[n]=r}return[eS(o.filter((e=>e?.css)),t),o.filter((e=>"svgs"===e.__unstableType)).map((e=>e.assets)).join("")]}),[e,n,t]);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("style",{ref:tS(o,t)}),o.map(((e,t)=>(0,U.jsx)("style",{children:e},t))),(0,U.jsx)(Ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 0 0",width:"0",height:"0",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"},dangerouslySetInnerHTML:{__html:r}})]})}));let oS;const rS=2e3,sS=[];function iS({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:o=sS}){e||(e=t);const[r,{height:s}]=(0,u.useResizeObserver)(),{styles:i}=(0,c.useSelect)((e=>({styles:e($r).getSettings().styles})),[]),l=(0,a.useMemo)((()=>i?[...i,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o]:i),[i,o]);oS=oS||(0,a.memo)(FC);const d=t/e,p=s?t/(s*d):0;return(0,U.jsx)(Ns.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${d})`,aspectRatio:p,maxHeight:s>rS?rS*d:void 0,minHeight:n},children:(0,U.jsxs)($y,{contentRef:(0,u.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.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:s,pointerEvents:"none",maxHeight:rS,minHeight:0!==d&&d<1&&n?n/d:n},children:[(0,U.jsx)(nS,{styles:l}),r,(0,U.jsx)(oS,{renderAppender:!1})]})})}function lS(e){const[t,{width:n}]=(0,u.useResizeObserver)();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("div",{style:{position:"relative",width:"100%",height:0},children:t}),(0,U.jsx)("div",{className:"block-editor-block-preview__container",children:!!n&&(0,U.jsx)(iS,{...e,containerWidth:n})})]})}const aS=[];const cS=(0,a.memo)((function({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:o=aS,__experimentalMinHeight:r,__experimentalPadding:s}){r&&(n=r,y()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),s&&(o=[...o,{css:`body { padding: ${s}px; }`}],y()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const i=(0,c.useSelect)((e=>e($r).getSettings()),[]),l=(0,a.useMemo)((()=>({...i,focusMode:!1,__unstableIsPreviewMode:!0})),[i]),u=(0,a.useMemo)((()=>Array.isArray(e)?e:[e]),[e]);return e&&0!==e.length?(0,U.jsx)(vy,{value:u,settings:l,children:(0,U.jsx)(lS,{viewportWidth:t,minHeight:n,additionalStyles:o})}):null}));function uS({blocks:e,props:t={},layout:n}){const o=(0,c.useSelect)((e=>e($r).getSettings()),[]),r=(0,a.useMemo)((()=>({...o,styles:void 0,focusMode:!1,__unstableIsPreviewMode:!0})),[o]),s=(0,u.useDisabled)(),i=(0,u.useMergeRefs)([t.ref,s]),l=(0,a.useMemo)((()=>Array.isArray(e)?e:[e]),[e]),d=(0,U.jsxs)(vy,{value:l,settings:r,children:[(0,U.jsx)(nS,{}),(0,U.jsx)($C,{renderAppender:!1,layout:n})]});return{...t,ref:i,className:Bs(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?d:null}}const dS=function({item:e}){var t;const{name:n,title:o,icon:r,description:s,initialAttributes:i,example:c}=e,u=(0,l.isReusableBlock)(e),d=(0,a.useMemo)((()=>c?(0,l.getBlockFromExample)(n,{attributes:{...c.attributes,...i},innerBlocks:c.innerBlocks}):(0,l.createBlock)(n,i)),[n,c,i]);return(0,U.jsxs)("div",{className:"block-editor-inserter__preview-container",children:[(0,U.jsx)("div",{className:"block-editor-inserter__preview",children:u||c?(0,U.jsx)("div",{className:"block-editor-inserter__preview-content",children:(0,U.jsx)(cS,{blocks:d,viewportWidth:null!==(t=c?.viewportWidth)&&void 0!==t?t:500,additionalStyles:[{css:"body { padding: 24px; }"}]})}):(0,U.jsx)("div",{className:"block-editor-inserter__preview-content-missing",children:(0,C.__)("No preview available.")})}),!u&&(0,U.jsx)(dy,{title:o,icon:r,description:s})]})},{CompositeItemV2:pS}=Q(Ns.privateApis);const hS=(0,a.forwardRef)((function({isFirst:e,as:t,children:n,...o},r){return(0,U.jsx)(pS,{ref:r,role:"option",accessibleWhenDisabled:!0,...o,render:o=>{const r={...o,tabIndex:e?0:o.tabIndex};return t?(0,U.jsx)(t,{...r,children:n}):"function"==typeof n?n(r):(0,U.jsx)(Ns.Button,{...r,children:n})}})})),gS=(0,U.jsx)(G.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"})});function mS({count:e,icon:t,isPattern:n,fadeWhenDisabled:o}){const r=n&&(0,C.__)("Pattern");return(0,U.jsx)("div",{className:"block-editor-block-draggable-chip-wrapper",children:(0,U.jsx)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:(0,U.jsxs)(Ns.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[(0,U.jsx)(Ns.FlexItem,{children:t?(0,U.jsx)(Tf,{icon:t}):r||(0,C.sprintf)((0,C._n)("%d block","%d blocks",e),e)}),(0,U.jsx)(Ns.FlexItem,{children:(0,U.jsx)(Tf,{icon:gS})}),o&&(0,U.jsx)(Ns.FlexItem,{className:"block-editor-block-draggable-chip__disabled",children:(0,U.jsx)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}const fS=({isEnabled:e,blocks:t,icon:n,children:o,pattern:r})=>{const s={type:"inserter",blocks:t},i=(0,c.useSelect)((e=>{const{getBlockType:n}=e(l.store);return 1===t.length&&n(t[0].name)?.icon}),[t]),{startDragging:a,stopDragging:u}=Q((0,c.useDispatch)($r));return(0,U.jsx)(Ns.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:s,onDragStart:e=>{a();const n=r?.type===ce.user&&"unsynced"!==r?.syncStatus?[(0,l.createBlock)("core/block",{ref:r.id})]:t;e.dataTransfer.setData("text/html",(0,l.serialize)(n))},onDragEnd:()=>{u()},__experimentalDragComponent:(0,U.jsx)(mS,{count:t.length,icon:n||!r&&i,isPattern:!!r}),children:({onDraggableStart:t,onDraggableEnd:n})=>o({draggable:e,onDragStart:e?t:void 0,onDragEnd:e?n:void 0})})};const bS=(0,a.memo)((function({className:e,isFirst:t,item:n,onSelect:o,onHover:r,isDraggable:s,...i}){const c=(0,a.useRef)(!1),u=n.icon?{backgroundColor:n.icon.background,color:n.icon.foreground}:{},d=(0,a.useMemo)((()=>[(0,l.createBlock)(n.name,n.initialAttributes,(0,l.createBlocksFromInnerBlocksTemplate)(n.innerBlocks))]),[n.name,n.initialAttributes,n.innerBlocks]),p=(0,l.isReusableBlock)(n)&&"unsynced"!==n.syncStatus||(0,l.isTemplatePart)(n);return(0,U.jsx)(fS,{isEnabled:s&&!n.isDisabled,blocks:d,icon:n.icon,children:({draggable:s,onDragStart:l,onDragEnd:a})=>(0,U.jsx)("div",{className:Bs("block-editor-block-types-list__list-item",{"is-synced":p}),draggable:s,onDragStart:e=>{c.current=!0,l&&(r(null),l(e))},onDragEnd:e=>{c.current=!1,a&&a(e)},children:(0,U.jsxs)(hS,{isFirst:t,className:Bs("block-editor-block-types-list__item",e),disabled:n.isDisabled,onClick:e=>{e.preventDefault(),o(n,(0,ca.isAppleOS)()?e.metaKey:e.ctrlKey),r(null)},onKeyDown:e=>{const{keyCode:t}=e;t===ca.ENTER&&(e.preventDefault(),o(n,(0,ca.isAppleOS)()?e.metaKey:e.ctrlKey),r(null))},onMouseEnter:()=>{c.current||r(n)},onMouseLeave:()=>r(null),...i,children:[(0,U.jsx)("span",{className:"block-editor-block-types-list__item-icon",style:u,children:(0,U.jsx)(Tf,{icon:n.icon,showColors:!0})}),(0,U.jsx)("span",{className:"block-editor-block-types-list__item-title",children:(0,U.jsx)(Ns.__experimentalTruncate,{numberOfLines:3,children:n.title})})]})})})}));const vS=(0,a.forwardRef)((function(e,t){const[n,o]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{n&&(0,Eo.speak)((0,C.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,U.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)},...e})})),{CompositeGroupV2:kS}=Q(Ns.privateApis);const _S=(0,a.forwardRef)((function(e,t){return(0,U.jsx)(kS,{role:"presentation",ref:t,...e})}));function xS(e,t){const n=[];for(let o=0,r=e.length;o<r;o+=t)n.push(e.slice(o,o+t));return n}const yS=function e({items:t=[],onSelect:n,onHover:o=(()=>{}),children:r,label:s,isDraggable:i=!0}){const a="block-editor-block-types-list",c=(0,u.useInstanceId)(e,a);return(0,U.jsxs)(vS,{className:a,"aria-label":s,children:[xS(t,3).map(((e,t)=>(0,U.jsx)(_S,{children:e.map(((e,r)=>(0,U.jsx)(bS,{item:e,className:(0,l.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:i&&!e.isDisabled,isFirst:0===t&&0===r,rowId:`${c}-${t}`},e.id)))},t))),r]})};const SS=function({title:e,icon:t,children:n}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,U.jsx)("h2",{className:"block-editor-inserter__panel-title",children:e}),(0,U.jsx)(Ns.Icon,{icon:t})]}),(0,U.jsx)("div",{className:"block-editor-inserter__panel-content",children:n})]})},{CompositeV2:wS,useCompositeStoreV2:CS}=Q(Ns.privateApis);const BS=function({children:e}){const t=CS({focusShift:!0,focusWrap:"horizontal"});return(0,U.jsx)(wS,{store:t,render:(0,U.jsx)(U.Fragment,{}),children:e})};const IS=function(){return(0,U.jsxs)("div",{className:"block-editor-inserter__no-results",children:[(0,U.jsx)(Ui,{className:"block-editor-inserter__no-results-icon",icon:Ef}),(0,U.jsx)("p",{children:(0,C.__)("No results found.")})]})},jS=e=>e.name.split("/")[0],ES=6,TS=[];function MS({items:e,collections:t,categories:n,onSelectItem:o,onHover:r,showMostUsedBlocks:s,className:i}){const l=(0,a.useMemo)((()=>ae(e,"frecency","desc").slice(0,ES)),[e]),c=(0,a.useMemo)((()=>e.filter((e=>!e.category))),[e]),d=(0,a.useMemo)((()=>{const n={...t};return Object.keys(t).forEach((t=>{n[t]=e.filter((e=>jS(e)===t)),0===n[t].length&&delete n[t]})),n}),[e,t]);(0,a.useEffect)((()=>()=>r(null)),[]);const p=(0,u.useAsyncList)(n),h=n.length===p.length,g=(0,a.useMemo)((()=>Object.entries(t)),[t]),m=(0,u.useAsyncList)(h?g:TS);return(0,U.jsxs)("div",{className:i,children:[s&&e.length>3&&!!l.length&&(0,U.jsx)(SS,{title:(0,C._x)("Most used","blocks"),children:(0,U.jsx)(yS,{items:l,onSelect:o,onHover:r,label:(0,C._x)("Most used","blocks")})}),p.map((t=>{const n=e.filter((e=>e.category===t.slug));return n&&n.length?(0,U.jsx)(SS,{title:t.title,icon:t.icon,children:(0,U.jsx)(yS,{items:n,onSelect:o,onHover:r,label:t.title})},t.slug):null})),h&&c.length>0&&(0,U.jsx)(SS,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,C.__)("Uncategorized"),children:(0,U.jsx)(yS,{items:c,onSelect:o,onHover:r,label:(0,C.__)("Uncategorized")})}),m.map((([e,t])=>{const n=d[e];return n&&n.length?(0,U.jsx)(SS,{title:t.title,icon:t.icon,children:(0,U.jsx)(yS,{items:n,onSelect:o,onHover:r,label:t.title})},e):null}))]})}const PS=(0,a.forwardRef)((function({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:o},r){const[s,i,l,a]=Eb(e,t);if(!s.length)return(0,U.jsx)(IS,{});const c=[],u=[];for(const t of s)"reusable"!==t.category&&(e&&t.rootClientId===e?c.push(t):u.push(t));return(0,U.jsx)(BS,{children:(0,U.jsxs)("div",{ref:r,children:[!!c.length&&(0,U.jsx)(U.Fragment,{children:(0,U.jsx)(MS,{items:c,categories:i,collections:l,onSelectItem:a,onHover:n,showMostUsedBlocks:o,className:"block-editor-inserter__insertable-blocks-at-selection"})}),(0,U.jsx)(MS,{items:u,categories:i,collections:l,onSelectItem:a,onHover:n,showMostUsedBlocks:o,className:"block-editor-inserter__all-blocks"})]})})}));function RS({selectedCategory:e,patternCategories:t,onClickCategory:n}){const o="block-editor-block-patterns-explorer__sidebar";return(0,U.jsx)("div",{className:`${o}__categories-list`,children:t.map((({name:t,label:r})=>(0,U.jsx)(Ns.Button,{label:r,className:`${o}__categories-list__item`,isPressed:e===t,onClick:()=>{n(t)},children:r},t)))})}function NS({searchValue:e,setSearchValue:t}){return(0,U.jsx)("div",{className:"block-editor-block-patterns-explorer__search",children:(0,U.jsx)(Ns.SearchControl,{__nextHasNoMarginBottom:!0,onChange:t,value:e,label:(0,C.__)("Search for patterns"),placeholder:(0,C.__)("Search")})})}const AS=function({selectedCategory:e,patternCategories:t,onClickCategory:n,searchValue:o,setSearchValue:r}){return(0,U.jsxs)("div",{className:"block-editor-block-patterns-explorer__sidebar",children:[(0,U.jsx)(NS,{searchValue:o,setSearchValue:r}),!o&&(0,U.jsx)(RS,{selectedCategory:e,patternCategories:t,onClickCategory:n})]})};function LS({currentPage:e,numPages:t,changePage:n,totalItems:o}){return(0,U.jsxs)(Ns.__experimentalVStack,{className:"block-editor-patterns__grid-pagination-wrapper",children:[(0,U.jsx)(Ns.__experimentalText,{variant:"muted",children:(0,C.sprintf)((0,C._n)("%s item","%s items",o),o)}),t>1&&(0,U.jsxs)(Ns.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination",children:[(0,U.jsxs)(Ns.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous",children:[(0,U.jsx)(Ns.Button,{variant:"tertiary",onClick:()=>n(1),disabled:1===e,"aria-label":(0,C.__)("First page"),__experimentalIsFocusable:!0,children:(0,U.jsx)("span",{children:"«"})}),(0,U.jsx)(Ns.Button,{variant:"tertiary",onClick:()=>n(e-1),disabled:1===e,"aria-label":(0,C.__)("Previous page"),__experimentalIsFocusable:!0,children:(0,U.jsx)("span",{children:"‹"})})]}),(0,U.jsx)(Ns.__experimentalText,{variant:"muted",children:(0,C.sprintf)((0,C._x)("%1$s of %2$s","paging"),e,t)}),(0,U.jsxs)(Ns.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next",children:[(0,U.jsx)(Ns.Button,{variant:"tertiary",onClick:()=>n(e+1),disabled:e===t,"aria-label":(0,C.__)("Next page"),__experimentalIsFocusable:!0,children:(0,U.jsx)("span",{children:"›"})}),(0,U.jsx)(Ns.Button,{variant:"tertiary",onClick:()=>n(t),disabled:e===t,"aria-label":(0,C.__)("Last page"),size:"default",__experimentalIsFocusable:!0,children:(0,U.jsx)("span",{children:"»"})})]})]})]})}const{CompositeV2:OS,CompositeItemV2:DS,useCompositeStoreV2:zS}=Q(Ns.privateApis),VS=({showTooltip:e,title:t,children:n})=>e?(0,U.jsx)(Ns.Tooltip,{text:t,children:n}):(0,U.jsx)(U.Fragment,{children:n});function FS({id:e,isDraggable:t,pattern:n,onClick:o,onHover:r,showTitle:s=!0,showTooltip:i,category:c}){const[d,p]=(0,a.useState)(!1),{blocks:h,viewportWidth:g}=n,m=`block-editor-block-patterns-list__item-description-${(0,u.useInstanceId)(FS)}`,f=(0,a.useMemo)((()=>c&&t?(null!=h?h:[]).map((e=>{const t=(0,l.cloneBlock)(e);return t.attributes.metadata?.categories?.includes(c)&&(t.attributes.metadata.categories=[c]),t})):h),[h,t,c]);return(0,U.jsx)(fS,{isEnabled:t,blocks:f,pattern:n,children:({draggable:t,onDragStart:l,onDragEnd:a})=>(0,U.jsx)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:e=>{p(!0),l&&(r?.(null),l(e))},onDragEnd:e=>{p(!1),a&&a(e)},children:(0,U.jsx)(VS,{showTooltip:i&&!n.type!==ce.user,title:n.title,children:(0,U.jsxs)(DS,{render:(0,U.jsx)("div",{role:"option","aria-label":n.title,"aria-describedby":n.description?m:void 0,className:Bs("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":n.type===ce.user&&!n.syncStatus})}),id:e,onClick:()=>{o(n,h),r?.(null)},onMouseEnter:()=>{d||r?.(n)},onMouseLeave:()=>r?.(null),children:[(0,U.jsx)(cS,{blocks:h,viewportWidth:g}),s&&(0,U.jsxs)(Ns.__experimentalHStack,{className:"block-editor-patterns__pattern-details",spacing:2,children:[n.type===ce.user&&!n.syncStatus&&(0,U.jsx)("div",{className:"block-editor-patterns__pattern-icon-wrapper",children:(0,U.jsx)(Ui,{className:"block-editor-patterns__pattern-icon",icon:$})}),(!i||n.type===ce.user)&&(0,U.jsx)("div",{className:"block-editor-block-patterns-list__item-title",children:n.title})]}),!!n.description&&(0,U.jsx)(Ns.VisuallyHidden,{id:m,children:n.description})]})})})})}function HS(){return(0,U.jsx)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const GS=(0,a.forwardRef)((function({isDraggable:e,blockPatterns:t,shownPatterns:n,onHover:o,onClickPattern:r,orientation:s,label:i=(0,C.__)("Block patterns"),category:l,showTitle:c=!0,showTitlesAsTooltip:u,pagingProps:d},p){const h=zS({orientation:s}),{setActiveId:g}=h;return(0,a.useEffect)((()=>{g(void 0)}),[g,n,t]),(0,U.jsxs)(OS,{store:h,role:"listbox",className:"block-editor-block-patterns-list","aria-label":i,ref:p,children:[t.map((t=>n.includes(t)?(0,U.jsx)(FS,{id:t.name,pattern:t,onClick:r,onHover:o,isDraggable:e,showTitle:c,showTooltip:u,category:l},t.name):(0,U.jsx)(HS,{},t.name))),d&&(0,U.jsx)(LS,{...d})]})}));function US({destinationRootClientId:e,destinationIndex:t,rootClientId:n,registry:o}){if(n===e)return t;const r=["",...o.select($r).getBlockParents(e),e],s=r.indexOf(n);return-1!==s?o.select($r).getBlockIndex(r[s+1])+1:o.select($r).getBlockOrder(n).length}const $S=function({rootClientId:e="",insertionIndex:t,clientId:n,isAppender:o,onSelect:r,shouldFocusBlock:s=!0,selectBlockOnInsert:i=!0}){const u=(0,c.useRegistry)(),{getSelectedBlock:d}=(0,c.useSelect)($r),{destinationRootClientId:p,destinationIndex:h}=(0,c.useSelect)((r=>{const{getSelectedBlockClientId:s,getBlockRootClientId:i,getBlockIndex:l,getBlockOrder:a}=r($r),c=s();let u,d=e;return void 0!==t?u=t:n?u=l(n):!o&&c?(d=i(c),u=l(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[e,t,n,o]),{replaceBlocks:g,insertBlocks:m,showInsertionPoint:f,hideInsertionPoint:b,setLastFocus:v}=Q((0,c.useDispatch)($r)),k=(0,a.useCallback)(((e,t,n=!1,a)=>{(n||s||i)&&v(null);const c=d();!o&&c&&(0,l.isUnmodifiedDefaultBlock)(c)?g(c.clientId,e,null,s||n?0:null,t):m(e,o||void 0===a?h:US({destinationRootClientId:p,destinationIndex:h,rootClientId:a,registry:u}),o||void 0===a?p:a,i,s||n?0:null,t);const f=Array.isArray(e)?e.length:1,b=(0,C.sprintf)((0,C._n)("%d block added.","%d blocks added.",f),f);(0,Eo.speak)(b),r&&r(e)}),[o,d,g,m,p,h,r,s,i]),_=(0,a.useCallback)((e=>{e?.hasOwnProperty("rootClientId")?f(e.rootClientId,US({destinationRootClientId:p,destinationIndex:h,rootClientId:e.rootClientId,registry:u})):b()}),[f,b,p,h]);return[p,k,_]},WS=(e,t,n)=>{const{patternCategories:o,patterns:r,userPatternCategories:s}=(0,c.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e($r),{__experimentalUserPatternCategories:r,__experimentalBlockPatternCategories:s}=o();return{patterns:n(t),userPatternCategories:r,patternCategories:s}}),[t]),i=(0,a.useMemo)((()=>{const e=[...o];return s?.forEach((t=>{e.find((e=>e.name===t.name))||e.push(t)})),e}),[o,s]),{createSuccessNotice:u}=(0,c.useDispatch)(To.store),d=(0,a.useCallback)(((t,o)=>{const r=t.type===ce.user&&"unsynced"!==t.syncStatus?[(0,l.createBlock)("core/block",{ref:t.id})]:o;e((null!=r?r:[]).map((e=>{const t=(0,l.cloneBlock)(e);return t.attributes.metadata?.categories?.includes(n)&&(t.attributes.metadata.categories=[n]),t})),t.name),u((0,C.sprintf)((0,C.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar",id:"block-pattern-inserted-notice"})}),[u,e,n]);return[r,i,d]},KS=20,ZS=5;function qS(e,t,n,o=""){const[r,s]=(0,a.useState)(1),i=(0,u.usePrevious)(t),l=(0,u.usePrevious)(o);i===t&&l===o||1===r||s(1);const c=e.length,d=r-1,p=(0,a.useMemo)((()=>e.slice(d*KS,d*KS+KS)),[d,e]),h=(0,u.useAsyncList)(p,{step:ZS}),g=Math.ceil(e.length/KS);return(0,a.useEffect)((function(){const e=(0,la.getScrollContainer)(n?.current);e?.scrollTo(0,0)}),[t,n]),{totalItems:c,categoryPatterns:p,categoryPatternsAsyncList:h,numPages:g,changePage:e=>{const t=(0,la.getScrollContainer)(n?.current);t?.scrollTo(0,0),s(e)},currentPage:r}}function YS({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,U.jsx)(Ns.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count",children:(0,C.sprintf)((0,C._n)("%d pattern found","%d patterns found",t),t)}):null}const XS=function({searchValue:e,selectedCategory:t,patternCategories:n,rootClientId:o}){const r=(0,a.useRef)(),s=(0,u.useDebounce)(Eo.speak,500),[i,l]=$S({rootClientId:o,shouldFocusBlock:!0}),[c,,d]=WS(l,i,t),p=(0,a.useMemo)((()=>n.map((e=>e.name))),[n]),h=(0,a.useMemo)((()=>{const n=c.filter((e=>{if(t===de.name)return!0;if(t===pe.name&&e.type===ce.user)return!0;if("uncategorized"===t){const t=e.categories.some((e=>p.includes(e)));return!e.categories?.length||!t}return e.categories?.includes(t)}));return e?Ib(n,e):n}),[e,c,t,p]);(0,a.useEffect)((()=>{if(!e)return;const t=h.length,n=(0,C.sprintf)((0,C._n)("%d result found.","%d results found.",t),t);s(n)}),[e,s,h.length]);const g=qS(h,t,r),[m,f]=(0,a.useState)(e);e!==m&&(f(e),g.changePage(1));const b=!!h?.length;return(0,U.jsxs)("div",{className:"block-editor-block-patterns-explorer__list",ref:r,children:[(0,U.jsx)(YS,{filterValue:e,filteredBlockPatternsLength:h.length}),(0,U.jsx)(BS,{children:b&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(GS,{shownPatterns:g.categoryPatternsAsyncList,blockPatterns:g.categoryPatterns,onClickPattern:d,isDraggable:!1}),(0,U.jsx)(LS,{...g})]})})]})};function QS(e,t="all"){const[n,o]=WS(void 0,e),r=(0,a.useMemo)((()=>"all"===t?n:n.filter((e=>!he(e,t)))),[t,n]),s=(0,a.useMemo)((()=>{const e=o.filter((e=>r.some((t=>t.categories?.includes(e.name))))).sort(((e,t)=>e.label.localeCompare(t.label)));return r.some((e=>!function(e,t){return!(!e.categories||!e.categories.length)&&e.categories.some((e=>t.some((t=>t.name===e))))}(e,o)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,C._x)("Uncategorized")}),r.some((e=>e.type===ce.user))&&e.unshift(pe),r.length>0&&e.unshift({name:de.name,label:de.label}),(0,Eo.speak)((0,C.sprintf)((0,C._n)("%d category button displayed.","%d category buttons displayed.",e.length),e.length)),e}),[o,r]);return s}function JS({initialCategory:e,rootClientId:t}){const[n,o]=(0,a.useState)(""),[r,s]=(0,a.useState)(e?.name),i=QS(t);return(0,U.jsxs)("div",{className:"block-editor-block-patterns-explorer",children:[(0,U.jsx)(AS,{selectedCategory:r,patternCategories:i,onClickCategory:s,searchValue:n,setSearchValue:o}),(0,U.jsx)(XS,{searchValue:n,selectedCategory:r,patternCategories:i,rootClientId:t})]})}const ew=function({onModalClose:e,...t}){return(0,U.jsx)(Ns.Modal,{title:(0,C.__)("Patterns"),onRequestClose:e,isFullScreen:!0,children:(0,U.jsx)(JS,{...t})})};function tw({title:e}){return(0,U.jsx)(Ns.__experimentalVStack,{spacing:0,children:(0,U.jsx)(Ns.__experimentalView,{children:(0,U.jsx)(Ns.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,U.jsxs)(Ns.__experimentalHStack,{spacing:2,children:[(0,U.jsx)(Ns.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,C.isRTL)()?cy:uy,size:"small",label:(0,C.__)("Back")}),(0,U.jsx)(Ns.__experimentalSpacer,{children:(0,U.jsx)(Ns.__experimentalHeading,{level:5,children:e})})]})})})})}function nw({categories:e,children:t}){return(0,U.jsxs)(Ns.__experimentalNavigatorProvider,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation",children:[(0,U.jsx)(Ns.__experimentalNavigatorScreen,{path:"/",children:(0,U.jsx)(Ns.__experimentalItemGroup,{children:e.map((e=>(0,U.jsx)(Ns.__experimentalNavigatorButton,{path:`/category/${e.name}`,as:Ns.__experimentalItem,isAction:!0,children:(0,U.jsxs)(Ns.__experimentalHStack,{children:[(0,U.jsx)(Ns.FlexBlock,{children:e.label}),(0,U.jsx)(Ui,{icon:(0,C.isRTL)()?uy:cy})]})},e.name)))})}),e.map((e=>(0,U.jsxs)(Ns.__experimentalNavigatorScreen,{path:`/category/${e.name}`,children:[(0,U.jsx)(tw,{title:(0,C.__)("Back")}),t(e)]},e.name)))]})}const ow=e=>"all"!==e,rw=e=>e.name===pe.name;function sw({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:n,patternSourceFilter:o,scrollContainerRef:r,category:s}){const i=s.name===pe.name?ce.user:o,l=ow(i),c=rw(s),u=(0,a.useMemo)((()=>[{value:"all",label:(0,C._x)("All","patterns")},{value:ue.full,label:(0,C._x)("Synced","patterns"),disabled:l},{value:ue.unsynced,label:(0,C._x)("Not synced","patterns"),disabled:l}]),[l]),d=(0,a.useMemo)((()=>[{value:"all",label:(0,C._x)("All","patterns"),disabled:c},{value:ce.directory,label:(0,C.__)("Pattern Directory"),disabled:c},{value:ce.theme,label:(0,C.__)("Theme & Plugins"),disabled:c},{value:ce.user,label:(0,C.__)("User")}]),[c]);return(0,U.jsx)(U.Fragment,{children:(0,U.jsx)(Ns.DropdownMenu,{popoverProps:{placement:"right-end"},label:(0,C.__)("Filter patterns"),toggleProps:{size:"compact"},icon:(0,U.jsx)(Ui,{icon:(0,U.jsx)(Ns.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(Ns.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"currentColor"})})}),children:()=>(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.MenuGroup,{label:(0,C.__)("Source"),children:(0,U.jsx)(Ns.MenuItemsChoice,{choices:d,onSelect:n=>{var o;t(o=n),ow(o)&&e("all"),r.current?.scrollTo(0,0)},value:i})}),(0,U.jsx)(Ns.MenuGroup,{label:(0,C.__)("Type"),children:(0,U.jsx)(Ns.MenuItemsChoice,{choices:u,onSelect:t=>{e(t),r.current?.scrollTo(0,0)},value:n})}),(0,U.jsx)("div",{className:"block-editor-tool-selector__help",children:(0,a.createInterpolateElement)((0,C.__)("Patterns are available from the <Link>WordPress.org Pattern Directory</Link>, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."),{Link:(0,U.jsx)(Ns.ExternalLink,{href:(0,C.__)("https://wordpress.org/patterns/")})})})]})})})}const iw=()=>{};function lw({rootClientId:e,onInsert:t,onHover:n=iw,category:o,showTitlesAsTooltip:r}){const[s,,i]=WS(t,e,o?.name),[l,c]=(0,a.useState)("all"),[u,d]=(0,a.useState)("all"),p=QS(e,u),h=(0,a.useRef)(),g=(0,a.useMemo)((()=>s.filter((e=>!he(e,u,l)&&(o.name===de.name||(o.name===pe.name&&e.type===ce.user||("uncategorized"===o.name?!e.categories||!e.categories.some((e=>p.some((t=>t.name===e)))):e.categories?.includes(o.name))))))),[s,p,o.name,u,l]),m=qS(g,o,h),{changePage:f}=m;(0,a.useEffect)((()=>()=>n(null)),[]);const b=(0,a.useCallback)((e=>{c(e),f(1)}),[c,f]),v=(0,a.useCallback)((e=>{d(e),f(1)}),[d,f]);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Ns.__experimentalVStack,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header",children:[(0,U.jsxs)(Ns.__experimentalHStack,{children:[(0,U.jsx)(Ns.FlexBlock,{children:(0,U.jsx)(Ns.__experimentalHeading,{className:"block-editor-inserter__patterns-category-panel-title",size:13,level:4,as:"div",children:o.label})}),(0,U.jsx)(sw,{patternSyncFilter:l,patternSourceFilter:u,setPatternSyncFilter:b,setPatternSourceFilter:v,scrollContainerRef:h,category:o})]}),!g.length&&(0,U.jsx)(Ns.__experimentalText,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results",children:(0,C.__)("No results found")})]}),g.length>0&&(0,U.jsx)(GS,{ref:h,shownPatterns:m.categoryPatternsAsyncList,blockPatterns:m.categoryPatterns,onClickPattern:i,onHover:n,label:o.label,orientation:"vertical",category:o.name,isDraggable:!0,showTitlesAsTooltip:r,patternFilter:u,pagingProps:m})]})}const{Tabs:aw}=Q(Ns.privateApis);const cw=function({categories:e,selectedCategory:t,onSelectCategory:n,children:o}){return(0,U.jsxs)(aw,{className:"block-editor-inserter__category-tabs",selectOnMove:!1,selectedTabId:t?t.name:null,orientation:"vertical",onSelect:t=>{n(e.find((e=>e.name===t)))},children:[(0,U.jsx)(aw.TabList,{className:"block-editor-inserter__category-tablist",children:e.map((e=>(0,U.jsx)(aw.Tab,{tabId:e.name,className:"block-editor-inserter__category-tab","aria-label":e.label,"aria-current":e===t?"true":void 0,children:(0,U.jsxs)(Ns.__experimentalHStack,{children:[(0,U.jsx)(Ns.FlexBlock,{children:e.label}),(0,U.jsx)(Ui,{icon:(0,C.isRTL)()?uy:cy})]})},e.name)))}),e.map((e=>(0,U.jsx)(aw.TabPanel,{tabId:e.name,focusable:!1,className:"block-editor-inserter__category-panel",children:o},e.name)))]})};const uw=function({onSelectCategory:e,selectedCategory:t,onInsert:n,rootClientId:o,children:r}){const[s,i]=(0,a.useState)(!1),l=QS(o),d=(0,u.useViewportMatch)("medium","<");return(0,c.useSelect)((e=>Q(e($r)).isResolvingPatterns()),[])?(0,U.jsx)("div",{className:"block-editor-inserter__patterns-loading",children:(0,U.jsx)(Ns.Spinner,{})}):l.length?(0,U.jsxs)(U.Fragment,{children:[!d&&(0,U.jsxs)("div",{className:"block-editor-inserter__block-patterns-tabs-container",children:[(0,U.jsx)(cw,{categories:l,selectedCategory:t,onSelectCategory:e,children:r}),(0,U.jsx)(Ns.Button,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>i(!0),variant:"secondary",children:(0,C.__)("Explore all patterns")})]}),d&&(0,U.jsx)(nw,{categories:l,children:e=>(0,U.jsx)("div",{className:"block-editor-inserter__category-panel",children:(0,U.jsx)(lw,{onInsert:n,rootClientId:o,category:e,showTitlesAsTooltip:!1},e.name)})}),s&&(0,U.jsx)(ew,{initialCategory:t||l[0],patternCategories:l,onModalClose:()=>i(!1),rootClientId:o})]}):(0,U.jsx)(IS,{})};function dw({rootClientId:e,onInsert:t,onHover:n,category:o,showTitlesAsTooltip:r,patternFilter:s}){return(0,U.jsx)(lw,{rootClientId:e,onInsert:t,onHover:n,category:o,showTitlesAsTooltip:r,patternFilter:s},o.name)}function pw(e){return Zf(),(0,U.jsx)(dw,{...e})}function hw(e){return window.__experimentalEnableZoomedOutPatternsTab?(0,U.jsx)(pw,{...e}):(0,U.jsx)(dw,{...e})}const gw=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})}),mw={image:"img",video:"video",audio:"audio"};function fw(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},o=e.url,r=e.alt||void 0;"image"===t?(n.url=o,n.alt=r):["video","audio"].includes(t)&&(n.src=o);const s=mw[t],i=(0,U.jsx)(s,{src:e.previewUrl||o,alt:r,controls:"audio"===t||void 0,inert:"true",onError:({currentTarget:t})=>{t.src===e.previewUrl&&(t.src=o)}});return[(0,l.createBlock)(`core/${t}`,n),i]}const bw=["image"],vw=25,kw={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"},{CompositeItemV2:_w}=Q(Ns.privateApis);function xw({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return(0,U.jsx)(Ns.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,C.__)("Options"),popoverProps:kw,icon:ev,children:()=>(0,U.jsx)(Ns.MenuGroup,{children:(0,U.jsx)(Ns.MenuItem,{onClick:()=>window.open(n,"_blank").focus(),icon:gw,children:(0,C.sprintf)((0,C.__)("Report %s"),e.mediaType)})})})}function yw({onClose:e,onSubmit:t}){return(0,U.jsxs)(Ns.Modal,{title:(0,C.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",children:[(0,U.jsxs)(Ns.__experimentalVStack,{spacing:3,children:[(0,U.jsx)("p",{children:(0,C.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")}),(0,U.jsx)("p",{children:(0,C.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation.")})]}),(0,U.jsxs)(Ns.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,U.jsx)(Ns.FlexItem,{children:(0,U.jsx)(Ns.Button,{variant:"tertiary",onClick:e,children:(0,C.__)("Cancel")})}),(0,U.jsx)(Ns.FlexItem,{children:(0,U.jsx)(Ns.Button,{variant:"primary",onClick:t,children:(0,C.__)("Insert")})})]})]})}function Sw({media:e,onClick:t,category:n}){const[o,r]=(0,a.useState)(!1),[s,i]=(0,a.useState)(!1),[u,d]=(0,a.useState)(!1),[p,h]=(0,a.useMemo)((()=>fw(e,n.mediaType)),[e,n.mediaType]),{createErrorNotice:g,createSuccessNotice:m}=(0,c.useDispatch)(To.store),{getSettings:f}=(0,c.useSelect)($r),b=(0,a.useCallback)((e=>{if(u)return;const n=f(),o=(0,l.cloneBlock)(e),{id:s,url:i,caption:a}=o.attributes;s||n.mediaUpload?s?t(o):(d(!0),window.fetch(i).then((e=>e.blob())).then((e=>{n.mediaUpload({filesList:[e],additionalData:{caption:a},onFileChange([e]){(0,aa.isBlobURL)(e.url)||(t({...o,attributes:{...o.attributes,id:e.id,url:e.url}}),m((0,C.__)("Image uploaded and inserted."),{type:"snackbar"}),d(!1))},allowedTypes:bw,onError(e){g(e,{type:"snackbar"}),d(!1)}})})).catch((()=>{r(!0),d(!1)}))):r(!0)}),[u,f,t,m,g]),v="string"==typeof e.title?e.title:e.title?.rendered||(0,C.__)("no title");let k;if(v.length>vw){const e="...";k=v.slice(0,vw-e.length)+e}const _=(0,a.useCallback)((()=>i(!0)),[]),x=(0,a.useCallback)((()=>i(!1)),[]);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(fS,{isEnabled:!0,blocks:[p],children:({draggable:t,onDragStart:o,onDragEnd:r})=>(0,U.jsx)("div",{className:Bs("block-editor-inserter__media-list__list-item",{"is-hovered":s}),draggable:t,onDragStart:o,onDragEnd:r,children:(0,U.jsxs)("div",{onMouseEnter:_,onMouseLeave:x,children:[(0,U.jsx)(Ns.Tooltip,{text:k||v,children:(0,U.jsx)(_w,{render:(0,U.jsx)("div",{"aria-label":v,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>b(p),children:(0,U.jsxs)("div",{className:"block-editor-inserter__media-list__item-preview",children:[h,u&&(0,U.jsx)("div",{className:"block-editor-inserter__media-list__item-preview-spinner",children:(0,U.jsx)(Ns.Spinner,{})})]})})}),!u&&(0,U.jsx)(xw,{category:n,media:e})]})})}),o&&(0,U.jsx)(yw,{onClose:()=>r(!1),onSubmit:()=>{t((0,l.cloneBlock)(p)),m((0,C.__)("Image inserted."),{type:"snackbar"}),r(!1)}})]})}const{CompositeV2:ww,useCompositeStoreV2:Cw}=Q(Ns.privateApis);const Bw=function({mediaList:e,category:t,onClick:n,label:o=(0,C.__)("Media List")}){const r=Cw();return(0,U.jsx)(ww,{store:r,role:"listbox",className:"block-editor-inserter__media-list","aria-label":o,children:e.map(((e,o)=>(0,U.jsx)(Sw,{media:e,category:t,onClick:n},e.id||e.sourceId||o)))})};const Iw=10;function jw({rootClientId:e,onInsert:t,category:n}){const[o,r,s]=(0,u.useDebouncedInput)(),{mediaList:i,isLoading:l}=function(e,t={}){const[n,o]=(0,a.useState)(),[r,s]=(0,a.useState)(!1),i=(0,a.useRef)();return(0,a.useEffect)((()=>{(async()=>{const n=JSON.stringify({category:e.name,...t});i.current=n,s(!0),o([]);const r=await(e.fetch?.(t));n===i.current&&(o(r),s(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}(n,{per_page:s?20:Iw,search:s}),c="block-editor-inserter__media-panel",d=n.labels.search_items||(0,C.__)("Search");return(0,U.jsxs)("div",{className:c,children:[(0,U.jsx)(Ns.SearchControl,{className:`${c}-search`,onChange:r,value:o,label:d,placeholder:d}),l&&(0,U.jsx)("div",{className:`${c}-spinner`,children:(0,U.jsx)(Ns.Spinner,{})}),!l&&!i?.length&&(0,U.jsx)(IS,{}),!l&&!!i?.length&&(0,U.jsx)(Bw,{rootClientId:e,onClick:t,mediaList:i,category:n})]})}const Ew=["image","video","audio"];const Tw=function({rootClientId:e,selectedCategory:t,onSelectCategory:n,onInsert:o,children:r}){const s=function(e){const[t,n]=(0,a.useState)([]),o=(0,c.useSelect)((e=>Q(e($r)).getInserterMediaCategories()),[]),{canInsertImage:r,canInsertVideo:s,canInsertAudio:i}=(0,c.useSelect)((t=>{const{canInsertBlockType:n}=t($r);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]);return(0,a.useEffect)((()=>{(async()=>{const e=[];if(!o)return;const t=new Map(await Promise.all(o.map((async e=>{if(e.isExternalResource)return[e.name,!0];let t=[];try{t=await e.fetch({per_page:1})}catch(e){}return[e.name,!!t.length]})))),l={image:r,video:s,audio:i};o.forEach((n=>{l[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[r,s,i,o]),t}(e),i=(0,u.useViewportMatch)("medium","<"),l=(0,a.useCallback)((e=>{if(!e?.url)return;const[t]=fw(e,e.type);o(t)}),[o]),d=(0,a.useMemo)((()=>s.map((e=>({...e,label:e.labels.name})))),[s]);return d.length?(0,U.jsxs)(U.Fragment,{children:[!i&&(0,U.jsxs)("div",{className:"block-editor-inserter__media-tabs-container",children:[(0,U.jsx)(cw,{categories:d,selectedCategory:t,onSelectCategory:n,children:r}),(0,U.jsx)(ga,{children:(0,U.jsx)(ha,{multiple:!1,onSelect:l,allowedTypes:Ew,render:({open:e})=>(0,U.jsx)(Ns.Button,{onClick:t=>{t.target.focus(),e()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal",children:(0,C.__)("Open Media Library")})})})]}),i&&(0,U.jsx)(nw,{categories:d,children:t=>(0,U.jsx)(jw,{onInsert:o,rootClientId:e,category:t})})]}):(0,U.jsx)(IS,{})},{Fill:Mw,Slot:Pw}=(0,Ns.createSlotFill)("__unstableInserterMenuExtension");Mw.Slot=Pw;const Rw=Mw,Nw=[];const Aw=function({filterValue:e,onSelect:t,onHover:n,onHoverPattern:o,rootClientId:r,clientId:s,isAppender:i,__experimentalInsertionIndex:l,maxBlockPatterns:d,maxBlockTypes:p,showBlockDirectory:h=!1,isDraggable:g=!0,shouldFocusBlock:m=!0,prioritizePatterns:f,selectBlockOnInsert:b,isQuick:v}){const k=(0,u.useDebounce)(Eo.speak,500),{prioritizedBlocks:_}=(0,c.useSelect)((e=>{const t=e($r).getBlockListSettings(r);return{prioritizedBlocks:t?.prioritizedInserterBlocks||Nw}}),[r]),[x,y]=$S({onSelect:t,rootClientId:r,clientId:s,isAppender:i,insertionIndex:l,shouldFocusBlock:m,selectBlockOnInsert:b}),[S,w,B,I]=Eb(x,y,v),[j,,E]=WS(y,x),T=(0,a.useMemo)((()=>{if(0===d)return[];const t=Ib(j,e);return void 0!==d?t.slice(0,d):t}),[e,j,d]);let M=p;f&&T.length>2&&(M=0);const P=(0,a.useMemo)((()=>{if(0===M)return[];let t=ae(S.filter((e=>"core/block"!==e.name)),"frecency","desc");!e&&_.length&&(t=Tb(t,_));const n=Bb(t,w,B,e);return void 0!==M?n.slice(0,M):n}),[e,S,w,B,M,_]);(0,a.useEffect)((()=>{if(!e)return;const t=P.length+T.length,n=(0,C.sprintf)((0,C._n)("%d result found.","%d results found.",t),t);k(n)}),[e,k,P,T]);const R=(0,u.useAsyncList)(P,{step:9}),N=(0,u.useAsyncList)(R.length===P.length?T:Nw),A=P.length>0||T.length>0,L=!!P.length&&(0,U.jsx)(SS,{title:(0,U.jsx)(Ns.VisuallyHidden,{children:(0,C.__)("Blocks")}),children:(0,U.jsx)(yS,{items:R,onSelect:I,onHover:n,label:(0,C.__)("Blocks"),isDraggable:g})}),O=!!T.length&&(0,U.jsx)(SS,{title:(0,U.jsx)(Ns.VisuallyHidden,{children:(0,C.__)("Block patterns")}),children:(0,U.jsx)("div",{className:"block-editor-inserter__quick-inserter-patterns",children:(0,U.jsx)(GS,{shownPatterns:N,blockPatterns:T,onClickPattern:E,onHover:o,isDraggable:g})})});return(0,U.jsxs)(BS,{children:[!h&&!A&&(0,U.jsx)(IS,{}),f?O:L,!!P.length&&!!T.length&&(0,U.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),f?L:O,h&&(0,U.jsx)(Rw.Slot,{fillProps:{onSelect:I,onHover:n,filterValue:e,hasItems:A,rootClientId:x},children:e=>e.length?e:A?null:(0,U.jsx)(IS,{})})]})},Lw=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})}),{Tabs:Ow}=Q(Ns.privateApis),Dw={name:"blocks",title:(0,C.__)("Blocks")},zw={name:"patterns",title:(0,C.__)("Patterns")},Vw={name:"media",title:(0,C.__)("Media")};const Fw=(0,a.forwardRef)((function({onSelect:e,children:t,onClose:n,selectedTab:o},r){const s=[Dw,zw,Vw];return(0,U.jsx)("div",{className:"block-editor-inserter__tabs",ref:r,children:(0,U.jsxs)(Ow,{onSelect:e,selectedTabId:o,children:[(0,U.jsxs)("div",{className:"block-editor-inserter__tablist-and-close-button",children:[(0,U.jsx)(Ns.Button,{className:"block-editor-inserter__close-button",icon:Lw,label:(0,C.__)("Close block inserter"),onClick:()=>n(),size:"small"}),(0,U.jsx)(Ow.TabList,{className:"block-editor-inserter__tablist",children:s.map((e=>(0,U.jsx)(Ow.Tab,{tabId:e.name,className:"block-editor-inserter__tab",children:e.title},e.name)))})]}),s.map((e=>(0,U.jsx)(Ow.TabPanel,{tabId:e.name,focusable:!1,className:"block-editor-inserter__tabpanel",children:t},e.name)))]})})})),Hw=()=>{};const Gw=(0,a.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,onSelect:r,showInserterHelpPanel:s,showMostUsedBlocks:i,__experimentalFilterValue:l="",shouldFocusBlock:d=!0,onPatternCategorySelection:p,onClose:h,__experimentalInitialTab:g,__experimentalInitialCategory:m},f){const b=(0,c.useSelect)((e=>"zoom-out"===e($r).__unstableGetEditorMode()),[]),[v,k,_]=(0,u.useDebouncedInput)(l),[x,y]=(0,a.useState)(null),[S,w]=(0,a.useState)(m),[B,I]=(0,a.useState)("all"),[j,E]=(0,a.useState)(null),[T,M]=(0,a.useState)(g),[P,R,N]=$S({rootClientId:e,clientId:t,isAppender:n,insertionIndex:o,shouldFocusBlock:d}),A=(0,a.useRef)(),L=(0,a.useCallback)(((e,t,n,o)=>{R(e,t,n,o),r(),window.requestAnimationFrame((()=>{d||A?.current.contains(f.current.ownerDocument.activeElement)||A?.current.querySelector("button").focus()}))}),[R,r,d]),O=(0,a.useCallback)(((e,t)=>{R(e,{patternName:t}),r()}),[R,r]),D=(0,a.useCallback)((e=>{N(e),y(e)}),[N,y]),z=(0,a.useCallback)((e=>{N(!!e)}),[N]),V=(0,a.useCallback)(((e,t)=>{w(e),I(t),p?.()}),[w,p]),F="patterns"===T&&!_&&!!S,H="media"===T&&!!j,G=(0,a.useMemo)((()=>"media"===T?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{x&&y(null),k(e)},value:v,label:(0,C.__)("Search for blocks and patterns"),placeholder:(0,C.__)("Search")}),!!_&&(0,U.jsx)(Aw,{filterValue:_,onSelect:r,onHover:D,onHoverPattern:z,rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,showBlockDirectory:!0,shouldFocusBlock:d,prioritizePatterns:"patterns"===T})]})),[T,x,y,k,v,_,r,D,z,d,t,e,o,n]),$=(0,a.useMemo)((()=>(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("div",{className:"block-editor-inserter__block-list",children:(0,U.jsx)(PS,{ref:A,rootClientId:P,onInsert:L,onHover:D,showMostUsedBlocks:i})}),s&&(0,U.jsxs)("div",{className:"block-editor-inserter__tips",children:[(0,U.jsx)(Ns.VisuallyHidden,{as:"h2",children:(0,C.__)("A tip for using the block editor")}),(0,U.jsx)(ay,{})]})]})),[P,L,D,i,s]),W=(0,a.useMemo)((()=>(0,U.jsx)(uw,{rootClientId:P,onInsert:O,onSelectCategory:V,selectedCategory:S,children:F&&(0,U.jsx)(hw,{rootClientId:P,onInsert:O,onHover:z,category:S,patternFilter:B,showTitlesAsTooltip:!0})})),[P,z,O,V,B,S,F]),K=(0,a.useMemo)((()=>(0,U.jsx)(Tw,{rootClientId:P,selectedCategory:j,onSelectCategory:E,onInsert:L,children:H&&(0,U.jsx)(jw,{rootClientId:P,onInsert:L,category:j})})),[P,L,j,E,H]),Z=(0,a.useRef)();return(0,a.useLayoutEffect)((()=>{Z.current&&window.requestAnimationFrame((()=>{Z.current.querySelector('[role="tab"][aria-selected="true"]')?.focus()}))}),[]),(0,U.jsxs)("div",{className:Bs("block-editor-inserter__menu",{"show-panel":F||H,"is-zoom-out":b}),ref:f,children:[(0,U.jsx)("div",{className:"block-editor-inserter__main-area",children:(0,U.jsxs)(Fw,{ref:Z,onSelect:e=>{"patterns"!==e&&w(null),M(e)},onClose:h,selectedTab:T,children:[G,"blocks"===T&&!_&&$,"patterns"===T&&!_&&W,"media"===T&&K]})}),s&&x&&(0,U.jsx)(Ns.Popover,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1,children:(0,U.jsx)(dS,{item:x})})]})}));const Uw=(0,a.forwardRef)((function(e,t){return(0,U.jsx)(Gw,{...e,onPatternCategorySelection:Hw,ref:t})}));function $w({onSelect:e,rootClientId:t,clientId:n,isAppender:o,prioritizePatterns:r,selectBlockOnInsert:s,hasSearch:i=!0}){const[l,u]=(0,a.useState)(""),[d,p]=$S({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:s}),[h]=Eb(d,p,!0),[g]=WS(p,d),{setInserterIsOpened:m,insertionIndex:f}=(0,c.useSelect)((e=>{const{getSettings:t,getBlockIndex:o,getBlockCount:r}=e($r),s=t(),i=o(n),l=r();return{setInserterIsOpened:s.__experimentalSetIsInserterOpened,insertionIndex:-1===i?l:i}}),[n]),b=g.length&&(!!l||r),v=i&&(b&&g.length>6||h.length>6);(0,a.useEffect)((()=>{m&&m(!1)}),[m]);let k=0;return b&&(k=r?4:2),(0,U.jsxs)("div",{className:Bs("block-editor-inserter__quick-inserter",{"has-search":v,"has-expand":m}),children:[v&&(0,U.jsx)(Ns.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:l,onChange:e=>{u(e)},label:(0,C.__)("Search for blocks and patterns"),placeholder:(0,C.__)("Search")}),(0,U.jsx)("div",{className:"block-editor-inserter__quick-inserter-results",children:(0,U.jsx)(Aw,{filterValue:l,onSelect:e,rootClientId:t,clientId:n,isAppender:o,maxBlockPatterns:k,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:r,selectBlockOnInsert:s,isQuick:!0})}),m&&(0,U.jsx)(Ns.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{m({rootClientId:t,insertionIndex:f,filterValue:l})},"aria-label":(0,C.__)("Browse all. This will open the main inserter panel in the editor toolbar."),children:(0,C.__)("Browse all")})]})}const Ww=({onToggle:e,disabled:t,isOpen:n,blockTitle:o,hasSingleBlockType:r,toggleProps:s={},prioritizePatterns:i})=>{const{as:l=Ns.Button,label:a,onClick:c,...u}=s;let d=a;return!d&&r?d=(0,C.sprintf)((0,C._x)("Add %s","directly add the only allowed block"),o):!d&&i?d=(0,C.__)("Add pattern"):d||(d=(0,C._x)("Add block","Generic label for block inserter button")),(0,U.jsx)(l,{icon:Ba,label:d,tooltipPosition:"bottom",onClick:function(t){e&&e(t),c&&c(t)},className:"block-editor-inserter__toggle","aria-haspopup":!r&&"true","aria-expanded":!r&&n,disabled:t,...u})};class Kw extends a.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({onToggle:e,isOpen:t}){const{disabled:n,blockTitle:o,hasSingleBlockType:r,directInsertBlock:s,toggleProps:i,hasItems:l,renderToggle:a=Ww,prioritizePatterns:c}=this.props;return a({onToggle:e,isOpen:t,disabled:n||!l,blockTitle:o,hasSingleBlockType:r,directInsertBlock:s,toggleProps:i,prioritizePatterns:c})}renderContent({onClose:e}){const{rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r,__experimentalIsQuick:s,prioritizePatterns:i,onSelectOrClose:l,selectBlockOnInsert:a}=this.props;return s?(0,U.jsx)($w,{onSelect:t=>{const n=Array.isArray(t)&&t?.length?t[0]:t;l&&"function"==typeof l&&l(n),e()},rootClientId:t,clientId:n,isAppender:o,prioritizePatterns:i,selectBlockOnInsert:a}):(0,U.jsx)(Uw,{onSelect:()=>{e()},rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:s}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,U.jsx)(Ns.Dropdown,{className:"block-editor-inserter",contentClassName:Bs("block-editor-inserter__popover",{"is-quick":r}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,C.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:s})}}const Zw=(0,u.compose)([(0,c.withSelect)(((e,{clientId:t,rootClientId:n,shouldDirectInsert:o=!0})=>{const{getBlockRootClientId:r,hasInserterItems:s,getAllowedBlocks:i,getDirectInsertBlock:a,getSettings:c}=e($r),{getBlockVariations:u}=e(l.store),d=i(n=n||r(t)||void 0),p=o&&a(n),h=c(),g=1===d?.length&&0===u(d[0].name,"inserter")?.length;let m=!1;return g&&(m=d[0]),{hasItems:s(n),hasSingleBlockType:g,blockTitle:m?m.title:"",allowedBlockType:m,directInsertBlock:p,rootClientId:n,prioritizePatterns:h.__experimentalPreferPatternsOnRoot&&!n}})),(0,c.withDispatch)(((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:o,clientId:r,isAppender:s,hasSingleBlockType:i,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!i&&!c)return;const{insertBlock:p}=e($r);let h;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:s}=n($r);if(!e||!r&&!o)return{};const i={};let l={};if(r){const e=t(r),n=t(s(r));e?.name===n?.name&&(l=n?.attributes||{})}else{const e=t(o);if(e?.innerBlocks?.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&c?.name===t.name&&(l=t.attributes)}}return e.forEach((e=>{l.hasOwnProperty(e)&&(i[e]=l[e])})),i}(c.attributesToCopy);h=(0,l.createBlock)(c.name,{...c.attributes||{},...e})}else h=(0,l.createBlock)(a.name);p(h,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:i,getBlockRootClientId:l}=n($r);if(r)return e(r);const a=t();return!s&&a&&l(a)===o?e(a)+1:i(o).length}(),o,d),u&&u({clientId:h?.clientId});const g=(0,C.sprintf)((0,C.__)("%s block added"),a.title);(0,Eo.speak)(g)}}))),(0,u.ifCondition)((({hasItems:e,isAppender:t,rootClientId:n,clientId:o})=>e||!t&&!n&&!o))])(Kw),qw=(0,a.forwardRef)(((e,t)=>(0,U.jsx)(Zw,{ref:t,...e}))),Yw="\ufeff";function Xw({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:o}=(0,c.useSelect)((t=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=t($r),s=!n(e),{bodyPlaceholder:i}=o();return{showPrompt:s,isLocked:!!r(e),placeholder:i}}),[e]),{insertDefaultBlock:r,startTyping:s}=(0,c.useDispatch)($r);if(n)return null;const i=(0,iy.decodeEntities)(o)||(0,C.__)("Type / to choose a block"),l=()=>{r(void 0,e),s()};return(0,U.jsxs)("div",{"data-root-client-id":e||"",className:Bs("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,U.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,C.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{ca.ENTER!==e.keyCode&&ca.SPACE!==e.keyCode||l()},onClick:()=>l(),onFocus:()=>{t&&l()},children:t?i:Yw}),(0,U.jsx)(qw,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}function Qw({rootClientId:e,className:t,onFocus:n,tabIndex:o},r){return(0,U.jsx)(qw,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,renderToggle:({onToggle:e,disabled:s,isOpen:i,blockTitle:l,hasSingleBlockType:a})=>{let c;c=a?(0,C.sprintf)((0,C._x)("Add %s","directly add the only allowed block"),l):(0,C._x)("Add block","Generic label for block inserter button");const u=!a;let d=(0,U.jsxs)(Ns.Button,{ref:r,onFocus:n,tabIndex:o,className:Bs(t,"block-editor-button-block-appender"),onClick:e,"aria-haspopup":u?"true":void 0,"aria-expanded":u?i:void 0,disabled:s,label:c,children:[!a&&(0,U.jsx)(Ns.VisuallyHidden,{as:"span",children:c}),(0,U.jsx)(Ui,{icon:Ba})]});return(u||a)&&(d=(0,U.jsx)(Ns.Tooltip,{text:c,children:d})),d},isAppender:!0})}const Jw=(0,a.forwardRef)(((e,t)=>(y()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Qw(e,t)))),eC=(0,a.forwardRef)(Qw);function tC({rootClientId:e}){return(0,c.useSelect)((t=>t($r).canInsertBlockType((0,l.getDefaultBlockName)(),e)))?(0,U.jsx)(Xw,{rootClientId:e}):(0,U.jsx)(eC,{rootClientId:e,className:"block-list-appender__toggle"})}function nC({rootClientId:e,CustomAppender:t,className:n,tagName:o="div"}){const r=(0,c.useSelect)((t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:o,getBlockCount:r}=t($r),s=n();return o()&&e===s?.rootClientId&&0===r(e)}),[e]);return(0,U.jsx)(o,{tabIndex:-1,className:Bs("block-list-appender wp-block",n,{"is-drag-over":r}),contentEditable:!1,"data-block":!0,children:t?(0,U.jsx)(t,{}):(0,U.jsx)(tC,{rootClientId:e})})}const oC=Number.MAX_SAFE_INTEGER;(0,a.createContext)();const rC=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,operation:s="insert",nearestSide:i="right",...l}){const[u,d]=(0,a.useReducer)((e=>(e+1)%oC),0),{orientation:p,rootClientId:h,isVisible:g}=(0,c.useSelect)((n=>{const{getBlockListSettings:o,getBlockRootClientId:r,isBlockVisible:s}=n($r),i=r(null!=e?e:t);return{orientation:o(i)?.orientation||"vertical",rootClientId:i,isVisible:s(e)&&s(t)}}),[e,t]),m=Ji(e),f=Ji(t),b="vertical"===p,v=(0,a.useMemo)((()=>{if(u<0||!m&&!f||!g)return;return{contextElement:"group"===s?f||m:m||f,getBoundingClientRect(){const e=m?m.getBoundingClientRect():null,t=f?f.getBoundingClientRect():null;let n=0,o=0,r=0,l=0;if("group"===s){const s=t||e;o=s.top,r=0,l=s.bottom-s.top,n="left"===i?s.left-2:s.right-2}else b?(o=e?e.bottom:t.top,r=e?e.width:t.width,l=t&&e?t.top-e.bottom:0,n=e?e.left:t.left):(o=e?e.top:t.top,l=e?e.height:t.height,(0,C.isRTL)()?(n=t?t.right:e.left,r=e&&t?e.left-t.right:0):(n=e?e.right:t.left,r=e&&t?t.left-e.right:0));return new window.DOMRect(n,o,r,l)}}}),[m,f,u,b,g,s,i]),k=el(r);return(0,a.useLayoutEffect)((()=>{if(!m)return;const e=new window.MutationObserver(d);return e.observe(m,{attributes:!0}),()=>{e.disconnect()}}),[m]),(0,a.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(d);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]),(0,a.useLayoutEffect)((()=>{if(m)return m.ownerDocument.defaultView.addEventListener("resize",d),()=>{m.ownerDocument.defaultView?.removeEventListener("resize",d)}}),[m]),(m||f)&&g?(0,U.jsx)(Ns.Popover,{ref:k,animate:!1,anchor:v,focusOnMount:!1,__unstableSlotName:o,inline:!o,...l,className:Bs("block-editor-block-popover","block-editor-block-popover__inbetween",l.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,U.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:n})},t+"--"+h):null},sC={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};const iC=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,c.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e($r),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}}),[]),o=(0,u.useReducedMotion)();return(0,U.jsx)(sl,{clientId:n,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,U.jsx)(Ns.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:o?sC.show:sC.hide,animate:sC.show,exit:o?sC.show:sC.exit,className:"block-editor-block-popover__drop-zone-foreground"})})},lC=(0,a.createContext)();function aC({__unstablePopoverSlot:e,__unstableContentRef:t,operation:n="insert",nearestSide:o="right"}){const{selectBlock:r,hideInsertionPoint:s}=(0,c.useDispatch)($r),i=(0,a.useContext)(lC),l=(0,a.useRef)(),{orientation:d,previousClientId:p,nextClientId:h,rootClientId:g,isInserterShown:m,isDistractionFree:f,isNavigationMode:b}=(0,c.useSelect)((e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:o,isBlockBeingDragged:r,getPreviousBlockClientId:s,getNextBlockClientId:i,getSettings:l,isNavigationMode:a}=e($r),c=o(),u=t(c.rootClientId);if(!u.length)return{};let d=u[c.index-1],p=u[c.index];for(;r(d);)d=s(d);for(;r(p);)p=i(p);const h=l();return{previousClientId:d,nextClientId:p,orientation:n(c.rootClientId)?.orientation||"vertical",rootClientId:c.rootClientId,isNavigationMode:a(),isDistractionFree:h.isDistractionFree,isInserterShown:c?.__unstableWithInserter}}),[]),{getBlockEditingMode:v}=(0,c.useSelect)($r),k=(0,u.useReducedMotion)();const _={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:m?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},x={start:{scale:k?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(f&&!b)return null;const y=Bs("block-editor-block-list__insertion-point","horizontal"===d||"group"===n?"is-horizontal":"is-vertical");return(0,U.jsx)(rC,{previousClientId:p,nextClientId:h,__unstablePopoverSlot:e,__unstableContentRef:t,operation:n,nearestSide:o,children:(0,U.jsxs)(Ns.__unstableMotion.div,{layout:!k,initial:k?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:l,tabIndex:-1,onClick:function(e){e.target===l.current&&h&&"disabled"!==v(h)&&r(h,-1)},onFocus:function(e){e.target!==l.current&&(i.current=!0)},className:Bs(y,{"is-with-inserter":m}),onHoverEnd:function(e){e.target!==l.current||i.current||s()},children:[(0,U.jsx)(Ns.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),m&&(0,U.jsx)(Ns.__unstableMotion.div,{variants:x,className:Bs("block-editor-block-list__insertion-point-inserter"),children:(0,U.jsx)(qw,{position:"bottom center",clientId:h,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{i.current=e},onSelectOrClose:()=>{i.current=!1}})})]})})}function cC(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:o}=(0,c.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:o}=e($r),r=t();return{insertionPoint:r,isVisible:n(),isBlockListEmpty:0===o(r?.rootClientId)}}),[]);return!n||o?null:"replace"===t.operation?(0,U.jsx)(iC,{...e},`${t.rootClientId}-${t.index}`):(0,U.jsx)(aC,{operation:t.operation,nearestSide:t.nearestSide,...e})}function uC(){const e=(0,a.useContext)(lC),t=(0,c.useSelect)((e=>e($r).getSettings().isDistractionFree||"zoom-out"===e($r).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockIndex:o,isMultiSelecting:r,getSelectedBlockClientIds:s,getTemplateLock:i,__unstableIsWithinBlockOverlay:l,getBlockEditingMode:d,getBlockName:p}=(0,c.useSelect)($r),{showInsertionPoint:h,hideInsertionPoint:g}=(0,c.useDispatch)($r);return(0,u.useRefEffect)((a=>{if(!t)return a.addEventListener("mousemove",c),()=>{a.removeEventListener("mousemove",c)};function c(t){if(void 0===e||e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(r())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void g();let a;if(!t.target.classList.contains("is-root-container")){a=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(i(a)||"disabled"===d(a)||"core/block"===p(a))return;const c=n(a)?.orientation||"vertical",u=t.clientY,m=t.clientX;let f=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===c&&t.top>u||e.classList.contains("wp-block")&&"horizontal"===c&&((0,C.isRTL)()?t.right<m:t.left>m)}));if(!f)return void g();if(!f.id&&(f=f.firstElementChild,!f))return void g();const b=f.id.slice(6);if(!b||l(b))return;if(s().includes(b))return;const v=f.getBoundingClientRect();if("horizontal"===c&&(t.clientY>v.bottom||t.clientY<v.top)||"vertical"===c&&(t.clientX>v.right||t.clientX<v.left))return void g();const k=o(b);0!==k?h(a,k,{__unstableWithInserter:!0}):g()}}),[e,n,o,r,h,g,s,t])}const dC=(0,u.createHigherOrderComponent)((e=>t=>{const{clientId:n}=_();return(0,U.jsx)(e,{...t,clientId:n})}),"withClientId"),pC=dC((({clientId:e,showSeparator:t,isFloating:n,onAddBlock:o,isToggle:r})=>(0,U.jsx)(eC,{className:Bs({"block-list-appender__toggle":r}),rootClientId:e,showSeparator:t,isFloating:n,onAddBlock:o}))),hC=(0,u.compose)([dC,(0,c.withSelect)(((e,{clientId:t})=>{const{getBlockOrder:n}=e($r),o=n(t);return{lastBlockClientId:o[o.length-1]}}))])((({clientId:e})=>(0,U.jsx)(Xw,{rootClientId:e}))),gC=new WeakMap;function mC(e,t,n,o,r,s,i,l,u,d,p,h){const g=(0,c.useRegistry)(),m=function(e){const[t,n]=(0,a.useState)(e);return fa()(t,e)||n(e),t}(n),f=(0,a.useMemo)((()=>o),o),b=void 0===u||"contentOnly"===t?t:u;(0,a.useLayoutEffect)((()=>{const t={allowedBlocks:m,prioritizedInserterBlocks:f,templateLock:b};if(void 0!==d&&(t.__experimentalCaptureToolbars=d),void 0!==p)t.orientation=p;else{const e=bl(h?.type);t.orientation=e.getOrientation(h)}void 0!==i&&(y()("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),t.defaultBlock=i),void 0!==r&&(t.defaultBlock=r),void 0!==l&&(y()("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),t.directInsert=l),void 0!==s&&(t.directInsert=s),void 0!==t.directInsert&&"boolean"!=typeof t.directInsert&&y()("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),gC.get(g)||gC.set(g,{}),gC.get(g)[e]=t,window.queueMicrotask((()=>{const e=gC.get(g);if(Object.keys(e).length){const{updateBlockListSettings:t}=g.dispatch($r);t(e),gC.set(g,{})}}))}),[e,m,f,b,r,s,i,l,d,p,h,g])}function fC(e,t,n,o,r,s,i,a,c){return u=>{const{srcRootClientId:d,srcClientIds:p,type:h,blocks:g}=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}(u);if("inserter"===h){i();const e=g.map((e=>(0,l.cloneBlock)(e)));s(e,!0,null)}if("block"===h){const i=n(p[0]);if(d===e&&i===t)return;if(p.includes(e)||o(p).some((t=>t===e)))return;if("group"===a){const e=p.map((e=>c(e)));return void s(e,!0,null,p)}const l=d===e,u=p.length;r(p,d,l&&i<t?t-u:t)}}}function bC(e,t,n={}){const{operation:o="insert",nearestSide:r="right"}=n,{canInsertBlockType:s,getBlockIndex:i,getClientIdsOfDescendants:u,getBlockOrder:d,getBlocksByClientId:p,getSettings:h,getBlock:g,isGroupable:m}=(0,c.useSelect)($r),{getGroupingBlockName:f}=(0,c.useSelect)(l.store),{insertBlocks:b,moveBlocksToPosition:v,updateBlockAttributes:k,clearSelectedBlock:_,replaceBlocks:x,removeBlocks:y}=(0,c.useDispatch)($r),S=(0,c.useRegistry)(),w=(0,a.useCallback)(((n,i=!0,a=0,c=[])=>{Array.isArray(n)||(n=[n]);const u=d(e)[t],p=n.map((e=>e.clientId)),h=m([...p,u]);if("replace"===o)x(u,n,void 0,a);else if("group"===o&&h){const t=g(u);"left"===r?n.push(t):n.unshift(t);const o=n.map((e=>(0,l.createBlock)(e.name,e.attributes,e.innerBlocks))),i=n.every((e=>"core/image"===e.name)),d=s("core/gallery",e),p=(0,l.createBlock)(i&&d?"core/gallery":f(),{layout:{type:"flex",flexWrap:i&&d?null:"nowrap"}},o);x([u,...c],p,void 0,a)}else b(n,t,e,i,a)}),[d,e,t,m,o,x,g,r,s,f,b]),C=(0,a.useCallback)(((n,r,s)=>{if("replace"===o){const o=p(n),r=d(e)[t];S.batch((()=>{y(n,!1),x(r,o,void 0,0)}))}else v(n,r,e,s)}),[o,d,p,v,S,y,x,t,e]),B=fC(e,t,i,u,C,w,_,o,g),I=function(e,t,n,o,r){return s=>{if(!t().mediaUpload)return;const i=(0,l.findTransform)((0,l.getBlockTransforms)("from"),(t=>"files"===t.type&&o(t.blockName,e)&&t.isMatch(s)));if(i){const e=i.transform(s,n);r(e)}}}(e,h,k,s,w),j=function(e){return t=>{const n=(0,l.pasteHandler)({HTML:t,mode:"BLOCKS"});n.length&&e(n)}}(w);return e=>{const t=(0,la.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?j(n):t.length?I(t):B(e)}}function vC(e,t,n=["top","bottom","left","right"]){let o,r;return n.forEach((n=>{const s=function(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:s}=e,i=o?r:s,l=o?s:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i<c?a:c,Math.sqrt((i-d)**2+(l-u)**2)}(e,t,n);(void 0===o||s<o)&&(o=s,r=n)})),[o,r]}function kC(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const _C=30,xC=120,yC=120;function SC(e,t,n,o){let r=!0;if(t){const e=t?.map((({name:e})=>e));r=n.every((t=>e?.includes(t)))}const s=n.map((t=>e(t))).every((e=>{const[t]=e?.parent||[];return!t||t===o}));return r&&s}function wC({dropZoneElement:e,rootClientId:t="",parentClientId:n="",isDisabled:o=!1}={}){const r=(0,c.useRegistry)(),[s,i]=(0,a.useState)({index:null,operation:"insert"}),{getBlockType:d}=(0,c.useSelect)(l.store),{getBlockListSettings:p,getBlocks:h,getBlockIndex:g,getDraggedBlockClientIds:m,getBlockNamesByClientId:f,getAllowedBlocks:b,isDragging:v}=Q((0,c.useSelect)($r)),{showInsertionPoint:k,hideInsertionPoint:_,startDragging:x,stopDragging:y}=Q((0,c.useDispatch)($r)),S=bC("before"===s.operation||"after"===s.operation?n:t,s.index,{operation:s.operation,nearestSide:s.nearestSide}),w=(0,u.useThrottle)((0,a.useCallback)(((o,s)=>{v()||x();const a=b(t),c=f([t])[0],u=f(m());if(!SC(d,a,u,c))return;const _=h(t);if(0===_.length)return void r.batch((()=>{i({index:0,operation:"insert"}),k(t,0,{operation:"insert"})}));const y=_.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,l.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>s.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:g(t),blockOrientation:p(t)?.orientation}})),[S,w,B]=function(e,t,n="vertical",o={}){const r="horizontal"===n?["left","right"]:["top","bottom"];let s=0,i="before",l=1/0,a=null,c="right";const{dropZoneElement:u,parentBlockOrientation:d,rootBlockIndex:p=0}=o;if(u&&"horizontal"!==d){const e=u.getBoundingClientRect(),[n,o]=vC(t,e,["top","bottom"]);if(e.height>xC&&n<_C){if("top"===o)return[p,"before"];if("bottom"===o)return[p+1,"after"]}}const h=(0,C.isRTL)();if(u&&"horizontal"===d){const e=u.getBoundingClientRect(),[n,o]=vC(t,e,["left","right"]);if(e.width>yC&&n<_C){if(h&&"right"===o||!h&&"left"===o)return[p,"before"];if(h&&"left"===o||!h&&"right"===o)return[p+1,"after"]}}e.forEach((({isUnmodifiedDefaultBlock:e,getBoundingClientRect:o,blockIndex:u,blockOrientation:d})=>{const p=o();let[g,m]=vC(t,p,r);const[f,b]=vC(t,p,["left","right"]),v=kC(t,p);e&&v?g=0:"vertical"===n&&"horizontal"!==d&&(v&&f<_C||!v&&function(e,t){return t.top<=e.y&&t.bottom>=e.y}(t,p))&&(a=u,c=b),g<l&&(i="bottom"===m||!h&&"right"===m||h&&"left"===m?"after":"before",l=g,s=u)}));const g=s+("after"===i?1:-1),m=!!e[s]?.isUnmodifiedDefaultBlock,f=!!e[g]?.isUnmodifiedDefaultBlock;if(null!==a)return[a,"group",c];if(!m&&!f)return["after"===i?s+1:s,"insert"];return[m?s:g,"replace"]}(y,{x:o.clientX,y:o.clientY},p(t)?.orientation,{dropZoneElement:e,parentBlockClientId:n,parentBlockOrientation:n?p(n)?.orientation:void 0,rootBlockIndex:g(t)});r.batch((()=>{i({index:S,operation:w,nearestSide:B});const e=["before","after"].includes(w)?n:t;k(e,S,{operation:w,nearestSide:B})}))}),[b,t,f,m,d,h,p,e,n,g,r,k,v,x]),200);return(0,u.__experimentalUseDropZone)({dropZoneElement:e,isDisabled:o,onDrop:S,onDragOver(e){w(e,e.currentTarget.ownerDocument)},onDragLeave(){w.cancel(),_()},onDragEnd(){w.cancel(),y(),_()}})}const CC={};function BC({children:e,clientId:t}){const n=function(e){return(0,c.useSelect)((t=>{const n=t($r).getBlock(e);if(!n)return;const o=t(l.store).getBlockType(n.name);return o&&0!==Object.keys(o.providesContext).length?Object.fromEntries(Object.entries(o.providesContext).map((([e,t])=>[e,n.attributes[t]]))):void 0}),[e])}(t);return(0,U.jsx)(qb,{value:n,children:e})}const IC=(0,a.memo)($C);function jC(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:o,defaultBlock:r,directInsert:s,__experimentalDefaultBlock:i,__experimentalDirectInsert:u,template:d,templateLock:p,wrapperRef:h,templateInsertUpdatesSelection:g,__experimentalCaptureToolbars:m,__experimentalAppenderTagName:f,renderAppender:b,orientation:v,placeholder:k,layout:_,name:x,blockType:y,parentLock:S,defaultLayout:C}=e;mC(t,S,n,o,r,s,i,u,p,m,v,_),function(e,t,n,o){const{getBlocks:r,getSelectedBlocksInitialCaretPosition:s,isBlockSelected:i}=(0,c.useSelect)($r),{replaceInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:d}=(0,c.useDispatch)($r),p=(0,a.useRef)(null);(0,a.useLayoutEffect)((()=>{let a=!1;return window.queueMicrotask((()=>{if(a)return;const c=r(e),h=0===c.length||"all"===n||"contentOnly"===n,g=!w()(t,p.current);if(!h||!g)return;p.current=t;const m=(0,l.synchronizeBlocksWithTemplate)(c,t);w()(m,c)||(d(),u(e,m,0===c.length&&o&&0!==m.length&&i(e),s()))})),()=>{a=!0}}),[t,n,e])}(t,d,p,g);const B=(0,l.getBlockSupport)(x,"layout")||(0,l.getBlockSupport)(x,"__experimentalLayout")||CC,{allowSizingOnChildren:I=!1}=B,j=_||B,E=(0,a.useMemo)((()=>({...C,...j,...I&&{allowSizingOnChildren:!0}})),[C,j,I]),T=(0,U.jsx)(IC,{rootClientId:t,renderAppender:b,__experimentalAppenderTagName:f,layout:E,wrapperRef:h,placeholder:k});return 0===Object.keys(y.providesContext).length?T:(0,U.jsx)(BC,{clientId:t,children:T})}function EC(e){return gy(e),(0,U.jsx)(jC,{...e})}const TC=(0,a.forwardRef)(((e,t)=>{const n=MC({ref:t},e);return(0,U.jsx)("div",{className:"block-editor-inner-blocks",children:(0,U.jsx)("div",{...n})})}));function MC(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o,dropZoneElement:r}=t,{clientId:s,layout:i=null,__unstableLayoutClassNames:a=""}=_(),d=(0,c.useSelect)((e=>{const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:o,__unstableGetEditorMode:r,getTemplateLock:i,getBlockRootClientId:a,getBlockEditingMode:c,getBlockSettings:u,isDragging:d,getSettings:p}=Q(e($r));let h;if("zoom-out"===r()){const{sectionRootClientId:e}=Q(p());h=s!==e}if(!s)return{isDropZoneDisabled:h};const{hasBlockSupport:g,getBlockType:m}=e(l.store),f=t(s),b="navigation"===r(),v=c(s),k=a(s),[_]=u(s,"layout");return void 0!==h&&(h="disabled"===v),{__experimentalCaptureToolbars:g(f,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==f&&!n(s)&&!o(s,!0)&&b&&!d(),name:f,blockType:m(f),parentLock:i(k),parentClientId:k,isDropZoneDisabled:h,defaultLayout:_}}),[s]),{__experimentalCaptureToolbars:p,hasOverlay:h,name:g,blockType:m,parentLock:f,parentClientId:b,isDropZoneDisabled:v,defaultLayout:k}=d,x=wC({dropZoneElement:r,rootClientId:s,parentClientId:b}),y=(0,u.useMergeRefs)([e.ref,o||v?null:x]),S={__experimentalCaptureToolbars:p,layout:i,name:g,blockType:m,parentLock:f,defaultLayout:k,...t},w=S.value&&S.onChange?EC:jC;return{...e,ref:y,className:Bs(e.className,"block-editor-block-list__layout",n?"":a,{"has-overlay":h}),children:s?(0,U.jsx)(w,{...S,clientId:s}):(0,U.jsx)($C,{...t})}}MC.save=l.__unstableGetInnerBlocksProps,TC.DefaultBlockAppender=hC,TC.ButtonBlockAppender=pC,TC.Content=()=>MC.save().children;const PC=TC,RC=new Set([ca.UP,ca.RIGHT,ca.DOWN,ca.LEFT,ca.ENTER,ca.BACKSPACE]);function NC(){const e=(0,c.useSelect)((e=>e($r).isTyping()),[]),{stopTyping:t}=(0,c.useDispatch)($r);return(0,u.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,s;function i(e){const{clientX:n,clientY:o}=e;r&&s&&(r!==n||s!==o)&&t(),r=n,s=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function AC(){const{isTyping:e}=(0,c.useSelect)((e=>{const{isTyping:t}=e($r);return{isTyping:t()}}),[]),{startTyping:t,stopTyping:n}=(0,c.useDispatch)($r),o=NC(),r=(0,u.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:s}=r,i=s.getSelection();if(e){let a;function c(e){const{target:t}=e;a=s.setTimeout((()=>{(0,la.isTextField)(t)||n()}))}function u(e){const{keyCode:t}=e;t!==ca.ESCAPE&&t!==ca.TAB||n()}function d(){i.isCollapsed||n()}return o.addEventListener("focus",c),o.addEventListener("keydown",u),r.addEventListener("selectionchange",d),()=>{s.clearTimeout(a),o.removeEventListener("focus",c),o.removeEventListener("keydown",u),r.removeEventListener("selectionchange",d)}}function l(e){const{type:n,target:r}=e;(0,la.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&RC.has(t)}(e))&&t()}return o.addEventListener("keypress",l),o.addEventListener("keydown",l),()=>{o.removeEventListener("keypress",l),o.removeEventListener("keydown",l)}}),[e,t,n]);return(0,u.useMergeRefs)([o,r])}const LC=function({children:e}){return(0,U.jsx)("div",{ref:AC(),children:e})},OC=(0,a.createContext)(),DC=new WeakMap;function zC({className:e,...t}){const n=(0,u.useViewportMatch)("medium"),{isOutlineMode:o,isFocusMode:r,editorMode:s,temporarilyEditingAsBlocks:i}=(0,c.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n,getTemporarilyEditingAsBlocks:o,isTyping:r}=Q(e($r)),{outlineMode:s,focusMode:i}=t();return{isOutlineMode:s&&!r(),isFocusMode:i,editorMode:n(),temporarilyEditingAsBlocks:o()}}),[]),l=(0,c.useRegistry)(),{setBlockVisibility:d}=(0,c.useDispatch)($r),p=(0,u.useDebounce)((0,a.useCallback)((()=>{const e={};DC.get(l).forEach((([t,n])=>{e[t]=n})),d(e)}),[l]),300,{trailing:!0}),h=(0,a.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{DC.get(l)||DC.set(l,[]);for(const t of e){const e=t.target.getAttribute("data-block");DC.get(l).push([e,t.isIntersecting])}p()}))}),[]),g=MC({ref:(0,u.useMergeRefs)([_y(),uC(),AC()]),className:Bs("is-root-container",e,{"is-outline-mode":o,"is-focus-mode":r&&n,"is-navigate-mode":"navigation"===s})},t);return(0,U.jsxs)(OC.Provider,{value:h,children:[(0,U.jsx)("div",{...g}),!!i&&(0,U.jsx)(VC,{clientId:i})]})}function VC({clientId:e}){const{stopEditingAsBlocks:t}=Q((0,c.useDispatch)($r)),n=(0,c.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t($r);return n(e)||o(e,!0)}),[e]);return(0,a.useEffect)((()=>{n||t(e)}),[n,e,t]),null}function FC(e){return(0,U.jsx)(k,{value:b,children:(0,U.jsx)(zC,{...e})})}const HC=[],GC=new Set;function UC({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:o,layout:r=vl}){const s=!1!==n,i=!!n,{order:l,selectedBlocks:a,visibleBlocks:u,shouldRenderAppender:d}=(0,c.useSelect)((e=>{const{getSettings:n,getBlockOrder:o,getSelectedBlockClientId:r,getSelectedBlockClientIds:l,__unstableGetVisibleBlocks:a,getTemplateLock:c,getBlockEditingMode:u,__unstableGetEditorMode:d}=e($r),p=o(t);if(n().__unstableIsPreviewMode)return{order:p,selectedBlocks:HC,visibleBlocks:GC};const h=r();return{order:p,selectedBlocks:l(),visibleBlocks:a(),shouldRenderAppender:s&&"zoom-out"!==d()&&(i?!c(t)&&"disabled"!==u(t):t===h||!t&&!h&&!p.length)}}),[t,s,i]);return(0,U.jsxs)(_l,{value:r,children:[l.map((e=>(0,U.jsx)(c.AsyncModeProvider,{value:!u.has(e)&&!a.includes(e),children:(0,U.jsx)(sy,{rootClientId:t,clientId:e})},e))),l.length<1&&e,d&&(0,U.jsx)(nC,{tagName:o,rootClientId:t,CustomAppender:n})]})}function $C(e){return(0,U.jsx)(c.AsyncModeProvider,{value:!1,children:(0,U.jsx)(UC,{...e})})}const WC={placement:"top-start"},KC={...WC,flip:!1,shift:!0},ZC={...WC,flip:!0,shift:!1};function qC(e,t,n,o,r){if(!e||!t)return KC;const s=n?.scrollTop||0,i=t.getBoundingClientRect(),l=s+e.getBoundingClientRect().top,a=e.ownerDocument.documentElement.clientHeight,c=l+o,u=i.top>c,d=i.height>a-o;return r||!u&&!d?ZC:KC}function YC({contentElement:e,clientId:t}){const n=Ji(t),[o,r]=(0,a.useState)(0),{blockIndex:s,isSticky:i}=(0,c.useSelect)((e=>{const{getBlockIndex:n,getBlockAttributes:o}=e($r);return{blockIndex:n(t),isSticky:_m(o(t))}}),[t]),l=(0,a.useMemo)((()=>{if(e)return(0,la.getScrollContainer)(e)}),[e]),[d,p]=(0,a.useState)((()=>qC(e,n,l,o,i))),h=(0,u.useRefEffect)((e=>{r(e.offsetHeight)}),[]),g=(0,a.useCallback)((()=>p(qC(e,n,l,o,i))),[e,n,l,o]);return(0,a.useLayoutEffect)(g,[s,g]),(0,a.useLayoutEffect)((()=>{if(!e||!n)return;const t=e?.ownerDocument?.defaultView;let o;t?.addEventHandler?.("resize",g);const r=n?.ownerDocument?.defaultView;return r.ResizeObserver&&(o=new r.ResizeObserver(g),o.observe(n)),()=>{t?.removeEventHandler?.("resize",g),o&&o.disconnect()}}),[g,e,n]),{...d,ref:h}}function XC(e){const t=(0,c.useSelect)((t=>{const{getBlockRootClientId:n,getBlockParents:o,__experimentalGetBlockListSettingsForBlocks:r,isBlockInsertionPointVisible:s,getBlockInsertionPoint:i,getBlockOrder:l,hasMultiSelection:a,getLastMultiSelectedBlockClientId:c}=t($r),u=o(e),d=r(u),p=u.find((e=>d[e]?.__experimentalCaptureToolbars));let h=!1;if(s()){const t=i();h=l(t.rootClientId)[t.index]===e}return{capturingClientId:p,isInsertionPointVisible:h,lastClientId:a()?c():null,rootClientId:n(e)}}),[e]);return t}function QC({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:r,rootClientId:s}=XC(e),i=YC({contentElement:t?.current,clientId:e});return(0,U.jsx)(sl,{clientId:n||e,bottomClientId:r,className:Bs("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":o}),__unstableContentRef:t,...i,children:(0,U.jsx)("div",{className:"block-editor-block-list__empty-block-inserter",children:(0,U.jsx)(qw,{position:"bottom right",rootClientId:s,clientId:e,__experimentalIsQuick:!0})})})}const JC=({appendToOwnerDocument:e,children:t,clientIds:n,cloneClassname:o,elementId:r,onDragStart:s,onDragEnd:i,fadeWhenDisabled:d=!1,dragComponent:p})=>{const{srcRootClientId:h,isDraggable:g,icon:m,visibleInserter:f,getBlockType:b}=(0,c.useSelect)((e=>{const{canMoveBlocks:t,getBlockRootClientId:o,getBlockName:r,getBlockAttributes:s,isBlockInsertionPointVisible:i}=e($r),{getBlockType:a,getActiveBlockVariation:c}=e(l.store),u=o(n[0]),d=r(n[0]),p=c(d,s(n[0]));return{srcRootClientId:u,isDraggable:t(n),icon:p?.icon||a(d)?.icon,visibleInserter:i(),getBlockType:a}}),[n]),v=(0,a.useRef)(!1),[k,_,x]=function(){const e=(0,a.useRef)(null),t=(0,a.useRef)(null),n=(0,a.useRef)(null),o=(0,a.useRef)(null);return(0,a.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,a.useCallback)((r=>{e.current=r.clientY,n.current=(0,la.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,a.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,s=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>s){const e=Math.max(r-s-50,0),n=Math.max(i-s-50,0),o=0===e||0===n?0:n/e;t.current=25*o}else if(o.clientY<s){const e=Math.max(s-50,0),n=Math.max(s-i-50,0),o=0===e||0===n?0:n/e;t.current=-25*o}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{getAllowedBlocks:y,getBlockNamesByClientId:S,getBlockRootClientId:w}=(0,c.useSelect)($r),{startDraggingBlocks:C,stopDraggingBlocks:B}=(0,c.useDispatch)($r);(0,a.useEffect)((()=>()=>{v.current&&B()}),[]);const I=Qi(n[0]),j=I.current?.closest("body");if((0,a.useEffect)((()=>{if(!j||!d)return;const e=(0,u.throttle)((e=>{if(!e.target.closest("[data-block]"))return;const t=S(n),o=e.target.closest("[data-block]").getAttribute("data-block"),r=y(o),s=S([o])[0];let i;if(0===r?.length){const e=w(o),n=S([e])[0],r=y(e);i=SC(b,r,t,n)}else i=SC(b,r,t,s);i||f?window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.add("block-draggable-invalid-drag-token")}),200);return j.addEventListener("dragover",e),()=>{j.removeEventListener("dragover",e)}}),[n,j,d,y,S,w,b,f]),!g)return t({draggable:!1});const E={type:"block",srcClientIds:n,srcRootClientId:h};return(0,U.jsx)(Ns.Draggable,{appendToOwnerDocument:e,cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:E,onDragStart:e=>{window.requestAnimationFrame((()=>{C(n),v.current=!0,k(e),s&&s()}))},onDragOver:_,onDragEnd:()=>{B(),v.current=!1,x(),i&&i()},__experimentalDragComponent:void 0!==p?p:(0,U.jsx)(mS,{count:n.length,icon:m,fadeWhenDisabled:!0}),elementId:r,children:({onDraggableStart:e,onDraggableEnd:n})=>t({draggable:!0,onDragStart:e,onDragEnd:n})})},eB=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),tB=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),nB=(e,t)=>"up"===e?"horizontal"===t?(0,C.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,C.isRTL)()?"left":"right":"down":null;function oB(e,t,n,o,r,s,i){const l=n+1;if(e>1)return function(e,t,n,o,r,s){const i=t+1;if(n&&o)return(0,C.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=nB("down",s);if("down"===t)return(0,C.sprintf)((0,C.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,C.sprintf)((0,C.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,C.sprintf)((0,C.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=nB("down",s);if("down"===e)return(0,C.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,C.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,C.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=nB("up",s);if("up"===t)return(0,C.sprintf)((0,C.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,C.sprintf)((0,C.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,C.sprintf)((0,C.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=nB("up",s);if("up"===e)return(0,C.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,C.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,C.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,s,i);if(o&&r)return(0,C.sprintf)((0,C.__)("Block %s is the only block, and cannot be moved"),t);if(s>0&&!r){const e=nB("down",i);if("down"===e)return(0,C.sprintf)((0,C.__)("Move %1$s block from position %2$d down to position %3$d"),t,l,l+1);if("left"===e)return(0,C.sprintf)((0,C.__)("Move %1$s block from position %2$d left to position %3$d"),t,l,l+1);if("right"===e)return(0,C.sprintf)((0,C.__)("Move %1$s block from position %2$d right to position %3$d"),t,l,l+1)}if(s>0&&r){const e=nB("down",i);if("down"===e)return(0,C.sprintf)((0,C.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,C.sprintf)((0,C.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,C.sprintf)((0,C.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(s<0&&!o){const e=nB("up",i);if("up"===e)return(0,C.sprintf)((0,C.__)("Move %1$s block from position %2$d up to position %3$d"),t,l,l-1);if("left"===e)return(0,C.sprintf)((0,C.__)("Move %1$s block from position %2$d left to position %3$d"),t,l,l-1);if("right"===e)return(0,C.sprintf)((0,C.__)("Move %1$s block from position %2$d right to position %3$d"),t,l,l-1)}if(s<0&&o){const e=nB("up",i);if("up"===e)return(0,C.sprintf)((0,C.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,C.sprintf)((0,C.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,C.sprintf)((0,C.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const rB=(e,t)=>"up"===e?"horizontal"===t?(0,C.isRTL)()?cy:uy:eB:"down"===e?"horizontal"===t?(0,C.isRTL)()?uy:cy:tB:null,sB=(e,t)=>"up"===e?"horizontal"===t?(0,C.isRTL)()?(0,C.__)("Move right"):(0,C.__)("Move left"):(0,C.__)("Move up"):"down"===e?"horizontal"===t?(0,C.isRTL)()?(0,C.__)("Move left"):(0,C.__)("Move right"):(0,C.__)("Move down"):null,iB=(0,a.forwardRef)((({clientIds:e,direction:t,orientation:n,...o},r)=>{const s=(0,u.useInstanceId)(iB),i=Array.isArray(e)?e:[e],a=i.length,{disabled:d}=o,{blockType:p,isDisabled:h,rootClientId:g,isFirst:m,isLast:f,firstIndex:b,orientation:v="vertical"}=(0,c.useSelect)((e=>{const{getBlockIndex:o,getBlockRootClientId:r,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e($r),u=i[0],p=r(u),h=o(u),g=o(i[i.length-1]),m=s(p),f=a(u),b=0===h,v=g===m.length-1,{orientation:k}=c(p)||{};return{blockType:f?(0,l.getBlockType)(f.name):null,isDisabled:d||("up"===t?b:v),rootClientId:p,firstIndex:h,isFirst:b,isLast:v,orientation:n||k}}),[e,t]),{moveBlocksDown:k,moveBlocksUp:_}=(0,c.useDispatch)($r),x="up"===t?_:k,y=`block-editor-block-mover-button__description-${s}`;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.Button,{ref:r,className:Bs("block-editor-block-mover-button",`is-${t}-button`),icon:rB(t,v),label:sB(t,v),"aria-describedby":y,...o,onClick:h?null:t=>{x(e,g),o.onClick&&o.onClick(t)},disabled:h,__experimentalIsFocusable:!0}),(0,U.jsx)(Ns.VisuallyHidden,{id:y,children:oB(a,p&&p.title,b,m,f,"up"===t?-1:1,v)})]})})),lB=(0,a.forwardRef)(((e,t)=>(0,U.jsx)(iB,{direction:"up",ref:t,...e}))),aB=(0,a.forwardRef)(((e,t)=>(0,U.jsx)(iB,{direction:"down",ref:t,...e})));const cB=function({clientIds:e,hideDragHandle:t,isBlockMoverUpButtonDisabled:n,isBlockMoverDownButtonDisabled:o}){const{canMove:r,rootClientId:s,isFirst:i,isLast:l,orientation:a}=(0,c.useSelect)((t=>{const{getBlockIndex:n,getBlockListSettings:o,canMoveBlocks:r,getBlockOrder:s,getBlockRootClientId:i}=t($r),l=Array.isArray(e)?e:[e],a=l[0],c=i(a),u=n(a),d=n(l[l.length-1]),p=s(c);return{canMove:r(e),rootClientId:c,isFirst:0===u,isLast:d===p.length-1,orientation:o(c)?.orientation}}),[e]);if(!r||i&&l&&!s)return null;const u=(0,C.__)("Drag");return(0,U.jsxs)(Ns.ToolbarGroup,{className:Bs("block-editor-block-mover",{"is-horizontal":"horizontal"===a}),children:[!t&&(0,U.jsx)(JC,{clientIds:e,fadeWhenDisabled:!0,children:e=>(0,U.jsx)(Ns.Button,{icon:gS,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:u,tabIndex:"-1",...e})}),(0,U.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,U.jsx)(Ns.ToolbarItem,{children:t=>(0,U.jsx)(lB,{disabled:n,clientIds:e,...t})}),(0,U.jsx)(Ns.ToolbarItem,{children:t=>(0,U.jsx)(aB,{disabled:o,clientIds:e,...t})})]})]})},{clearTimeout:uB,setTimeout:dB}=window,pB=200;function hB({ref:e,isFocused:t,highlightParent:n,debounceTimeout:o=pB}){const{getSelectedBlockClientId:r,getBlockRootClientId:s}=(0,c.useSelect)($r),{toggleBlockHighlight:i}=(0,c.useDispatch)($r),l=(0,a.useRef)(),u=(0,c.useSelect)((e=>e($r).getSettings().isDistractionFree),[]),d=e=>{if(e&&u)return;const t=r(),o=n?s(t):t;i(o,e)},p=()=>{const n=e?.current&&e.current.matches(":hover");return!t&&!n},h=()=>{const e=l.current;e&&uB&&uB(e)};return(0,a.useEffect)((()=>()=>{d(!1),h()}),[]),{debouncedShowGestures:e=>{e&&e.stopPropagation(),h(),d(!0)},debouncedHideGestures:e=>{e&&e.stopPropagation(),h(),l.current=dB((()=>{p()&&d(!1)}),o)}}}function gB({ref:e,highlightParent:t=!1,debounceTimeout:n=pB}){const[o,r]=(0,a.useState)(!1),{debouncedShowGestures:s,debouncedHideGestures:i}=hB({ref:e,debounceTimeout:n,isFocused:o,highlightParent:t}),l=(0,a.useRef)(!1),c=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,a.useEffect)((()=>{const t=e.current,n=()=>{c()&&(r(!0),s())},o=()=>{c()||(r(!1),i())};return t&&!l.current&&(t.addEventListener("focus",n,!0),t.addEventListener("blur",o,!0),l.current=!0),()=>{t&&(t.removeEventListener("focus",n),t.removeEventListener("blur",o))}}),[e,l,r,s,i]),{onMouseMove:s,onMouseLeave:i}}function mB(){const{selectBlock:e}=(0,c.useDispatch)($r),{firstParentClientId:t,isVisible:n}=(0,c.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getBlockEditingMode:r}=e($r),{hasBlockSupport:s}=e(l.store),i=n(o()),a=i[i.length-1],c=t(a),u=(0,l.getBlockType)(c);return{firstParentClientId:a,isVisible:a&&"default"===r(a)&&s(u,"__experimentalParentSelector",!0)}}),[]),o=dm(t),r=(0,a.useRef)(),s=gB({ref:r,highlightParent:!0});return n?(0,U.jsx)("div",{className:"block-editor-block-parent-selector",ref:r,...s,children:(0,U.jsx)(Ns.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,C.sprintf)((0,C.__)("Select parent block: %s"),o?.title),showTooltip:!0,icon:(0,U.jsx)(Tf,{icon:o?.icon})})},t):null}const fB=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})});function bB({blocks:e}){return(0,U.jsx)("div",{className:"block-editor-block-switcher__popover__preview__parent",children:(0,U.jsx)("div",{className:"block-editor-block-switcher__popover__preview__container",children:(0,U.jsx)(Ns.Popover,{className:"block-editor-block-switcher__preview__popover",placement:"bottom-start",focusOnMount:!1,children:(0,U.jsxs)("div",{className:"block-editor-block-switcher__preview",children:[(0,U.jsx)("div",{className:"block-editor-block-switcher__preview-title",children:(0,C.__)("Preview")}),(0,U.jsx)(cS,{viewportWidth:500,blocks:e})]})})})})}const vB={};function kB({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:s}=e;return(0,U.jsxs)(Ns.MenuItem,{className:(0,l.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[(0,U.jsx)(Tf,{icon:r,showColors:!0}),s]})}const _B=({transformations:e,onSelect:t,blocks:n})=>{const[o,r]=(0,a.useState)();return(0,U.jsxs)(U.Fragment,{children:[o&&(0,U.jsx)(bB,{blocks:(0,l.cloneBlock)(n[0],e.find((({name:e})=>e===o)).attributes)}),e?.map((e=>(0,U.jsx)(kB,{item:e,onSelect:t,setHoveredTransformItemName:r},e.name)))]})};function xB({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map((e=>(0,U.jsx)(yB,{item:e,onSelect:t,setHoveredTransformItemName:n},e.name)))}function yB({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:s,isDisabled:i}=e;return(0,U.jsxs)(Ns.MenuItem,{className:(0,l.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},disabled:i,onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[(0,U.jsx)(Tf,{icon:r,showColors:!0}),s]})}const SB=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:n,onSelect:o,onSelectVariation:r,blocks:s})=>{const[i,c]=(0,a.useState)(),{priorityTextTransformations:u,restTransformations:d}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,a.useMemo)((()=>{const n=Object.keys(t),o=e.reduce(((e,t)=>{const{name:o}=t;return n.includes(o)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]});if(1===o.priorityTextTransformations.length&&"core/quote"===o.priorityTextTransformations[0].name){const e=o.priorityTextTransformations.pop();o.restTransformations.push(e)}return o}),[e]);return n.priorityTextTransformations.sort((({name:e},{name:n})=>t[e]<t[n]?-1:1)),n}(t),p=u.length&&d.length,h=!!d.length&&(0,U.jsx)(xB,{restTransformations:d,onSelect:o,setHoveredTransformItemName:c});return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Ns.MenuGroup,{label:(0,C.__)("Transform to"),className:e,children:[i&&(0,U.jsx)(bB,{blocks:(0,l.switchToBlockType)(s,i)}),!!n?.length&&(0,U.jsx)(_B,{transformations:n,blocks:s,onSelect:r}),u.map((e=>(0,U.jsx)(yB,{item:e,onSelect:o,setHoveredTransformItemName:c},e.name))),!p&&h]}),!!p&&(0,U.jsx)(Ns.MenuGroup,{className:e,children:h})]})};function wB(e,t,n){const o=new(dh())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function CB(e){return e?.find((e=>e.isDefault))}function BB({clientId:e,onSwitch:t}){const{styles:n,block:o,blockType:r,className:s}=(0,c.useSelect)((t=>{const{getBlock:n}=t($r),o=n(e);if(!o)return{};const r=(0,l.getBlockType)(o.name),{getBlockStyles:s}=t(l.store);return{block:o,blockType:r,styles:s(o.name),className:o.attributes.className||""}}),[e]),{updateBlockAttributes:i}=(0,c.useDispatch)($r),u=function(e){return e&&0!==e.length?CB(e)?e:[{name:"default",label:(0,C._x)("Default","block style"),isDefault:!0},...e]:[]}(n),d=function(e,t){for(const n of new(dh())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=e?.find((({name:e})=>e===t));if(o)return o}return CB(e)}(u,s),p=function(e,t){return(0,a.useMemo)((()=>{const n=t?.example,o=t?.name;return n&&o?(0,l.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,l.cloneBlock)(e):void 0}),[t?.example?e?.name:e,t])}(o,r);return{onSelect:n=>{const o=wB(s,d,n);i(e,{className:o}),t()},stylesToRender:u,activeStyle:d,genericPreviewBlock:p,className:s}}const IB=()=>{};function jB({clientId:e,onSwitch:t=IB}){const{onSelect:n,stylesToRender:o,activeStyle:r}=BB({clientId:e,onSwitch:t});return o&&0!==o.length?(0,U.jsx)(U.Fragment,{children:o.map((e=>{const t=e.label||e.name;return(0,U.jsx)(Ns.MenuItem,{icon:r.name===e.name?Zu:null,onClick:()=>n(e),children:(0,U.jsx)(Ns.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:t})},e.name)}))}):null}function EB({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return(0,U.jsx)(Ns.MenuGroup,{label:(0,C.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:(0,U.jsx)(jB,{clientId:n,onSwitch:t})})}const TB=(e,t,n=new Set)=>{const{clientId:o,name:r,innerBlocks:s=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of s){const o=TB(e,t,n);if(o)return o}}},MB=(e,t)=>{const n=((e,t)=>{const n=(0,l.__experimentalGetBlockAttributesNamesByRole)(e,"content");return n?.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}},PB=(e,t)=>(0,a.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 r of n){const n=TB(r,t.name,o);if(n){e=!0,o.add(n.clientId),MB(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]),{CompositeV2:RB,CompositeItemV2:NB,useCompositeStoreV2:AB}=Q(Ns.privateApis);function LB({patterns:e,onSelect:t}){return(0,U.jsx)("div",{className:"block-editor-block-switcher__popover__preview__parent",children:(0,U.jsx)("div",{className:"block-editor-block-switcher__popover__preview__container",children:(0,U.jsx)(Ns.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",children:(0,U.jsx)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:(0,U.jsx)(OB,{patterns:e,onSelect:t})})})})})}function OB({patterns:e,onSelect:t}){const n=AB();return(0,U.jsx)(RB,{store:n,role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,C.__)("Patterns list"),children:e.map((e=>(0,U.jsx)(DB,{pattern:e,onSelect:t},e.name)))})}function DB({pattern:e,onSelect:t}){const n="block-editor-block-switcher__preview-patterns-container",o=(0,u.useInstanceId)(DB,`${n}-list__item-description`);return(0,U.jsxs)("div",{className:`${n}-list__list-item`,children:[(0,U.jsxs)(NB,{render:(0,U.jsx)("div",{role:"option","aria-label":e.title,"aria-describedby":e.description?o:void 0,className:`${n}-list__item`}),onClick:()=>t(e.transformedBlocks),children:[(0,U.jsx)(cS,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,U.jsx)("div",{className:`${n}-list__item-title`,children:e.title})]}),!!e.description&&(0,U.jsx)(Ns.VisuallyHidden,{id:o,children:e.description})]})}const zB=function({blocks:e,patterns:t,onSelect:n}){const[o,r]=(0,a.useState)(!1),s=PB(t,e);return s.length?(0,U.jsxs)(Ns.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[o&&(0,U.jsx)(LB,{patterns:s,onSelect:n}),(0,U.jsx)(Ns.MenuItem,{onClick:e=>{e.preventDefault(),r(!o)},icon:cy,children:(0,C.__)("Patterns")})]}):null};function VB({onClose:e,clientIds:t,hasBlockStyles:n,canRemove:o,isUsingBindings:r}){const{replaceBlocks:s,multiSelect:i,updateBlockAttributes:u}=(0,c.useDispatch)($r),{possibleBlockTransformations:d,patterns:p,blocks:h}=(0,c.useSelect)((e=>{const{getBlocksByClientId:n,getBlockRootClientId:o,getBlockTransformItems:r,__experimentalGetPatternTransformItems:s}=e($r),i=o(Array.isArray(t)?t[0]:t),l=n(t);return{blocks:l,possibleBlockTransformations:r(l,i),patterns:s(l,i)}}),[t]),g=function({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:o}=(0,c.useSelect)((n=>{const{getBlockAttributes:o,canRemoveBlocks:r}=n($r),{getActiveBlockVariation:s,getBlockVariations:i}=n(l.store),a=r(e);if(1!==t.length||!a)return vB;const[c]=t;return{blockVariationTransformations:i(c.name,"transform"),activeBlockVariation:s(c.name,o(c.clientId))}}),[e,t]);return(0,a.useMemo)((()=>o?.filter((({name:e})=>e!==n?.name))),[o,n])}({clientIds:t,blocks:h});function m(e){e.length>1&&i(e[0].clientId,e[e.length-1].clientId)}const f=1===h.length,b=f&&(0,l.isTemplatePart)(h[0]),v=!!d.length&&o&&!b,k=!!g?.length,_=!!p?.length&&o,x=v||k;if(!(n||x||_))return(0,U.jsx)("p",{className:"block-editor-block-switcher__no-transforms",children:(0,C.__)("No transforms.")});const y=f?(0,C._x)("This block is connected.","block toolbar button label and description"):(0,C._x)("These blocks are connected.","block toolbar button label and description");return(0,U.jsxs)("div",{className:"block-editor-block-switcher__container",children:[_&&(0,U.jsx)(zB,{blocks:h,patterns:p,onSelect:n=>{!function(e){s(t,e),m(e)}(n),e()}}),x&&(0,U.jsx)(SB,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:d,possibleBlockVariationTransformations:g,blocks:h,onSelect:n=>{!function(e){const n=(0,l.switchToBlockType)(h,e);s(t,n),m(n)}(n),e()},onSelectVariation:t=>{!function(e){u(h[0].clientId,{...g.find((({name:t})=>t===e)).attributes})}(t),e()}}),n&&(0,U.jsx)(EB,{hoveredBlock:h[0],onSwitch:e}),r&&(0,U.jsx)(Ns.MenuGroup,{children:(0,U.jsx)(Ns.__experimentalText,{className:"block-editor-block-switcher__binding-indicator",children:y})})]})}const FB=({clientIds:e,disabled:t,isUsingBindings:n})=>{const{canRemove:o,hasBlockStyles:r,icon:s,invalidBlocks:i,isReusable:a,isTemplate:u}=(0,c.useSelect)((t=>{const{getBlocksByClientId:n,getBlockAttributes:o,canRemoveBlocks:r}=t($r),{getBlockStyles:s,getBlockType:i,getActiveBlockVariation:a}=t(l.store),c=n(e);if(!c.length||c.some((e=>!e)))return{invalidBlocks:!0};const[{name:u}]=c,d=1===c.length,p=i(u);let h;if(d){const t=a(u,o(e[0]));h=t?.icon||p.icon}else{h=1===new Set(c.map((({name:e})=>e))).size?p.icon:fB}return{canRemove:r(e),hasBlockStyles:d&&!!s(u)?.length,icon:h,isReusable:d&&(0,l.isReusableBlock)(c[0]),isTemplate:d&&(0,l.isTemplatePart)(c[0])}}),[e]),d=Ub({clientId:e?.[0],maximumLength:35});if(i)return null;const p=1===e.length,h=p?d:(0,C.__)("Multiple blocks selected");if(t||!r&&!o)return(0,U.jsx)(Ns.ToolbarGroup,{children:(0,U.jsx)(Ns.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:h,icon:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Tf,{icon:s,showColors:!0}),(a||u)&&(0,U.jsx)("span",{className:"block-editor-block-switcher__toggle-text",children:d})]})})});const g=p?(0,C.__)("Change block type or style"):(0,C.sprintf)((0,C._n)("Change type of %d block","Change type of %d blocks",e.length),e.length);return(0,U.jsx)(Ns.ToolbarGroup,{children:(0,U.jsx)(Ns.ToolbarItem,{children:t=>(0,U.jsx)(Ns.DropdownMenu,{className:"block-editor-block-switcher",label:h,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Tf,{icon:s,className:"block-editor-block-switcher__toggle",showColors:!0}),(a||u)&&(0,U.jsx)("span",{className:"block-editor-block-switcher__toggle-text",children:d})]}),toggleProps:{describedBy:g,...t},menuProps:{orientation:"both"},children:({onClose:t})=>(0,U.jsx)(VB,{onClose:t,clientIds:e,hasBlockStyles:r,canRemove:o,isUsingBindings:n})})})})},{Fill:HB,Slot:GB}=(0,Ns.createSlotFill)("__unstableBlockToolbarLastItem");HB.Slot=GB;const UB=HB,$B="align",WB="__experimentalBorder",KB="color",ZB="customClassName",qB="typography.__experimentalFontFamily",YB="typography.fontSize",XB="typography.textAlign",QB="layout",JB=["shadow",...["typography.lineHeight",YB,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",qB,XB,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalWritingMode","typography.__experimentalLetterSpacing"],WB,KB,"spacing"];const eI={align:e=>(0,l.hasBlockSupport)(e,$B),borderColor:e=>function(e,t="any"){if("web"!==a.Platform.OS)return!1;const n=(0,l.getBlockSupport)(e,WB);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}(e,"color"),backgroundColor:e=>{const t=(0,l.getBlockSupport)(e,KB);return t&&!1!==t.background},textAlign:e=>(0,l.hasBlockSupport)(e,XB),textColor:e=>{const t=(0,l.getBlockSupport)(e,KB);return t&&!1!==t.text},gradient:e=>{const t=(0,l.getBlockSupport)(e,KB);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,l.hasBlockSupport)(e,ZB,!0),fontFamily:e=>(0,l.hasBlockSupport)(e,qB),fontSize:e=>(0,l.hasBlockSupport)(e,YB),layout:e=>(0,l.hasBlockSupport)(e,QB),style:e=>JB.some((t=>(0,l.hasBlockSupport)(e,t)))};function tI(e,t){return Object.entries(eI).reduce(((n,[o,r])=>(r(e.name)&&r(t.name)&&(n[o]=e.attributes[o]),n)),{})}function nI(e,t,n){for(let o=0;o<Math.min(t.length,e.length);o+=1)n(e[o].clientId,tI(t[o],e[o])),nI(e[o].innerBlocks,t[o].innerBlocks,n)}function oI(){const e=(0,c.useRegistry)(),{updateBlockAttributes:t}=(0,c.useDispatch)($r),{createSuccessNotice:n,createWarningNotice:o,createErrorNotice:r}=(0,c.useDispatch)(To.store);return(0,a.useCallback)((async s=>{let i="";try{if(!window.navigator.clipboard)return void r((0,C.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});i=await window.navigator.clipboard.readText()}catch(e){return void r((0,C.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!i||!function(e){try{const t=(0,l.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(i))return void o((0,C.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const a=(0,l.parse)(i);if(1===a.length?e.batch((()=>{nI(s,s.map((()=>a[0])),t)})):e.batch((()=>{nI(s,a,t)})),1===s.length){const e=(0,l.getBlockType)(s[0].name)?.title;n((0,C.sprintf)((0,C.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,C.sprintf)((0,C.__)("Pasted styles to %d blocks."),s.length),{type:"snackbar"})}),[e.batch,t,n,o,r])}function rI({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{getDefaultBlockName:o,getGroupingBlockName:r}=(0,c.useSelect)(l.store),s=(0,c.useSelect)((t=>{const{canInsertBlockType:n,getBlockRootClientId:r,getBlocksByClientId:s,getDirectInsertBlock:i,canMoveBlocks:a,canRemoveBlocks:c}=t($r),u=s(e),d=r(e[0]),p=n(o(),d),h=d?i(d):null;return{canMove:a(e),canRemove:c(e),canInsertBlock:p||!!h,canCopyStyles:u.every((e=>!!e&&((0,l.hasBlockSupport)(e.name,"color")||(0,l.hasBlockSupport)(e.name,"typography")))),canDuplicate:u.every((e=>!!e&&(0,l.hasBlockSupport)(e.name,"multiple",!0)&&n(e.name,d)))}}),[e,o]),{getBlocksByClientId:i,getBlocks:a}=(0,c.useSelect)($r),{canMove:u,canRemove:d,canInsertBlock:p,canCopyStyles:h,canDuplicate:g}=s,{removeBlocks:m,replaceBlocks:f,duplicateBlocks:b,insertAfterBlock:v,insertBeforeBlock:k,flashBlock:_,setBlockMovingClientId:x,setNavigationMode:y,selectBlock:S}=(0,c.useDispatch)($r),w=Ny(),C=oI();return t({canCopyStyles:h,canDuplicate:g,canInsertBlock:p,canMove:u,canRemove:d,onDuplicate:()=>b(e,n),onRemove:()=>m(e,n),onInsertBefore(){k(e[0])},onInsertAfter(){v(e[e.length-1])},onMoveTo(){y(!0),S(e[0]),x(e[0])},onGroup(){if(!e.length)return;const t=r(),n=(0,l.switchToBlockType)(i(e),t);n&&f(e,n)},onUngroup(){if(!e.length)return;const t=a(e[0]);t.length&&f(e,t)},onCopy(){1===e.length&&_(e[0]),w("copy",e)},async onPasteStyles(){await C(i(e))}})}const sI=function({clientId:e}){const t=(0,c.useSelect)((t=>t($r).getBlock(e)),[e]),{replaceBlocks:n}=(0,c.useDispatch)($r);return t&&"core/html"===t.name?(0,U.jsx)(Ns.MenuItem,{onClick:()=>n(e,(0,l.rawHandler)({HTML:(0,l.getBlockContent)(t)})),children:(0,C.__)("Convert to Blocks")}):null},{Fill:iI,Slot:lI}=(0,Ns.createSlotFill)("__unstableBlockSettingsMenuFirstItem");iI.Slot=lI;const aI=iI;function cI({parentClientId:e,parentBlockType:t}){const n=(0,u.useViewportMatch)("medium","<"),{selectBlock:o}=(0,c.useDispatch)($r),r=(0,a.useRef)(),s=gB({ref:r,highlightParent:!0});return n?(0,U.jsx)(Ns.MenuItem,{...s,ref:r,icon:(0,U.jsx)(Tf,{icon:t.icon}),onClick:()=>o(e),children:(0,C.sprintf)((0,C.__)("Select parent block (%s)"),t.title)}):null}const uI={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function dI({clientIds:e,onCopy:t,label:n,shortcut:o}){const{getBlocksByClientId:r}=(0,c.useSelect)($r),s=(0,u.useCopyToClipboard)((()=>(0,l.serialize)(r(e))),t),i=n||(0,C.__)("Copy");return(0,U.jsx)(Ns.MenuItem,{ref:s,shortcut:o,children:i})}function pI({block:e,clientIds:t,children:n,__experimentalSelectBlock:o,...r}){const s=e?.clientId,i=t.length,d=t[0],{firstParentClientId:p,onlyBlock:h,parentBlockType:g,previousBlockClientId:m,selectedBlockClientIds:f,openedBlockSettingsMenu:b,isContentOnly:v}=(0,c.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:r,getSelectedBlockClientIds:s,getBlockAttributes:i,getOpenedBlockSettingsMenu:a,getBlockEditingMode:c}=Q(e($r)),{getActiveBlockVariation:u}=e(l.store),p=o(d),h=p&&n(p);return{firstParentClientId:p,onlyBlock:1===t(p),parentBlockType:p&&(u(h,i(p))||(0,l.getBlockType)(h)),previousBlockClientId:r(d),selectedBlockClientIds:s(),openedBlockSettingsMenu:a(),isContentOnly:"contentOnly"===c(d)}}),[d]),{getBlockOrder:k,getSelectedBlockClientIds:_}=(0,c.useSelect)($r),{setOpenedBlockSettingsMenu:x}=Q((0,c.useDispatch)($r)),y=(0,c.useSelect)((e=>{const{getShortcutRepresentation:t}=e(my.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")}}),[]),S=f.length>0;async function w(e){if(!o)return;const t=await e;t&&t[0]&&o(t[0],!1)}function B(){if(!o)return;let e=m||p;e||(e=k()[0]);const t=S&&0===_().length;o(e,t)}const I=f?.includes(p),j=s?b===s||!1:void 0;function E(e){e&&b!==s?x(s):!e&&b&&b===s&&x(void 0)}return(0,U.jsx)(rI,{clientIds:t,__experimentalUpdateSelection:!o,children:({canCopyStyles:e,canDuplicate:o,canInsertBlock:s,canMove:l,canRemove:c,onDuplicate:m,onInsertAfter:f,onInsertBefore:b,onRemove:k,onCopy:_,onPasteStyles:x,onMoveTo:S})=>(0,U.jsx)(Ns.DropdownMenu,{icon:ev,label:(0,C.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:uI,open:j,onToggle:E,noIcons:!0,...r,children:({onClose:r})=>(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Ns.MenuGroup,{children:[(0,U.jsx)(aI.Slot,{fillProps:{onClose:r}}),!I&&!!p&&(0,U.jsx)(cI,{parentClientId:p,parentBlockType:g}),1===i&&(0,U.jsx)(sI,{clientId:d}),!v&&(0,U.jsx)(dI,{clientIds:t,onCopy:_,shortcut:ca.displayShortcut.primary("c")}),o&&(0,U.jsx)(Ns.MenuItem,{onClick:(0,u.pipe)(r,m,w),shortcut:y.duplicate,children:(0,C.__)("Duplicate")}),s&&!v&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.MenuItem,{onClick:(0,u.pipe)(r,b),shortcut:y.insertBefore,children:(0,C.__)("Add before")}),(0,U.jsx)(Ns.MenuItem,{onClick:(0,u.pipe)(r,f),shortcut:y.insertAfter,children:(0,C.__)("Add after")})]})]}),e&&!v&&(0,U.jsxs)(Ns.MenuGroup,{children:[(0,U.jsx)(dI,{clientIds:t,onCopy:_,label:(0,C.__)("Copy styles")}),(0,U.jsx)(Ns.MenuItem,{onClick:x,children:(0,C.__)("Paste styles")})]}),(0,U.jsx)(Bf.Slot,{fillProps:{onClose:r,canMove:l,onMoveTo:S,onlyBlock:h,count:i,firstBlockClientId:d},clientIds:t}),"function"==typeof n?n({onClose:r}):a.Children.map((e=>(0,a.cloneElement)(e,{onClose:r}))),c&&(0,U.jsx)(Ns.MenuGroup,{children:(0,U.jsx)(Ns.MenuItem,{onClick:(0,u.pipe)(r,k,B),shortcut:y.remove,children:(0,C.__)("Delete")})})]})})})}const hI=pI;const gI=function({clientIds:e,...t}){return(0,U.jsx)(Ns.ToolbarGroup,{children:(0,U.jsx)(Ns.ToolbarItem,{children:n=>(0,U.jsx)(hI,{clientIds:e,toggleProps:n,...t})})})};function mI({clientId:e}){const{canLock:t,isLocked:n}=uf(e),[o,r]=(0,a.useReducer)((e=>!e),!1),s=(0,a.useRef)(!1);if((0,a.useEffect)((()=>{n&&(s.current=!0)}),[n]),!n&&!s.current)return null;let i=n?(0,C.__)("Unlock"):(0,C.__)("Lock");return!t&&n&&(i=(0,C.__)("Locked")),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.ToolbarGroup,{className:"block-editor-block-lock-toolbar",children:(0,U.jsx)(Ns.ToolbarButton,{accessibleWhenDisabled:!0,disabled:!t,icon:n?hf:df,label:i,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog"})}),o&&(0,U.jsx)(ff,{clientId:e,onClose:r})]})}const fI=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.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"})}),bI=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z"})}),vI=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z"})}),kI=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z",fillRule:"evenodd",clipRule:"evenodd"})}),_I={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}};const xI=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=af(),{replaceBlocks:r}=(0,c.useDispatch)($r),{canRemove:s,variations:i}=(0,c.useSelect)((e=>{const{canRemoveBlocks:o}=e($r),{getBlockVariations:r}=e(l.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),a=o=>{const s=(0,l.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),s&&s.length>0&&(s[0].attributes.layout=_I[o],r(t,s))};if(!o||!s)return null;const u=!!i.find((({name:e})=>"group-row"===e)),d=!!i.find((({name:e})=>"group-stack"===e)),p=!!i.find((({name:e})=>"group-grid"===e));return(0,U.jsxs)(Ns.ToolbarGroup,{children:[(0,U.jsx)(Ns.ToolbarButton,{icon:fI,label:(0,C._x)("Group","verb"),onClick:a}),u&&(0,U.jsx)(Ns.ToolbarButton,{icon:bI,label:(0,C._x)("Row","single horizontal line"),onClick:()=>a("row")}),d&&(0,U.jsx)(Ns.ToolbarButton,{icon:vI,label:(0,C._x)("Stack","verb"),onClick:()=>a("stack")}),p&&(0,U.jsx)(Ns.ToolbarButton,{icon:kI,label:(0,C._x)("Grid","verb"),onClick:()=>a("grid")})]})};function yI({clientIds:e}){const t=1===e.length?e[0]:void 0,n=(0,c.useSelect)((e=>!!t&&"html"===e($r).getBlockMode(t)),[t]),{toggleBlockMode:o}=(0,c.useDispatch)($r);return n?(0,U.jsx)(Ns.ToolbarGroup,{children:(0,U.jsx)(Ns.ToolbarButton,{onClick:()=>{o(t)},children:(0,C.__)("Edit visually")})}):null}const SI=(0,a.createContext)("");function wI(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function CI(e){return e.contains(e.ownerDocument.activeElement)}function BI({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:n,defaultIndex:o,onIndexChange:r,shouldUseKeyboardFocusShortcut:s,focusEditorOnEscape:i}){const[l]=(0,a.useState)(t),[u]=(0,a.useState)(o),d=(0,a.useCallback)((()=>{!function(e){const[t]=la.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[e]);(0,my.useShortcut)("core/block-editor/focus-toolbar",(()=>{s&&d()})),(0,a.useEffect)((()=>{l&&d()}),[n,l,d]),(0,a.useEffect)((()=>{const t=e.current;let n=0;return l||CI(t)||(n=window.requestAnimationFrame((()=>{const e=wI(t),n=u||0;e[n]&&CI(t)&&e[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(n),!r||!t)return;const e=wI(t).findIndex((e=>0===e.tabIndex));r(e)}}),[u,l,r,e]);const{getLastFocus:p}=Q((0,c.useSelect)($r));(0,a.useEffect)((()=>{const t=e.current;if(i){const e=e=>{const t=p();e.keyCode===ca.ESCAPE&&t?.current&&(e.preventDefault(),t.current.focus())};return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}}),[i,p,e])}function II({children:e,focusOnMount:t,focusEditorOnEscape:n=!1,shouldUseKeyboardFocusShortcut:o=!0,__experimentalInitialIndex:r,__experimentalOnIndexChange:s,...i}){const l=(0,a.useRef)(),c=function(e){const[t,n]=(0,a.useState)(!0),o=(0,a.useCallback)((()=>{const t=!la.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||y()("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)}),[e]);return(0,a.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[o,t,e]),t}(l);return BI({toolbarRef:l,focusOnMount:t,defaultIndex:r,onIndexChange:s,isAccessibleToolbar:c,shouldUseKeyboardFocusShortcut:o,focusEditorOnEscape:n}),c?(0,U.jsx)(Ns.Toolbar,{label:i["aria-label"],ref:l,...i,children:e}):(0,U.jsx)(Ns.NavigableMenu,{orientation:"horizontal",role:"toolbar",ref:l,...i,children:e})}const jI=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/SVG",children:(0,U.jsx)(G.Path,{d:"M17.192 6.75L15.47 5.03l1.06-1.06 3.537 3.53-3.537 3.53-1.06-1.06 1.723-1.72h-3.19c-.602 0-.993.202-1.28.498-.309.319-.538.792-.695 1.383-.13.488-.222 1.023-.296 1.508-.034.664-.116 1.413-.303 2.117-.193.721-.513 1.467-1.068 2.04-.575.594-1.359.954-2.357.954H4v-1.5h4.003c.601 0 .993-.202 1.28-.498.308-.319.538-.792.695-1.383.149-.557.216-1.093.288-1.662l.039-.31a9.653 9.653 0 0 1 .272-1.653c.193-.722.513-1.467 1.067-2.04.576-.594 1.36-.954 2.358-.954h3.19zM8.004 6.75c.8 0 1.46.23 1.988.628a6.24 6.24 0 0 0-.684 1.396 1.725 1.725 0 0 0-.024-.026c-.287-.296-.679-.498-1.28-.498H4v-1.5h4.003zM12.699 14.726c-.161.459-.38.94-.684 1.396.527.397 1.188.628 1.988.628h3.19l-1.722 1.72 1.06 1.06L20.067 16l-3.537-3.53-1.06 1.06 1.723 1.72h-3.19c-.602 0-.993-.202-1.28-.498a1.96 1.96 0 0 1-.024-.026z"})}),EI=[];function TI(e){return(0,U.jsx)(Ns.ToolbarGroup,{children:(0,U.jsx)(Ns.ToolbarButton,{...e})})}function MI({clientId:e,as:t=TI}){const{categories:n,patterns:o,patternName:r}=(0,c.useSelect)((t=>{const{getBlockAttributes:n,getBlockRootClientId:o,__experimentalGetAllowedPatterns:r}=t($r),s=n(e),i=s?.metadata?.categories||EI,l=s?.metadata?.patternName;return{categories:i,patterns:r(o(e)),patternName:l}}),[e]),{replaceBlocks:s}=(0,c.useDispatch)($r),i=(0,a.useMemo)((()=>n&&0!==n.length&&o&&0!==o.length?o.filter((e=>1===e.blocks.length&&e.categories?.some((e=>n.includes(e)))&&("unsynced"===e.syncStatus||!e.id))):EI),[n,o]);if(i.length<2)return null;const l=t;return(0,U.jsx)(l,{label:(0,C.__)("Shuffle"),icon:jI,onClick:()=>{const t=function(){const e=i.length,t=i.findIndex((({name:e})=>e===r));return i[t+1<e?t+1:0]}();t.blocks[0].attributes={...t.blocks[0].attributes,metadata:{...t.blocks[0].attributes.metadata,categories:n}},s(e,t.blocks)}})}function PI(e="default"){const t=As[e]?.Slot,n=(0,Ns.__experimentalUseSlotFills)(t?.__unstableName);return t?!!n?.length:null}function RI(){const{isToolbarEnabled:e,isDefaultEditingMode:t}=(0,c.useSelect)((e=>{const{getBlockEditingMode:t,getBlockName:n,getBlockSelectionStart:o}=e($r),r=o(),s=r&&(0,l.getBlockType)(n(r));return{isToolbarEnabled:s&&(0,l.hasBlockSupport)(s,"__experimentalToolbar",!0),isDefaultEditingMode:"default"===t(r)}}),[]),n=function(){let e=!1;for(const t in As)PI(t)&&(e=!0);return e}();return!(!e||!t&&!n)}function NI({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,variant:r="unstyled"}){const{blockClientId:s,blockClientIds:i,isDefaultEditingMode:d,blockType:p,toolbarKey:h,shouldShowVisualToolbar:g,showParentSelector:m,isUsingBindings:f}=(0,c.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getBlockParents:o,getSelectedBlockClientIds:r,isBlockValid:s,getBlockRootClientId:i,getBlockEditingMode:a,getBlockAttributes:c}=e($r),u=r(),d=u[0],p=i(d),h=o(d),g=h[h.length-1],m=t(g),f=(0,l.getBlockType)(m),b="default"===a(d),v=t(d),k=u.every((e=>s(e))),_=u.every((e=>"visual"===n(e))),x=u.every((e=>!!c(e)?.metadata?.bindings));return{blockClientId:d,blockClientIds:u,isDefaultEditingMode:b,blockType:d&&(0,l.getBlockType)(v),shouldShowVisualToolbar:k&&_,rootClientId:p,toolbarKey:`${d}${g}`,showParentSelector:f&&"default"===a(g)&&(0,l.hasBlockSupport)(f,"__experimentalParentSelector",!0)&&1===u.length&&b,isUsingBindings:x}}),[]),b=(0,a.useRef)(null),v=(0,a.useRef)(),k=gB({ref:v}),_=!(0,u.useViewportMatch)("medium","<");if(!RI())return null;const x=i.length>1,y=(0,l.isReusableBlock)(p)||(0,l.isTemplatePart)(p),S=Bs("block-editor-block-contextual-toolbar",{"has-parent":m}),w=Bs("block-editor-block-toolbar",{"is-synced":y,"is-connected":f});return(0,U.jsx)(II,{focusEditorOnEscape:!0,className:S,"aria-label":(0,C.__)("Block tools"),variant:"toolbar"===r?void 0:r,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,children:(0,U.jsxs)("div",{ref:b,className:w,children:[!x&&_&&d&&(0,U.jsx)(mB,{}),(g||x)&&(d||y)&&(0,U.jsx)("div",{ref:v,...k,children:(0,U.jsxs)(Ns.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls",children:[(0,U.jsx)(FB,{clientIds:i,disabled:!d,isUsingBindings:f}),d&&(0,U.jsxs)(U.Fragment,{children:[!x&&(0,U.jsx)(mI,{clientId:s}),(0,U.jsx)(cB,{clientIds:i,hideDragHandle:e})]})]})}),(0,U.jsx)(MI,{clientId:s}),g&&x&&(0,U.jsx)(xI,{}),g&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Fs.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,U.jsx)(Fs.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,U.jsx)(Fs.Slot,{className:"block-editor-block-toolbar__slot"}),(0,U.jsx)(Fs.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,U.jsx)(Fs.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,U.jsx)(SI.Provider,{value:p?.name,children:(0,U.jsx)(UB.Slot,{})})]}),(0,U.jsx)(yI,{clientIds:i}),d&&(0,U.jsx)(gI,{clientIds:i})]})},h)}function AI({hideDragHandle:e,variant:t}){return(0,U.jsx)(NI,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0})}function LI({clientId:e,isTyping:t,__unstableContentRef:n}){const{capturingClientId:o,isInsertionPointVisible:r,lastClientId:s}=XC(e),i=(0,a.useRef)();(0,a.useEffect)((()=>{i.current=void 0}),[e]);const{stopTyping:l}=(0,c.useDispatch)($r),u=(0,a.useRef)(!1);(0,my.useShortcut)("core/block-editor/focus-toolbar",(()=>{u.current=!0,l(!0)})),(0,a.useEffect)((()=>{u.current=!1}));const d=YC({contentElement:n?.current,clientId:e});return!t&&(0,U.jsx)(ol,{clientId:o||e,bottomClientId:s,className:Bs("block-editor-block-list__block-popover",{"is-insertion-point-visible":r}),resize:!1,...d,children:(0,U.jsx)(NI,{focusOnMount:u.current,__experimentalInitialIndex:i.current,__experimentalOnIndexChange:e=>{i.current=e},variant:"toolbar"})})}const OI=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})});const DI=function({clientId:e,rootClientId:t}){const n=(0,c.useSelect)((n=>{const{getBlock:o,getBlockIndex:r,hasBlockMovingClientId:s,getBlockListSettings:i,__unstableGetEditorMode:a,getNextBlockClientId:c,getPreviousBlockClientId:u,canRemoveBlock:d,canMoveBlock:p}=n($r),{getActiveBlockVariation:h,getBlockType:g}=n(l.store),m=r(e),{name:f,attributes:b}=o(e),v=g(f),k=i(t)?.orientation,_=h(f,b),x="core/template-part"===v?.name;let y=!1;const S=c();if(S){const{name:e}=o(S),t=g(e);y="core/template-part"===t?.name}let w=!1;const C=u();if(C){const{name:e}=o(C),t=g(e);w="core/template-part"===t?.name}return{blockMovingMode:s(),editorMode:a(),icon:_?.icon||v.icon,label:(0,l.__experimentalGetAccessibleBlockLabel)(v,b,m+1,k),isBlockTemplatePart:x,isNextBlockTemplatePart:y,isPrevBlockTemplatePart:w,canRemove:d(e),canMove:p(e)}}),[e,t]),{label:o,icon:r,blockMovingMode:s,editorMode:i,isBlockTemplatePart:u,isNextBlockTemplatePart:d,isPrevBlockTemplatePart:p,canRemove:h,canMove:g}=n,{setNavigationMode:m,removeBlock:f}=(0,c.useDispatch)($r),b=(0,a.useRef)();(0,a.useEffect)((()=>{"navigation"===i&&(b.current.focus(),(0,Eo.speak)(o))}),[o,i]);const v=Ji(e),{hasBlockMovingClientId:k,getBlockIndex:_,getBlockRootClientId:x,getClientIdsOfDescendants:y,getSelectedBlockClientId:S,getMultiSelectedBlocksEndClientId:w,getPreviousBlockClientId:B,getNextBlockClientId:I}=(0,c.useSelect)($r),{selectBlock:j,clearSelectedBlock:E,setBlockMovingClientId:T,moveBlockToPosition:M}=(0,c.useDispatch)($r),P=Bs("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!s}),R=(0,C.__)("Drag"),N=g&&"navigation"===i||"zoom-out"===i&&g&&!u;return(0,U.jsx)("div",{className:P,children:(0,U.jsxs)(Ns.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content",children:[(0,U.jsx)(Ns.FlexItem,{children:(0,U.jsx)(Tf,{icon:r,showColors:!0})}),N&&(0,U.jsx)(Ns.FlexItem,{children:(0,U.jsx)(JC,{clientIds:[e],children:e=>(0,U.jsx)(Ns.Button,{icon:gS,className:"block-selection-button_drag-handle","aria-hidden":"true",label:R,tabIndex:"-1",...e})})}),"zoom-out"===i&&!u&&(0,U.jsx)(Ns.FlexItem,{children:(0,U.jsx)(cB,{clientIds:[e],hideDragHandle:!0,isBlockMoverUpButtonDisabled:p,isBlockMoverDownButtonDisabled:d})}),g&&h&&"zoom-out"===i&&(0,U.jsx)(MI,{clientId:e,as:Ns.Button}),h&&"zoom-out"===i&&!u&&(0,U.jsx)(Ns.FlexItem,{children:(0,U.jsx)(Ns.ToolbarButton,{icon:OI,label:"Delete",onClick:()=>{f(e)}})}),"navigation"===i&&(0,U.jsx)(Ns.FlexItem,{children:(0,U.jsx)(Ns.Button,{ref:b,onClick:"navigation"===i?()=>m(!1):void 0,onKeyDown:function(t){const{keyCode:n}=t,o=n===ca.UP,r=n===ca.DOWN,s=n===ca.LEFT,l=n===ca.RIGHT,a=n===ca.TAB,c=n===ca.ESCAPE,u=n===ca.ENTER,d=n===ca.SPACE,p=t.shiftKey;if(c&&"navigation"===i)return m(!1),void t.preventDefault();if(n===ca.BACKSPACE||n===ca.DELETE)return f(e),void t.preventDefault();const h=S(),g=w(),b=B(g||h),C=I(g||h),P=a&&p||o,R=a&&!p||r,N=s,A=l;let L;if(P)L=b;else if(R)L=C;else if(N){var O;L=null!==(O=x(h))&&void 0!==O?O:h}else if(A){var D;L=null!==(D=y(h)[0])&&void 0!==D?D:h}const z=k();if(c&&z&&!t.defaultPrevented&&(T(null),t.preventDefault()),(u||d)&&z){const e=x(z),t=x(h),n=_(z);let o=_(h);n<o&&e===t&&(o-=1),M(z,e,t,o),j(z),T(null)}if((!z||h!==z||!A)&&(R||P||N||A))if(L)t.preventDefault(),j(L);else if(a&&h){let e;if(R){e=v;do{e=la.focus.tabbable.findNext(e)}while(e&&v.contains(e));e||(e=v.ownerDocument.defaultView.frameElement,e=la.focus.tabbable.findNext(e))}else e=la.focus.tabbable.findPrevious(v);e&&(t.preventDefault(),e.focus(),E())}},label:o,showTooltip:!1,className:"block-selection-button_select-button",children:(0,U.jsx)($b,{clientId:e,maximumLength:35})})})]})})};function zI({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:r,rootClientId:s}=XC(e),i=YC({contentElement:t?.current,clientId:e});return(0,U.jsx)(nl,{clientId:n||e,bottomClientId:r,className:Bs("block-editor-block-list__block-popover",{"is-insertion-point-visible":o}),resize:!1,...i,children:(0,U.jsx)(DI,{clientId:e,rootClientId:s})})}const VI=function(){const[e,t]=(0,a.useState)(!1),{blockOrder:n,sectionRootClientId:o,insertionPoint:r,setInserterIsOpened:s,selectedSection:i}=(0,c.useSelect)((e=>{const{getSettings:t,getBlockOrder:n}=e($r),{sectionRootClientId:o}=Q(t()),r=e("core/editor");return{selectedSection:r.getSelectedBlock(),blockOrder:n(o),insertionPoint:Q(r).getInsertionPoint(),sectionRootClientId:o,setInserterIsOpened:t().__experimentalSetIsInserterOpened}}),[]),l=(0,a.useRef)(!1);return(0,a.useEffect)((()=>{l.current?s(!0):l.current=!0}),[n,s]),(0,a.useEffect)((()=>{const e=setTimeout((()=>{t(!0)}),500);return()=>{clearTimeout(e)}}),[]),e&&i?[void 0,...n].map(((e,t)=>(0,U.jsxs)(rC,{previousClientId:e,nextClientId:n[t],children:[r.insertionIndex===t&&(0,U.jsx)("div",{style:{borderRadius:"0",height:"12px",opacity:1,transform:"translateY(-50%)",width:"100%"},className:"block-editor-block-list__insertion-point-indicator"}),r.insertionIndex!==t&&(0,U.jsx)(Ns.Button,{variant:"primary",icon:Ba,size:"compact",className:"block-editor-button-pattern-inserter__button",onClick:()=>{s({rootClientId:o,insertionIndex:t,tab:"patterns",category:"all"})},label:(0,C._x)("Add pattern","Generic label for pattern inserter button")})]},t))):null};function FI(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getSettings:o,__unstableGetEditorMode:r,isTyping:s}=e($r),i=t()||n(),l=r();return{clientId:i,hasFixedToolbar:o().hasFixedToolbar,isTyping:s(),isZoomOutMode:"zoom-out"===l}}function HI({children:e,__unstableContentRef:t,...n}){const{clientId:o,hasFixedToolbar:r,isTyping:s,isZoomOutMode:i}=(0,c.useSelect)(FI,[]),u=(0,my.__unstableUseShortcutEventMatch)(),{getBlocksByClientId:d,getSelectedBlockClientIds:p,getBlockRootClientId:h,isGroupable:g}=(0,c.useSelect)($r),{getGroupingBlockName:m}=(0,c.useSelect)(l.store),{showEmptyBlockSideInserter:f,showBreadcrumb:b,showBlockToolbarPopover:v}=(0,c.useSelect)((e=>{const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlock:o,getSettings:r,hasMultiSelection:s,__unstableGetEditorMode:i,isTyping:a}=e($r),c=t()||n(),u=o(c)||{name:"",attributes:{}},d=i(),p=c&&u?.name,h=(0,l.isUnmodifiedDefaultBlock)(u),g=c&&!a()&&"edit"===d&&h,m=p&&!s()&&("navigation"===d||"zoom-out"===d);return{showEmptyBlockSideInserter:g,showBreadcrumb:!g&&m,showBlockToolbarPopover:!r().hasFixedToolbar&&!g&&p&&!h&&!m}}),[]),{duplicateBlocks:k,removeBlocks:_,replaceBlocks:x,insertAfterBlock:y,insertBeforeBlock:S,selectBlock:w,moveBlocksUp:B,moveBlocksDown:I,expandBlock:j}=Q((0,c.useDispatch)($r));const E=el(t),T=el(t);return(0,U.jsx)("div",{...n,onKeyDown:function(e){if(!e.defaultPrevented)if(u("core/block-editor/move-up",e)){const t=p();if(t.length){e.preventDefault();const n=h(t[0]);B(t,n)}}else if(u("core/block-editor/move-down",e)){const t=p();if(t.length){e.preventDefault();const n=h(t[0]);I(t,n)}}else if(u("core/block-editor/duplicate",e)){const t=p();t.length&&(e.preventDefault(),k(t))}else if(u("core/block-editor/remove",e)){const t=p();t.length&&(e.preventDefault(),_(t))}else if(u("core/block-editor/insert-after",e)){const t=p();t.length&&(e.preventDefault(),y(t[t.length-1]))}else if(u("core/block-editor/insert-before",e)){const t=p();t.length&&(e.preventDefault(),S(t[0]))}else if(u("core/block-editor/unselect",e)){if(e.target.closest("[role=toolbar]"))return;const t=p();t.length>1&&(e.preventDefault(),w(t[0]))}else if(u("core/block-editor/collapse-list-view",e)){if((0,la.isTextField)(e.target)||(0,la.isTextField)(e.target?.contentWindow?.document?.activeElement))return;e.preventDefault(),j(o)}else if(u("core/block-editor/group",e)){const t=p();if(t.length>1&&g(t)){e.preventDefault();const n=d(t),o=m(),r=(0,l.switchToBlockType)(n,o);x(t,r),(0,Eo.speak)((0,C.__)("Selected blocks are grouped."))}}},children:(0,U.jsxs)(lC.Provider,{value:(0,a.useRef)(!1),children:[!s&&(0,U.jsx)(cC,{__unstableContentRef:t}),f&&(0,U.jsx)(QC,{__unstableContentRef:t,clientId:o}),v&&(0,U.jsx)(LI,{__unstableContentRef:t,clientId:o,isTyping:s}),b&&(0,U.jsx)(zI,{__unstableContentRef:t,clientId:o}),!i&&!r&&(0,U.jsx)(Ns.Popover.Slot,{name:"block-toolbar",ref:E}),e,(0,U.jsx)(Ns.Popover.Slot,{name:"__unstable-block-tools-after",ref:T}),window.__experimentalEnableZoomedOutPatternsTab&&i&&(0,U.jsx)(VI,{__unstableContentRef:t})]})})}const GI=window.wp.commands,UI=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M19.75 9c0-1.257-.565-2.197-1.39-2.858-.797-.64-1.827-1.017-2.815-1.247-1.802-.42-3.703-.403-4.383-.396L11 4.5V6l.177-.001c.696-.006 2.416-.02 4.028.356.887.207 1.67.518 2.216.957.52.416.829.945.829 1.688 0 .592-.167.966-.407 1.23-.255.281-.656.508-1.236.674-1.19.34-2.82.346-4.607.346h-.077c-1.692 0-3.527 0-4.942.404-.732.209-1.424.545-1.935 1.108-.526.579-.796 1.33-.796 2.238 0 1.257.565 2.197 1.39 2.858.797.64 1.827 1.017 2.815 1.247 1.802.42 3.703.403 4.383.396L13 19.5h.714V22L18 18.5 13.714 15v3H13l-.177.001c-.696.006-2.416.02-4.028-.356-.887-.207-1.67-.518-2.216-.957-.52-.416-.829-.945-.829-1.688 0-.592.167-.966.407-1.23.255-.281.656-.508 1.237-.674 1.189-.34 2.819-.346 4.606-.346h.077c1.692 0 3.527 0 4.941-.404.732-.209 1.425-.545 1.936-1.108.526-.579.796-1.33.796-2.238z"})}),$I=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"})}),WI=()=>{const{replaceBlocks:e,multiSelect:t}=(0,c.useDispatch)($r),{blocks:n,clientIds:o,canRemove:r,possibleBlockTransformations:s,invalidSelection:i}=(0,c.useSelect)((e=>{const{getBlockRootClientId:t,getBlockTransformItems:n,getSelectedBlockClientIds:o,getBlocksByClientId:r,canRemoveBlocks:s}=e($r),i=o(),l=r(i);if(l.filter((e=>!e)).length>0)return{invalidSelection:!0};return{blocks:l,clientIds:i,possibleBlockTransformations:n(l,t(i[0])),canRemove:s(i),invalidSelection:!1}}),[]);if(i)return{isLoading:!1,commands:[]};const a=1===n.length&&(0,l.isTemplatePart)(n[0]);function u(r){const s=(0,l.switchToBlockType)(n,r);var i;e(o,s),(i=s).length>1&&t(i[0].clientId,i[i.length-1].clientId)}const d=!!s.length&&r&&!a;if(!o||o.length<1||!d)return{isLoading:!1,commands:[]};return{isLoading:!1,commands:s.map((e=>{const{name:t,title:n,icon:o}=e;return{name:"core/block-editor/transform-to-"+t.replace("/","-"),label:(0,C.sprintf)((0,C.__)("Transform to %s"),n),icon:(0,U.jsx)(Tf,{icon:o}),callback:({close:e})=>{u(t),e()}}}))}},KI=()=>{const{clientIds:e}=(0,c.useSelect)((e=>{const{getSelectedBlockClientIds:t}=e($r);return{clientIds:t()}}),[]),{getBlockRootClientId:t,canMoveBlocks:n,getBlockCount:o}=(0,c.useSelect)($r),{setBlockMovingClientId:r,setNavigationMode:s,selectBlock:i}=(0,c.useDispatch)($r);if(!e||e.length<1)return{isLoading:!1,commands:[]};const l=t(e[0]),a=[];return n(e)&&1!==o(l)&&a.push({name:"move-to",label:(0,C.__)("Move to"),callback:()=>{s(!0),i(e[0]),r(e[0])},icon:UI}),{isLoading:!1,commands:a.map((e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}})))}},ZI=()=>{const{clientIds:e,isUngroupable:t,isGroupable:n}=(0,c.useSelect)((e=>{const{getSelectedBlockClientIds:t,isUngroupable:n,isGroupable:o}=e($r);return{clientIds:t(),isUngroupable:n(),isGroupable:o()}}),[]),{canInsertBlockType:o,getBlockRootClientId:r,getBlocksByClientId:s,canRemoveBlocks:i}=(0,c.useSelect)($r),{getDefaultBlockName:a,getGroupingBlockName:u}=(0,c.useSelect)(l.store),d=s(e),{removeBlocks:p,replaceBlocks:h,duplicateBlocks:g,insertAfterBlock:m,insertBeforeBlock:f}=(0,c.useDispatch)($r),b=()=>{if(!d.length)return;const t=u(),n=(0,l.switchToBlockType)(d,t);n&&h(e,n)},v=()=>{if(!d.length)return;const t=d[0].innerBlocks;t.length&&h(e,t)};if(!e||e.length<1)return{isLoading:!1,commands:[]};const k=r(e[0]),_=o(a(),k),x=d.every((e=>!!e&&(0,l.hasBlockSupport)(e.name,"multiple",!0)&&o(e.name,k))),y=i(e),S=[];return x&&S.push({name:"duplicate",label:(0,C.__)("Duplicate"),callback:()=>g(e,!0),icon:fB}),_&&S.push({name:"add-before",label:(0,C.__)("Add before"),callback:()=>{const t=Array.isArray(e)?e[0]:t;f(t)},icon:Ba},{name:"add-after",label:(0,C.__)("Add after"),callback:()=>{const t=Array.isArray(e)?e[e.length-1]:t;m(t)},icon:Ba}),n&&S.push({name:"Group",label:(0,C.__)("Group"),callback:b,icon:fI}),t&&S.push({name:"ungroup",label:(0,C.__)("Ungroup"),callback:v,icon:$I}),y&&S.push({name:"remove",label:(0,C.__)("Delete"),callback:()=>p(e,!0),icon:OI}),{isLoading:!1,commands:S.map((e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}})))}},qI=()=>{(0,GI.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:WI}),(0,GI.useCommandLoader)({name:"core/block-editor/blockActions",hook:KI}),(0,GI.useCommandLoader)({name:"core/block-editor/blockQuickActions",hook:ZI,context:"block-selection-edit"})};function YI({shouldIframe:e=!0,height:t="300px",children:n=(0,U.jsx)(FC,{}),styles:o,contentRef:r,iframeProps:s}){qI();const i=NC(),l=_y(),c=(0,a.useRef)(),d=(0,u.useMergeRefs)([r,l,c]);return e?(0,U.jsx)(HI,{__unstableContentRef:c,style:{height:t,display:"flex"},children:(0,U.jsxs)($y,{...s,ref:i,contentRef:d,style:{...s?.style},name:"editor-canvas",children:[(0,U.jsx)(nS,{styles:o}),n]})}):(0,U.jsxs)(HI,{__unstableContentRef:c,style:{height:t,display:"flex"},children:[(0,U.jsx)(nS,{styles:o,scope:".editor-styles-wrapper"}),(0,U.jsx)(Vy,{ref:d,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%"},children:n})]})}const XI=function({children:e,height:t,styles:n}){return(0,U.jsx)(YI,{height:t,styles:n,children:e})},QI=()=>(0,U.jsx)(Ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:(0,U.jsx)(Ns.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"})}),JI=({style:e,className:t})=>(0,U.jsx)("div",{className:"block-library-colors-selector__icon-container",children:(0,U.jsx)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e,children:(0,U.jsx)(QI,{})})}),ej=({TextColor:e,BackgroundColor:t})=>({onToggle:n,isOpen:o})=>(0,U.jsx)(Ns.ToolbarGroup,{children:(0,U.jsx)(Ns.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,C.__)("Open Colors Selector"),onClick:n,onKeyDown:e=>{o||e.keyCode!==ca.DOWN||(e.preventDefault(),n())},icon:(0,U.jsx)(t,{children:(0,U.jsx)(e,{children:(0,U.jsx)(JI,{})})})})}),tj=({children:e,...t})=>(y()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,U.jsx)(Ns.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:ej(t),renderContent:()=>e})),nj=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),oj=(0,a.createContext)({}),rj=()=>(0,a.useContext)(oj);function sj({children:e,...t}){const n=(0,a.useRef)();return(0,a.useEffect)((()=>{n.current&&(n.current.textContent=n.current.textContent)}),[e]),(0,U.jsx)("div",{hidden:!0,...t,ref:n,children:e})}const ij=(0,a.forwardRef)((({nestingLevel:e,blockCount:t,clientId:n,...o},r)=>{const{insertedBlock:s,setInsertedBlock:i}=rj(),l=(0,u.useInstanceId)(ij),d=(0,c.useSelect)((e=>{const{getTemplateLock:t,__unstableGetEditorMode:o}=e($r);return!!t(n)||"zoom-out"===o()}),[n]),p=Ub({clientId:n,context:"list-view"}),h=Ub({clientId:s?.clientId,context:"list-view"});if((0,a.useEffect)((()=>{h?.length&&(0,Eo.speak)((0,C.sprintf)((0,C.__)("%s block inserted"),h),"assertive")}),[h]),d)return null;const g=`list-view-appender__${l}`,m=(0,C.sprintf)((0,C.__)("Append to %1$s block at position %2$d, Level %3$d"),p,t+1,e);return(0,U.jsxs)("div",{className:"list-view-appender",children:[(0,U.jsx)(qw,{ref:r,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0,...o,toggleProps:{"aria-describedby":g},onSelectOrClose:e=>{e?.clientId&&i(e)}}),(0,U.jsx)(sj,{id:g,children:m})]})})),lj=Dx(Ns.__experimentalTreeGridRow),aj=(0,a.forwardRef)((({isDragged:e,isSelected:t,position:n,level:o,rowCount:r,children:s,className:i,path:l,...a},c)=>{const d=Vx({clientId:a["data-block"],enableAnimation:!0,triggerAnimationOnChange:l}),p=(0,u.useMergeRefs)([c,d]);return(0,U.jsx)(lj,{ref:p,className:Bs("block-editor-list-view-leaf",i),level:o,positionInSet:n,setSize:r,isExpanded:void 0,...a,children:s})})),cj=aj;const uj=(0,U.jsx)(G.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.Path,{d:"M10.97 10.159a3.382 3.382 0 0 0-2.857.955l1.724 1.723-2.836 2.913L7 17h1.25l2.913-2.837 1.723 1.723a3.38 3.38 0 0 0 .606-.825c.33-.63.446-1.343.35-2.032L17 10.695 13.305 7l-2.334 3.159Z"})}),dj=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"})});function pj({onClick:e}){return(0,U.jsx)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander",children:(0,U.jsx)(Ui,{icon:(0,C.isRTL)()?ka:_a})})}const hj=3;function gj(e){if("core/image"===e.name)return e.attributes?.url?{url:e.attributes.url,alt:e.attributes.alt,clientId:e.clientId}:void 0}function mj(e,t){const n=gj(e);return n?[n]:t?[]:function(e){if("core/gallery"!==e.name||!e.innerBlocks)return[];const t=[];for(const n of e.innerBlocks){const e=gj(n);if(e&&t.push(e),t.length>=hj)return t}return t}(e)}const fj=(0,a.forwardRef)((function({className:e,block:{clientId:t},onClick:n,onContextMenu:o,onMouseDown:r,onToggleExpanded:s,tabIndex:i,onFocus:l,onDragStart:u,onDragEnd:d,draggable:p,isExpanded:h,ariaDescribedBy:g},m){const f=dm(t),b=Ub({clientId:t,context:"list-view"}),{isLocked:v}=uf(t),{isContentOnly:k}=(0,c.useSelect)((e=>({isContentOnly:"contentOnly"===e($r).getBlockEditingMode(t)})),[t]),_=v&&!k,x="sticky"===f?.positionType,y=function({clientId:e,isExpanded:t}){const{block:n}=(0,c.useSelect)((t=>({block:t($r).getBlock(e)})),[e]);return(0,a.useMemo)((()=>mj(n,t)),[n,t])}({clientId:t,isExpanded:h}),S=f?.positionLabel?(0,C.sprintf)((0,C.__)("Position: %1$s"),f.positionLabel):"";return(0,U.jsxs)(Ns.Button,{className:Bs("block-editor-list-view-block-select-button",e),onClick:n,onContextMenu:o,onKeyDown:function(e){e.keyCode!==ca.ENTER&&e.keyCode!==ca.SPACE||n(e)},onMouseDown:r,ref:m,tabIndex:i,onFocus:l,onDragStart:e=>{e.dataTransfer.clearData(),u?.(e)},onDragEnd:d,draggable:p,href:`#block-${t}`,"aria-describedby":g,"aria-expanded":h,children:[(0,U.jsx)(pj,{onClick:s}),(0,U.jsx)(Tf,{icon:f?.icon,showColors:!0,context:"list-view"}),(0,U.jsxs)(Ns.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[(0,U.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,U.jsx)(Ns.__experimentalTruncate,{ellipsizeMode:"auto",children:b})}),f?.anchor&&(0,U.jsx)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:(0,U.jsx)(Ns.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto",children:f.anchor})}),S&&x&&(0,U.jsx)(Ns.Tooltip,{text:S,children:(0,U.jsx)(Ui,{icon:uj})}),y.length?(0,U.jsx)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:y.map(((e,t)=>(0,U.jsx)("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${e.url})`,zIndex:y.length-t}},e.clientId)))}):null,_&&(0,U.jsx)("span",{className:"block-editor-list-view-block-select-button__lock",children:(0,U.jsx)(Ui,{icon:dj})})]})]})})),bj=(0,a.forwardRef)((({onClick:e,onToggleExpanded:t,block:n,isSelected:o,position:r,siblingBlockCount:s,level:i,isExpanded:l,selectedClientIds:a,...u},d)=>{const{clientId:p}=n,{blockMovingClientId:h,selectedBlockInBlockEditor:g}=(0,c.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e($r);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[]),{AdditionalBlockContent:m,insertedBlock:f,setInsertedBlock:b}=rj(),v=Bs("block-editor-list-view-block-contents",{"is-dropping-before":h&&g===p}),k=a.includes(p)?a:[p];return(0,U.jsxs)(U.Fragment,{children:[m&&(0,U.jsx)(m,{block:n,insertedBlock:f,setInsertedBlock:b}),(0,U.jsx)(JC,{appendToOwnerDocument:!0,clientIds:k,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:a,onDragStart:c,onDragEnd:p})=>(0,U.jsx)(fj,{ref:d,className:v,block:n,onClick:e,onToggleExpanded:t,isSelected:o,position:r,siblingBlockCount:s,level:i,draggable:a,onDragStart:c,onDragEnd:p,isExpanded:l,...u})})]})})),vj=bj;function kj(e,t){const n=()=>{const n=t?.querySelector(`[role=row][data-block="${e}"]`);return n?la.focus.focusable.find(n)[0]:null};let o=n();o?o.focus():window.requestAnimationFrame((()=>{o=n(),o&&o.focus()}))}const _j=(0,a.memo)((function e({block:{clientId:t},displacement:n,isAfterDraggedBlocks:o,isDragged:r,isNesting:s,isSelected:i,isBranchSelected:d,selectBlock:p,position:h,level:g,rowCount:m,siblingBlockCount:f,showBlockMovers:b,path:v,isExpanded:k,selectedClientIds:_,isSyncedBranch:x}){const y=(0,a.useRef)(null),S=(0,a.useRef)(null),w=(0,a.useRef)(null),[B,I]=(0,a.useState)(!1),[j,E]=(0,a.useState)(),{isLocked:T,canEdit:M,canMove:P}=uf(t),R=i&&_[0]===t,N=i&&_[_.length-1]===t,{toggleBlockHighlight:A,duplicateBlocks:L,multiSelect:O,replaceBlocks:D,removeBlocks:z,insertAfterBlock:V,insertBeforeBlock:F,setOpenedBlockSettingsMenu:H}=Q((0,c.useDispatch)($r)),{canInsertBlockType:G,getSelectedBlockClientIds:$,getPreviousBlockClientId:W,getBlockRootClientId:K,getBlockOrder:Z,getBlockParents:q,getBlocksByClientId:Y,canRemoveBlocks:X,isGroupable:J}=(0,c.useSelect)($r),{getGroupingBlockName:ee}=(0,c.useSelect)(l.store),te=dm(t),{block:ne,blockName:oe,allowRightClickOverrides:re}=(0,c.useSelect)((e=>{const{getBlock:n,getBlockName:o,getSettings:r}=e($r);return{block:n(t),blockName:o(t),allowRightClickOverrides:r().allowRightClickOverrides}}),[t]),se=(0,l.hasBlockSupport)(oe,"__experimentalToolbar",!0),ie=`list-view-block-select-button__description-${(0,u.useInstanceId)(e)}`,{expand:le,collapse:ae,collapseAll:ce,BlockSettingsMenu:ue,listViewInstanceId:de,expandedState:pe,setInsertedBlock:he,treeGridElementRef:ge,rootClientId:me}=rj(),fe=(0,my.__unstableUseShortcutEventMatch)();function be(){const e=$(),n=e.includes(t),o=n?e[0]:t,r=K(o);return{blocksToUpdate:n?e:[t],firstBlockClientId:o,firstBlockRootClientId:r,selectedBlockClientIds:e}}const ve=(0,a.useCallback)((()=>{I(!0),A(t,!0)}),[t,I,A]),ke=(0,a.useCallback)((()=>{I(!1),A(t,!1)}),[t,I,A]),_e=(0,a.useCallback)((e=>{p(e,t),e.preventDefault()}),[t,p]),xe=(0,a.useCallback)(((e,t)=>{t&&p(void 0,e,null,null),kj(e,ge?.current)}),[p,ge]),ye=(0,a.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?ae(t):!1===k&&le(t)}),[t,le,ae,k]),Se=(0,a.useCallback)((e=>{se&&re&&(w.current?.click(),E(new window.DOMRect(e.clientX,e.clientY,0,0)),e.preventDefault())}),[re,w,se]),we=(0,a.useCallback)((e=>{re&&2===e.button&&e.preventDefault()}),[re]),Ce=(0,a.useMemo)((()=>{const{ownerDocument:e}=S?.current||{};if(j&&e)return{ownerDocument:e,getBoundingClientRect:()=>j}}),[j]),Be=(0,a.useCallback)((()=>{E(void 0)}),[E]);if(function({isSelected:e,selectedClientIds:t,rowItemRef:n}){const o=1===t.length;(0,a.useLayoutEffect)((()=>{if(!e||!o||!n.current)return;const t=(0,la.getScrollContainer)(n.current),{ownerDocument:r}=n.current;if(t===r.body||t===r.documentElement||!t)return;const s=n.current.getBoundingClientRect(),i=t.getBoundingClientRect();(s.top<i.top||s.bottom>i.bottom)&&n.current.scrollIntoView()}),[e,o,n])}({isSelected:i,rowItemRef:S,selectedClientIds:_}),!ne)return null;const Ie=((e,t,n)=>(0,C.sprintf)((0,C.__)("Block %1$d of %2$d, Level %3$d."),e,t,n))(h,f,g),je=(e=>e?(0,C.__)("This block is locked."):"")(T),Ee=b&&f>0,Te=Bs("block-editor-list-view-block__mover-cell",{"is-visible":B||i}),Me=Bs("block-editor-list-view-block__menu-cell",{"is-visible":B||R});let Pe;Ee?Pe=2:se||(Pe=3);const Re=Bs({"is-selected":i,"is-first-selected":R,"is-last-selected":N,"is-branch-selected":d,"is-synced-branch":x,"is-dragging":r,"has-single-cell":!se,"is-synced":te?.isSynced,"is-draggable":P,"is-displacement-normal":"normal"===n,"is-displacement-up":"up"===n,"is-displacement-down":"down"===n,"is-after-dragged-blocks":o,"is-nesting":s}),Ne=_.includes(t)?_:[t],Ae=i&&1===_.length;return(0,U.jsxs)(cj,{className:Re,isDragged:r,onKeyDown:async function(e){if(e.defaultPrevented)return;if(e.target.closest("[role=dialog]"))return;const t=[ca.BACKSPACE,ca.DELETE].includes(e.keyCode);if(fe("core/block-editor/unselect",e)&&_.length>0)e.stopPropagation(),e.preventDefault(),p(e,void 0);else if(t||fe("core/block-editor/remove",e)){var n;const{blocksToUpdate:e,firstBlockClientId:t,firstBlockRootClientId:o,selectedBlockClientIds:r}=be();if(!X(e))return;let s=null!==(n=W(t))&&void 0!==n?n:o;z(e,!1);const i=r.length>0&&0===$().length;s||(s=Z()[0]),xe(s,i)}else if(fe("core/block-editor/duplicate",e)){e.preventDefault();const{blocksToUpdate:t,firstBlockRootClientId:n}=be();if(Y(t).every((e=>!!e&&(0,l.hasBlockSupport)(e.name,"multiple",!0)&&G(e.name,n)))){const e=await L(t,!1);e?.length&&xe(e[0],!1)}}else if(fe("core/block-editor/insert-before",e)){e.preventDefault();const{blocksToUpdate:t}=be();await F(t[0]);const n=$();H(void 0),xe(n[0],!1)}else if(fe("core/block-editor/insert-after",e)){e.preventDefault();const{blocksToUpdate:t}=be();await V(t.at(-1));const n=$();H(void 0),xe(n[0],!1)}else if(fe("core/block-editor/select-all",e)){e.preventDefault();const{firstBlockRootClientId:t,selectedBlockClientIds:n}=be(),o=Z(t);if(!o.length)return;if(fa()(n,o)&&t&&t!==me)return void xe(t,!0);O(o[0],o[o.length-1],null)}else if(fe("core/block-editor/collapse-list-view",e)){e.preventDefault();const{firstBlockClientId:t}=be(),n=q(t,!1);ce(),le(n)}else if(fe("core/block-editor/group",e)){const{blocksToUpdate:t}=be();if(t.length>1&&J(t)){e.preventDefault();const n=Y(t),o=ee(),r=(0,l.switchToBlockType)(n,o);D(t,r),(0,Eo.speak)((0,C.__)("Selected blocks are grouped."));const s=$();H(void 0),xe(s[0],!1)}}},onMouseEnter:ve,onMouseLeave:ke,onFocus:ve,onBlur:ke,level:g,position:h,rowCount:m,path:v,id:`list-view-${de}-block-${t}`,"data-block":t,"data-expanded":M?k:void 0,ref:S,children:[(0,U.jsx)(Ns.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Pe,ref:y,"aria-selected":!!i,children:({ref:e,tabIndex:t,onFocus:n})=>(0,U.jsxs)("div",{className:"block-editor-list-view-block__contents-container",children:[(0,U.jsx)(vj,{block:ne,onClick:_e,onContextMenu:Se,onMouseDown:we,onToggleExpanded:ye,isSelected:i,position:h,siblingBlockCount:f,level:g,ref:e,tabIndex:Ae?0:t,onFocus:n,isExpanded:M?k:void 0,selectedClientIds:_,ariaDescribedBy:ie}),(0,U.jsx)(sj,{id:ie,children:`${Ie} ${je}`})]})}),Ee&&(0,U.jsx)(U.Fragment,{children:(0,U.jsxs)(Ns.__experimentalTreeGridCell,{className:Te,withoutGridItem:!0,children:[(0,U.jsx)(Ns.__experimentalTreeGridItem,{children:({ref:e,tabIndex:n,onFocus:o})=>(0,U.jsx)(lB,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o})}),(0,U.jsx)(Ns.__experimentalTreeGridItem,{children:({ref:e,tabIndex:n,onFocus:o})=>(0,U.jsx)(aB,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o})})]})}),se&&ue&&(0,U.jsx)(Ns.__experimentalTreeGridCell,{className:Me,"aria-selected":!!i,ref:w,children:({ref:e,tabIndex:t,onFocus:n})=>(0,U.jsx)(ue,{clientIds:Ne,block:ne,icon:ev,label:(0,C.__)("Options"),popoverProps:{anchor:Ce},toggleProps:{ref:e,className:"block-editor-list-view-block__menu",tabIndex:t,onClick:Be,onFocus:n},disableOpenOnArrowDown:!0,expand:le,expandedState:pe,setInsertedBlock:he,__experimentalSelectBlock:xe})})]})}));function xj(e,t,n,o){var r;const s=n?.includes(e.clientId);if(s)return 0;return(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(yj(t,n,o),0):1}const yj=(e,t,n)=>(o,r)=>{var s;const i=t?.includes(r.clientId);if(i)return o;return(null!==(s=e[r.clientId])&&void 0!==s?s:n)&&r.innerBlocks.length>0?o+xj(r,e,t,n):o+1},Sj=()=>{};const wj=(0,a.memo)((function e(t){const{blocks:n,selectBlock:o=Sj,showBlockMovers:r,selectedClientIds:s,level:i=1,path:l="",isBranchSelected:a=!1,listPosition:u=0,fixedListWindow:d,isExpanded:p,parentId:h,shouldShowInnerBlocks:g=!0,isSyncedBranch:m=!1,showAppender:f=!0}=t,b=dm(h),v=m||!!b?.isSynced,k=(0,c.useSelect)((e=>!h||e($r).canEditBlock(h)),[h]),{blockDropPosition:_,blockDropTargetIndex:x,firstDraggedBlockIndex:y,blockIndexes:S,expandedState:w,draggedClientIds:C}=rj();if(!k)return null;const B=f&&1===i,I=n.filter(Boolean),j=I.length,E=B?j+1:j;let T=u;return(0,U.jsxs)(U.Fragment,{children:[I.map(((t,n)=>{var u;const{clientId:h,innerBlocks:m}=t;n>0&&(T+=xj(I[n-1],w,C,p));const f=!!C?.includes(h),{displacement:b,isAfterDraggedBlocks:k,isNesting:B}=function({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:n,clientId:o,firstDraggedBlockIndex:r,isDragged:s}){let i,l,a;if(!s){l=!1;const s=e[o];a=s>r,null!=t&&void 0!==r?void 0!==s&&(i=s>=r&&s<t?"up":s<r&&s>=t?"down":"normal",l="number"==typeof t&&t-1===s&&"inside"===n):null===t&&void 0!==r?i=void 0!==s&&s>=r?"up":"normal":null!=t&&void 0===r?void 0!==s&&(i=s<t?"normal":"down"):null===t&&(i="normal")}return{displacement:i,isNesting:l,isAfterDraggedBlocks:a}}({blockIndexes:S,blockDropTargetIndex:x,blockDropPosition:_,clientId:h,firstDraggedBlockIndex:y,isDragged:f}),{itemInView:M}=d,P=M(T),R=n+1,N=l.length>0?`${l}_${R}`:`${R}`,A=!!m?.length,L=A&&g?null!==(u=w[h])&&void 0!==u?u:p:void 0,O=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(h,s),D=a||O&&A,z=f||P||O&&h===s[0]||0===n||n===j-1;return(0,U.jsxs)(c.AsyncModeProvider,{value:!O,children:[z&&(0,U.jsx)(_j,{block:t,selectBlock:o,isSelected:O,isBranchSelected:D,isDragged:f,level:i,position:R,rowCount:E,siblingBlockCount:j,showBlockMovers:r,path:N,isExpanded:!f&&L,listPosition:T,selectedClientIds:s,isSyncedBranch:v,displacement:b,isAfterDraggedBlocks:k,isNesting:B}),!z&&(0,U.jsx)("tr",{children:(0,U.jsx)("td",{className:"block-editor-list-view-placeholder"})}),A&&L&&!f&&(0,U.jsx)(e,{parentId:h,blocks:m,selectBlock:o,showBlockMovers:r,level:i+1,path:N,listPosition:T+1,fixedListWindow:d,isBranchSelected:D,selectedClientIds:s,isExpanded:p,isSyncedBranch:v})]},h)})),B&&(0,U.jsx)(Ns.__experimentalTreeGridRow,{level:i,setSize:E,positionInSet:E,isExpanded:!0,children:(0,U.jsx)(Ns.__experimentalTreeGridCell,{children:e=>(0,U.jsx)(ij,{clientId:h,nestingLevel:i,blockCount:j,...e})})})]})}));function Cj({draggedBlockClientId:e,listViewRef:t,blockDropTarget:n}){const o=dm(e),r=Ub({clientId:e,context:"list-view"}),{rootClientId:s,clientId:i,dropPosition:l}=n||{},[c,u]=(0,a.useMemo)((()=>{if(!t.current)return[];return[s?t.current.querySelector(`[data-block="${s}"]`):void 0,i?t.current.querySelector(`[data-block="${i}"]`):void 0]}),[t,s,i]),d=u||c,p=(0,C.isRTL)(),h=(0,a.useCallback)(((e,t)=>{if(!d)return 0;let n=d.offsetWidth;const o=(0,la.getScrollContainer)(d,"horizontal"),r=d.ownerDocument,s=o===r.body||o===r.documentElement;if(o&&!s){const r=o.getBoundingClientRect(),s=(0,C.isRTL)()?r.right-e.right:e.left-r.left,i=o.clientWidth;if(i<n+s&&(n=i-s),!p&&e.left+t<r.left)return n-=r.left-e.left,n;if(p&&e.right-t>r.right)return n-=e.right-r.right,n}return n-t}),[p,d]),g=(0,a.useMemo)((()=>{if(!d)return{};const e=d.getBoundingClientRect();return{width:h(e,0)}}),[h,d]),m=(0,a.useMemo)((()=>{if(!d)return{};const e=(0,la.getScrollContainer)(d),t=d.ownerDocument,n=e===t.body||e===t.documentElement;if(e&&!n){const t=e.getBoundingClientRect(),n=d.getBoundingClientRect(),o=p?t.right-n.right:n.left-t.left;if(!p&&t.left>n.left)return{transform:`translateX( ${o}px )`};if(p&&t.right<n.right)return{transform:`translateX( ${-1*o}px )`}}return{}}),[p,d]),f=(0,a.useMemo)((()=>{if(!c)return 1;const e=parseInt(c.getAttribute("aria-level"),10);return e?e+1:1}),[c]),b=(0,a.useMemo)((()=>!!d&&d.classList.contains("is-branch-selected")),[d]),v=(0,a.useMemo)((()=>{if(d&&("top"===l||"bottom"===l||"inside"===l))return{contextElement:d,getBoundingClientRect(){const e=d.getBoundingClientRect();let t=e.left,n=0;const o=(0,la.getScrollContainer)(d,"horizontal"),r=d.ownerDocument,s=o===r.body||o===r.documentElement;if(o&&!s){const e=o.getBoundingClientRect(),n=p?o.offsetWidth-o.clientWidth:0;t<e.left+n&&(t=e.left+n)}n="top"===l?e.top-2*e.height:e.top;const i=h(e,0),a=e.height;return new window.DOMRect(t,n,i,a)}}}),[d,l,h,p]);return d?(0,U.jsx)(Ns.Popover,{animate:!1,anchor:v,focusOnMount:!1,className:"block-editor-list-view-drop-indicator--preview",variant:"unstyled",flip:!1,resize:!0,children:(0,U.jsx)("div",{style:g,className:Bs("block-editor-list-view-drop-indicator__line",{"block-editor-list-view-drop-indicator__line--darker":b}),children:(0,U.jsxs)("div",{className:"block-editor-list-view-leaf","aria-level":f,children:[(0,U.jsxs)("div",{className:Bs("block-editor-list-view-block-select-button","block-editor-list-view-block-contents"),style:m,children:[(0,U.jsx)(pj,{onClick:()=>{}}),(0,U.jsx)(Tf,{icon:o?.icon,showColors:!0,context:"list-view"}),(0,U.jsx)(Ns.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:(0,U.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,U.jsx)(Ns.__experimentalTruncate,{ellipsizeMode:"auto",children:r})})})]}),(0,U.jsx)("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}function Bj(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,c.useDispatch)($r),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:s,getSelectedBlockClientIds:i,hasMultiSelection:u,hasSelectedBlock:d}=(0,c.useSelect)($r),{getBlockType:p}=(0,c.useSelect)(l.store);return{updateBlockSelection:(0,a.useCallback)((async(l,a,c,h)=>{if(!l?.shiftKey&&l?.keyCode!==ca.ESCAPE)return void n(a,h);l.preventDefault();const g="keydown"===l.type&&l.keyCode===ca.ESCAPE,m="keydown"===l.type&&(l.keyCode===ca.UP||l.keyCode===ca.DOWN||l.keyCode===ca.HOME||l.keyCode===ca.END);if(!m&&!d()&&!u())return void n(a,null);const f=i(),b=[...r(a),a];if((g||m&&!f.some((e=>b.includes(e))))&&await e(),!g){let e=s(),n=a;m&&(d()||u()||(e=a),c&&(n=c));const o=r(e),i=r(n),{start:l,end:p}=function(e,t,n,o){const r=[...n,e],s=[...o,t],i=Math.min(r.length,s.length)-1;return{start:r[i],end:s[i]}}(e,n,o,i);await t(l,p,null)}const v=i();if((l.keyCode===ca.HOME||l.keyCode===ca.END)&&v.length>1)return;const k=f.filter((e=>!v.includes(e)));let _;if(1===k.length){const e=p(o(k[0]))?.title;e&&(_=(0,C.sprintf)((0,C.__)("%s deselected."),e))}else k.length>1&&(_=(0,C.sprintf)((0,C.__)("%s blocks deselected."),k.length));_&&(0,Eo.speak)(_,"assertive")}),[e,o,p,r,s,i,u,d,t,n])}}const Ij=24;function jj(e,t){const n=e[t+1];return n&&n.isDraggedBlock?jj(e,t+1):n}const Ej=["top","bottom"];function Tj(e,t,n=!1){let o,r,s,i,l;for(let n=0;n<e.length;n++){const a=e[n];if(a.isDraggedBlock)continue;const c=a.element.getBoundingClientRect(),[u,d]=vC(t,c,Ej),p=kC(t,c);if(void 0===s||u<s||p){s=u;const t=e.indexOf(a),n=e[t-1];if("top"===d&&n&&n.rootClientId===a.rootClientId&&!n.isDraggedBlock?(r=n,o="bottom",i=n.element.getBoundingClientRect(),l=t-1):(r=a,o=d,i=c,l=t),p)break}}if(!r)return;const a=function(e,t){const n=[];let o=e;for(;o;)n.push({...o}),o=t.find((e=>e.clientId===o.rootClientId));return n}(r,e),c="bottom"===o;if(c&&r.canInsertDraggedBlocksAsChild&&(r.innerBlockCount>0&&r.isExpanded||function(e,t,n=1,o=!1){const r=o?t.right-n*Ij:t.left+n*Ij;return(o?e.x<r-Ij:e.x>r+Ij)&&e.y<t.bottom}(t,i,a.length,n))){const e=r.isExpanded?0:r.innerBlockCount||0;return{rootClientId:r.clientId,clientId:r.clientId,blockIndex:e,dropPosition:"inside"}}if(c&&r.rootClientId&&function(e,t,n=1,o=!1){const r=o?t.right-n*Ij:t.left+n*Ij;return o?e.x>r:e.x<r}(t,i,a.length,n)){const s=jj(e,l),c=r.nestingLevel,u=s?s.nestingLevel:1;if(c&&u){const d=function(e,t,n=1,o=!1){const r=o?t.right-n*Ij:t.left+n*Ij,s=o?r-e.x:e.x-r,i=Math.round(s/Ij);return Math.abs(i)}(t,i,a.length,n),p=Math.max(Math.min(d,c-u),0);if(a[p]){let t=r.blockIndex;if(a[p].nestingLevel===s?.nestingLevel)t=s?.blockIndex;else for(let n=l;n>=0;n--){const o=e[n];if(o.rootClientId===a[p].rootClientId){t=o.blockIndex+1;break}}return{rootClientId:a[p].rootClientId,clientId:r.clientId,blockIndex:t,dropPosition:o}}}}if(!r.canInsertDraggedBlocksAsSibling)return;const u=c?1:0;return{rootClientId:r.rootClientId,clientId:r.clientId,blockIndex:r.blockIndex+u,dropPosition:o}}const Mj={leading:!1,trailing:!0};function Pj({selectBlock:e}){const t=(0,c.useRegistry)(),{getBlockOrder:n,getBlockRootClientId:o,getBlocksByClientId:r,getPreviousBlockClientId:s,getSelectedBlockClientIds:i,getSettings:a,canInsertBlockType:d,canRemoveBlocks:p}=(0,c.useSelect)($r),{flashBlock:h,removeBlocks:g,replaceBlocks:m,insertBlocks:f}=(0,c.useDispatch)($r),b=Ny();return(0,u.useRefEffect)((c=>{function u(t,n){n&&e(void 0,t,null,null),kj(t,c)}function v(e){if(e.defaultPrevented)return;if(!c.contains(e.target.ownerDocument.activeElement))return;const v=e.target.ownerDocument.activeElement?.closest("[role=row]"),k=v?.dataset?.block;if(!k)return;const{blocksToUpdate:_,firstBlockClientId:x,firstBlockRootClientId:y,originallySelectedBlockClientIds:S}=function(e){const t=i(),n=t.includes(e),r=n?t[0]:e;return{blocksToUpdate:n?t:[e],firstBlockClientId:r,firstBlockRootClientId:o(r),originallySelectedBlockClientIds:t}}(k);if(0!==_.length){if(e.preventDefault(),"copy"===e.type||"cut"===e.type){1===_.length&&h(_[0]),b(e.type,_);Oy(e,r(_),t)}if("cut"===e.type){var w;if(!p(_))return;let e=null!==(w=s(x))&&void 0!==w?w:y;g(_,!1);const t=S.length>0&&0===i().length;e||(e=n()[0]),u(e,t)}else if("paste"===e.type){const{__experimentalCanUserUseUnfilteredHTML:t}=a(),n=function(e,t){const{plainText:n,html:o,files:r}=Ay(e);let s=[];if(r.length){const e=(0,l.getBlockTransforms)("from");s=r.reduce(((t,n)=>{const o=(0,l.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else s=(0,l.pasteHandler)({HTML:o,plainText:n,mode:"BLOCKS",canUserUseUnfilteredHTML:t});return s}(e,t);if(1===_.length){const[e]=_;if(n.every((t=>d(t.name,e))))return f(n,void 0,e),void u(n[0]?.clientId,!1)}m(_,n,n.length-1,-1),u(n[0]?.clientId,!1)}}}return c.ownerDocument.addEventListener("copy",v),c.ownerDocument.addEventListener("cut",v),c.ownerDocument.addEventListener("paste",v),()=>{c.ownerDocument.removeEventListener("copy",v),c.ownerDocument.removeEventListener("cut",v),c.ownerDocument.removeEventListener("paste",v)}}),[])}const Rj=(e,t)=>"clear"===t.type?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;const Nj=(0,a.forwardRef)((function e({id:t,blocks:n,dropZoneElement:o,showBlockMovers:r=!1,isExpanded:s=!1,showAppender:i=!1,blockSettingsMenu:l=pI,rootClientId:d,description:p,onSelect:h,additionalBlockContent:g},m){n&&y()("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const f=(0,u.useInstanceId)(e),{clientIdsTree:b,draggedClientIds:v,selectedClientIds:k}=function({blocks:e,rootClientId:t}){return(0,c.useSelect)((n=>{const{getDraggedBlockClientIds:o,getSelectedBlockClientIds:r,getEnabledClientIdsTree:s}=Q(n($r));return{selectedClientIds:r(),draggedClientIds:o(),clientIdsTree:null!=e?e:s(t)}}),[e,t])}({blocks:n,rootClientId:d}),_=function(e){const t=(0,a.useMemo)((()=>{const t={};let n=0;const o=e=>{e.forEach((e=>{t[e.clientId]=n,n++,e.innerBlocks.length>0&&o(e.innerBlocks)}))};return o(e),t}),[e]);return t}(b),{getBlock:x}=(0,c.useSelect)($r),{visibleBlockCount:S,shouldShowInnerBlocks:w}=(0,c.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e($r),r=v?.length>0?n(v).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[v]),{updateBlockSelection:B}=Bj(),[I,j]=(0,a.useReducer)(Rj,{}),[E,T]=(0,a.useState)(null),{setSelectedTreeId:M}=function({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,o]=(0,a.useState)(null),{selectedBlockParentClientIds:r}=(0,c.useSelect)((t=>{const{getBlockParents:n}=t($r);return{selectedBlockParentClientIds:n(e,!1)}}),[e]);return(0,a.useEffect)((()=>{n!==e&&r?.length&&t({type:"expand",clientIds:r})}),[e,r,n,t]),{setSelectedTreeId:o}}({firstSelectedBlockClientId:k[0],setExpandedState:j}),P=(0,a.useCallback)(((e,t,n)=>{B(e,t,null,n),M(t),h&&h(x(t))}),[M,B,h,x]),{ref:R,target:N}=function({dropZoneElement:e,expandedState:t,setExpandedState:n}){const{getBlockRootClientId:o,getBlockIndex:r,getBlockCount:s,getDraggedBlockClientIds:i,canInsertBlocks:l}=(0,c.useSelect)($r),[d,p]=(0,a.useState)(),{rootClientId:h,blockIndex:g}=d||{},m=bC(h,g),f=(0,C.isRTL)(),b=(0,u.usePrevious)(h),v=(0,a.useCallback)(((e,t)=>{const{rootClientId:o}=t||{};o&&("inside"!==t?.dropPosition||e[o]||n({type:"expand",clientIds:[o]}))}),[n]),k=(0,u.useThrottle)(v,500,Mj);(0,a.useEffect)((()=>{"inside"===d?.dropPosition&&b===d?.rootClientId?k(t,d):k.cancel()}),[t,b,d,k]);const _=i(),x=(0,u.useThrottle)((0,a.useCallback)(((e,t)=>{const n={x:e.clientX,y:e.clientY},i=!!_?.length,a=Tj(Array.from(t.querySelectorAll("[data-block]")).map((e=>{const t=e.dataset.block,n="true"===e.dataset.expanded,a=e.classList.contains("is-dragging"),c=parseInt(e.getAttribute("aria-level"),10),u=o(t);return{clientId:t,isExpanded:n,rootClientId:u,blockIndex:r(t),element:e,nestingLevel:c||void 0,isDraggedBlock:!!i&&a,innerBlockCount:s(t),canInsertDraggedBlocksAsSibling:!i||l(_,u),canInsertDraggedBlocksAsChild:!i||l(_,t)}})),n,f);a&&p(a)}),[l,_,s,r,o,f]),50);return{ref:(0,u.__experimentalUseDropZone)({dropZoneElement:e,onDrop(e){x.cancel(),d&&m(e),p(void 0)},onDragLeave(){x.cancel(),p(null)},onDragOver(e){x(e,e.currentTarget)},onDragEnd(){x.cancel(),p(void 0)}}),target:d}}({dropZoneElement:o,expandedState:I,setExpandedState:j}),A=(0,a.useRef)(),L=Pj({selectBlock:P}),O=(0,u.useMergeRefs)([L,A,R,m]);(0,a.useEffect)((()=>{k?.length&&kj(k[0],A?.current)}),[]);const D=(0,a.useCallback)((e=>{if(!e)return;const t=Array.isArray(e)?e:[e];j({type:"expand",clientIds:t})}),[j]),z=(0,a.useCallback)((e=>{e&&j({type:"collapse",clientIds:[e]})}),[j]),V=(0,a.useCallback)((()=>{j({type:"clear"})}),[j]),F=(0,a.useCallback)((e=>{D(e?.dataset?.block)}),[D]),H=(0,a.useCallback)((e=>{z(e?.dataset?.block)}),[z]),G=(0,a.useCallback)(((e,t,n)=>{e.shiftKey&&B(e,t?.dataset?.block,n?.dataset?.block)}),[B]);!function({collapseAll:e,expand:t}){const{expandedBlock:n,getBlockParents:o}=(0,c.useSelect)((e=>{const{getBlockParents:t,getExpandedBlock:n}=Q(e($r));return{expandedBlock:n(),getBlockParents:t}}),[]);(0,a.useEffect)((()=>{if(n){const r=o(n,!1);e(),t(r)}}),[e,t,n,o])}({collapseAll:V,expand:D});const $=v?.[0],{blockDropTargetIndex:W,blockDropPosition:K,firstDraggedBlockIndex:Z}=(0,a.useMemo)((()=>{let e,t;if(N?.clientId){const t=_[N.clientId];e=void 0===t||"top"===N?.dropPosition?t:t+1}else null===N&&(e=null);if($){const e=_[$];t=void 0===e||"top"===N?.dropPosition?e:e+1}return{blockDropTargetIndex:e,blockDropPosition:N?.dropPosition,firstDraggedBlockIndex:t}}),[N,_,$]),q=(0,a.useMemo)((()=>({blockDropPosition:K,blockDropTargetIndex:W,blockIndexes:_,draggedClientIds:v,expandedState:I,expand:D,firstDraggedBlockIndex:Z,collapse:z,collapseAll:V,BlockSettingsMenu:l,listViewInstanceId:f,AdditionalBlockContent:g,insertedBlock:E,setInsertedBlock:T,treeGridElementRef:A,rootClientId:d})),[K,W,_,v,I,D,Z,z,V,l,f,g,E,T,d]),[Y]=(0,u.__experimentalUseFixedWindowList)(A,32,S,{expandedState:I,useWindowing:!0,windowOverscan:40});if(!b.length&&!i)return null;const X=p&&`block-editor-list-view-description-${f}`;return(0,U.jsxs)(c.AsyncModeProvider,{value:!0,children:[(0,U.jsx)(Cj,{draggedBlockClientId:$,listViewRef:A,blockDropTarget:N}),p&&(0,U.jsx)(Ns.VisuallyHidden,{id:X,children:p}),(0,U.jsx)(Ns.__experimentalTreeGrid,{id:t,className:Bs("block-editor-list-view-tree",{"is-dragging":v?.length>0&&void 0!==W}),"aria-label":(0,C.__)("Block navigation structure"),ref:O,onCollapseRow:H,onExpandRow:F,onFocusRow:G,applicationAriaLabel:(0,C.__)("Block navigation structure"),"aria-describedby":X,style:{"--wp-admin--list-view-dragged-items-height":v?.length?32*(v.length-1)+"px":null},children:(0,U.jsx)(oj.Provider,{value:q,children:(0,U.jsx)(wj,{blocks:b,parentId:d,selectBlock:P,showBlockMovers:r,fixedListWindow:Y,selectedClientIds:k,isExpanded:s,shouldShowInnerBlocks:w,showAppender:i})})})]})})),Aj=(0,a.forwardRef)(((e,t)=>(0,U.jsx)(Nj,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0})));function Lj({isEnabled:e,onToggle:t,isOpen:n,innerRef:o,...r}){return(0,U.jsx)(Ns.Button,{...r,ref:o,icon:nj,"aria-expanded":n,"aria-haspopup":"true",onClick:e?t:void 0,label:(0,C.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}const Oj=(0,a.forwardRef)((function({isDisabled:e,...t},n){y()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const o=(0,c.useSelect)((e=>!!e($r).getBlockCount()),[])&&!e;return(0,U.jsx)(Ns.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:e,onToggle:r})=>(0,U.jsx)(Lj,{...t,innerRef:n,isOpen:e,onToggle:r,isEnabled:o}),renderContent:()=>(0,U.jsxs)("div",{className:"block-editor-block-navigation__container",children:[(0,U.jsx)("p",{className:"block-editor-block-navigation__label",children:(0,C.__)("List view")}),(0,U.jsx)(Aj,{})]})})}));function Dj({genericPreviewBlock:e,style:t,className:n,activeStyle:o}){const r=(0,l.getBlockType)(e.name)?.example,s=wB(n,o,t),i=(0,a.useMemo)((()=>({...e,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:s+" block-editor-block-styles__block-preview-container"},example:r})),[e,s]);return(0,U.jsx)(dS,{item:i})}const zj=()=>{};const Vj=function({clientId:e,onSwitch:t=zj,onHoverClassName:n=zj}){const{onSelect:o,stylesToRender:r,activeStyle:s,genericPreviewBlock:i,className:l}=BB({clientId:e,onSwitch:t}),[c,d]=(0,a.useState)(null),p=(0,u.useViewportMatch)("medium","<");if(!r||0===r.length)return null;const h=(0,u.debounce)(d,250),g=e=>{var t;c!==e?(h(e),n(null!==(t=e?.name)&&void 0!==t?t:null)):h.cancel()};return(0,U.jsxs)("div",{className:"block-editor-block-styles",children:[(0,U.jsx)("div",{className:"block-editor-block-styles__variants",children:r.map((e=>{const t=e.label||e.name;return(0,U.jsx)(Ns.Button,{__next40pxDefaultSize:!0,className:Bs("block-editor-block-styles__item",{"is-active":s.name===e.name}),variant:"secondary",label:t,onMouseEnter:()=>g(e),onFocus:()=>g(e),onMouseLeave:()=>g(null),onBlur:()=>g(null),onClick:()=>(e=>{o(e),n(null),d(null),h.cancel()})(e),"aria-current":s.name===e.name,children:(0,U.jsx)(Ns.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:t})},e.name)}))}),c&&!p&&(0,U.jsx)(Ns.Popover,{placement:"left-start",offset:34,focusOnMount:!1,children:(0,U.jsx)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>g(null),children:(0,U.jsx)(Dj,{activeStyle:s,className:l,genericPreviewBlock:i,style:c})})})]})},Fj={0:(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z"})}),1:(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})}),2:(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z"})}),3:(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z"})}),4:(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})}),5:(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z"})}),6:(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M20.7 12.4c-.2-.3-.4-.6-.7-.9s-.6-.5-1-.6c-.4-.2-.8-.2-1.2-.2-.5 0-.9.1-1.3.3s-.8.5-1.2.8c0-.5 0-.9.2-1.4l.6-.9c.2-.2.5-.4.8-.5.6-.2 1.3-.2 1.9 0 .3.1.6.3.8.5 0 0 1.3-1.3 1.3-1.4-.4-.3-.9-.6-1.4-.8-.6-.2-1.3-.3-2-.3-.6 0-1.1.1-1.7.4-.5.2-1 .5-1.4.9-.4.4-.8 1-1 1.6-.3.7-.4 1.5-.4 2.3s.1 1.5.3 2.1c.2.6.6 1.1 1 1.5.4.4.9.7 1.4.9 1 .3 2 .3 3 0 .4-.1.8-.3 1.2-.6.3-.3.6-.6.8-1 .2-.5.3-.9.3-1.4s-.1-.9-.3-1.3zm-2 2.1c-.1.2-.3.4-.4.5-.1.1-.3.2-.5.2-.2.1-.4.1-.6.1-.2.1-.5 0-.7-.1-.2 0-.3-.2-.5-.3-.1-.2-.3-.4-.4-.6-.2-.3-.3-.7-.3-1 .3-.3.6-.5 1-.7.3-.1.7-.2 1-.2.4 0 .8.1 1.1.3.3.3.4.7.4 1.1 0 .2 0 .5-.1.7zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z"})})};function Hj({level:e}){return Fj[e]?(0,U.jsx)(Ns.Icon,{icon:Fj[e]}):null}const Gj=[1,2,3,4,5,6],Uj={className:"block-library-heading-level-dropdown"};function $j({options:e=Gj,value:t,onChange:n}){return(0,U.jsx)(Ns.ToolbarDropdownMenu,{popoverProps:Uj,icon:(0,U.jsx)(Hj,{level:t}),label:(0,C.__)("Change level"),controls:e.map((e=>{const o=e===t;return{icon:(0,U.jsx)(Hj,{level:e}),title:0===e?(0,C.__)("Paragraph"):(0,C.sprintf)((0,C.__)("Heading %d"),e),isActive:o,onClick(){n(e)},role:"menuitemradio"}}))})}const Wj=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})});const Kj=function({icon:e=Wj,label:t=(0,C.__)("Choose variation"),instructions:n=(0,C.__)("Select a variation to start with:"),variations:o,onSelect:r,allowSkip:s}){const i=Bs("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,U.jsxs)(Ns.Placeholder,{icon:e,label:t,instructions:n,className:i,children:[(0,U.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,C.__)("Block variations"),children:o.map((e=>(0,U.jsxs)("li",{children:[(0,U.jsx)(Ns.Button,{__next40pxDefaultSize:!0,variant:"tertiary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>r(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,U.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:e.title})]},e.name)))}),s&&(0,U.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,U.jsx)(Ns.Button,{variant:"link",onClick:()=>r(),children:(0,C.__)("Skip")})})]})},Zj="carousel",qj="grid",Yj=({onBlockPatternSelect:e})=>(0,U.jsx)("div",{className:"block-editor-block-pattern-setup__actions",children:(0,U.jsx)(Ns.Button,{variant:"primary",onClick:e,children:(0,C.__)("Choose")})}),Xj=({handlePrevious:e,handleNext:t,activeSlide:n,totalSlides:o})=>(0,U.jsxs)("div",{className:"block-editor-block-pattern-setup__navigation",children:[(0,U.jsx)(Ns.Button,{icon:uy,label:(0,C.__)("Previous pattern"),onClick:e,disabled:0===n,__experimentalIsFocusable:!0}),(0,U.jsx)(Ns.Button,{icon:cy,label:(0,C.__)("Next pattern"),onClick:t,disabled:n===o-1,__experimentalIsFocusable:!0})]}),Qj=({viewMode:e,setViewMode:t,handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:s,onBlockPatternSelect:i})=>{const l=e===Zj,a=(0,U.jsxs)("div",{className:"block-editor-block-pattern-setup__display-controls",children:[(0,U.jsx)(Ns.Button,{icon:El,label:(0,C.__)("Carousel view"),onClick:()=>t(Zj),isPressed:l}),(0,U.jsx)(Ns.Button,{icon:kI,label:(0,C.__)("Grid view"),onClick:()=>t(qj),isPressed:e===qj})]});return(0,U.jsxs)("div",{className:"block-editor-block-pattern-setup__toolbar",children:[l&&(0,U.jsx)(Xj,{handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:s}),a,l&&(0,U.jsx)(Yj,{onBlockPatternSelect:i})]})};const Jj=function(e,t,n){return(0,c.useSelect)((o=>{const{getBlockRootClientId:r,getPatternsByBlockTypes:s,__experimentalGetAllowedPatterns:i}=o($r),l=r(e);return n?i(l).filter(n):s(t,l)}),[e,t,n])},{CompositeV2:eE,CompositeItemV2:tE,useCompositeStoreV2:nE}=Q(Ns.privateApis),oE=({viewMode:e,activeSlide:t,patterns:n,onBlockPatternSelect:o,showTitles:r})=>{const s=nE(),i="block-editor-block-pattern-setup__container";if(e===Zj){const e=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,U.jsx)("div",{className:"block-editor-block-pattern-setup__carousel",children:(0,U.jsx)("div",{className:i,children:(0,U.jsx)("div",{className:"carousel-container",children:n.map(((n,o)=>(0,U.jsx)(sE,{active:o===t,className:e.get(o)||"",pattern:n},n.name)))})})})}return(0,U.jsx)("div",{className:"block-editor-block-pattern-setup__grid",children:(0,U.jsx)(eE,{store:s,role:"listbox",className:i,"aria-label":(0,C.__)("Patterns list"),children:n.map((e=>(0,U.jsx)(rE,{pattern:e,onSelect:o,showTitles:r},e.name)))})})};function rE({pattern:e,onSelect:t,showTitles:n}){const o="block-editor-block-pattern-setup-list",{blocks:r,description:s,viewportWidth:i=700}=e,l=(0,u.useInstanceId)(rE,`${o}__item-description`);return(0,U.jsx)("div",{className:`${o}__list-item`,children:(0,U.jsxs)(tE,{render:(0,U.jsx)("div",{"aria-describedby":s?l:void 0,"aria-label":e.title,className:`${o}__item`}),id:`${o}__pattern__${e.name}`,role:"option",onClick:()=>t(r),children:[(0,U.jsx)(cS,{blocks:r,viewportWidth:i}),n&&(0,U.jsx)("div",{className:`${o}__item-title`,children:e.title}),!!s&&(0,U.jsx)(Ns.VisuallyHidden,{id:l,children:s})]})})}function sE({active:e,className:t,pattern:n,minHeight:o}){const{blocks:r,title:s,description:i}=n,l=(0,u.useInstanceId)(sE,"block-editor-block-pattern-setup-list__item-description");return(0,U.jsxs)("div",{"aria-hidden":!e,role:"img",className:`pattern-slide ${t}`,"aria-label":s,"aria-describedby":i?l:void 0,children:[(0,U.jsx)(cS,{blocks:r,minHeight:o}),!!i&&(0,U.jsx)(Ns.VisuallyHidden,{id:l,children:i})]})}const iE=({clientId:e,blockName:t,filterPatternsFn:n,onBlockPatternSelect:o,initialViewMode:r=Zj,showTitles:s=!1})=>{const[i,u]=(0,a.useState)(r),[d,p]=(0,a.useState)(0),{replaceBlock:h}=(0,c.useDispatch)($r),g=Jj(e,t,n);if(!g?.length)return null;const m=o||(t=>{const n=t.map((e=>(0,l.cloneBlock)(e)));h(e,n)});return(0,U.jsx)(U.Fragment,{children:(0,U.jsxs)("div",{className:`block-editor-block-pattern-setup view-mode-${i}`,children:[(0,U.jsx)(oE,{viewMode:i,activeSlide:d,patterns:g,onBlockPatternSelect:m,showTitles:s}),(0,U.jsx)(Qj,{viewMode:i,setViewMode:u,activeSlide:d,totalSlides:g.length,handleNext:()=>{p((e=>Math.min(e+1,g.length-1)))},handlePrevious:()=>{p((e=>Math.max(e-1,0)))},onBlockPatternSelect:()=>{m(g[d].blocks)}})]})})};function lE({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,U.jsxs)("fieldset",{className:e,children:[(0,U.jsx)(Ns.VisuallyHidden,{as:"legend",children:(0,C.__)("Transform to variation")}),o.map((e=>(0,U.jsx)(Ns.Button,{icon:(0,U.jsx)(Tf,{icon:e.icon,showColors:!0}),isPressed:n===e.name,label:n===e.name?e.title:(0,C.sprintf)((0,C.__)("Transform to %s"),e.title),onClick:()=>t(e.name),"aria-label":e.title,showTooltip:!0},e.name)))]})}function aE({className:e,onSelectVariation:t,selectedValue:n,variations:o}){const r=o.map((({name:e,title:t,description:n})=>({value:e,label:t,info:n})));return(0,U.jsx)(Ns.DropdownMenu,{className:e,label:(0,C.__)("Transform to variation"),text:(0,C.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:tB,toggleProps:{iconPosition:"right"},children:()=>(0,U.jsx)("div",{className:`${e}__container`,children:(0,U.jsx)(Ns.MenuGroup,{children:(0,U.jsx)(Ns.MenuItemsChoice,{choices:r,value:n,onSelect:t})})})})}function cE({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,U.jsx)("div",{className:e,children:(0,U.jsx)(Ns.__experimentalToggleGroupControl,{label:(0,C.__)("Transform to variation"),value:n,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:o.map((e=>(0,U.jsx)(Ns.__experimentalToggleGroupControlOptionIcon,{icon:(0,U.jsx)(Tf,{icon:e.icon,showColors:!0}),value:e.name,label:n===e.name?e.title:(0,C.sprintf)((0,C.__)("Transform to %s"),e.title)},e.name)))})})}const uE=function({blockClientId:e}){const{updateBlockAttributes:t}=(0,c.useDispatch)($r),{activeBlockVariation:n,variations:o}=(0,c.useSelect)((t=>{const{getActiveBlockVariation:n,getBlockVariations:o}=t(l.store),{getBlockName:r,getBlockAttributes:s}=t($r),i=e&&r(e);return{activeBlockVariation:n(i,s(e)),variations:i&&o(i,"transform")}}),[e]),r=n?.name,s=(0,a.useMemo)((()=>{const e=new Set;return!!o&&(o.forEach((t=>{t.icon&&e.add(t.icon?.src||t.icon)})),e.size===o.length)}),[o]);if(!o?.length)return null;const i=o.length>5,u=s?i?lE:cE:aE;return(0,U.jsx)(u,{className:"block-editor-block-variation-transforms",onSelectVariation:n=>{t(e,{...o.find((({name:e})=>e===n)).attributes})},selectedValue:r,variations:o})},dE=(0,u.createHigherOrderComponent)((e=>t=>{const[n,o]=Kr("color.palette","color.custom"),{colors:r=n,disableCustomColors:s=!o}=t,i=r&&r.length>0||!s;return(0,U.jsx)(e,{...t,colors:r,disableCustomColors:s,hasColorsToChoose:i})}),"withColorContext"),pE=dE(Ns.ColorPalette);function hE({onChange:e,value:t,...n}){return(0,U.jsx)(zd,{...n,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}const gE=window.wp.date,mE=new Date(2022,0,25);function fE({format:e,defaultFormat:t,onChange:n}){return(0,U.jsxs)("fieldset",{className:"block-editor-date-format-picker",children:[(0,U.jsx)(Ns.VisuallyHidden,{as:"legend",children:(0,C.__)("Date format")}),(0,U.jsx)(Ns.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Default format"),help:`${(0,C.__)("Example:")}  ${(0,gE.dateI18n)(t,mE)}`,checked:!e,onChange:e=>n(e?null:t)}),e&&(0,U.jsx)(bE,{format:e,onChange:n})]})}function bE({format:e,onChange:t}){var n;const o=[...new Set(["Y-m-d",(0,C._x)("n/j/Y","short date format"),(0,C._x)("n/j/Y g:i A","short date format with time"),(0,C._x)("M j, Y","medium date format"),(0,C._x)("M j, Y g:i A","medium date format with time"),(0,C._x)("F j, Y","long date format"),(0,C._x)("M j","short date format without the year")])],r=o.map(((e,t)=>({key:`suggested-${t}`,name:(0,gE.dateI18n)(e,mE),format:e}))),s={key:"custom",name:(0,C.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,C.__)("Enter your own date format")},[i,l]=(0,a.useState)((()=>!!e&&!o.includes(e)));return(0,U.jsxs)(Ns.__experimentalVStack,{children:[(0,U.jsx)(Ns.CustomSelectControl,{label:(0,C.__)("Choose a format"),options:[...r,s],value:i?s:null!==(n=r.find((t=>t.format===e)))&&void 0!==n?n:s,onChange:({selectedItem:e})=>{e===s?l(!0):(l(!1),t(e.format))}}),i&&(0,U.jsx)(Ns.TextControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Custom format"),hideLabelFromVision:!0,help:(0,a.createInterpolateElement)((0,C.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,U.jsx)(Ns.ExternalLink,{href:(0,C.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:e=>t(e)})]})}const vE=({setting:e,children:t,panelId:n,...o})=>(0,U.jsx)(Ns.__experimentalToolsPanelItem,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()},isShownByDefault:void 0===e.isShownByDefault||e.isShownByDefault,...o,className:"block-editor-tools-panel-color-gradient-settings__item",panelId:n,resetAllFilter:e.resetAllFilter,children:t}),kE=({colorValue:e,label:t})=>(0,U.jsxs)(Ns.__experimentalHStack,{justify:"flex-start",children:[(0,U.jsx)(Ns.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,U.jsx)(Ns.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),_E=e=>({onToggle:t,isOpen:n})=>{const{colorValue:o,label:r}=e,s={onClick:t,className:Bs("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n};return(0,U.jsx)(Ns.Button,{...s,children:(0,U.jsx)(kE,{colorValue:o,label:r})})};function xE({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradients:r,settings:s,__experimentalIsRenderedInSidebar:i,...l}){let a;return i&&(a={placement:"left-start",offset:36,shift:!0}),(0,U.jsx)(U.Fragment,{children:s.map(((s,c)=>{var u;const d={clearable:!1,colorValue:s.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradientValue:s.gradientValue,gradients:r,label:s.label,onColorChange:s.onColorChange,onGradientChange:s.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:i,...s},p={colorValue:null!==(u=s.gradientValue)&&void 0!==u?u:s.colorValue,label:s.label};return s&&(0,U.jsx)(vE,{setting:s,...l,children:(0,U.jsx)(Ns.Dropdown,{popoverProps:a,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:_E(p),renderContent:()=>(0,U.jsx)(Ns.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,U.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,U.jsx)(zd,{...d})})})})},c)}))})}const yE=["colors","disableCustomColors","gradients","disableCustomGradients"],SE=({className:e,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,children:s,settings:i,title:l,showTitle:a=!0,__experimentalIsRenderedInSidebar:d,enableAlpha:p})=>{const h=(0,u.useInstanceId)(SE),{batch:g}=(0,c.useRegistry)();return t&&0!==t.length||n&&0!==n.length||!o||!r||!i?.every((e=>(!e.colors||0===e.colors.length)&&(!e.gradients||0===e.gradients.length)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?(0,U.jsxs)(Ns.__experimentalToolsPanel,{className:Bs("block-editor-panel-color-gradient-settings",e),label:a?l:void 0,resetAll:()=>{g((()=>{i.forEach((({colorValue:e,gradientValue:t,onColorChange:n,onGradientChange:o})=>{e?n():t&&o()}))}))},panelId:h,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,U.jsx)(xE,{settings:i,panelId:h,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:d,enableAlpha:p}),!!s&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.__experimentalSpacer,{marginY:4})," ",s]})]}):null},wE=e=>{const t=Ru();return(0,U.jsx)(SE,{...t,...e})},CE=e=>yE.every((t=>e.hasOwnProperty(t)))?(0,U.jsx)(SE,{...e}):(0,U.jsx)(wE,{...e}),BE=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"})}),IE=100,jE=300,EE={placement:"bottom-start"};const TE=(0,a.createContext)({}),ME=()=>(0,a.useContext)(TE);function PE({id:e,url:t,naturalWidth:n,naturalHeight:o,onFinishEditing:r,onSaveImage:s,children:i}){const l=function({url:e,naturalWidth:t,naturalHeight:n}){const[o,r]=(0,a.useState)(),[s,i]=(0,a.useState)(),[l,c]=(0,a.useState)({x:0,y:0}),[u,p]=(0,a.useState)(100),[h,g]=(0,a.useState)(0),m=t/n,[f,b]=(0,a.useState)(m),v=(0,a.useCallback)((()=>{const t=(h+90)%360;let n=m;if(h%180==90&&(n=1/m),0===t)return r(),g(t),b(m),void c((e=>({x:-e.y*n,y:e.x*n})));const o=new window.Image;o.src=e,o.onload=function(e){const o=document.createElement("canvas");let s=0,i=0;t%180?(o.width=e.target.height,o.height=e.target.width):(o.width=e.target.width,o.height=e.target.height),90!==t&&180!==t||(s=o.width),270!==t&&180!==t||(i=o.height);const l=o.getContext("2d");l.translate(s,i),l.rotate(t*Math.PI/180),l.drawImage(e.target,0,0),o.toBlob((e=>{r(URL.createObjectURL(e)),g(t),b(o.width/o.height),c((e=>({x:-e.y*n,y:e.x*n})))}))};const s=(0,d.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof s&&(o.crossOrigin=s)}),[h,m,e]);return(0,a.useMemo)((()=>({editedUrl:o,setEditedUrl:r,crop:s,setCrop:i,position:l,setPosition:c,zoom:u,setZoom:p,rotation:h,setRotation:g,rotateClockwise:v,aspect:f,setAspect:b,defaultAspect:m})),[o,s,l,u,h,v,f,m])}({url:t,naturalWidth:n,naturalHeight:o}),u=function({crop:e,rotation:t,url:n,id:o,onSaveImage:r,onFinishEditing:s}){const{createErrorNotice:i}=(0,c.useDispatch)(To.store),[l,u]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>{u(!1),s()}),[s]),p=(0,a.useCallback)((()=>{u(!0);const l=[];t>0&&l.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&l.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),Nb()({path:`/wp/v2/media/${o}/edit`,method:"POST",data:{src:n,modifiers:l}}).then((e=>{r({id:e.id,url:e.source_url})})).catch((e=>{i((0,C.sprintf)((0,C.__)("Could not edit image. %s"),(0,la.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{u(!1),s()}))}),[e,t,o,n,r,i,s]);return(0,a.useMemo)((()=>({isInProgress:l,apply:p,cancel:d})),[l,p,d])}({id:e,url:t,onSaveImage:s,onFinishEditing:r,...l}),p=(0,a.useMemo)((()=>({...l,...u})),[l,u]);return(0,U.jsx)(TE.Provider,{value:p,children:i})}function RE({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:r}){return(0,U.jsx)(Ns.MenuGroup,{label:n,children:e.map((({name:e,slug:n,ratio:s})=>(0,U.jsx)(Ns.MenuItem,{disabled:t,onClick:()=>{o(s)},role:"menuitemradio",isSelected:s===r,icon:s===r?Zu:void 0,children:e},n)))})}function NE(e){const[t,n,...o]=e.split("/").map(Number);return t<=0||n<=0||Number.isNaN(t)||Number.isNaN(n)||o.length?NaN:n?t/n:t}function AE({ratio:e,...t}){return{ratio:NE(e),...t}}function LE({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:r}=ME(),[s,i,l]=Kr("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return(0,U.jsx)(Ns.DropdownMenu,{icon:BE,label:(0,C.__)("Aspect Ratio"),popoverProps:EE,toggleProps:e,children:({onClose:e})=>(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(RE,{isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{slug:"original",name:(0,C.__)("Original"),aspect:r},...l?s.map(AE).filter((({ratio:e})=>1===e)):[]]}),i?.length>0&&(0,U.jsx)(RE,{label:(0,C.__)("Theme"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:i}),l&&(0,U.jsx)(RE,{label:(0,C.__)("Landscape"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:s.map(AE).filter((({ratio:e})=>e>1))}),l&&(0,U.jsx)(RE,{label:(0,C.__)("Portrait"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:s.map(AE).filter((({ratio:e})=>e<1))})]})})}var OE=function(e,t){return OE=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},OE(e,t)};function DE(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}OE(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var zE=function(){return zE=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},zE.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var VE=n(7520),FE=n.n(VE);function HE(e,t,n,o,r){void 0===r&&(r=0);var s=qE(t.width,t.height,r),i=s.width,l=s.height;return{x:GE(e.x,i,n.width,o),y:GE(e.y,l,n.height,o)}}function GE(e,t,n,o){var r=t*o/2-n/2;return YE(e,-r,r)}function UE(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function $E(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function WE(e,t){return Math.min(e,Math.max(0,t))}function KE(e,t){return t}function ZE(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function qE(e,t,n){var o=n*Math.PI/180;return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}function YE(e,t,n){return Math.min(Math.max(e,t),n)}function XE(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var QE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=ya.createRef(),n.videoRef=ya.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,o,r,s){var i=qE(t.width,t.height,n),l=YE(o.width/i.width*(100/e.width),r,s);return{crop:{x:l*i.width/2-o.width/2-i.width*l*(e.x/100),y:l*i.height/2-o.height/2-i.height*l*(e.y/100)},zoom:l}}(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),o=t.crop,r=t.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}else if(n.props.initialCroppedAreaPixels){var s=function(e,t,n,o,r,s){void 0===n&&(n=0);var i=qE(t.naturalWidth,t.naturalHeight,n),l=YE(function(e,t,n){var o=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*o):n.width/(e.width*o)}(e,t,o),r,s),a=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((i.width-e.width)/2-e.x)*a,y:((i.height-e.height)/2-e.y)*a},zoom:l}}(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);o=s.crop,r=s.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}},n.computeSizes=function(){var e,t,o,r,s,i,l=n.imageRef.current||n.videoRef.current;if(l&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var a=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(o=n.imageRef.current)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef.current)||void 0===r?void 0:r.videoHeight)||0,d=c/u,p=void 0;if(l.offsetWidth<c||l.offsetHeight<u)switch(n.state.mediaObjectFit){default:case"contain":p=a>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":p={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":p={width:n.containerRect.height*d,height:n.containerRect.height}}else p={width:l.offsetWidth,height:l.offsetHeight};n.mediaSize=zE(zE({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var h=n.props.cropSize?n.props.cropSize:function(e,t,n,o,r,s){void 0===s&&(s=0);var i=qE(e,t,s),l=i.width,a=i.height,c=Math.min(l,n),u=Math.min(a,o);return c>u*r?{width:u*r,height:u}:{width:c,height:c/r}}(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(s=n.state.cropSize)||void 0===s?void 0:s.height)===h.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===h.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(h),n.setState({cropSize:h},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(h),h}},n.saveContainerPosition=function(){if(n.containerRef){var e=n.containerRef.getBoundingClientRect();n.containerPosition={x:e.left,y:e.top}}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onScroll=function(e){n.currentDoc&&(e.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var o=t.getMousePoint(e),r=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(r,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var s=n.gestureRotationStart+e.rotation;n.props.onRotationChange(s)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,o,r=e.x,s=e.y;n.dragStartPosition={x:r,y:s},n.dragStartCrop=zE({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,s={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?HE(s,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):s;n.props.onCropChange(i)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var o=t.getMousePoint(e),r=FE()(e).pixelY,s=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(s,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e,t){var o=e.x,r=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-t.x),y:n.containerRect.height/2-(r-t.y)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,s=r.crop,i=r.zoom;return{x:(t+s.x)/i,y:(o+s.y)/i}},n.setNewZoom=function(e,t,o){var r=(void 0===o?{}:o).shouldUpdatePosition,s=void 0===r||r;if(n.state.cropSize&&n.props.onZoomChange){var i=YE(e,n.props.minZoom,n.props.maxZoom);if(s){var l=n.getPointOnContainer(t,n.containerPosition),a=n.getPointOnMedia(l),c={x:a.x*i-l.x,y:a.y*i-l.y},u=n.props.restrictPosition?HE(c,n.mediaSize,n.state.cropSize,i,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(i)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,o,r,s,i){void 0===s&&(s=0),void 0===i&&(i=!0);var l=i?WE:KE,a=qE(t.width,t.height,s),c=qE(t.naturalWidth,t.naturalHeight,s),u={x:l(100,((a.width-n.width/r)/2-e.x/r)/a.width*100),y:l(100,((a.height-n.height/r)/2-e.y/r)/a.height*100),width:l(100,n.width/a.width*100/r),height:l(100,n.height/a.height*100/r)},d=Math.round(l(c.width,u.width*c.width/100)),p=Math.round(l(c.height,u.height*c.height/100)),h=c.width>=c.height*o?{width:Math.round(p*o),height:p}:{width:d,height:Math.round(d/o)};return{croppedAreaPercentages:u,croppedAreaPixels:zE(zE({},h),{x:Math.round(l(c.width-h.width,u.x*c.width/100)),y:Math.round(l(c.height-h.height,u.y*c.height/100))})}}(n.props.restrictPosition?HE(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?HE(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return DE(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  overflow: hidden;\n  user-select: none;\n  touch-action: none;\n  cursor: move;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n  will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n  max-width: 100%;\n  max-height: 100%;\n  margin: auto;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n  width: 100%;\n  height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n  width: auto;\n  height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  transform: translate(-50%, -50%);\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  box-sizing: border-box;\n  box-shadow: 0 0 0 9999em;\n  color: rgba(0, 0, 0, 0.5);\n  overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n  border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 0;\n  bottom: 0;\n  left: 33.33%;\n  right: 33.33%;\n  border-top: 0;\n  border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 33.33%;\n  bottom: 33.33%;\n  left: 0;\n  right: 0;\n  border-left: 0;\n  border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,o,r,s,i,l,a,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect||e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(o=e.cropSize)||void 0===o?void 0:o.width)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.width)?this.computeSizes():(null===(s=e.crop)||void 0===s?void 0:s.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(l=e.crop)||void 0===l?void 0:l.y)===(null===(a=this.props.crop)||void 0===a?void 0:a.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load());var u=this.getObjectFit();u!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:u},this.computeSizes)},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.getObjectFit=function(){var e,t,n,o;if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var r=this.containerRect.width/this.containerRect.height;return((null===(e=this.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=this.videoRef.current)||void 0===t?void 0:t.videoWidth)||0)/((null===(n=this.imageRef.current)||void 0===n?void 0:n.naturalHeight)||(null===(o=this.videoRef.current)||void 0===o?void 0:o.videoHeight)||0)<r?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=UE(n,o),this.lastPinchRotation=$E(n,o),this.onDragStart(ZE(n,o))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),s=ZE(o,r);this.onDrag(s),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=UE(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,s,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var i=$E(o,r),l=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(l),n.lastPinchRotation=i}))}},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,s=t.transform,i=t.crop,l=i.x,a=i.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,h=t.style,g=h.containerStyle,m=h.cropAreaStyle,f=h.mediaStyle,b=t.classes,v=b.containerClassName,k=b.cropAreaClassName,_=b.mediaClassName,x=this.state.mediaObjectFit;return ya.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:XE("reactEasyCrop_Container",v)},n?ya.createElement("img",zE({alt:"",className:XE("reactEasyCrop_Image","contain"===x&&"reactEasyCrop_Contain","horizontal-cover"===x&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===x&&"reactEasyCrop_Cover_Vertical",_)},r,{src:n,ref:this.imageRef,style:zE(zE({},f),{transform:s||"translate(".concat(l,"px, ").concat(a,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),onLoad:this.onMediaLoad})):o&&ya.createElement("video",zE({autoPlay:!0,loop:!0,muted:!0,className:XE("reactEasyCrop_Video","contain"===x&&"reactEasyCrop_Contain","horizontal-cover"===x&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===x&&"reactEasyCrop_Cover_Vertical",_)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:zE(zE({},f),{transform:s||"translate(".concat(l,"px, ").concat(a,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return ya.createElement("source",zE({key:e.src},e))}))),this.state.cropSize&&ya.createElement("div",{style:zE(zE({},m),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:XE("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",k)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(ya.Component);function JE({url:e,width:t,height:n,naturalHeight:o,naturalWidth:r,borderProps:s}){const{isInProgress:i,editedUrl:l,position:a,zoom:c,aspect:d,setPosition:p,setCrop:h,setZoom:g,rotation:m}=ME(),[f,{width:b}]=(0,u.useResizeObserver)();let v=n||b*o/r;m%180==90&&(v=b*r/o);const k=(0,U.jsxs)("div",{className:Bs("wp-block-image__crop-area",s?.className,{"is-applying":i}),style:{...s?.style,width:t||b,height:v},children:[(0,U.jsx)(QE,{image:l||e,disabled:i,minZoom:IE/100,maxZoom:jE/100,crop:a,zoom:c/100,aspect:d,onCropChange:e=>{p(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{g(100*e)}}),i&&(0,U.jsx)(Ns.Spinner,{})]});return(0,U.jsxs)(U.Fragment,{children:[f,k]})}const eT=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"})});function tT(){const{isInProgress:e,zoom:t,setZoom:n}=ME();return(0,U.jsx)(Ns.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:EE,renderToggle:({isOpen:t,onToggle:n})=>(0,U.jsx)(Ns.ToolbarButton,{icon:eT,label:(0,C.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,U.jsx)(Ns.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Zoom"),min:IE,max:jE,value:Math.round(t),onChange:n})})}const nT=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})});function oT(){const{isInProgress:e,rotateClockwise:t}=ME();return(0,U.jsx)(Ns.ToolbarButton,{icon:nT,label:(0,C.__)("Rotate"),onClick:t,disabled:e})}function rT(){const{isInProgress:e,apply:t,cancel:n}=ME();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.ToolbarButton,{onClick:t,disabled:e,children:(0,C.__)("Apply")}),(0,U.jsx)(Ns.ToolbarButton,{onClick:n,children:(0,C.__)("Cancel")})]})}function sT({id:e,url:t,width:n,height:o,naturalHeight:r,naturalWidth:s,onSaveImage:i,onFinishEditing:l,borderProps:a}){return(0,U.jsxs)(PE,{id:e,url:t,naturalWidth:s,naturalHeight:r,onSaveImage:i,onFinishEditing:l,children:[(0,U.jsx)(JE,{borderProps:a,url:t,width:n,height:o,naturalHeight:r,naturalWidth:s}),(0,U.jsxs)(Fs,{children:[(0,U.jsxs)(Ns.ToolbarGroup,{children:[(0,U.jsx)(tT,{}),(0,U.jsx)(Ns.ToolbarItem,{children:e=>(0,U.jsx)(LE,{toggleProps:e})}),(0,U.jsx)(oT,{})]}),(0,U.jsx)(Ns.ToolbarGroup,{children:(0,U.jsx)(rT,{})})]})]})}const iT=[25,50,75,100],lT=()=>{};function aT({imageSizeHelp:e,imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:s,width:i,height:l,onChange:c,onChangeImage:u=lT}){const{currentHeight:d,currentWidth:p,updateDimension:h,updateDimensions:g}=function(e,t,n,o,r){var s,i;const[l,c]=(0,a.useState)(null!==(s=null!=t?t:o)&&void 0!==s?s:""),[u,d]=(0,a.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,a.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,a.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(l)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:l,updateDimension:(e,t)=>{const n=""===t?void 0:parseInt(t,10);"width"===e?c(n):d(n),r({[e]:n})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(l,i,n,t,c);return(0,U.jsxs)(U.Fragment,{children:[o&&o.length>0&&(0,U.jsx)(Ns.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Resolution"),value:s,options:o,onChange:u,help:e,size:"__unstable-large"}),r&&(0,U.jsxs)("div",{className:"block-editor-image-size-control",children:[(0,U.jsxs)(Ns.__experimentalHStack,{align:"baseline",spacing:"3",children:[(0,U.jsx)(Ns.__experimentalNumberControl,{className:"block-editor-image-size-control__width",label:(0,C.__)("Width"),value:p,min:1,onChange:e=>h("width",e),size:"__unstable-large"}),(0,U.jsx)(Ns.__experimentalNumberControl,{className:"block-editor-image-size-control__height",label:(0,C.__)("Height"),value:d,min:1,onChange:e=>h("height",e),size:"__unstable-large"})]}),(0,U.jsxs)(Ns.__experimentalHStack,{children:[(0,U.jsx)(Ns.ButtonGroup,{"aria-label":(0,C.__)("Image size presets"),children:iT.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),s=p===o&&d===r;return(0,U.jsxs)(Ns.Button,{size:"small",variant:s?"primary":void 0,isPressed:s,onClick:()=>g(r,o),children:[e,"%"]},e)}))}),(0,U.jsx)(Ns.Button,{size:"small",onClick:()=>g(),children:(0,C.__)("Reset")})]})]})]})}function cT({url:e,urlLabel:t,className:n}){const o=Bs(n,"block-editor-url-popover__link-viewer-url");return e?(0,U.jsx)(Ns.ExternalLink,{className:o,href:e,children:t||(0,ia.filterURLForDisplay)((0,ia.safeDecodeURI)(e))}):(0,U.jsx)("span",{className:o})}const{__experimentalPopoverLegacyPositionToPlacement:uT}=Q(Ns.privateApis),dT=(0,a.forwardRef)((({additionalControls:e,children:t,renderSettings:n,placement:o,focusOnMount:r="firstElement",position:s,...i},l)=>{let c;void 0!==s&&y()("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==o?c=o:void 0!==s&&(c=uT(s)),c=c||"bottom";const[u,d]=(0,a.useState)(!1),p=!!n&&u;return(0,U.jsxs)(Ns.Popover,{ref:l,className:"block-editor-url-popover",focusOnMount:r,placement:c,shift:!0,variant:"toolbar",...i,children:[(0,U.jsx)("div",{className:"block-editor-url-popover__input-container",children:(0,U.jsxs)("div",{className:"block-editor-url-popover__row",children:[t,!!n&&(0,U.jsx)(Ns.Button,{className:"block-editor-url-popover__settings-toggle",icon:tB,label:(0,C.__)("Link settings"),onClick:()=>{d(!u)},"aria-expanded":u,size:"compact"})]})}),p&&(0,U.jsx)("div",{className:"block-editor-url-popover__settings",children:n()}),e&&!p&&(0,U.jsx)("div",{className:"block-editor-url-popover__additional-controls",children:e})]})}));dT.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...r}){return(0,U.jsxs)("form",{className:Bs("block-editor-url-popover__link-editor",t),...r,children:[(0,U.jsx)(Ca,{__nextHasNoMarginBottom:!0,value:o,onChange:n,autocompleteRef:e}),(0,U.jsx)(Ns.Button,{icon:va,label:(0,C.__)("Apply"),type:"submit",size:"compact"})]})},dT.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:r,...s}){return(0,U.jsxs)("div",{className:Bs("block-editor-url-popover__link-viewer",e),...s,children:[(0,U.jsx)(cT,{url:o,urlLabel:r,className:t}),n&&(0,U.jsx)(Ns.Button,{icon:rc,label:(0,C.__)("Edit"),onClick:n,size:"compact"})]})};const pT=dT,hT=()=>{},gT=({src:e,onChange:t,onSubmit:n,onClose:o,popoverAnchor:r})=>(0,U.jsx)(pT,{anchor:r,onClose:o,children:(0,U.jsxs)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n,children:[(0,U.jsx)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,C.__)("URL"),placeholder:(0,C.__)("Paste or type URL"),onChange:t,value:e}),(0,U.jsx)(Ns.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:va,label:(0,C.__)("Apply"),type:"submit"})]})}),mT=({isURLInputVisible:e,src:t,onChangeSrc:n,onSubmitSrc:o,openURLInput:r,closeURLInput:s})=>{const[i,l]=(0,a.useState)(null);return(0,U.jsxs)("div",{className:"block-editor-media-placeholder__url-input-container",ref:l,children:[(0,U.jsx)(Ns.Button,{className:"block-editor-media-placeholder__button",onClick:r,isPressed:e,variant:"secondary",children:(0,C.__)("Insert from URL")}),e&&(0,U.jsx)(gT,{src:t,onChange:n,onSubmit:o,onClose:s,popoverAnchor:i})]})};const fT=(0,Ns.withFilters)("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:o,labels:r={},mediaPreview:s,notices:i,isAppender:u,accept:d,addToGallery:p,multiple:h=!1,handleUpload:g=!0,disableDropZone:m,disableMediaButtons:f,onError:b,onSelect:v,onCancel:k,onSelectURL:_,onToggleFeaturedImage:x,onDoubleClick:S,onFilesPreUpload:w=hT,onHTMLDrop:B,children:I,mediaLibraryButton:j,placeholder:E,style:T}){B&&y()("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const M=(0,c.useSelect)((e=>{const{getSettings:t}=e($r);return t().mediaUpload}),[]),[P,R]=(0,a.useState)(""),[N,A]=(0,a.useState)(!1);(0,a.useEffect)((()=>{var t;R(null!==(t=e?.src)&&void 0!==t?t:"")}),[e?.src]);const L=e=>{R(e.target.value)},O=()=>{A(!0)},D=()=>{A(!1)},z=e=>{e.preventDefault(),P&&_&&(_(P),D())},V=n=>{if(!g)return v(n);let o;if(w(n),h)if(p){let t=[];o=n=>{const o=(null!=e?e:[]).filter((e=>e.id?!t.some((({id:t})=>Number(t)===Number(e.id))):!t.some((({urlSlug:t})=>e.url.includes(t)))));v(o.concat(n)),t=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=v;else o=([e])=>v(e);M({allowedTypes:t,filesList:n,onFileChange:o,onError:b})};async function F(e){const n=(0,l.pasteHandler)({HTML:e});return await async function(e){if(!e||!Array.isArray(e))return;const n=function e(t){return t.flatMap((t=>"core/image"!==t.name&&"core/audio"!==t.name&&"core/video"!==t.name||!t.attributes.url?e(t.innerBlocks):[t]))}(e);if(!n.length)return;const o=await Promise.all(n.map((e=>e.attributes.id?e.attributes:new Promise(((n,o)=>{window.fetch(e.attributes.url).then((e=>e.blob())).then((r=>M({filesList:[r],additionalData:{title:e.attributes.title,alt_text:e.attributes.alt,caption:e.attributes.caption},onFileChange:([e])=>{e.id&&n(e)},allowedTypes:t,onError:o}))).catch((()=>n(e.attributes.url)))}))))).catch((e=>b(e)));v(h?o:o[0])}(n)}const H=e=>{V(e.target.files)},G=null!=E?E:e=>{let{instructions:l,title:a}=r;if(M||_||(l=(0,C.__)("To edit this block, you need permission to upload media.")),void 0===l||void 0===a){const e=null!=t?t:[],[n]=e,o=1===e.length,r=o&&"audio"===n,s=o&&"image"===n,i=o&&"video"===n;void 0===l&&M&&(l=(0,C.__)("Upload a media file or pick one from your media library."),r?l=(0,C.__)("Upload an audio file, pick one from your media library, or add one with a URL."):s?l=(0,C.__)("Upload an image file, pick one from your media library, or add one with a URL."):i&&(l=(0,C.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===a&&(a=(0,C.__)("Media"),r?a=(0,C.__)("Audio"):s?a=(0,C.__)("Image"):i&&(a=(0,C.__)("Video")))}const c=Bs("block-editor-media-placeholder",n,{"is-appender":u});return(0,U.jsxs)(Ns.Placeholder,{icon:o,label:a,instructions:l,className:c,notices:i,onDoubleClick:S,preview:s,style:T,children:[e,I]})},$=()=>m?null:(0,U.jsx)(Ns.DropZone,{onFilesDrop:V,onHTMLDrop:F}),W=()=>k&&(0,U.jsx)(Ns.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,C.__)("Cancel"),variant:"link",onClick:k,children:(0,C.__)("Cancel")}),K=()=>_&&(0,U.jsx)(mT,{isURLInputVisible:N,src:P,onChangeSrc:L,onSubmitSrc:z,openURLInput:O,closeURLInput:D}),Z=()=>x&&(0,U.jsx)("div",{className:"block-editor-media-placeholder__url-input-container",children:(0,U.jsx)(Ns.Button,{className:"block-editor-media-placeholder__button",onClick:x,variant:"secondary",children:(0,C.__)("Use featured image")})});return f?(0,U.jsx)(ga,{children:$()}):(0,U.jsx)(ga,{fallback:G(K()),children:(()=>{const n=null!=j?j:({open:e})=>(0,U.jsx)(Ns.Button,{variant:"secondary",onClick:()=>{e()},children:(0,C.__)("Media Library")}),o=(0,U.jsx)(ha,{addToGallery:p,gallery:h&&!(!t||0===t.length)&&t.every((e=>"image"===e||e.startsWith("image/"))),multiple:h,onSelect:v,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map((({id:e})=>e)):e.id,render:n});if(M&&u)return(0,U.jsxs)(U.Fragment,{children:[$(),(0,U.jsx)(Ns.FormFileUpload,{onChange:H,accept:d,multiple:!!h,render:({openFileDialog:e})=>{const t=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.Button,{variant:"primary",className:Bs("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e,children:(0,C.__)("Upload")}),o,K(),Z(),W()]});return G(t)}})]});if(M){const e=(0,U.jsxs)(U.Fragment,{children:[$(),(0,U.jsx)(Ns.FormFileUpload,{variant:"primary",className:Bs("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:H,accept:d,multiple:!!h,children:(0,C.__)("Upload")}),o,K(),Z(),W()]});return G(e)}return G(o)})()})})),bT=({colorSettings:e,...t})=>{const n=e.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,U.jsx)(CE,{settings:n,gradients:[],disableCustomGradients:!0,...t})},vT={placement:"bottom-start"},kT=()=>(0,U.jsxs)(U.Fragment,{children:[["bold","italic","link","unknown"].map((e=>(0,U.jsx)(Ns.Slot,{name:`RichText.ToolbarControls.${e}`},e))),(0,U.jsx)(Ns.Slot,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;const t=e.map((([{props:e}])=>e)).some((({isActive:e})=>e));return(0,U.jsx)(Ns.ToolbarItem,{children:n=>(0,U.jsx)(Ns.DropdownMenu,{icon:tB,label:(0,C.__)("More"),toggleProps:{...n,className:Bs(n.className,{"is-pressed":t}),describedBy:(0,C.__)("Displays more block tools")},controls:ae(e.map((([{props:e}])=>e)),"title"),popoverProps:vT})})}})]});function _T({popoverAnchor:e}){return(0,U.jsx)(Ns.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,U.jsx)(II,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,C.__)("Format tools"),children:(0,U.jsx)(Ns.ToolbarGroup,{children:(0,U.jsx)(kT,{})})})})}const xT=({inline:e,editableContentElement:t})=>e?(0,U.jsx)(_T,{popoverAnchor:t}):(0,U.jsx)(Fs,{group:"inline",children:(0,U.jsx)(kT,{})});function yT(e){return e(W.store).getFormatTypes()}const ST=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function wT(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((([e,n])=>[`${t}.${e}`,n])))}function CT(e,t){return e[t]?e[t]:Object.keys(e).filter((e=>e.startsWith(t+"."))).reduce(((n,o)=>(n[o.slice(t.length+1)]=e[o],n)),{})}const BT=["`",'"',"'","“”","‘’"];function IT(e){let t=e.length;for(;t--;){const n=Po(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].toString().replace(Mo,""),[e[t].clientId,n,0,0];const o=IT(e[t].innerBlocks);if(o)return o}return[]}function jT(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function ET({allowedFormats:e,disableFormats:t}){return t?ET.EMPTY_ARRAY:e}ET.EMPTY_ARRAY=[];const TT=[e=>t=>{function n(n){const{inputType:o,data:r}=n,{value:s,onChange:i,registry:l}=e.current;if("insertText"!==o)return;if((0,W.isCollapsed)(s))return;const a=(0,d.applyFilters)("blockEditor.wrapSelectionSettings",BT).find((([e,t])=>e===r||t===r));if(!a)return;const[c,u=c]=a,p=s.start,h=s.end+c.length;let g=(0,W.insert)(s,c,p,p);g=(0,W.insert)(g,u,h,h);const{__unstableMarkLastChangeAsPersistent:m,__unstableMarkAutomaticChange:f}=l.dispatch($r);m(),i(g),f();const b={};for(const e in n)b[e]=n[e];b.data=u;const{ownerDocument:v}=t,{defaultView:k}=v,_=new k.InputEvent("input",b);window.queueMicrotask((()=>{n.target.dispatchEvent(_)})),n.preventDefault()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},e=>t=>{function n(){const{getValue:t,onReplace:n,selectionChange:o,registry:r}=e.current;if(!n)return;const s=t(),{start:i,text:a}=s;if(" "!==a.slice(i-1,i))return;const c=a.slice(0,i).trim(),u=(0,l.getBlockTransforms)("from").filter((({type:e})=>"prefix"===e)),d=(0,l.findTransform)(u,(({prefix:e})=>c===e));if(!d)return;const p=(0,W.toHTMLString)({value:(0,W.insert)(s,Mo,0,i)}),h=d.transform(p);return o(...IT([h])),n([h]),r.dispatch($r).__unstableMarkAutomaticChange(),!0}function o(t){const{inputType:o,type:r}=t,{getValue:s,onChange:i,__unstableAllowPrefixTransformations:l,formatTypes:a,registry:c}=e.current;if("insertText"!==o&&"compositionend"!==r)return;if(l&&n())return;const u=s(),d=a.reduce(((e,{__unstableInputRule:t})=>(t&&(e=t(e)),e)),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<18||o.slice(n-18,n).toLowerCase()!==t?e:(0,W.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(u)),{__unstableMarkLastChangeAsPersistent:p,__unstableMarkAutomaticChange:h}=c.dispatch($r);d!==u&&(p(),i({...d,activeFormats:u.activeFormats}),h())}return t.addEventListener("input",o),t.addEventListener("compositionend",o),()=>{t.removeEventListener("input",o),t.removeEventListener("compositionend",o)}},e=>t=>{function n(t){if("insertReplacementText"!==t.inputType)return;const{registry:n}=e.current;n.dispatch($r).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},()=>e=>{function t(e){(ca.isKeyboardEvent.primary(e,"z")||ca.isKeyboardEvent.primary(e,"y")||ca.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},e=>t=>{const{keyboardShortcuts:n}=e.current;function o(e){for(const t of n.current)t(e)}return t.addEventListener("keydown",o),()=>{t.removeEventListener("keydown",o)}},e=>t=>{const{inputEvents:n}=e.current;function o(e){for(const t of n.current)t(e)}return t.addEventListener("input",o),()=>{t.removeEventListener("input",o)}},e=>t=>{function n(t){const{keyCode:n}=t;if(t.defaultPrevented)return;if(n!==ca.BACKSPACE&&n!==ca.ESCAPE)return;const{registry:o}=e.current,{didAutomaticChange:r,getSettings:s}=o.select($r),{__experimentalUndo:i}=s();i&&r()&&(t.preventDefault(),i())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(n){const{disableFormats:o,onChange:r,value:s,formatTypes:i,tagName:a,onReplace:c,__unstableEmbedURLOnPaste:u,preserveWhiteSpace:d,pastePlainText:p}=e.current;if(n.target!==t)return;if(n.defaultPrevented)return;const{plainText:h,html:g}=Ay(n);if(n.preventDefault(),window.console.log("Received HTML:\n\n",g),window.console.log("Received plain text:\n\n",h),o)return void r((0,W.insert)(s,h));function m(e){const t=i.reduce(((e,{__unstablePasteRule:t})=>(t&&e===s&&(e=t(s,{html:g,plainText:h})),e)),s);if(t!==s)r(t);else{const t=(0,W.create)({html:e});!function(e,t){if(t?.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}(t,s.activeFormats),r((0,W.insert)(s,t))}}if("true"===n.clipboardData.getData("rich-text"))return void m(g);if(p)return void r((0,W.insert)(s,(0,W.create)({text:h})));let f="INLINE";const b=h.trim();u&&(0,W.isEmpty)(s)&&(0,ia.isURL)(b)&&/^https?:/.test(b)&&(f="BLOCKS");const v=(0,l.pasteHandler)({HTML:g,plainText:h,mode:f,tagName:a,preserveWhiteSpace:d});"string"==typeof v?m(v):v.length>0&&c&&(0,W.isEmpty)(s)&&c(v,v.length-1,-1)}const{defaultView:o}=t.ownerDocument;return o.addEventListener("paste",n),()=>{o.removeEventListener("paste",n)}},e=>t=>{function n(t){const{keyCode:n}=t;if(t.defaultPrevented)return;const{value:o,onMerge:r,onRemove:s}=e.current;if(n===ca.DELETE||n===ca.BACKSPACE){const{start:e,end:i,text:l}=o,a=n===ca.BACKSPACE,c=o.activeFormats&&!!o.activeFormats.length;if(!(0,W.isCollapsed)(o)||c||a&&0!==e||!a&&i!==l.length)return;r?r(!a):s&&(0,W.isEmpty)(o)&&a&&s(!a),t.preventDefault()}}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){if(t.keyCode!==ca.ENTER)return;const{onReplace:n,onSplit:o}=e.current;n&&o&&(t.__deprecatedOnSplit=!0)}function o(n){if(n.defaultPrevented)return;if(n.target!==t)return;if(n.keyCode!==ca.ENTER)return;const{value:o,onChange:r,disableLineBreaks:s,onSplitAtEnd:i,onSplitAtDoubleLineEnd:l,registry:a}=e.current;n.preventDefault();const{text:c,start:u,end:d}=o;n.shiftKey?s||r((0,W.insert)(o,"\n")):i&&u===d&&d===c.length?i():l&&u===d&&d===c.length&&"\n\n"===c.slice(-2)?a.batch((()=>{const e={...o};e.start=e.end-2,r((0,W.remove)(e)),l()})):s||r((0,W.insert)(o,"\n"))}const{defaultView:r}=t.ownerDocument;return r.addEventListener("keydown",o),t.addEventListener("keydown",n),()=>{r.removeEventListener("keydown",o),t.removeEventListener("keydown",n)}},e=>t=>{function n(){const{registry:n}=e.current;if(!n.select($r).isMultiSelecting())return;const o=t.parentElement.closest('[contenteditable="true"]');o&&o.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}];function MT(e){const t=(0,a.useRef)(e);t.current=e;const n=(0,a.useMemo)((()=>TT.map((e=>e(t)))),[t]);return(0,u.useRefEffect)((t=>{if(!e.isSelected)return;const o=n.map((e=>e(t)));return()=>{o.forEach((e=>e()))}}),[n,e.isSelected])}const PT={},RT=Symbol("usesContext");function NT({onChange:e,onFocus:t,value:n,forwardedRef:o,settings:r}){const{name:s,edit:i,[RT]:l}=r,c=(0,a.useContext)(Yb),u=(0,a.useMemo)((()=>l?Object.fromEntries(Object.entries(c).filter((([e])=>l.includes(e)))):PT),[l,c]);if(!i)return null;const d=(0,W.getActiveFormat)(n,s),p=void 0!==d,h=(0,W.getActiveObject)(n),g=void 0!==h&&h.type===s;return(0,U.jsx)(i,{isActive:p,activeAttributes:p&&d.attributes||{},isObjectActive:g,activeObjectAttributes:g&&h.attributes||{},value:n,onChange:e,onFocus:t,contentRef:o,context:u},s)}function AT({formatTypes:e,...t}){return e.map((e=>(0,ya.createElement)(NT,{settings:e,...t,key:e.name})))}function LT(e,t){if(KT.isEmpty(e)){const e=jT(t);return e?`<${e}></${e}>`:""}return Array.isArray(e)?(y()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),l.children.toHTML(e)):"string"==typeof e?e:e.toHTMLString()}function OT({value:e,tagName:t,multiline:n,format:o,...r}){return e=(0,U.jsx)(a.RawHTML,{children:LT(e,n)}),t?(0,U.jsx)(t,{...r,children:e}):e}const DT=(0,a.forwardRef)((function({children:e,identifier:t,tagName:n="div",value:o="",onChange:r,multiline:s,...i},l){y()("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const{clientId:a}=_(),{getSelectionStart:u,getSelectionEnd:d}=(0,c.useSelect)($r),{selectionChange:p}=(0,c.useDispatch)($r),h=jT(s),g=`</${h}>${o=o||`<${h}></${h}>`}<${h}>`.split(`</${h}><${h}>`);function m(e){r(`<${h}>${e.join(`</${h}><${h}>`)}</${h}>`)}return g.shift(),g.pop(),(0,U.jsx)(n,{ref:l,children:g.map(((e,n)=>(0,U.jsx)(GT,{identifier:`${t}-${n}`,tagName:h,value:e,onChange:e=>{const t=g.slice();t[n]=e,m(t)},isSelected:void 0,onKeyDown:o=>{if(o.keyCode!==ca.ENTER)return;o.preventDefault();const{offset:r}=u(),{offset:s}=d();if("number"!=typeof r||"number"!=typeof s)return;const i=(0,W.create)({html:e});i.start=r,i.end=s;const l=(0,W.split)(i).map((e=>(0,W.toHTMLString)({value:e}))),c=g.slice();c.splice(n,1,...l),m(c),p(a,`${t}-${n+1}`,0,0)},onMerge:e=>{const o=g.slice();let r=0;if(e){if(!o[n+1])return;o.splice(n,2,o[n]+o[n+1]),r=o[n].length-1}else{if(!o[n-1])return;o.splice(n-1,2,o[n-1]+o[n]),r=o[n-1].length-1}m(o),p(a,`${t}-${n-(e?0:1)}`,r,r)},...i},n)))})}));const zT=(0,a.createContext)(),VT=(0,a.createContext)(),FT=Symbol("instanceId");function HT(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:r,selectionColor:s,tagsToEliminate:i,disableEditingMenu:l,fontSize:a,fontFamily:c,fontWeight:u,fontStyle:d,minWidth:p,maxWidth:h,disableSuggestions:g,disableAutocorrection:m,...f}=e;return f}function GT({children:e,tagName:t="div",value:n="",onChange:o,isSelected:r,multiline:s,inlineToolbar:i,wrapperClassName:d,autocompleters:p,onReplace:h,placeholder:g,allowedFormats:f,withoutInteractiveFormatting:b,onRemove:v,onMerge:k,onSplit:x,__unstableOnSplitAtEnd:S,__unstableOnSplitAtDoubleLineEnd:w,identifier:C,preserveWhiteSpace:B,__unstablePastePlainText:I,__unstableEmbedURLOnPaste:j,__unstableDisableFormats:E,disableLineBreaks:T,__unstableAllowPrefixTransformations:M,readOnly:P,...R},N){R=HT(R),x&&y()("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});const A=(0,u.useInstanceId)(GT),L=(0,a.useRef)(),O=_(),{clientId:D,isSelected:z,name:V}=O,F=O[m],H=(0,a.useContext)(Yb),{selectionStart:G,selectionEnd:$,isSelected:K}=(0,c.useSelect)((e=>{if(!z)return{isSelected:!1};const{getSelectionStart:t,getSelectionEnd:n}=e($r),o=t(),s=n();let i;return void 0===r?i=o.clientId===D&&s.clientId===D&&(C?o.attributeKey===C:o[FT]===A):r&&(i=o.clientId===D),{selectionStart:i?o.offset:void 0,selectionEnd:i?s.offset:void 0,isSelected:i}}),[D,C,A,r,z]),Z=(0,c.useSelect)((e=>{let t=!1;if(F&&Af(V)){const n=(0,l.getBlockType)(V).attributes,{getBlockBindingsSource:o}=Q(e(l.store));for(const[r,s]of Object.entries(F)){if("rich-text"!==n?.[r]?.source)break;const i=o(s.source);if(!i?.canUserEditValue({select:e,context:H,args:s.args})){t=!0;break}}}return t}),[F,V]),q=P||Z,{getSelectionStart:Y,getSelectionEnd:X,getBlockRootClientId:J}=(0,c.useSelect)($r),{selectionChange:ee}=(0,c.useDispatch)($r),te=ET({allowedFormats:f,disableFormats:E}),ne=!te||te.length>0,oe=(0,a.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t,r={clientId:D,[C?"attributeKey":FT]:C||A};if("number"==typeof e||o){if(void 0===t&&J(D)!==J(X().clientId))return;n.start={...r,offset:e}}if("number"==typeof t||o){if(void 0===e&&J(D)!==J(Y().clientId))return;n.end={...r,offset:t}}ee(n)}),[D,J,X,Y,C,A,ee]),{formatTypes:re,prepareHandlers:se,valueHandlers:ie,changeHandlers:le,dependencies:ae}=function({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:o}){const r=(0,c.useSelect)(yT,[]),s=(0,a.useMemo)((()=>r.filter((({name:e,interactive:t,tagName:r})=>!(o&&!o.includes(e)||n&&(t||ST.has(r)))))),[r,o,n]),i=(0,c.useSelect)((n=>s.reduce(((o,r)=>r.__experimentalGetPropsForEditableTreePreparation?{...o,...wT(r.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e}),r.name)}:o),{})),[s,e,t]),l=(0,c.useDispatch)(),u=[],d=[],p=[],h=[];for(const e in i)h.push(i[e]);return s.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const o=n.__experimentalCreatePrepareEditableTree(CT(i,n.name),{richTextIdentifier:t,blockClientId:e});n.__experimentalCreateOnChangeEditableValue?d.push(o):u.push(o)}if(n.__experimentalCreateOnChangeEditableValue){let o={};n.__experimentalGetPropsForEditableTreeChangeHandler&&(o=n.__experimentalGetPropsForEditableTreeChangeHandler(l,{richTextIdentifier:t,blockClientId:e}));const r=CT(i,n.name);p.push(n.__experimentalCreateOnChangeEditableValue({..."object"==typeof r?r:{},...o},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:s,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:h}}({clientId:D,identifier:C,withoutInteractiveFormatting:b,allowedFormats:te});function ce(e){return re.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,W.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:ue,getValue:de,onChange:pe,ref:he}=(0,W.__unstableUseRichText)({value:n,onChange(e,{__unstableFormats:t,__unstableText:n}){o(e),Object.values(le).forEach((e=>{e(t,n)}))},selectionStart:G,selectionEnd:$,onSelectionChange:oe,placeholder:g,__unstableIsSelected:K,__unstableDisableFormats:E,preserveWhiteSpace:B,__unstableDependencies:[...ae,t],__unstableAfterParse:function(e){return ie.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:ce,__unstableAddInvisibleFormats:function(e){return se.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ge=function(e){return(0,Ns.__unstableUseAutocompleteProps)({...e,completers:Db(e)})}({onReplace:h,completers:p,record:ue,onChange:pe});!function({html:e,value:t}){const n=(0,a.useRef)(),o=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:r}=(0,c.useDispatch)($r);(0,a.useLayoutEffect)((()=>{if(n.current){if(n.current!==t.text){const e=window.setTimeout((()=>{r()}),1e3);return n.current=t.text,()=>{window.clearTimeout(e)}}r()}else n.current=t.text}),[e,o])}({html:n,value:ue});const me=(0,a.useRef)(new Set),fe=(0,a.useRef)(new Set);function be(){L.current?.focus()}const ve=(0,c.useRegistry)(),ke=t;return(0,U.jsxs)(U.Fragment,{children:[K&&(0,U.jsx)(zT.Provider,{value:me,children:(0,U.jsx)(VT.Provider,{value:fe,children:(0,U.jsxs)(Ns.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:ue,onChange:pe,onFocus:be}),(0,U.jsx)(AT,{value:ue,onChange:pe,onFocus:be,formatTypes:re,forwardedRef:L})]})})}),K&&ne&&(0,U.jsx)(xT,{inline:i,editableContentElement:L.current}),(0,U.jsx)(ke,{role:"textbox","aria-multiline":!T,"aria-label":g,"aria-readonly":q,...R,...ge,ref:(0,u.useMergeRefs)([he,N,ge.ref,R.ref,MT({registry:ve,getValue:de,onChange:pe,__unstableAllowPrefixTransformations:M,formatTypes:re,onReplace:h,selectionChange:ee,isSelected:K,disableFormats:E,value:ue,tagName:t,onSplit:x,__unstableEmbedURLOnPaste:j,pastePlainText:I,onMerge:k,onRemove:v,removeEditorOnlyFormats:ce,disableLineBreaks:T,onSplitAtEnd:S,onSplitAtDoubleLineEnd:w,keyboardShortcuts:me,inputEvents:fe}),L]),contentEditable:!q,suppressContentEditableWarning:!0,className:Bs("block-editor-rich-text__editable",R.className,"rich-text"),tabIndex:0!==R.tabIndex||q?R.tabIndex:null,"data-wp-block-attribute-key":C})]})}const UT=($T=(0,a.forwardRef)(GT),(0,a.forwardRef)(((e,t)=>{let n=e.value,o=e.onChange;Array.isArray(n)&&(y()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),n=l.children.toHTML(e.value),o=t=>e.onChange(l.children.fromDOM((0,W.__unstableCreateElement)(document,t).childNodes)));const r=e.multiline?DT:$T;return(0,U.jsx)(r,{...e,value:n,onChange:o,ref:t})})));var $T;UT.Content=OT,UT.isEmpty=e=>!e||0===e.length;const WT=(0,a.forwardRef)(((e,t)=>{if(_()[f]){const{children:t,tagName:n="div",value:o,onChange:r,isSelected:s,multiline:i,inlineToolbar:l,wrapperClassName:a,autocompleters:c,onReplace:u,placeholder:d,allowedFormats:p,withoutInteractiveFormatting:h,onRemove:g,onMerge:m,onSplit:f,__unstableOnSplitAtEnd:b,__unstableOnSplitAtDoubleLineEnd:v,identifier:k,preserveWhiteSpace:_,__unstablePastePlainText:x,__unstableEmbedURLOnPaste:y,__unstableDisableFormats:S,disableLineBreaks:w,__unstableAllowPrefixTransformations:C,readOnly:B,...I}=HT(e);return(0,U.jsx)(n,{...I,dangerouslySetInnerHTML:{__html:LT(o,i)}})}return(0,U.jsx)(UT,{ref:t,...e,readOnly:!1})}));WT.Content=OT,WT.isEmpty=e=>!e||0===e.length;const KT=WT,ZT=(0,a.forwardRef)(((e,t)=>(0,U.jsx)(KT,{ref:t,...e,__unstableDisableFormats:!0})));ZT.Content=({value:e="",tagName:t="div",...n})=>(0,U.jsx)(t,{...n,children:e});const qT=ZT,YT=(0,a.forwardRef)((({__experimentalVersion:e,...t},n)=>{if(2===e)return(0,U.jsx)(qT,{ref:n,...t});const{className:o,onChange:r,...s}=t;return(0,U.jsx)(gv.A,{ref:n,className:Bs("block-editor-plain-text",o),onChange:e=>r(e.target.value),...s})}));function XT({property:e,viewport:t,desc:n}){const o=(0,u.useInstanceId)(XT),r=n||(0,C.sprintf)((0,C._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),e,t.label);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("span",{"aria-describedby":`rbc-desc-${o}`,children:t.label}),(0,U.jsx)(Ns.VisuallyHidden,{as:"span",id:`rbc-desc-${o}`,children:r})]})}const QT=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:s,renderResponsiveControls:i,isResponsive:l=!1,defaultLabel:c={id:"all",label:(0,C._x)("All","screen sizes")},viewports:u=[{id:"small",label:(0,C.__)("Small screens")},{id:"medium",label:(0,C.__)("Medium screens")},{id:"large",label:(0,C.__)("Large screens")}]}=e;if(!t||!n||!s)return null;const d=o||(0,C.sprintf)((0,C.__)("Use the same %s on all screen sizes."),n),p=(0,C.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),h=s((0,U.jsx)(XT,{property:n,viewport:c}),c);return(0,U.jsxs)("fieldset",{className:"block-editor-responsive-block-control",children:[(0,U.jsx)("legend",{className:"block-editor-responsive-block-control__title",children:t}),(0,U.jsxs)("div",{className:"block-editor-responsive-block-control__inner",children:[(0,U.jsx)(Ns.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-responsive-block-control__toggle",label:d,checked:!l,onChange:r,help:p}),(0,U.jsxs)("div",{className:Bs("block-editor-responsive-block-control__group",{"is-responsive":l}),children:[!l&&h,l&&(i?i(u):u.map((e=>(0,U.jsx)(a.Fragment,{children:s((0,U.jsx)(XT,{property:n,viewport:e}),e)},e.id))))]})]})]})};function JT({character:e,type:t,onUse:n}){const o=(0,a.useContext)(zT),r=(0,a.useRef)();return r.current=n,(0,a.useEffect)((()=>{function n(n){ca.isKeyboardEvent[t](n,e)&&(r.current(),n.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}}),[e,t]),null}function eM({name:e,shortcutType:t,shortcutCharacter:n,...o}){let r,s="RichText.ToolbarControls";return e&&(s+=`.${e}`),t&&n&&(r=ca.displayShortcut[t](n)),(0,U.jsx)(Ns.Fill,{name:s,children:(0,U.jsx)(Ns.ToolbarButton,{...o,shortcut:r})})}function tM({inputType:e,onInput:t}){const n=(0,a.useContext)(VT),o=(0,a.useRef)();return o.current=t,(0,a.useEffect)((()=>{function t(t){t.inputType===e&&(o.current(),t.preventDefault())}return n.current.add(t),()=>{n.current.delete(t)}}),[e]),null}const nM=(0,U.jsx)(Ns.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,U.jsx)(Ns.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"})});const oM=(0,a.forwardRef)((function(e,t){const n=(0,c.useSelect)((e=>e($r).__unstableGetEditorMode()),[]),{__unstableSetEditorMode:o}=(0,c.useDispatch)($r);return(0,U.jsx)(Ns.Dropdown,{renderToggle:({isOpen:o,onToggle:r})=>(0,U.jsx)(Ns.Button,{...e,ref:t,icon:"navigation"===n?nM:rc,"aria-expanded":o,"aria-haspopup":"true",onClick:r,label:(0,C.__)("Tools")}),popoverProps:{placement:"bottom-start"},renderContent:()=>(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.NavigableMenu,{role:"menu","aria-label":(0,C.__)("Tools"),children:(0,U.jsx)(Ns.MenuItemsChoice,{value:"navigation"===n?"navigation":"edit",onSelect:o,choices:[{value:"edit",label:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ui,{icon:rc}),(0,C.__)("Edit")]})},{value:"navigation",label:(0,U.jsxs)(U.Fragment,{children:[nM,(0,C.__)("Select")]})}]})}),(0,U.jsx)("div",{className:"block-editor-tool-selector__help",children:(0,C.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")})]})})}));function rM({units:e,...t}){const[n]=Kr("spacing.units"),o=(0,Ns.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vw"],units:e});return(0,U.jsx)(Ns.__experimentalUnitControl,{units:o,...t})}const sM=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})});class iM extends a.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,C.__)("Edit link"):(0,C.__)("Insert link");return(0,U.jsxs)("div",{className:"block-editor-url-input__button",children:[(0,U.jsx)(Ns.Button,{icon:Hu,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,U.jsx)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink,children:(0,U.jsxs)("div",{className:"block-editor-url-input__button-modal-line",children:[(0,U.jsx)(Ns.Button,{className:"block-editor-url-input__back",icon:sM,label:(0,C.__)("Close"),onClick:this.toggle}),(0,U.jsx)(Ca,{__nextHasNoMarginBottom:!0,value:e||"",onChange:t}),(0,U.jsx)(Ns.Button,{icon:va,label:(0,C.__)("Submit"),type:"submit"})]})})]})}}const lM=iM,aM=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})}),cM="none",uM="custom",dM="media",pM="attachment",hM=["noreferrer","noopener"],gM=({linkDestination:e,onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:r,mediaLink:s,linkTarget:i,linkClass:l,rel:c,showLightboxSetting:u,lightboxEnabled:d,onSetLightbox:p,resetLightbox:h})=>{const[g,m]=(0,a.useState)(!1),[f,b]=(0,a.useState)(null),[v,k]=(0,a.useState)(!1),[_,x]=(0,a.useState)(null),y=(0,a.useRef)(null),S=(0,a.useRef)();(0,a.useEffect)((()=>{if(!S.current)return;(la.focus.focusable.find(S.current)[0]||S.current).focus()}),[v,n,d]);const w=()=>{e!==dM&&e!==pM||x(""),k(!0)},B=()=>{k(!1)},I=()=>{const e=[{linkDestination:dM,title:(0,C.__)("Link to image file"),url:"image"===o?r:void 0,icon:aM}];return"image"===o&&s&&e.push({linkDestination:pM,title:(0,C.__)("Link to attachment page"),url:"image"===o?s:void 0,icon:Ea}),e},j=(0,U.jsxs)(Ns.__experimentalVStack,{spacing:"3",children:[(0,U.jsx)(Ns.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Open in new tab"),onChange:e=>{const n=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=c?c:"").split(" ");hM.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=c?c:"").split(" ").filter((e=>!1===hM.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===i}),(0,U.jsx)(Ns.TextControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Link rel"),value:null!=c?c:"",onChange:e=>{t({rel:e})}}),(0,U.jsx)(Ns.TextControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Link CSS class"),value:l||"",onChange:e=>{t({linkClass:e})}})]}),E=null!==_?_:n,T=!d||d&&!u,M=!E&&T,P=(I().find((t=>t.linkDestination===e))||{}).title;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ns.ToolbarButton,{icon:Hu,className:"components-toolbar__control",label:(0,C.__)("Link"),"aria-expanded":g,onClick:()=>{m(!0)},ref:b,isActive:!!n||d&&u}),g&&(0,U.jsx)(pT,{ref:S,anchor:f,onFocusOutside:e=>{const t=y.current;t&&t.contains(e.target)||(m(!1),x(null),B())},onClose:()=>{x(null),B(),m(!1)},renderSettings:T?()=>j:null,additionalControls:M&&(0,U.jsxs)(Ns.NavigableMenu,{children:[I().map((e=>(0,U.jsx)(Ns.MenuItem,{icon:e.icon,iconPosition:"left",onClick:()=>{x(null),(e=>{const n=I();let o;o=e?(n.find((t=>t.url===e))||{linkDestination:uM}).linkDestination:cM,t({linkDestination:o,href:e})})(e.url),B()},children:e.title},e.linkDestination))),u&&(0,U.jsx)(Ns.MenuItem,{className:"block-editor-url-popover__expand-on-click",icon:Vb,info:(0,C.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{x(null),t({linkDestination:cM,href:""}),p(!0),B()},children:(0,C.__)("Expand on click")},"expand-on-click")]}),offset:13,children:d&&u&&!n&&!v?(0,U.jsxs)("div",{className:"block-editor-url-popover__expand-on-click",children:[(0,U.jsx)(Ui,{icon:Vb}),(0,U.jsxs)("div",{className:"text",children:[(0,U.jsx)("p",{children:(0,C.__)("Expand on click")}),(0,U.jsx)("p",{className:"description",children:(0,C.__)("Scales the image with a lightbox effect")})]}),(0,U.jsx)(Ns.Button,{icon:sc,label:(0,C.__)("Disable expand on click"),onClick:()=>{p(!1)},size:"compact"})]}):!n||v?(0,U.jsx)(pT.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:E,onChangeInputValue:x,onSubmit:e=>{if(_){const e=I().find((e=>e.url===_))?.linkDestination||uM;t({href:_,linkDestination:e,lightbox:{enabled:!1}})}B(),x(null),e.preventDefault()},autocompleteRef:y}):n&&!v?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(pT.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:w,urlLabel:P}),(0,U.jsx)(Ns.Button,{icon:sc,label:(0,C.__)("Remove link"),onClick:()=>{t({linkDestination:cM,href:""}),h()},size:"compact"})]}):void 0})]})};function mM(){return y()("wp.blockEditor.PreviewOptions",{version:"6.5"}),null}function fM(e){const[t,n]=(0,a.useState)(window.innerWidth);(0,a.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n<t?n:t};return(e=>{const t="Mobile"===e?"768px":"1024px",n=(window.innerHeight<800?36:72)+"px",r="auto";switch(e){case"Tablet":case"Mobile":return{width:o(e),marginTop:n,marginBottom:n,marginLeft:r,marginRight:r,height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return{marginLeft:r,marginRight:r}}})(e)}function bM(){const e=(0,c.useSelect)((e=>e($r).getBlockSelectionStart()),[]),t=Qi(e);return e?(0,U.jsx)(Ns.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current.focus()},children:(0,C.__)("Skip to the selected block")}):null}const vM=window.wp.wordcount;const kM=(0,c.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e($r);return{blocks:t()}}))((function({blocks:e}){const t=(0,vM.count)((0,l.serialize)(e),"words");return(0,U.jsxs)("div",{className:"block-editor-multi-selection-inspector__card",children:[(0,U.jsx)(Tf,{icon:fB,showColors:!0}),(0,U.jsxs)("div",{className:"block-editor-multi-selection-inspector__card-content",children:[(0,U.jsx)("div",{className:"block-editor-multi-selection-inspector__card-title",children:(0,C.sprintf)((0,C._n)("%d Block","%d Blocks",e.length),e.length)}),(0,U.jsx)("div",{className:"block-editor-multi-selection-inspector__card-description",children:(0,C.sprintf)((0,C._n)("%d word selected.","%d words selected.",t),t)})]})]})})),_M=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})}),xM=(0,U.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)(G.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"})}),yM={name:"settings",title:(0,C.__)("Settings"),value:"settings",icon:_M,className:"block-editor-block-inspector__tab-item"},SM={name:"styles",title:(0,C.__)("Styles"),value:"styles",icon:xM,className:"block-editor-block-inspector__tab-item"},wM={name:"list",title:(0,C.__)("List View"),value:"list-view",icon:nj,className:"block-editor-block-inspector__tab-item"},CM=()=>{const e=(0,Ns.__experimentalUseSlotFills)(ra.slotName);return Boolean(e&&e.length)?(0,U.jsx)(Ns.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,C.__)("Advanced"),initialOpen:!1,children:(0,U.jsx)(sa.Slot,{group:"advanced"})}):null},BM=()=>{const[e,t]=(0,a.useState)(),{multiSelectedBlocks:n}=(0,c.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:n}=e($r);return{multiSelectedBlocks:t(n())}}),[]);return(0,a.useLayoutEffect)((()=>{void 0===e&&t(n.some((({attributes:e})=>!!e?.style?.position?.type)))}),[e,n,t]),(0,U.jsx)(Ns.PanelBody,{className:"block-editor-block-inspector__position",title:(0,C.__)("Position"),initialOpen:null!=e&&e,children:(0,U.jsx)(sa.Slot,{group:"position"})})},IM=()=>{const e=(0,Ns.__experimentalUseSlotFills)(Yl.position.Slot.__unstableName);return Boolean(e&&e.length)?(0,U.jsx)(BM,{}):null},jM=(0,U.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(G.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})}),EM="isInspectorControlsTabsHintVisible";function TM(){const e=(0,c.useSelect)((e=>{var t;return null===(t=e(ba.store).get("core",EM))||void 0===t||t}),[]),t=(0,a.useRef)(),{set:n}=(0,c.useDispatch)(ba.store);return e?(0,U.jsxs)("div",{ref:t,className:"block-editor-inspector-controls-tabs__hint",children:[(0,U.jsx)("div",{className:"block-editor-inspector-controls-tabs__hint-content",children:(0,C.__)("Looking for other block settings? They've moved to the styles tab.")}),(0,U.jsx)(Ns.Button,{className:"block-editor-inspector-controls-tabs__hint-dismiss",icon:jM,iconSize:"16",label:(0,C.__)("Dismiss hint"),onClick:()=>{const e=la.focus.tabbable.findPrevious(t.current);e?.focus(),n("core",EM,!1)},showTooltip:!1})]}):null}const MM=({showAdvancedControls:e=!1})=>(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(sa.Slot,{}),(0,U.jsx)(IM,{}),e&&(0,U.jsx)("div",{children:(0,U.jsx)(CM,{})}),(0,U.jsx)(TM,{})]}),PM=({blockName:e,clientId:t,hasBlockStyles:n})=>{const o=Cd({blockName:e});return(0,U.jsxs)(U.Fragment,{children:[n&&(0,U.jsx)("div",{children:(0,U.jsx)(Ns.PanelBody,{title:(0,C.__)("Styles"),children:(0,U.jsx)(Vj,{clientId:t})})}),(0,U.jsx)(sa.Slot,{group:"color",label:(0,C.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,U.jsx)(sa.Slot,{group:"background",label:(0,C.__)("Background image")}),(0,U.jsx)(sa.Slot,{group:"filter"}),(0,U.jsx)(sa.Slot,{group:"typography",label:(0,C.__)("Typography")}),(0,U.jsx)(sa.Slot,{group:"dimensions",label:(0,C.__)("Dimensions")}),(0,U.jsx)(sa.Slot,{group:"border",label:o}),(0,U.jsx)(sa.Slot,{group:"styles"})]})},RM=["core/navigation"],NM=e=>!RM.includes(e),{Tabs:AM}=Q(Ns.privateApis);function LM({blockName:e,clientId:t,hasBlockStyles:n,tabs:o}){const r=(0,c.useSelect)((e=>e(ba.store).get("core","showIconLabels")),[]),s=NM(e)?void 0:wM.name;return(0,U.jsx)("div",{className:"block-editor-block-inspector__tabs",children:(0,U.jsxs)(AM,{defaultTabId:s,children:[(0,U.jsx)(AM.TabList,{children:o.map((e=>(0,U.jsx)(AM.Tab,{tabId:e.name,render:(0,U.jsx)(Ns.Button,{icon:r?void 0:e.icon,label:r?void 0:e.title,className:e.className,children:r&&e.title})},e.name)))}),(0,U.jsx)(AM.TabPanel,{tabId:yM.name,focusable:!1,children:(0,U.jsx)(MM,{showAdvancedControls:!!e})}),(0,U.jsx)(AM.TabPanel,{tabId:SM.name,focusable:!1,children:(0,U.jsx)(PM,{blockName:e,clientId:t,hasBlockStyles:n})}),(0,U.jsx)(AM.TabPanel,{tabId:wM.name,focusable:!1,children:(0,U.jsx)(sa.Slot,{group:"list"})})]},t)})}const OM=[];function DM(e){const t=[],{border:n,color:o,default:r,dimensions:s,list:i,position:l,styles:a,typography:u,effects:d}=Yl,p=NM(e),h=(0,Ns.__experimentalUseSlotFills)(i.Slot.__unstableName),g=!p&&!!h&&h.length,m=[...(0,Ns.__experimentalUseSlotFills)(n.Slot.__unstableName)||[],...(0,Ns.__experimentalUseSlotFills)(o.Slot.__unstableName)||[],...(0,Ns.__experimentalUseSlotFills)(s.Slot.__unstableName)||[],...(0,Ns.__experimentalUseSlotFills)(a.Slot.__unstableName)||[],...(0,Ns.__experimentalUseSlotFills)(u.Slot.__unstableName)||[],...(0,Ns.__experimentalUseSlotFills)(d.Slot.__unstableName)||[]].length,f=(0,Ns.__experimentalUseSlotFills)(ra.slotName)||[],b=[...(0,Ns.__experimentalUseSlotFills)(r.Slot.__unstableName)||[],...(0,Ns.__experimentalUseSlotFills)(l.Slot.__unstableName)||[],...g&&m>1?f:[]];g&&t.push(wM),b.length&&t.push(yM),m&&t.push(SM);const v=function(e,t={}){return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,c.useSelect)((e=>e($r).getSettings().blockInspectorTabs),[]));return v?t:OM}const{createPrivateSlotFill:zM}=Q(Ns.privateApis),{Fill:VM,Slot:FM}=zM("BlockInformation"),HM=e=>_()[p]?(0,U.jsx)(VM,{...e}):null;HM.Slot=e=>(0,U.jsx)(FM,{...e});const GM=HM;function UM({clientIds:e}){return e.length?(0,U.jsx)(Ns.__experimentalVStack,{spacing:1,children:e.map((e=>(0,U.jsx)($M,{clientId:e},e)))}):null}function $M({clientId:e}){const{name:t,icon:n,isSelected:o}=(0,c.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o,isBlockSelected:r,hasSelectedInnerBlock:s}=t($r),{getBlockType:i}=t(l.store),a=i(n(e)),c=o(e);return{name:a&&(0,l.__experimentalGetBlockLabel)(a,c,"list-view"),icon:a?.icon,isSelected:r(e)||s(e,!0)}}),[e]),{selectBlock:r}=(0,c.useDispatch)($r);return(0,U.jsx)(Ns.Button,{isPressed:o,onClick:()=>r(e),children:(0,U.jsxs)(Ns.Flex,{children:[(0,U.jsx)(Ns.FlexItem,{children:(0,U.jsx)(Tf,{icon:n})}),(0,U.jsx)(Ns.FlexBlock,{style:{textAlign:"left"},children:(0,U.jsx)(Ns.__experimentalTruncate,{children:t})})]})})}function WM({topLevelLockedBlock:e}){const t=(0,c.useSelect)((t=>{const{getClientIdsOfDescendants:n,getBlockName:o,getBlockEditingMode:r}=t($r);return n(e).filter((e=>"core/list-item"!==o(e)&&"contentOnly"===r(e)))}),[e]),n=dm(e);return(0,U.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,U.jsx)(dy,{...n,className:n.isSynced&&"is-synced"}),(0,U.jsx)(uE,{blockClientId:e}),(0,U.jsx)(GM.Slot,{}),t.length>0&&(0,U.jsx)(Ns.PanelBody,{title:(0,C.__)("Content"),children:(0,U.jsx)(UM,{clientIds:t})})]})}const KM=({animate:e,wrapper:t,children:n})=>e?t(n):n,ZM=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const o=e&&"leftToRight"===e.enterDirection?-50:50;return(0,U.jsx)(Ns.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},children:n},t)},qM=({clientId:e,blockName:t})=>{const n=DM(t),o=n?.length>1,r=(0,c.useSelect)((e=>{const{getBlockStyles:n}=e(l.store),o=n(t);return o&&o.length>0}),[t]),s=dm(e),i=Cd({blockName:t});return(0,U.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,U.jsx)(dy,{...s,className:s.isSynced&&"is-synced"}),(0,U.jsx)(uE,{blockClientId:e}),(0,U.jsx)(GM.Slot,{}),o&&(0,U.jsx)(LM,{hasBlockStyles:r,clientId:e,blockName:t,tabs:n}),!o&&(0,U.jsxs)(U.Fragment,{children:[r&&(0,U.jsx)("div",{children:(0,U.jsx)(Ns.PanelBody,{title:(0,C.__)("Styles"),children:(0,U.jsx)(Vj,{clientId:e})})}),(0,U.jsx)(sa.Slot,{}),(0,U.jsx)(sa.Slot,{group:"list"}),(0,U.jsx)(sa.Slot,{group:"color",label:(0,C.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,U.jsx)(sa.Slot,{group:"typography",label:(0,C.__)("Typography")}),(0,U.jsx)(sa.Slot,{group:"dimensions",label:(0,C.__)("Dimensions")}),(0,U.jsx)(sa.Slot,{group:"border",label:i}),(0,U.jsx)(sa.Slot,{group:"styles"}),(0,U.jsx)(sa.Slot,{group:"background",label:(0,C.__)("Background image")}),(0,U.jsx)(IM,{}),(0,U.jsx)("div",{children:(0,U.jsx)(CM,{})})]}),(0,U.jsx)(bM,{},"back")]})},YM=({showNoBlockSelectedMessage:e=!0})=>{const{count:t,selectedBlockName:n,selectedBlockClientId:o,blockType:r,topLevelLockedBlock:s}=(0,c.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o,getContentLockingParent:r,getTemplateLock:s}=Q(e($r)),i=t(),a=i&&o(i),c=a&&(0,l.getBlockType)(a);return{count:n(),selectedBlockClientId:i,selectedBlockName:a,blockType:c,topLevelLockedBlock:r(i)||("contentOnly"===s(i)||"core/block"===a?i:void 0)}}),[]),i=DM(r?.name),a=i?.length>1,u=function(e){return(0,c.useSelect)((t=>{if(e){const n=t($r).getSettings().blockInspectorAnimation,o=n?.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:s}=t($r);return s(r(),o,!0)[0]||e.name===o?n?.[e.name]:null}return null}),[e])}(r),d=Cd({blockName:n});if(t>1)return(0,U.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,U.jsx)(kM,{}),a?(0,U.jsx)(LM,{tabs:i}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(sa.Slot,{}),(0,U.jsx)(sa.Slot,{group:"color",label:(0,C.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,U.jsx)(sa.Slot,{group:"typography",label:(0,C.__)("Typography")}),(0,U.jsx)(sa.Slot,{group:"dimensions",label:(0,C.__)("Dimensions")}),(0,U.jsx)(sa.Slot,{group:"border",label:d}),(0,U.jsx)(sa.Slot,{group:"styles"})]})]});const p=n===(0,l.getUnregisteredTypeHandlerName)();return r&&o&&!p?s?(0,U.jsx)(WM,{topLevelLockedBlock:s}):(0,U.jsx)(KM,{animate:u,wrapper:e=>(0,U.jsx)(ZM,{blockInspectorAnimationSettings:u,selectedBlockClientId:o,children:e}),children:(0,U.jsx)(qM,{clientId:o,blockName:r.name})}):e?(0,U.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,C.__)("No block selected.")}):null},XM=()=>(y()("__unstableUseClipboardHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),Dy());function QM(e){return y()("CopyHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),(0,U.jsx)("div",{...e,ref:Dy()})}const JM=()=>{};const eP=(0,a.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r=!1,__experimentalInsertionIndex:s,__experimentalInitialTab:i,__experimentalInitialCategory:l,__experimentalFilterValue:a,onPatternCategorySelection:u,onSelect:d=JM,shouldFocusBlock:p=!1,onClose:h},g){const{destinationRootClientId:m}=(0,c.useSelect)((n=>{const{getBlockRootClientId:o}=n($r);return{destinationRootClientId:e||o(t)||void 0}}),[t,e]);return(0,U.jsx)(Gw,{onSelect:d,rootClientId:m,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r,__experimentalInsertionIndex:s,__experimentalFilterValue:a,onPatternCategorySelection:u,__experimentalInitialTab:i,__experimentalInitialCategory:l,shouldFocusBlock:p,ref:g,onClose:h})}));const tP=(0,a.forwardRef)((function(e,t){return(0,U.jsx)(eP,{...e,onPatternCategorySelection:void 0,ref:t})}));function nP(){return y()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const oP=-1!==window.navigator.userAgent.indexOf("Trident"),rP=new Set([ca.UP,ca.DOWN,ca.LEFT,ca.RIGHT]),sP=.75;function iP(){const e=(0,c.useSelect)((e=>e($r).hasSelectedBlock()),[]);return(0,u.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,s,i;function l(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){s&&o.cancelAnimationFrame(s),s=o.requestAnimationFrame((()=>{c(e),s=null}))}function c({keyCode:e}){if(!h())return;const r=(0,la.computeCaretRect)(o);if(!r)return;if(!i)return void(i=r);if(rP.has(e))return void(i=r);const s=r.top-i.top;if(0===s)return;const l=(0,la.getScrollContainer)(t);if(!l)return;const a=l===n.body||l===n.documentElement,c=a?o.scrollY:l.scrollTop,u=a?0:l.getBoundingClientRect().top,d=a?i.top/o.innerHeight:(i.top-u)/(o.innerHeight-u);if(0===c&&d<sP&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=r);const p=a?o.innerHeight:l.clientHeight;i.top+i.height>u+p||i.top<u?i=r:a?o.scrollBy(0,s):l.scrollTop+=s}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){h()&&(i=(0,la.computeCaretRect)(o))}function h(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",l,!0),o.addEventListener("resize",l,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",l,!0),o.removeEventListener("resize",l,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(s)}}),[e])}const lP=oP?e=>e.children:function({children:e}){return(0,U.jsx)("div",{ref:iP(),className:"block-editor__typewriter",children:e})},aP=(0,a.createContext)({});function cP({children:e,uniqueId:t,blockName:n=""}){const o=(0,a.useContext)(aP),{name:r}=_();n=n||r;const s=(0,a.useMemo)((()=>function(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}(o,n,t)),[o,n,t]);return(0,U.jsx)(aP.Provider,{value:s,children:e})}function uP(e,t=""){const n=(0,a.useContext)(aP),{name:o}=_();return t=t||o,Boolean(n[t]?.has(e))}const dP=e=>(y()("wp.blockEditor.__experimentalRecursionProvider",{since:"6.5",alternative:"wp.blockEditor.RecursionProvider"}),(0,U.jsx)(cP,{...e})),pP=(...e)=>(y()("wp.blockEditor.__experimentalUseHasRecursion",{since:"6.5",alternative:"wp.blockEditor.useHasRecursion"}),uP(...e));function hP({title:e,help:t,actions:n=[],onClose:o}){return(0,U.jsxs)(Ns.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4,children:[(0,U.jsxs)(Ns.__experimentalHStack,{alignment:"center",children:[(0,U.jsx)(Ns.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),(0,U.jsx)(Ns.__experimentalSpacer,{}),n.map((({label:e,icon:t,onClick:n})=>(0,U.jsx)(Ns.Button,{className:"block-editor-inspector-popover-header__action",label:e,icon:t,variant:!t&&"tertiary",onClick:n,children:!t&&e},e))),o&&(0,U.jsx)(Ns.Button,{className:"block-editor-inspector-popover-header__action",label:(0,C.__)("Close"),icon:Lw,onClick:o})]}),t&&(0,U.jsx)(Ns.__experimentalText,{children:t})]})}const gP=(0,a.forwardRef)((function({onClose:e,onChange:t,showPopoverHeaderActions:n,isCompact:o,currentDate:r,...s},i){const l={startOfWeek:(0,gE.getSettings)().l10n.startOfWeek,onChange:t,currentDate:o?void 0:r,currentTime:o?r:void 0,...s},a=o?Ns.TimePicker:Ns.DateTimePicker;return(0,U.jsxs)("div",{ref:i,className:"block-editor-publish-date-time-picker",children:[(0,U.jsx)(hP,{title:(0,C.__)("Publish"),actions:n?[{label:(0,C.__)("Now"),onClick:()=>t?.(null)}]:void 0,onClose:e}),(0,U.jsx)(a,{...l})]})}));const mP=(0,a.forwardRef)((function(e,t){return(0,U.jsx)(gP,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})})),fP="isResuableBlocksrRenameHintVisible";function bP(){const e=(0,c.useSelect)((e=>{var t;return null===(t=e(ba.store).get("core",fP))||void 0===t||t}),[]),t=(0,a.useRef)(),{set:n}=(0,c.useDispatch)(ba.store);return e?(0,U.jsxs)("div",{ref:t,className:"reusable-blocks-menu-items__rename-hint",children:[(0,U.jsx)("div",{className:"reusable-blocks-menu-items__rename-hint-content",children:(0,C.__)("Reusable blocks are now synced patterns. A synced pattern will behave in exactly the same way as a reusable block.")}),(0,U.jsx)(Ns.Button,{className:"reusable-blocks-menu-items__rename-hint-dismiss",icon:jM,iconSize:"16",label:(0,C.__)("Dismiss hint"),onClick:()=>{const e=la.focus.tabbable.findPrevious(t.current);e?.focus(),n("core",fP,!1)},showTooltip:!1})]}):null}const vP={button:"wp-element-button",caption:"wp-element-caption"},kP=e=>vP[e]?vP[e]:"",_P=()=>"";function xP(e,t,n){return"core/image"===e&&n?.lightbox?.allowEditing||!!t?.lightbox}function yP({onChange:e,value:t,inheritedValue:n,panelId:o}){const r=us(),s=()=>{e(void 0)};let i=!1;return n?.lightbox?.enabled&&(i=n.lightbox.enabled),(0,U.jsx)(U.Fragment,{children:(0,U.jsx)(Ns.__experimentalToolsPanel,{label:(0,C._x)("Settings","Image settings"),resetAll:s,panelId:o,dropdownMenuProps:r,children:(0,U.jsx)(Ns.__experimentalToolsPanelItem,{hasValue:()=>!!t?.lightbox,label:(0,C.__)("Expand on click"),onDeselect:s,isShownByDefault:!0,panelId:o,children:(0,U.jsx)(Ns.ToggleControl,{label:(0,C.__)("Expand on click"),checked:i,onChange:t=>{e({enabled:t})}})})})})}function SP({value:e,onChange:t,inheritedValue:n=e}){const[o,r]=(0,a.useState)(null),s=n?.css;return(0,U.jsxs)(Ns.__experimentalVStack,{spacing:3,children:[o&&(0,U.jsx)(Ns.Notice,{status:"error",onRemove:()=>r(null),children:o}),(0,U.jsx)(Ns.TextareaControl,{label:(0,C.__)("Additional CSS"),__nextHasNoMarginBottom:!0,value:s,onChange:n=>function(n){if(t({...e,css:n}),o){const[e]=eS([{css:n}],".for-validation-only");e&&r(null)}}(n),onBlur:function(e){if(!e?.target?.value)return void r(null);const[t]=eS([{css:e.target.value}],".for-validation-only");r(null===t?(0,C.__)("There is an error with your CSS structure."):null)},className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1})]})}const wP=new Map,CP=[],BP={caption:(0,C.__)("Caption"),link:(0,C.__)("Link"),button:(0,C.__)("Button"),heading:(0,C.__)("Heading"),h1:(0,C.__)("H1"),h2:(0,C.__)("H2"),h3:(0,C.__)("H3"),h4:(0,C.__)("H4"),h5:(0,C.__)("H5"),h6:(0,C.__)("H6"),"settings.color":(0,C.__)("Color"),"settings.typography":(0,C.__)("Typography"),"styles.color":(0,C.__)("Colors"),"styles.spacing":(0,C.__)("Spacing"),"styles.background":(0,C.__)("Background"),"styles.typography":(0,C.__)("Typography")},IP=function(e,t){var n,o,r=0;function s(){var s,i,l=n,a=arguments.length;e:for(;l;){if(l.args.length===arguments.length){for(i=0;i<a;i++)if(l.args[i]!==arguments[i]){l=l.next;continue e}return l!==n&&(l===o&&(o=l.prev),l.prev.next=l.next,l.next&&(l.next.prev=l.prev),l.next=n,l.prev=null,n.prev=l,n=l),l.val}l=l.next}for(s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];return l={args:s,val:e.apply(null,s)},n?(n.prev=l,l.next=n):o=l,r===t.maxSize?(o=o.prev).next=null:r++,n=l,l.val}return t=t||{},s.clear=function(){n=null,o=null,r=0},s}((()=>(0,l.getBlockTypes)().reduce(((e,{name:t,title:n})=>(e[t]=n,e)),{}))),jP=e=>null!==e&&"object"==typeof e;function EP(e,t,n=""){if(!jP(e)&&!jP(t))return e!==t?n.split(".").slice(0,2).join("."):void 0;e=jP(e)?e:{},t=jP(t)?t:{};const o=new Set([...Object.keys(e),...Object.keys(t)]);let r=[];for(const s of o){const o=n?n+"."+s:s,i=EP(e[s],t[s],o);i&&(r=r.concat(i))}return r}function TP(e,t){const n=JSON.stringify({next:e,previous:t});if(wP.has(n))return wP.get(n);const o=EP({styles:{background:e?.styles?.background,color:e?.styles?.color,typography:e?.styles?.typography,spacing:e?.styles?.spacing},blocks:e?.styles?.blocks,elements:e?.styles?.elements,settings:e?.settings},{styles:{background:t?.styles?.background,color:t?.styles?.color,typography:t?.styles?.typography,spacing:t?.styles?.spacing},blocks:t?.styles?.blocks,elements:t?.styles?.elements,settings:t?.settings});if(!o.length)return wP.set(n,CP),CP;const r=[...new Set(o)].reduce(((e,t)=>{const n=function(e){if(BP[e])return BP[e];const t=e.split(".");if("blocks"===t?.[0]){const e=IP()?.[t[1]];return e||t[1]}return"elements"===t?.[0]?BP[t[1]]||t[1]:void 0}(t);return n&&e.push([t.split(".")[0],n]),e}),[]);return wP.set(n,r),r}function MP(e,t,n={}){let o=TP(e,t);const r=o.length,{maxResults:s}=n;return r?(s&&r>s&&(o=o.slice(0,s)),Object.entries(o.reduce(((e,t)=>{const n=e[t[0]]||[];return n.includes(t[1])||(e[t[0]]=[...n,t[1]]),e}),{})).map((([e,t])=>{const n=t.length,o=t.join((0,C.__)(", "));switch(e){case"blocks":return(0,C.sprintf)((0,C._n)("%s block.","%s blocks.",n),o);case"elements":return(0,C.sprintf)((0,C._n)("%s element.","%s elements.",n),o);case"settings":return(0,C.sprintf)((0,C.__)("%s settings."),o);case"styles":return(0,C.sprintf)((0,C.__)("%s styles."),o);default:return(0,C.sprintf)((0,C.__)("%s."),o)}}))):CP}function PP(e,t,n){if(null==e||!1===e)return;if(Array.isArray(e))return RP(e,t,n);switch(typeof e){case"string":case"number":return}const{type:o,props:r}=e;switch(o){case a.StrictMode:case a.Fragment:return RP(r.children,t,n);case a.RawHTML:return;case PC.Content:return NP(t,n);case OT:return void t.push(r.value)}switch(typeof o){case"string":return void 0!==r.children?RP(r.children,t,n):void 0;case"function":return PP(o.prototype&&"function"==typeof o.prototype.render?new o(r).render():o(r),t,n)}}function RP(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;n<e.length;n++)PP(e[n],...t)}function NP(e,t){for(let n=0;n<t.length;n++){const{name:o,attributes:r,innerBlocks:s}=t[n];PP((0,l.getSaveElement)(o,r,(0,U.jsx)(PC.Content,{})),e,s)}}const AP=[{value:"fill",label:(0,C._x)("Fill","Scale option for dimensions control"),help:(0,C.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,C._x)("Contain","Scale option for dimensions control"),help:(0,C.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,C._x)("Cover","Scale option for dimensions control"),help:(0,C.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,C._x)("None","Scale option for dimensions control"),help:(0,C.__)("Do not adjust the sizing of the content. Content that is too large will be clipped, and content that is too small will have additional padding.")},{value:"scale-down",label:(0,C._x)("Scale down","Scale option for dimensions control"),help:(0,C.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function LP({panelId:e,value:t,onChange:n,options:o=AP,defaultValue:r=AP[0].value,isShownByDefault:s=!0}){const i=null!=t?t:"fill",l=(0,a.useMemo)((()=>o.reduce(((e,t)=>(e[t.value]=t.help,e)),{})),[o]);return(0,U.jsx)(Ns.__experimentalToolsPanelItem,{label:(0,C.__)("Scale"),isShownByDefault:s,hasValue:()=>i!==r,onDeselect:()=>n(r),panelId:e,children:(0,U.jsx)(Ns.__experimentalToggleGroupControl,{label:(0,C.__)("Scale"),isBlock:!0,help:l[i],value:i,onChange:n,size:"__unstable-large",children:o.map((e=>(0,U.jsx)(Ns.__experimentalToggleGroupControlOption,{...e},e.value)))})})}function OP(){return OP=Object.assign?Object.assign.bind():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},OP.apply(this,arguments)}function DP(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var zP=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,VP=DP((function(e){return zP.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));var FP=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){0}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),HP=Math.abs,GP=String.fromCharCode,UP=Object.assign;function $P(e){return e.trim()}function WP(e,t,n){return e.replace(t,n)}function KP(e,t){return e.indexOf(t)}function ZP(e,t){return 0|e.charCodeAt(t)}function qP(e,t,n){return e.slice(t,n)}function YP(e){return e.length}function XP(e){return e.length}function QP(e,t){return t.push(e),e}var JP=1,eR=1,tR=0,nR=0,oR=0,rR="";function sR(e,t,n,o,r,s,i){return{value:e,root:t,parent:n,type:o,props:r,children:s,line:JP,column:eR,length:i,return:""}}function iR(e,t){return UP(sR("",null,null,"",null,null,0),e,{length:-e.length},t)}function lR(){return oR=nR>0?ZP(rR,--nR):0,eR--,10===oR&&(eR=1,JP--),oR}function aR(){return oR=nR<tR?ZP(rR,nR++):0,eR++,10===oR&&(eR=1,JP++),oR}function cR(){return ZP(rR,nR)}function uR(){return nR}function dR(e,t){return qP(rR,e,t)}function pR(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function hR(e){return JP=eR=1,tR=YP(rR=e),nR=0,[]}function gR(e){return rR="",e}function mR(e){return $P(dR(nR-1,vR(91===e?e+2:40===e?e+1:e)))}function fR(e){for(;(oR=cR())&&oR<33;)aR();return pR(e)>2||pR(oR)>3?"":" "}function bR(e,t){for(;--t&&aR()&&!(oR<48||oR>102||oR>57&&oR<65||oR>70&&oR<97););return dR(e,uR()+(t<6&&32==cR()&&32==aR()))}function vR(e){for(;aR();)switch(oR){case e:return nR;case 34:case 39:34!==e&&39!==e&&vR(oR);break;case 40:41===e&&vR(e);break;case 92:aR()}return nR}function kR(e,t){for(;aR()&&e+oR!==57&&(e+oR!==84||47!==cR()););return"/*"+dR(t,nR-1)+"*"+GP(47===e?e:aR())}function _R(e){for(;!pR(cR());)aR();return dR(e,nR)}var xR="-ms-",yR="-moz-",SR="-webkit-",wR="comm",CR="rule",BR="decl",IR="@keyframes";function jR(e,t){for(var n="",o=XP(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function ER(e,t,n,o){switch(e.type){case"@import":case BR:return e.return=e.return||e.value;case wR:return"";case IR:return e.return=e.value+"{"+jR(e.children,o)+"}";case CR:e.value=e.props.join(",")}return YP(n=jR(e.children,o))?e.return=e.value+"{"+n+"}":""}function TR(e){return gR(MR("",null,null,null,[""],e=hR(e),0,[0],e))}function MR(e,t,n,o,r,s,i,l,a){for(var c=0,u=0,d=i,p=0,h=0,g=0,m=1,f=1,b=1,v=0,k="",_=r,x=s,y=o,S=k;f;)switch(g=v,v=aR()){case 40:if(108!=g&&58==ZP(S,d-1)){-1!=KP(S+=WP(mR(v),"&","&\f"),"&\f")&&(b=-1);break}case 34:case 39:case 91:S+=mR(v);break;case 9:case 10:case 13:case 32:S+=fR(g);break;case 92:S+=bR(uR()-1,7);continue;case 47:switch(cR()){case 42:case 47:QP(RR(kR(aR(),uR()),t,n),a);break;default:S+="/"}break;case 123*m:l[c++]=YP(S)*b;case 125*m:case 59:case 0:switch(v){case 0:case 125:f=0;case 59+u:h>0&&YP(S)-d&&QP(h>32?NR(S+";",o,n,d-1):NR(WP(S," ","")+";",o,n,d-2),a);break;case 59:S+=";";default:if(QP(y=PR(S,t,n,c,u,r,l,k,_=[],x=[],d),s),123===v)if(0===u)MR(S,t,y,y,_,s,d,l,x);else switch(99===p&&110===ZP(S,3)?100:p){case 100:case 109:case 115:MR(e,y,y,o&&QP(PR(e,y,y,0,0,r,l,k,r,_=[],d),x),r,x,d,l,o?_:x);break;default:MR(S,y,y,y,[""],x,0,l,x)}}c=u=h=0,m=b=1,k=S="",d=i;break;case 58:d=1+YP(S),h=g;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==lR())continue;switch(S+=GP(v),v*m){case 38:b=u>0?1:(S+="\f",-1);break;case 44:l[c++]=(YP(S)-1)*b,b=1;break;case 64:45===cR()&&(S+=mR(aR())),p=cR(),u=d=YP(k=S+=_R(uR())),v++;break;case 45:45===g&&2==YP(S)&&(m=0)}}return s}function PR(e,t,n,o,r,s,i,l,a,c,u){for(var d=r-1,p=0===r?s:[""],h=XP(p),g=0,m=0,f=0;g<o;++g)for(var b=0,v=qP(e,d+1,d=HP(m=i[g])),k=e;b<h;++b)(k=$P(m>0?p[b]+" "+v:WP(v,/&\f/g,p[b])))&&(a[f++]=k);return sR(e,t,n,0===r?CR:l,a,c,u)}function RR(e,t,n){return sR(e,t,n,wR,GP(oR),qP(e,2,-2),0)}function NR(e,t,n,o){return sR(e,t,n,BR,qP(e,0,o),qP(e,o+1,-1),o)}var AR=function(e,t,n){for(var o=0,r=0;o=r,r=cR(),38===o&&12===r&&(t[n]=1),!pR(r);)aR();return dR(e,nR)},LR=function(e,t){return gR(function(e,t){var n=-1,o=44;do{switch(pR(o)){case 0:38===o&&12===cR()&&(t[n]=1),e[n]+=AR(nR-1,t,n);break;case 2:e[n]+=mR(o);break;case 4:if(44===o){e[++n]=58===cR()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=GP(o)}}while(o=aR());return e}(hR(e),t))},OR=new WeakMap,DR=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,o=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||OR.get(n))&&!o){OR.set(e,!0);for(var r=[],s=LR(t,r),i=n.props,l=0,a=0;l<s.length;l++)for(var c=0;c<i.length;c++,a++)e.props[a]=r[l]?s[l].replace(/&\f/g,i[c]):i[c]+" "+s[l]}}},zR=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function VR(e,t){switch(function(e,t){return 45^ZP(e,0)?(((t<<2^ZP(e,0))<<2^ZP(e,1))<<2^ZP(e,2))<<2^ZP(e,3):0}(e,t)){case 5103:return SR+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return SR+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return SR+e+yR+e+xR+e+e;case 6828:case 4268:return SR+e+xR+e+e;case 6165:return SR+e+xR+"flex-"+e+e;case 5187:return SR+e+WP(e,/(\w+).+(:[^]+)/,SR+"box-$1$2"+xR+"flex-$1$2")+e;case 5443:return SR+e+xR+"flex-item-"+WP(e,/flex-|-self/,"")+e;case 4675:return SR+e+xR+"flex-line-pack"+WP(e,/align-content|flex-|-self/,"")+e;case 5548:return SR+e+xR+WP(e,"shrink","negative")+e;case 5292:return SR+e+xR+WP(e,"basis","preferred-size")+e;case 6060:return SR+"box-"+WP(e,"-grow","")+SR+e+xR+WP(e,"grow","positive")+e;case 4554:return SR+WP(e,/([^-])(transform)/g,"$1"+SR+"$2")+e;case 6187:return WP(WP(WP(e,/(zoom-|grab)/,SR+"$1"),/(image-set)/,SR+"$1"),e,"")+e;case 5495:case 3959:return WP(e,/(image-set\([^]*)/,SR+"$1$`$1");case 4968:return WP(WP(e,/(.+:)(flex-)?(.*)/,SR+"box-pack:$3"+xR+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+SR+e+e;case 4095:case 3583:case 4068:case 2532:return WP(e,/(.+)-inline(.+)/,SR+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(YP(e)-1-t>6)switch(ZP(e,t+1)){case 109:if(45!==ZP(e,t+4))break;case 102:return WP(e,/(.+:)(.+)-([^]+)/,"$1"+SR+"$2-$3$1"+yR+(108==ZP(e,t+3)?"$3":"$2-$3"))+e;case 115:return~KP(e,"stretch")?VR(WP(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==ZP(e,t+1))break;case 6444:switch(ZP(e,YP(e)-3-(~KP(e,"!important")&&10))){case 107:return WP(e,":",":"+SR)+e;case 101:return WP(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+SR+(45===ZP(e,14)?"inline-":"")+"box$3$1"+SR+"$2$3$1"+xR+"$2box$3")+e}break;case 5936:switch(ZP(e,t+11)){case 114:return SR+e+xR+WP(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return SR+e+xR+WP(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return SR+e+xR+WP(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return SR+e+xR+e+e}return e}var FR=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case BR:e.return=VR(e.value,e.length);break;case IR:return jR([iR(e,{value:WP(e.value,"@","@"+SR)})],o);case CR:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return jR([iR(e,{props:[WP(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return jR([iR(e,{props:[WP(t,/:(plac\w+)/,":"+SR+"input-$1")]}),iR(e,{props:[WP(t,/:(plac\w+)/,":-moz-$1")]}),iR(e,{props:[WP(t,/:(plac\w+)/,xR+"input-$1")]})],o)}return""}))}}];const HR=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o=e.stylisPlugins||FR;var r,s,i={},l=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;l.push(e)}));var a,c,u,d,p=[ER,(d=function(e){a.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],h=(c=[DR,zR].concat(o,p),u=XP(c),function(e,t,n,o){for(var r="",s=0;s<u;s++)r+=c[s](e,t,n,o)||"";return r});s=function(e,t,n,o){a=n,function(e){jR(TR(e),h)}(e?e+"{"+t.styles+"}":t.styles),o&&(g.inserted[t.name]=!0)};var g={key:t,sheet:new FP({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return g.sheet.hydrate(l),g};const GR=function(e){for(var t,n=0,o=0,r=e.length;r>=4;++o,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)};const UR={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function $R(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var WR=/[A-Z]|^ms/g,KR=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ZR=function(e){return 45===e.charCodeAt(1)},qR=function(e){return null!=e&&"boolean"!=typeof e},YR=$R((function(e){return ZR(e)?e:e.replace(WR,"-$&").toLowerCase()})),XR=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(KR,(function(e,t,n){return JR={name:t,styles:n,next:JR},t}))}return 1===UR[e]||ZR(e)||"number"!=typeof t||0===t?t:t+"px"};function QR(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return JR={name:n.name,styles:n.styles,next:JR},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)JR={name:o.name,styles:o.styles,next:JR},o=o.next;return n.styles+";"}return function(e,t,n){var o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=QR(e,t,n[r])+";";else for(var s in n){var i=n[s];if("object"!=typeof i)null!=t&&void 0!==t[i]?o+=s+"{"+t[i]+"}":qR(i)&&(o+=YR(s)+":"+XR(s,i)+";");else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=QR(e,t,i);switch(s){case"animation":case"animationName":o+=YR(s)+":"+l+";";break;default:o+=s+"{"+l+"}"}}else for(var a=0;a<i.length;a++)qR(i[a])&&(o+=YR(s)+":"+XR(s,i[a])+";")}return o}(e,t,n);case"function":if(void 0!==e){var r=JR,s=n(e);return JR=r,QR(e,t,s)}}if(null==t)return n;var i=t[n];return void 0!==i?i:n}var JR,eN=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var tN=!!ya.useInsertionEffect&&ya.useInsertionEffect,nN=tN||function(e){return e()},oN=(0,ya.createContext)("undefined"!=typeof HTMLElement?HR({key:"css"}):null);oN.Provider;var rN=function(e){return(0,ya.forwardRef)((function(t,n){var o=(0,ya.useContext)(oN);return e(t,o,n)}))},sN=(0,ya.createContext)({});var iN=function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)},lN=VP,aN=function(e){return"theme"!==e},cN=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?lN:aN},uN=function(e,t,n){var o;if(t){var r=t.shouldForwardProp;o=e.__emotion_forwardProp&&r?function(t){return e.__emotion_forwardProp(t)&&r(t)}:r}return"function"!=typeof o&&n&&(o=e.__emotion_forwardProp),o},dN=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;iN(t,n,o);nN((function(){return function(e,t,n){iN(e,t,n);var o=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+o:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,o)}));return null};const pN=function e(t,n){var o,r,s=t.__emotion_real===t,i=s&&t.__emotion_base||t;void 0!==n&&(o=n.label,r=n.target);var l=uN(t,n,s),a=l||cN(i),c=!a("as");return function(){var u=arguments,d=s&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&d.push("label:"+o+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{0,d.push(u[0][0]);for(var p=u.length,h=1;h<p;h++)d.push(u[h],u[0][h])}var g=rN((function(e,t,n){var o=c&&e.as||i,s="",u=[],p=e;if(null==e.theme){for(var h in p={},e)p[h]=e[h];p.theme=(0,ya.useContext)(sN)}"string"==typeof e.className?s=function(e,t,n){var o="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):o+=n+" "})),o}(t.registered,u,e.className):null!=e.className&&(s=e.className+" ");var g=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,r="";JR=void 0;var s=e[0];null==s||void 0===s.raw?(o=!1,r+=QR(n,t,s)):r+=s[0];for(var i=1;i<e.length;i++)r+=QR(n,t,e[i]),o&&(r+=s[i]);eN.lastIndex=0;for(var l,a="";null!==(l=eN.exec(r));)a+="-"+l[1];return{name:GR(r)+a,styles:r,next:JR}}(d.concat(u),t.registered,p);s+=t.key+"-"+g.name,void 0!==r&&(s+=" "+r);var m=c&&void 0===l?cN(o):a,f={};for(var b in e)c&&"as"===b||m(b)&&(f[b]=e[b]);return f.className=s,f.ref=n,(0,ya.createElement)(ya.Fragment,null,(0,ya.createElement)(dN,{cache:t,serialized:g,isStringTag:"string"==typeof o}),(0,ya.createElement)(o,f))}));return g.displayName=void 0!==o?o:"Styled("+("string"==typeof i?i:i.displayName||i.name||"Component")+")",g.defaultProps=t.defaultProps,g.__emotion_real=g,g.__emotion_base=i,g.__emotion_styles=d,g.__emotion_forwardProp=l,Object.defineProperty(g,"toString",{value:function(){return"."+r}}),g.withComponent=function(t,o){return e(t,OP({},n,o,{shouldForwardProp:uN(g,o,!0)})).apply(void 0,d)},g}};const hN=pN(Ns.__experimentalToolsPanelItem,{target:"ef8pe3d0"})({name:"957xgf",styles:"grid-column:span 1"});function gN({panelId:e,value:t={},onChange:n=(()=>{}),units:o,isShownByDefault:r=!0}){var s,i;const l="auto"===t.width?"":null!==(s=t.width)&&void 0!==s?s:"",a="auto"===t.height?"":null!==(i=t.height)&&void 0!==i?i:"",c=e=>o=>{const r={...t};o?r[e]=o:delete r[e],n(r)};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(hN,{label:(0,C.__)("Width"),isShownByDefault:r,hasValue:()=>""!==l,onDeselect:c("width"),panelId:e,children:(0,U.jsx)(Ns.__experimentalUnitControl,{label:(0,C.__)("Width"),placeholder:(0,C.__)("Auto"),labelPosition:"top",units:o,min:0,value:l,onChange:c("width"),size:"__unstable-large"})}),(0,U.jsx)(hN,{label:(0,C.__)("Height"),isShownByDefault:r,hasValue:()=>""!==a,onDeselect:c("height"),panelId:e,children:(0,U.jsx)(Ns.__experimentalUnitControl,{label:(0,C.__)("Height"),placeholder:(0,C.__)("Auto"),labelPosition:"top",units:o,min:0,value:a,onChange:c("height"),size:"__unstable-large"})})]})}const mN=function({panelId:e,value:t={},onChange:n=(()=>{}),aspectRatioOptions:o,defaultAspectRatio:r="auto",scaleOptions:s,defaultScale:i="fill",unitsOptions:l}){const c=void 0===t.width||"auto"===t.width?null:t.width,u=void 0===t.height||"auto"===t.height?null:t.height,d=void 0===t.aspectRatio||"auto"===t.aspectRatio?null:t.aspectRatio,p=void 0===t.scale||"fill"===t.scale?null:t.scale,[h,g]=(0,a.useState)(p),[m,f]=(0,a.useState)(d),b=c&&u?"custom":m,v=d||c&&u;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ig,{panelId:e,options:o,defaultValue:r,value:b,onChange:e=>{const o={...t};f(e="auto"===e?null:e),e?o.aspectRatio=e:delete o.aspectRatio,e?h?o.scale=h:(o.scale=i,g(i)):delete o.scale,"custom"!==e&&c&&u&&delete o.height,n(o)}}),(0,U.jsx)(gN,{panelId:e,units:l,value:{width:c,height:u},onChange:({width:e,height:o})=>{const r={...t};o="auto"===o?null:o,(e="auto"===e?null:e)?r.width=e:delete r.width,o?r.height=o:delete r.height,e&&o?delete r.aspectRatio:m&&(r.aspectRatio=m),m||!!e==!!o?h?r.scale=h:(r.scale=i,g(i)):delete r.scale,n(r)}}),v&&(0,U.jsx)(LP,{panelId:e,options:s,defaultValue:i,value:h,onChange:e=>{const o={...t};g(e="fill"===e?null:e),e?o.scale=e:delete o.scale,n(o)}})]})},fN=[{label:(0,C._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,C._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,C._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,C._x)("Full Size","Image size option for resolution control"),value:"full"}];const bN={};X(bN,{...i,ExperimentalBlockCanvas:YI,ExperimentalBlockEditorProvider:vy,getDuotoneFilter:Zg,getRichTextValues:function(e=[]){l.__unstableGetBlockProps.skipFilters=!0;const t=[];return NP(t,e),l.__unstableGetBlockProps.skipFilters=!1,t.map((e=>e instanceof W.RichTextData?e:W.RichTextData.fromHTMLString(e)))},PrivateInserter:Zw,PrivateQuickInserter:$w,extractWords:Sb,getNormalizedSearchTerms:Cb,normalizeString:wb,PrivateListView:Nj,ResizableBoxPopover:function({clientId:e,resizableBoxProps:t,...n}){return(0,U.jsx)(sl,{clientId:e,__unstablePopoverSlot:"block-toolbar",...n,children:(0,U.jsx)(Ns.ResizableBox,{...t})})},BlockInfo:GM,useHasBlockToolbar:RI,cleanEmptyObject:Is,useStyleOverride:Ms,BlockQuickNavigation:UM,LayoutStyle:function({layout:e={},css:t,...n}){const o=bl(e.type),[r]=Kr("spacing.blockGap"),s=null!==r;if(o){if(t)return(0,U.jsx)("style",{children:t});const r=o.getLayoutStyle?.({hasBlockGapSupport:s,layout:e,...n});if(r)return(0,U.jsx)("style",{children:r})}return null},BlockRemovalWarningModal:function({rules:e}){const{clientIds:t,selectPrevious:n,message:o}=(0,c.useSelect)((e=>Q(e($r)).getRemovalPromptData())),{clearBlockRemovalPrompt:r,setBlockRemovalRules:s,privateRemoveBlocks:i}=Q((0,c.useDispatch)($r));if((0,a.useEffect)((()=>(s(e),()=>{s()})),[e,s]),!o)return;return(0,U.jsxs)(Ns.Modal,{title:(0,C.__)("Be careful!"),onRequestClose:r,size:"medium",children:[(0,U.jsx)("p",{children:o}),(0,U.jsxs)(Ns.__experimentalHStack,{justify:"right",children:[(0,U.jsx)(Ns.Button,{variant:"tertiary",onClick:r,children:(0,C.__)("Cancel")}),(0,U.jsx)(Ns.Button,{variant:"primary",onClick:()=>{i(t,n,!0),r()},children:(0,C.__)("Delete")})]})]})},useLayoutClasses:Xm,useLayoutStyles:function(e={},t,n){const{layout:o={},style:r={}}=e,s=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||{},i=bl(s?.type||"default"),[l]=Kr("spacing.blockGap"),a=null!==l;return i?.getLayoutStyle?.({blockName:t,selector:n,layout:o,style:r,hasBlockGapSupport:a})},DimensionsTool:mN,ResolutionTool:function({panelId:e,value:t,onChange:n,options:o=fN,defaultValue:r=fN[0].value,isShownByDefault:s=!0}){const i=null!=t?t:r;return(0,U.jsx)(Ns.__experimentalToolsPanelItem,{hasValue:()=>i!==r,label:(0,C.__)("Resolution"),onDeselect:()=>n(r),isShownByDefault:s,panelId:e,children:(0,U.jsx)(Ns.SelectControl,{label:(0,C.__)("Resolution"),value:i,options:o,onChange:n,help:(0,C.__)("Select the size of the source image."),size:"__unstable-large"})})},TextAlignmentControl:Pp,ReusableBlocksRenameHint:bP,useReusableBlocksRenameHint:function(){return(0,c.useSelect)((e=>{var t;return null===(t=e(ba.store).get("core",fP))||void 0===t||t}),[])},usesContextKey:RT,useFlashEditableBlocks:ey,globalStylesDataKey:K,selectBlockPatternsKey:Z,requiresWrapperOnCopy:Ly,PrivateRichText:UT,PrivateInserterLibrary:eP,reusableBlocksSelectKey:q,PrivateBlockPopover:nl,PrivatePublishDateTimePicker:gP,useSpacingSizes:Jh,useBlockDisplayTitle:Ub,__unstableBlockStyleVariationOverridesWithConfig:function({config:e}){const{getBlockStyles:t,overrides:n}=(0,c.useSelect)((e=>({getBlockStyles:e(l.store).getBlockStyles,overrides:Q(e($r)).getStyleOverrides()})),[]),{getBlockName:o}=(0,c.useSelect)($r),r=(0,a.useMemo)((()=>{if(!n?.length)return;const r=[],s=[];for(const[,i]of n)if(i?.variation&&i?.clientId&&!s.includes(i.clientId)){const n=o(i.clientId),a=e?.styles?.blocks?.[n]?.variations?.[i.variation];if(a){const o={settings:e?.settings,styles:{blocks:{[n]:{variations:{[`${i.variation}-${i.clientId}`]:a}}}}},c=zm((0,l.getBlockTypes)(),t,i.clientId),u=Om(o,c,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0});r.push({id:`${i.variation}-${i.clientId}`,css:u,__unstableType:"variation",variation:i.variation,clientId:i.clientId}),s.push(i.clientId)}}return r}),[e,n,t,o]);if(r&&r.length)return(0,U.jsx)(U.Fragment,{children:r.map((e=>(0,U.jsx)($m,{override:e},e.id)))})}})})(),(window.wp=window.wp||{}).blockEditor=o})();

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists