WordPress/wp-includes/js/dist/block-editor.min.js

21 lines
823 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

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

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! This file is auto-generated */
(()=>{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))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function s(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,s=function(){e.clientWidth!==n&&p()},l=function(t){window.removeEventListener("resize",s,!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",s,!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 s=i("autosize:resized");try{e.dispatchEvent(s)}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 s(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 i=0,s=t.length,l=0,a=0;i<s;i++){var c=t[i];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,i&&t[i-1].added){var u=t[i-1];t[i-1]=t[i],t[i]=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[s-1];return s>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[s-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 i=this;function s(e){return r?(setTimeout((function(){r(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var 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 s([{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)},i.pushComponent(r.components,void 0,!0)):((r=u).newPos++,i.pushComponent(r.components,!0,void 0)),h=i.extractCommon(r,t,e,n),r.newPos+1>=l&&h+1>=a)return s(o(i,r.components,t,e,i.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,i=n.length,s=e.newPos,l=s-o,a=0;s+1<r&&l+1<i&&this.equals(t[s+1],n[l+1]);)s++,l++,a++;return a&&e.components.push({count:a}),e.newPos=s,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,i;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=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;0!=r--;){var s=i[r];if(!e(t[s],n[s]))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,i;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=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;0!=r--;){var s=i[r];if(!e(t[s],n[s]))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 i=e.nodeName,s=document.createElement(i);s.innerHTML="&nbsp;","TEXTAREA"===i.toUpperCase()&&s.setAttribute("rows","1");var l=o(e,"font-size");s.style.fontSize=l,s.style.padding="0px",s.style.border="0px";var a=document.body;a.appendChild(s),n=s.offsetHeight,a.removeChild(s)}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,i,s,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),k=/(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 v=/(?:Trident\/(\d+.\d+))/.exec(e);s=v?parseFloat(v[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),i=b&&b[1]?parseFloat(b[1]):NaN):i=NaN}else t=n=o=i=r=NaN;if(k){if(k[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);l=!_||parseFloat(_[1].replace("_","."))}else l=!1;a=!!k[2],c=!!k[3]}else l=a=c=!1}}var k={ie:function(){return b()||t},ieCompatibilityMode:function(){return b()||s>t},ie64:function(){return k.ie()&&d},firefox:function(){return b()||n},opera:function(){return b()||o},webkit:function(){return b()||r},safari:function(){return k.webkit()},chrome:function(){return b()||i},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=k},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,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i="function"==typeof s[n]}return!i&&o&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},7191:(e,t,n)=>{"use strict";var o=n(2213),r=n(1087);function i(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}}i.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},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,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};e.exports=n(),e.exports.createColors=n},1443:e=>{function t(e,t){return t.some((t=>t instanceof RegExp?t.test(e):e.includes(t)))}e.exports=function(e){const n=e.prefix,o=/\s+$/.test(n)?n:`${n} `,r=e.ignoreFiles?[].concat(e.ignoreFiles):[],i=e.includeFiles?[].concat(e.includeFiles):[];return function(s){r.length&&s.source.input.file&&t(s.source.input.file,r)||i.length&&s.source.input.file&&!t(s.source.input.file,i)||s.walkRules((t=>{t.parent&&["keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes","-ms-keyframes"].includes(t.parent.name)||(t.selectors=t.selectors.map((r=>e.exclude&&function(e,t){return t.some((t=>t instanceof RegExp?t.test(e):e===t))}(r,e.exclude)?r:e.transform?e.transform(n,r,o+r,s.source.input.file,t):o+r)))}))}}},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 i=!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(),i=!0),!1})),i&&(n.value=o.stringify(r))}}},e.exports.postcss=!0},1544:(e,t,n)=>{var o=n(8491),r=n(3815),i=n(4725);function s(e){return this instanceof s?(this.nodes=o(e),this):new s(e)}s.prototype.toString=function(){return Array.isArray(this.nodes)?i(this.nodes):""},s.prototype.walk=function(e,t){return r(this.nodes,e,t),this},s.unit=n(1524),s.walk=r,s.stringify=i,e.exports=s},8491:e=>{var t="(".charCodeAt(0),n=")".charCodeAt(0),o="'".charCodeAt(0),r='"'.charCodeAt(0),i="\\".charCodeAt(0),s="/".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,k,v,_,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===s&&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(k=!1,~(g=w.indexOf(m,g+1)))for(v=g;w.charCodeAt(v-1)===i;)v-=1,k=!k;else g=(w+=m).length-1,b.unclosed=!0}while(k);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===s&&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!==s&&B!==c||!y||"function"!==y.type||"calc"!==y.value)if(B===s||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(k=!1,~(g=w.indexOf(")",g+1)))for(v=g;w.charCodeAt(v-1)===i;)v-=1,k=!k;else g=(w+=")").length-1,b.unclosed=!0}while(k);_=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===i&&(g+=1),g+=1,B=w.charCodeAt(g)}while(g<I&&!(B<=32||B===o||B===r||B===l||B===a||B===s||B===t||B===c&&y&&"function"===y.type&&"calc"===y.value||B===s&&"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,i=e.type,s=e.value;return t&&void 0!==(r=t(e))?r:"word"===i||"space"===i?s:"string"===i?(o=e.quote||"")+s+(e.unclosed?"":o):"comment"===i?"/*"+s+(e.unclosed?"":"*/"):"div"===i?(e.before||"")+s+(e.after||""):Array.isArray(e.nodes)?(o=n(e.nodes,t),"function"!==i?o:s+"("+(e.before||"")+o+(e.after||"")+(e.unclosed?"":")")):s}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),i="E".charCodeAt(0);e.exports=function(e){var s,l,a,c=0,u=e.length;if(0===u||!function(e){var r,i=e.charCodeAt(0);if(i===n||i===t){if((r=e.charCodeAt(1))>=48&&r<=57)return!0;var s=e.charCodeAt(2);return r===o&&s>=48&&s<=57}return i===o?(r=e.charCodeAt(1))>=48&&r<=57:i>=48&&i<=57}(e))return!1;for((s=e.charCodeAt(c))!==n&&s!==t||c++;c<u&&!((s=e.charCodeAt(c))<48||s>57);)c+=1;if(s=e.charCodeAt(c),l=e.charCodeAt(c+1),s===o&&l>=48&&l<=57)for(c+=2;c<u&&!((s=e.charCodeAt(c))<48||s>57);)c+=1;if(s=e.charCodeAt(c),l=e.charCodeAt(c+1),a=e.charCodeAt(c+2),(s===r||s===i)&&(l>=48&&l<=57||(l===n||l===t)&&a>=48&&a<=57))for(c+=l===n||l===t?3:2;c<u&&!((s=e.charCodeAt(c))<48||s>57);)c+=1;return{number:e.slice(0,c),unit:e.slice(c)}}},3815:e=>{e.exports=function e(t,n,o){var r,i,s,l;for(r=0,i=t.length;r<i;r+=1)s=t[r],o||(l=n(s,r,t)),!1!==l&&"function"===s.type&&Array.isArray(s.nodes)&&e(s.nodes,n,o),o&&n(s,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,i,s,l=n(6589),a=n(1516),c=n(7490),{isClean:u,my:d}=n(1381);function p(e){return e.map((e=>(e.nodes&&(e.nodes=p(e.nodes)),delete e.source,e)))}function h(e){if(e[u]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)h(t)}class g extends c{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",i=this.normalize(t,this.proxyOf.nodes[o],r).reverse();o=this.index(e);for(let e of i)this.proxyOf.nodes.splice(o,0,e);for(let e in this.indexes)n=this.indexes[e],o<=n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=p(r(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 a(e)]}else if(e.selector||e.selectors)e=[new s(e)];else if(e.name)e=[new o(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new l(e)]}return e.map((e=>(e[d]||g.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[u]&&h(e),e.raws||(e.raws={}),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=>{r=e},g.registerRule=e=>{s=e},g.registerAtRule=e=>{o=e},g.registerRoot=e=>{i=e},e.exports=g,g.default=g,g.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,o.prototype):"rule"===e.type?Object.setPrototypeOf(e,s.prototype):"decl"===e.type?Object.setPrototypeOf(e,a.prototype):"comment"===e.type?Object.setPrototypeOf(e,l.prototype):"root"===e.type&&Object.setPrototypeOf(e,i.prototype),e[d]=!0,e.nodes&&e.nodes.forEach((e=>{g.rebuild(e)}))}},356:(e,t,n)=>{"use strict";let o=n(2775),r=n(9746);class i extends Error{constructor(e,t,n,o,r,s){super(e),this.name="CssSyntaxError",this.reason=e,r&&(this.file=r),o&&(this.source=o),s&&(this.plugin=s),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,i)}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);let n=e=>e,i=e=>e,s=e=>e;if(e){let{bold:e,gray:t,red:l}=o.createColors(!0);i=t=>e(l(t)),n=e=>t(e),r&&(s=e=>r(e))}let l=t.split(/\r?\n/),a=Math.max(this.line-3,0),c=Math.min(this.line+2,l.length),u=String(c).length;return l.slice(a,c).map(((e,t)=>{let o=a+1+t,r=" "+(" "+o).slice(-u)+" | ";if(o===this.line){if(e.length>160){let t=20,o=Math.max(0,this.column-t),l=Math.max(this.column+t,this.endColumn+t),a=e.slice(o,l),c=n(r.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+n(r)+s(a)+"\n "+c+i("^")}let t=n(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+n(r)+s(e)+"\n "+t+i("^")}return" "+n(r)+s(e)})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=i,i.default=i},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,i=n(683);class s extends i{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new o(new r,this,e).stringify()}}s.registerLazyResult=e=>{o=e},s.registerProcessor=e=>{r=e},e.exports=s,s.default=s},8940:(e,t,n)=>{"use strict";let o=n(1326),r=n(6589),i=n(1516),s=n(5380),l=n(5696),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__:s.prototype};n.map&&(n.map={...n.map,__proto__:l.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 i(d);if("rule"===d.type)return new c(d);if("comment"===d.type)return new r(d);if("atrule"===d.type)return new o(d);throw new Error("Unknown node type: "+e.type)}e.exports=u,u.default=u},5380:(e,t,n)=>{"use strict";let{nanoid:o}=n(5042),{isAbsolute:r,resolve:i}=n(197),{SourceMapConsumer:s,SourceMapGenerator:l}=n(1866),{fileURLToPath:a,pathToFileURL:c}=n(2739),u=n(356),d=n(5696),p=n(9746),h=Symbol("fromOffsetCache"),g=Boolean(s&&l),m=Boolean(i&&r);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)||r(t.from)?this.file=t.from:this.file=i(t.from)),m&&g){let e=new d(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 "+o(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,o={}){let r,i,s;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);i=e.line,r=e.col}else i=o.line,r=o.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let l=this.origin(t,n,i,r);return s=l?new u(e,void 0===l.endLine?l.line:{column:l.column,line:l.line},void 0===l.endLine?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,o.plugin):new u(e,void 0===i?t:{column:n,line:t},void 0===i?n:{column:r,line:i},this.css,this.file,o.plugin),s.input={column:n,endColumn:r,endLine:i,line:t,source:this.css},this.file&&(c&&(s.input.url=c(this.file).toString()),s.input.file=this.file),s}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:i(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,o){if(!this.map)return!1;let i,s,l=this.map.consumer(),u=l.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof n&&(i=l.originalPositionFor({column:o,line:n})),s=r(u.source)?c(u.source):new URL(u.source,this.map.consumer().sourceRoot||c(this.map.mapFile));let d={column:u.column,endColumn:i&&i.column,endLine:i&&i.line,line:u.line,url:s.toString()};if("file:"===s.protocol){if(!a)throw new Error("file: protocol is not available in this PostCSS build");d.file=a(s)}let p=l.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,p&&p.registerInput&&p.registerInput(f)},448:(e,t,n)=>{"use strict";let o=n(683),r=n(271),i=n(1670),s=n(4295),l=n(9055),a=n(9434),c=n(633),{isClean:u,my:d}=n(1381);n(3122);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 k(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 v(e){return e[u]=!1,e.nodes&&e.nodes.forEach((e=>v(e))),e}let _={};class x{constructor(e,t,n){let r;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof x||t instanceof l)r=v(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=s;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{r=e(t,n)}catch(e){this.processed=!0,this.error=e}r&&!r[d]&&o.rebuild(r)}else r=v(t);this.result=new l(e,r,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[u];){e[u]=!0;let t=[k(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=c;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new i(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[u];)e[u]=!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:o}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(o.length>0&&t.visitorIndex<o.length){let[e,r]=o[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===o.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return r(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let o,r=t.iterator;for(;o=n.nodes[n.indexes[r]];)if(n.indexes[r]+=1,!o[u])return o[u]=!0,void e.push(k(o));t.iterator=0,delete n.indexes[r]}let r=t.events;for(;t.eventIndex<r.length;){let e=r[t.eventIndex];if(t.eventIndex+=1,e===m)return void(n.nodes&&n.nodes.length&&(n[u]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[u]=!0;let t=b(e);for(let n of t)if(n===m)e.nodes&&e.each((e=>{e[u]||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,a.registerLazyResult(x),r.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="",i=!1,s=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?s+=1:")"===n?s>0&&(s-=1):0===s&&t.includes(n)&&(i=!0),i?(""!==r&&o.push(r.trim()),r="",i=!1):r+=n;return(n||""!==r)&&o.push(r.trim()),o}};e.exports=t,t.default=t},1670:(e,t,n)=>{"use strict";let{dirname:o,relative:r,resolve:i,sep:s}=n(197),{SourceMapConsumer:l,SourceMapGenerator:a}=n(1866),{pathToFileURL:c}=n(2739),u=n(5380),d=Boolean(l&&a),p=Boolean(o&&i&&r&&s);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||o(e.file);!1===this.mapOpts.sourcesContent?(t=new l(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&&e.text.startsWith("# 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=a.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new a({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 a({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,o=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,l,a)=>{if(this.css+=s,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=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),t=s.match(/\n/g),t?(n+=t.length,e=s.lastIndexOf("\n"),o=s.length-e):o+=s.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=r,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?o(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=o(i(n,this.mapOpts.annotation)));let s=r(n,e);return this.memoizedPaths.set(e,s),s}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;"\\"===s&&(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(4295);const i=n(9055);let s=n(633);n(3122);class l{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let l=s;this.result=new i(this._processor,r,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let c=new o(l,r,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=r;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 o=n(356),r=n(346),i=n(633),{isClean:s,my:l}=n(1381);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],i=typeof r;"parent"===o&&"object"===i?t&&(n[o]=t):"source"===o?n[o]=r:Array.isArray(r)?n[o]=r.map((e=>a(e,n))):("object"===i&&null!==r&&(r=a(r)),n[o]=r)}return n}class c{constructor(e={}){this.raws={},this[s]=!1,this[l]=!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 o(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)}}markClean(){this[s]=!0}markDirty(){if(this[s]){this[s]=!1;let e=this;for(;e=e.parent;)e[s]=!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 r).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 i=t.get(o.input);null==i&&(i=r,t.set(o.input,r),r++),n[e]={end:o.end,inputId:i,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=i){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(5380),i=n(3937);function s(e,t){let n=new r(e,t),o=new i(n);try{o.parse()}catch(e){throw e}return o.root}e.exports=s,s.default=s,o.registerParse(s)},3937:(e,t,n)=>{"use strict";let o=n(1326),r=n(6589),i=n(1516),s=n(9434),l=n(4092),a=n(2327);const c={empty:!0,space:!0};e.exports=class{constructor(e){this.input=e,this.root=new s,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,r,i=new o;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,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){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){l=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),s&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),l&&(i.nodes=[],this.current=i)}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[i,s]of e.entries()){if(n=s,o=n[0],"("===o&&(r+=1),")"===o&&(r-=1),0===r&&":"===o){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(n)}t=n}return!1}comment(e){let t=new r;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=a(this.input)}decl(e,t){let n=new i;this.init(n,e[0][2]);let o,r=e[e.length-1];for(";"===r[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(r[3]||r[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(o=e.shift(),":"===o[0]){n.raws.between+=o[1];break}"word"===o[0]&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,l=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)l.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(o=e[t],"!important"===o[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"===o[1].toLowerCase()){let o=e.slice(0),r="";for(let e=t;e>0;e--){let t=o[e][0];if(r.trim().startsWith("!")&&"space"!==t)break;r=o.pop()[1]+r}r.trim().startsWith("!")&&(n.important=!0,n.raws.important=r,e=o)}if("space"!==o[0]&&"comment"!==o[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 l;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,i=[],s=e[1].startsWith("--"),l=[],a=e;for(;a;){if(n=a[0],l.push(a),"("===n||"["===n)r||(r=a),i.push("("===n?")":"]");else if(s&&o&&"{"===n)r||(r=a),i.push("}");else if(0===i.length){if(";"===n){if(o)return void this.decl(l,s);break}if("{"===n)return void this.rule(l);if("}"===n){this.tokenizer.back(l.pop()),t=!0;break}":"===n&&(o=!0)}else n===i[i.length-1]&&(i.pop(),0===i.length&&(r=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(r),t&&o){if(!s)for(;l.length&&(a=l[l.length-1][0],"space"===a||"comment"===a);)this.tokenizer.back(l.pop());this.decl(l,s)}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,i,s,l,a=n.length,u="",d=!0;for(let e=0;e<a;e+=1)r=n[e],i=r[0],"space"!==i||e!==a-1||o?"comment"===i?(l=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",c[l]||c[s]||","===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 l;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(1326),r=n(6589),i=n(683),s=n(356),l=n(1516),a=n(271),c=n(8940),u=n(5380),d=n(448),p=n(7374),h=n(7490),g=n(4295),m=n(9656),f=n(9055),b=n(9434),k=n(4092),v=n(633),_=n(5776);function x(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new m(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 m).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=v,x.parse=g,x.fromJSON=c,x.list=p,x.comment=e=>new r(e),x.atRule=e=>new o(e),x.decl=e=>new l(e),x.rule=e=>new k(e),x.root=e=>new b(e),x.document=e=>new a(e),x.CssSyntaxError=s,x.Declaration=l,x.Container=i,x.Processor=m,x.Document=a,x.Comment=r,x.Warning=_,x.AtRule=o,x.Result=f,x.Input=u,x.Rule=k,x.Root=b,x.Node=h,d.registerPostcss(x),e.exports=x,x.default=x},5696:(e,t,n)=>{"use strict";let{existsSync:o,readFileSync:r}=n(9977),{dirname:i,join:s}=n(197),{SourceMapConsumer:l,SourceMapGenerator:a}=n(1866);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=i(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new l(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let n=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(n)return o=e.substr(n[0].length),Buffer?Buffer.from(o,"base64").toString():window.atob(o);var o;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}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=/g);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=i(e),o(e))return this.mapFile=e,r(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 l)return a.fromSourceMap(t).toString();if(t instanceof a)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=s(i(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(271),r=n(448),i=n(7661),s=n(9434);class l{constructor(e=[]){this.version="8.4.47",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 i(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=l,l.default=l,s.registerProcessor(l),o.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,i=n(683);class s extends i{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()}}s.registerLazyResult=e=>{o=e},s.registerProcessor=e=>{r=e},e.exports=s,s.default=s,i.registerRoot(s)},4092:(e,t,n)=>{"use strict";let o=n(683),r=n(7374);class i 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=i,i.default=i,o.registerRule(i)},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],i=this.raw(r,"before");i&&this.builder(i),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 i=e.parent;if("before"===o){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return t[o];let s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[o])return s.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](s,e):s.walk((e=>{if(r=e.raws[n],void 0!==r)return!1}))}var l;return void 0===r&&(r=t[o]),s.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),i="\n".charCodeAt(0),s=" ".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),k=":".charCodeAt(0),v="@".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,L=e.css.valueOf(),A=w.ignoreErrors,D=L.length,O=0,z=[],V=[];function F(t){throw e.error("Unclosed "+t,O)}return{back:function(e){V.push(e)},endOfFile:function(){return 0===V.length&&O>=D},nextToken:function(e){if(V.length)return V.pop();if(O>=D)return;let w=!!e&&e.ignoreUnclosed;switch(C=L.charCodeAt(O),C){case i:case s:case a:case c:case l:j=O;do{j+=1,C=L.charCodeAt(j)}while(C===s||C===i||C===a||C===c||C===l);T=["space",L.slice(O,j)],O=j-1;break;case u:case d:case g:case m:case k:case f:case h:{let e=String.fromCharCode(C);T=[e,e,O];break}case p:if(N=z.length?z.pop()[1]:"",R=L.charCodeAt(O+1),"url"===N&&R!==t&&R!==n&&R!==s&&R!==i&&R!==a&&R!==l&&R!==c){j=O;do{if(M=!1,j=L.indexOf(")",j+1),-1===j){if(A||w){j=O;break}F("bracket")}for(P=j;L.charCodeAt(P-1)===o;)P-=1,M=!M}while(M);T=["brackets",L.slice(O,j+1),O,j],O=j}else j=L.indexOf(")",O+1),B=L.slice(O,j+1),-1===j||y.test(B)?T=["(","(",O]:(T=["brackets",B,O,j],O=j);break;case t:case n:E=C===t?"'":'"',j=O;do{if(M=!1,j=L.indexOf(E,j+1),-1===j){if(A||w){j=O+1;break}F("string")}for(P=j;L.charCodeAt(P-1)===o;)P-=1,M=!M}while(M);T=["string",L.slice(O,j+1),O,j],O=j;break;case v:_.lastIndex=O+1,_.test(L),j=0===_.lastIndex?L.length-1:_.lastIndex-2,T=["at-word",L.slice(O,j+1),O,j],O=j;break;case o:for(j=O,I=!0;L.charCodeAt(j+1)===o;)j+=1,I=!I;if(C=L.charCodeAt(j+1),I&&C!==r&&C!==s&&C!==i&&C!==a&&C!==c&&C!==l&&(j+=1,S.test(L.charAt(j)))){for(;S.test(L.charAt(j+1));)j+=1;L.charCodeAt(j+1)===s&&(j+=1)}T=["word",L.slice(O,j+1),O,j],O=j;break;default:C===r&&L.charCodeAt(O+1)===b?(j=L.indexOf("*/",O+2)+1,0===j&&(A||w?j=L.length:F("comment")),T=["comment",L.slice(O,j+1),O,j],O=j):(x.lastIndex=O+1,x.test(L),j=0===x.lastIndex?L.length-1:x.lastIndex-2,T=["word",L.slice(O,j+1),O,j],z.push(T),O=j)}return O++,T},position:function(){return O}}}},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 i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,s){if(s!==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:i,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)}),i=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},s=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=s(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return l.createElement("textarea",i({},a,{onChange:this.onChange,style:u?i({},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,i({},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 i(e){return t[e]}var s=function(e){return e.replace(o,i)};e.exports=s,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=s},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 i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.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:()=>Oh,AlignmentToolbar:()=>zh,Autocomplete:()=>iB,BlockAlignmentControl:()=>Dl,BlockAlignmentToolbar:()=>Ol,BlockBreadcrumb:()=>hB,BlockCanvas:()=>Vj,BlockColorsStyleSelector:()=>$j,BlockContextProvider:()=>Yf,BlockControls:()=>ss,BlockEdit:()=>ib,BlockEditorKeyboardShortcuts:()=>Wf,BlockEditorProvider:()=>Zf,BlockFormatControls:()=>is,BlockIcon:()=>zf,BlockInspector:()=>NP,BlockList:()=>Qx,BlockMover:()=>TB,BlockNavigationDropdown:()=>BE,BlockPopover:()=>Kg,BlockPreview:()=>eS,BlockSelectionClearer:()=>yx,BlockSettingsMenu:()=>JI,BlockSettingsMenuControls:()=>KI,BlockStyles:()=>EE,BlockTitle:()=>dB,BlockToolbar:()=>fj,BlockTools:()=>Tj,BlockVerticalAlignmentControl:()=>Ws,BlockVerticalAlignmentToolbar:()=>Ks,ButtonBlockAppender:()=>Xw,ButtonBlockerAppender:()=>Yw,ColorPalette:()=>QE,ColorPaletteControl:()=>JE,ContrastChecker:()=>cp,CopyHandler:()=>AP,DefaultBlockAppender:()=>ux,FontSizePicker:()=>KC,HeadingLevelDropdown:()=>NE,HeightControl:()=>pg,InnerBlocks:()=>Hx,Inserter:()=>Zw,InspectorAdvancedControls:()=>ua,InspectorControls:()=>da,JustifyContentControl:()=>Ys,JustifyToolbar:()=>Xs,LineHeightControl:()=>Lp,MediaPlaceholder:()=>nM,MediaReplaceFlow:()=>Tc,MediaUpload:()=>va,MediaUploadCheck:()=>_a,MultiSelectScrollIntoView:()=>VP,NavigableToolbar:()=>pj,ObserveTyping:()=>Wx,PanelColorSettings:()=>oM,PlainText:()=>AM,RecursionProvider:()=>KP,RichText:()=>RM,RichTextShortcut:()=>zM,RichTextToolbarButton:()=>VM,SETTINGS_DEFAULTS:()=>I,SkipToSelectedBlock:()=>oP,ToolSelector:()=>GM,Typewriter:()=>UP,URLInput:()=>Ma,URLInputButton:()=>KM,URLPopover:()=>QT,Warning:()=>nb,WritingFlow:()=>xy,__experimentalBlockAlignmentMatrixControl:()=>cB,__experimentalBlockFullHeightAligmentControl:()=>lB,__experimentalBlockPatternSetup:()=>WE,__experimentalBlockPatternsList:()=>jS,__experimentalBlockVariationPicker:()=>AE,__experimentalBlockVariationTransforms:()=>YE,__experimentalBorderRadiusControl:()=>rd,__experimentalColorGradientControl:()=>Kd,__experimentalColorGradientSettingsDropdown:()=>lT,__experimentalDateFormatPicker:()=>nT,__experimentalDuotoneControl:()=>vm,__experimentalFontAppearanceControl:()=>Rp,__experimentalFontFamilyControl:()=>Mp,__experimentalGetBorderClassesAndStyles:()=>EC,__experimentalGetColorClassesAndStyles:()=>PC,__experimentalGetElementClassName:()=>tR,__experimentalGetGapCSSValue:()=>Ds,__experimentalGetGradientClass:()=>Dd,__experimentalGetGradientObjectByGradientValue:()=>zd,__experimentalGetShadowClassesAndStyles:()=>MC,__experimentalGetSpacingClassesAndStyles:()=>NC,__experimentalImageEditor:()=>UT,__experimentalImageSizeControl:()=>ZT,__experimentalImageURLInputUI:()=>eP,__experimentalInspectorPopoverHeader:()=>XP,__experimentalLetterSpacingControl:()=>Ap,__experimentalLibrary:()=>zP,__experimentalLinkControl:()=>Ic,__experimentalLinkControlSearchInput:()=>ac,__experimentalLinkControlSearchItem:()=>Ka,__experimentalLinkControlSearchResults:()=>ec,__experimentalListView:()=>wE,__experimentalPanelColorGradientSettings:()=>dT,__experimentalPreviewOptions:()=>tP,__experimentalPublishDateTimePicker:()=>JP,__experimentalRecursionProvider:()=>qP,__experimentalResponsiveBlockControl:()=>OM,__experimentalSpacingSizesControl:()=>ug,__experimentalTextDecorationControl:()=>Jp,__experimentalTextTransformControl:()=>qp,__experimentalUnitControl:()=>$M,__experimentalUseBlockOverlayActive:()=>gB,__experimentalUseBlockPreview:()=>tS,__experimentalUseBorderProps:()=>TC,__experimentalUseColorProps:()=>RC,__experimentalUseCustomSides:()=>sm,__experimentalUseGradient:()=>Fd,__experimentalUseHasRecursion:()=>YP,__experimentalUseMultipleOriginColorsAndGradients:()=>$u,__experimentalUseResizeCanvas:()=>nP,__experimentalWritingModeControl:()=>oh,__unstableBlockNameContext:()=>aj,__unstableBlockSettingsMenuFirstItem:()=>II,__unstableBlockToolbarLastItem:()=>cI,__unstableEditorStyles:()=>Ky,__unstableIframe:()=>By,__unstableInserterMenuExtension:()=>Lw,__unstableRichTextInputEvent:()=>FM,__unstableUseBlockSelectionClearer:()=>xx,__unstableUseClipboardHandler:()=>LP,__unstableUseMouseMoveTypingReset:()=>$x,__unstableUseTypewriter:()=>$P,__unstableUseTypingObserver:()=>Ux,createCustomColorsHOC:()=>UC,getColorClassName:()=>Gu,getColorObjectByAttributeValues:()=>Fu,getColorObjectByColorValue:()=>Hu,getComputedFluidTypographyValue:()=>gi,getCustomValueFromPreset:()=>Ps,getFontSize:()=>jh,getFontSizeClass:()=>Th,getFontSizeObjectByValue:()=>Eh,getGradientSlugByValue:()=>Vd,getGradientValueBySlug:()=>Od,getPxFromCssUnit:()=>nR,getSpacingPresetCssVar:()=>Ns,getTypographyClassesAndStyles:()=>AC,isValueSpacingPreset:()=>Ms,privateApis:()=>JN,store:()=>oi,storeConfig:()=>ni,transformStyles:()=>Uy,useBlockBindingsUtils:()=>bC,useBlockCommands:()=>Dj,useBlockDisplayInformation:()=>zm,useBlockEditContext:()=>_,useBlockEditingMode:()=>zl,useBlockProps:()=>nx,useCachedTruthy:()=>DC,useHasRecursion:()=>ZP,useInnerBlocksProps:()=>Fx,useSetting:()=>si,useSettings:()=>ii,useStyleOverride:()=>qi,useZoomOut:()=>OC,withColorContext:()=>XE,withColors:()=>WC,withFontSizes:()=>YC});var e={};n.r(e),n.d(e,{getAllPatterns:()=>Fe,getBlockRemovalRules:()=>Re,getBlockSettings:()=>Ce,getBlockStyles:()=>Xe,getBlockWithoutAttributes:()=>je,getContentLockingParent:()=>Ze,getEnabledBlockParents:()=>Me,getEnabledClientIdsTree:()=>Te,getExpandedBlock:()=>Ke,getInserterMediaCategories:()=>De,getLastFocus:()=>Ue,getLastInsertedBlocksClientIds:()=>Ie,getOpenedBlockSettingsMenu:()=>Ne,getPatternBySlug:()=>Ve,getRegisteredInserterMediaCategories:()=>Ae,getRemovalPromptData:()=>Pe,getReusableBlocks:()=>$e,getSectionRootClientId:()=>Je,getStyleOverrides:()=>Le,getTemporarilyEditingAsBlocks:()=>qe,getTemporarilyEditingFocusModeToRevert:()=>Ye,getZoomLevel:()=>et,hasAllowedPatterns:()=>Oe,isBlockInterfaceHidden:()=>Be,isBlockSubtreeDisabled:()=>Ee,isDragging:()=>We,isResolvingPatterns:()=>He,isZoomOut:()=>tt,isZoomOutMode:()=>Qe});var t={};n.r(t),n.d(t,{__experimentalGetActiveBlockIdByBlockNames:()=>so,__experimentalGetAllowedBlocks:()=>On,__experimentalGetAllowedPatterns:()=>Gn,__experimentalGetBlockListSettingsForBlocks:()=>Yn,__experimentalGetDirectInsertBlock:()=>Vn,__experimentalGetGlobalBlocksByName:()=>bt,__experimentalGetLastBlockAttributeChanges:()=>Jn,__experimentalGetParsedPattern:()=>Fn,__experimentalGetPatternTransformItems:()=>Wn,__experimentalGetPatternsByBlockTypes:()=>Un,__experimentalGetReusableBlockTitle:()=>Xn,__unstableGetBlockWithoutInnerBlocks:()=>ct,__unstableGetClientIdWithClientIdsTree:()=>dt,__unstableGetClientIdsTree:()=>pt,__unstableGetContentLockingParent:()=>bo,__unstableGetEditorMode:()=>to,__unstableGetSelectedBlocksWithPartialSelection:()=>Qt,__unstableGetTemporarilyEditingAsBlocks:()=>ko,__unstableGetTemporarilyEditingFocusModeToRevert:()=>vo,__unstableGetVisibleBlocks:()=>uo,__unstableHasActiveBlockOverlayActive:()=>po,__unstableIsFullySelected:()=>Zt,__unstableIsLastBlockChangeIgnored:()=>Qn,__unstableIsSelectionCollapsed:()=>qt,__unstableIsSelectionMergeable:()=>Xt,__unstableIsWithinBlockOverlay:()=>ho,__unstableSelectionHasUnmergeableBlock:()=>Yt,areInnerBlocksControlled:()=>io,canEditBlock:()=>jn,canInsertBlockType:()=>yn,canInsertBlocks:()=>Sn,canLockBlockType:()=>En,canMoveBlock:()=>Bn,canMoveBlocks:()=>In,canRemoveBlock:()=>wn,canRemoveBlocks:()=>Cn,didAutomaticChange:()=>oo,getAdjacentBlockClientId:()=>Nt,getAllowedBlocks:()=>Dn,getBlock:()=>at,getBlockAttributes:()=>lt,getBlockCount:()=>_t,getBlockEditingMode:()=>go,getBlockHierarchyRootClientId:()=>Pt,getBlockIndex:()=>en,getBlockInsertionPoint:()=>fn,getBlockListSettings:()=>Kn,getBlockMode:()=>cn,getBlockName:()=>it,getBlockNamesByClientId:()=>vt,getBlockOrder:()=>Jt,getBlockParents:()=>Tt,getBlockParentsByBlockName:()=>Mt,getBlockRootClientId:()=>Et,getBlockSelectionEnd:()=>wt,getBlockSelectionStart:()=>St,getBlockTransformItems:()=>Ln,getBlocks:()=>ut,getBlocksByClientId:()=>kt,getBlocksByName:()=>ft,getClientIdsOfDescendants:()=>ht,getClientIdsWithDescendants:()=>gt,getDirectInsertBlock:()=>zn,getDraggedBlockClientIds:()=>pn,getFirstMultiSelectedBlockClientId:()=>Ft,getGlobalBlockCount:()=>mt,getHoveredBlockClientId:()=>co,getInserterItems:()=>Nn,getLastMultiSelectedBlockClientId:()=>Ht,getLowestCommonAncestorWithSelectedBlock:()=>Rt,getMultiSelectedBlockClientIds:()=>zt,getMultiSelectedBlocks:()=>Vt,getMultiSelectedBlocksEndClientId:()=>Kt,getMultiSelectedBlocksStartClientId:()=>Wt,getNextBlockClientId:()=>At,getPatternsByBlockTypes:()=>$n,getPreviousBlockClientId:()=>Lt,getSelectedBlock:()=>jt,getSelectedBlockClientId:()=>It,getSelectedBlockClientIds:()=>Ot,getSelectedBlockCount:()=>Ct,getSelectedBlocksInitialCaretPosition:()=>Dt,getSelectionEnd:()=>yt,getSelectionStart:()=>xt,getSettings:()=>Zn,getTemplate:()=>vn,getTemplateLock:()=>_n,hasBlockMovingClientId:()=>no,hasDraggedInnerBlock:()=>on,hasInserterItems:()=>An,hasMultiSelection:()=>sn,hasSelectedBlock:()=>Bt,hasSelectedInnerBlock:()=>nn,isAncestorBeingDragged:()=>gn,isAncestorMultiSelected:()=>Ut,isBlockBeingDragged:()=>hn,isBlockHighlighted:()=>ro,isBlockInsertionPointVisible:()=>bn,isBlockMultiSelected:()=>$t,isBlockSelected:()=>tn,isBlockValid:()=>st,isBlockVisible:()=>ao,isBlockWithinSelection:()=>rn,isCaretWithinFormattedText:()=>mn,isDraggingBlocks:()=>dn,isFirstMultiSelectedBlock:()=>Gt,isGroupable:()=>fo,isLastBlockChangePersistent:()=>qn,isMultiSelecting:()=>ln,isNavigationMode:()=>eo,isSelectionEnabled:()=>an,isTyping:()=>un,isUngroupable:()=>mo,isValidTemplate:()=>kn,wasBlockJustInserted:()=>lo});var r={};n.r(r),n.d(r,{__experimentalUpdateSettings:()=>xo,clearBlockRemovalPrompt:()=>Io,deleteStyleOverride:()=>Mo,ensureDefaultBlock:()=>Co,expandBlock:()=>Ao,hideBlockInterface:()=>yo,modifyContentLockBlock:()=>Do,privateRemoveBlocks:()=>wo,resetZoomLevel:()=>zo,setBlockRemovalRules:()=>jo,setLastFocus:()=>Po,setOpenedBlockSettingsMenu:()=>Eo,setStyleOverride:()=>To,setZoomLevel:()=>Oo,showBlockInterface:()=>So,startDragging:()=>No,stopDragging:()=>Lo,stopEditingAsBlocks:()=>Ro});var i={};n.r(i),n.d(i,{__unstableDeleteSelection:()=>_r,__unstableExpandSelection:()=>yr,__unstableMarkAutomaticChange:()=>Fr,__unstableMarkLastChangeAsPersistent:()=>zr,__unstableMarkNextChangeAsNotPersistent:()=>Vr,__unstableSaveReusableBlock:()=>Or,__unstableSetEditorMode:()=>Gr,__unstableSetTemporarilyEditingAsBlocks:()=>Qr,__unstableSplitSelection:()=>xr,clearSelectedBlock:()=>ir,duplicateBlocks:()=>Ur,enterFormattedText:()=>Pr,exitFormattedText:()=>Rr,flashBlock:()=>qr,hideInsertionPoint:()=>br,hoverBlock:()=>Jo,insertAfterBlock:()=>Kr,insertBeforeBlock:()=>Wr,insertBlock:()=>gr,insertBlocks:()=>mr,insertDefaultBlock:()=>Lr,mergeBlocks:()=>Sr,moveBlockToPosition:()=>hr,moveBlocksDown:()=>ur,moveBlocksToPosition:()=>pr,moveBlocksUp:()=>dr,multiSelect:()=>rr,receiveBlocks:()=>qo,registerInserterMediaCategory:()=>Jr,removeBlock:()=>Cr,removeBlocks:()=>wr,replaceBlock:()=>ar,replaceBlocks:()=>lr,replaceInnerBlocks:()=>Br,resetBlocks:()=>Wo,resetSelection:()=>Zo,selectBlock:()=>Qo,selectNextBlock:()=>tr,selectPreviousBlock:()=>er,selectionChange:()=>Nr,setBlockEditingMode:()=>ei,setBlockMovingClientId:()=>$r,setBlockVisibility:()=>Xr,setHasControlledInnerBlocks:()=>Yr,setNavigationMode:()=>Hr,setTemplateValidity:()=>kr,showInsertionPoint:()=>fr,startDraggingBlocks:()=>Tr,startMultiSelect:()=>nr,startTyping:()=>jr,stopDraggingBlocks:()=>Mr,stopMultiSelect:()=>or,stopTyping:()=>Er,synchronizeTemplate:()=>vr,toggleBlockHighlight:()=>Zr,toggleBlockMode:()=>Ir,toggleSelection:()=>sr,unsetBlockEditingMode:()=>ti,updateBlock:()=>Xo,updateBlockAttributes:()=>Yo,updateBlockListSettings:()=>Ar,updateSettings:()=>Dr,validateBlocksToTemplate:()=>Ko});var s={};n.r(s),n.d(s,{AdvancedPanel:()=>iR,BackgroundPanel:()=>Wc,BorderPanel:()=>yd,ColorPanel:()=>ap,DimensionsPanel:()=>Ng,FiltersPanel:()=>Pm,GlobalStylesContext:()=>Ni,ImageSettingsPanel:()=>rR,TypographyPanel:()=>vh,areGlobalStyleConfigsEqual:()=>Pi,getBlockCSSSelector:()=>Sm,getBlockSelectors:()=>df,getGlobalStylesChanges:()=>hR,getLayoutStyles:()=>nf,toStyles:()=>cf,useGlobalSetting:()=>Oi,useGlobalStyle:()=>zi,useGlobalStylesOutput:()=>gf,useGlobalStylesOutputWithConfig:()=>hf,useGlobalStylesReset:()=>Di,useHasBackgroundPanel:()=>Gc,useHasBorderPanel:()=>hd,useHasBorderPanelControls:()=>gd,useHasColorPanel:()=>Zd,useHasDimensionsPanel:()=>xg,useHasFiltersPanel:()=>Bm,useHasImageSettingsPanel:()=>oR,useHasTypographyPanel:()=>sh,useSettingsForBlockElement:()=>Vi});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},k=(0,a.createContext)(b),{Provider:v}=k;function _(){return(0,a.useContext)(k)}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:[],__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 L(e){return R(e,(e=>e.attributes))}function A(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 D(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 O(e,t,n=!1){const o=e.tree,r=new Set([]),i=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){i.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 i)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:i}=t.byClientId.get(r);"core/block"===i&&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),D(o,n.blocks),O(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)}),O(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)})})),O(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)})),D(o,n.blocks),O(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)}O(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)})),O(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),O(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),O(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})})),O(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 i=r;if(n.blocks.length){i=e(i,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(i.order);Object.keys(o).forEach((e=>{t.order.get(e)&&r.set(e,t.order.get(e))})),i.order=r,i.tree=new Map(i.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&i.tree.set(n,t.tree.get(n))}))}return i}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(N(n.blocks)),attributes:new Map(L(n.blocks)),order:M(n.blocks),parents:new Map(P(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(t?.tree),D(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,i)=>{let s,l=e(r,i);var a;"SET_EXPLICIT_PERSISTENT"===i.type&&(n=i.isPersistentChange,s=null===(a=r.isPersistentChange)||void 0===a||a);if(void 0!==n)return s=n,s===l.isPersistentChange?l:{...l,isPersistentChange:s};const c="MARK_LAST_CHANGE_AS_PERSISTENT"===i.type||o;var u;return r!==l||c?(l={...l,isPersistentChange:c?!o:!A(i,t)},t=i,o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,l):(o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,s=null===(u=r?.isPersistentChange)||void 0===u||u,r.isPersistentChange===s?r:{...l,isPersistentChange:s})}}),(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 L(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 i of t.clientIds){var n;const s=Object.entries(t.uniqueByBlock?t.attributes[i]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===s.length)continue;let l=!1;const a=e.get(i),c={};s.forEach((([e,t])=>{a[e]!==t&&(l=!0,c[e]=t)})),o=o||l,l&&r.set(i,{...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)})),L(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:i=o.length}=t,s=new Map(e);return r.forEach(((e,t)=>{s.set(t,e)})),s.set(n,j(o,r.get(n),i)),s}case"MOVE_BLOCKS_TO_POSITION":{var o;const{fromRootClientId:n="",toRootClientId:r="",clientIds:i}=t,{index:s=e.get(r).length}=t;if(n===r){const t=e.get(r).indexOf(i[0]),n=new Map(e);return n.set(r,E(e.get(r),t,s,i.length)),n}const l=new Map(e);return l.set(n,null!==(o=e.get(n)?.filter((e=>!i.includes(e))))&&void 0!==o?o:[]),l.set(r,j(e.get(r),i,s)),l}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],i=e.get(o);if(!i.length||r===i[0])return e;const s=i.indexOf(r),l=new Map(e);return l.set(o,E(i,s,s-1,n.length)),l}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],i=n[n.length-1],s=e.get(o);if(!s.length||i===s[s.length-1])return e;const l=s.indexOf(r),a=new Map(e);return a.set(o,E(s,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 i=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);r.set(t,i)})),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 i=null!==(r=e?.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==r?r:[];i.length!==e.length&&n.set(o,i)})),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:i}=t;return r===e.selectionStart?.clientId&&i===e.selectionEnd?.clientId?e:{selectionStart:{clientId:r},selectionEnd:{clientId:i}};case"RESET_BLOCKS":const s=e?.selectionStart?.clientId,l=e?.selectionEnd?.clientId;if(!s&&!l)return e;if(!t.blocks.some((e=>e.clientId===s)))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:i,nearestSide:s}=t,l={rootClientId:n,index:o,__unstableWithInserter:r,operation:i,nearestSide:s};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 i=r;const s=(0,c.select)(l.store).getActiveBlockVariation(r,o);return s?.name&&(i+="/"+s.name),"core/block"===r&&(i+="/"+o.ref),{...e,[i]:{time:t.time,count:e[i]?e[i].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},hoveredBlockClientId:function(e=!1,t){return"HOVER_BLOCK"===t.type?t.clientId:e},zoomLevel:function(e=100,t){switch(t.type){case"SET_ZOOM_LEVEL":return t.zoom;case"RESET_ZOOM_LEVEL":return 100}return 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,$=window.ReactJSXRuntime,U=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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=window.wp.blockSerializationDefaultParser,Z=Symbol("globalStylesDataKey"),q=Symbol("globalStylesLinks"),Y=Symbol("selectBlockPatternsKey"),X=Symbol("reusableBlocksSelect"),Q=Symbol("sectionRootClientIdKey"),J=window.wp.privateApis,{lock:ee,unlock:te}=(0,J.__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"),ne="core/block-editor",oe=Symbol("withRootClientId"),re=new WeakMap,ie=new WeakMap;function se(e){let t=re.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),re.set(e,t)),t}function le(e){let t=ie.get(e);return t||(t=(0,K.parse)(e.content),t=t.filter((e=>null!==e.blockName)),ie.set(e,t)),t}const ae=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,ce=(e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!ae(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach((e=>{n.push(e)}))}return!0},ue=e=>t=>[t.settings.__experimentalBlockPatterns,t.settings.__experimentalUserPatternCategories,t.settings.__experimentalReusableBlocks,t.settings[Y]?.(e),t.blockPatterns,te(e(ne)).getReusableBlocks()];function de(e,t){return[e.blockListSettings[t],e.blocks.byClientId.get(t),e.settings.allowedBlockTypes,e.settings.templateLock,e.blockEditingModes]}const pe=(e,t,n)=>(o,r)=>{let i,s;if("function"==typeof e?(i=e(o),s=e(r)):(i=o[e],s=r[e]),i>s)return"asc"===n?1:-1;if(s>i)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 he(e,t,n="asc"){return e.concat().sort(pe(t,e,n))}const ge={user:"user",theme:"theme",directory:"directory"},me={full:"fully",unsynced:"unsynced"},fe={name:"allPatterns",label:(0,C._x)("All","patterns")},be={name:"myPatterns",label:(0,C.__)("My patterns")};function ke(e,t,n){const o=e.name.startsWith("core/block"),r="core"===e.source||e.source?.startsWith("pattern-directory");return!(t!==ge.theme||!o&&!r)||(!(t!==ge.directory||!o&&r)||(t===ge.user&&e.type!==ge.user||(n===me.full&&""!==e.syncStatus||!(n!==me.unsynced||"unsynced"===e.syncStatus||!o))))}function ve(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 _e=(e,t,n)=>{var o;const r=Array.isArray(t)?t:t.split(".");let i=e;return r.forEach((e=>{i=i?.[e]})),null!==(o=i)&&void 0!==o?o:n};const xe=["color","border","dimensions","typography","spacing"],ye={"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},Se={"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"},we=e=>Se[e]||e;function Ce(e,t,...n){const o=it(e,t),r=[];if(t){let n=t;do{const t=it(e,n);(0,l.hasBlockSupport)(t,"__experimentalSettings",!1)&&r.push(n)}while(n=e.blocks.parents.get(n))}return n.map((n=>{if(xe.includes(n))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let i=(0,d.applyFilters)("blockEditor.useSetting.before",void 0,n,t,o);if(void 0!==i)return i;const s=we(n);for(const t of r){var a;const n=lt(e,t);if(i=null!==(a=_e(n.settings?.blocks?.[o],s))&&void 0!==a?a:_e(n.settings,s),void 0!==i)break}const c=Zn(e);var u,p;if(void 0===i&&o&&(i=_e(c.__experimentalFeatures?.blocks?.[o],s)),void 0===i&&(i=_e(c.__experimentalFeatures,s)),void 0!==i)return l.__EXPERIMENTAL_PATHS_WITH_OVERRIDE[s]?null!==(u=null!==(p=i.custom)&&void 0!==p?p:i.theme)&&void 0!==u?u:i.default:i;const h=ye[s]?.(c);return void 0!==h?h:"typography.dropCap"===s||void 0}))}function Be(e){return e.isBlockInterfaceHidden}function Ie(e){return e?.lastBlockInserted?.clientIds}function je(e,t){return e.blocks.byClientId.get(t)}const Ee=(e,t)=>{const n=t=>"disabled"===go(e,t)&&Jt(e,t).every(n);return Jt(e,t).every(n)};const Te=(0,c.createSelector)((function e(t,n){const o=Jt(t,n),r=[];for(const n of o){const o=e(t,n);"disabled"!==go(t,n)?r.push({clientId:n,innerBlocks:o}):r.push(...o)}return r}),(e=>[e.blocks.order,e.blockEditingModes,e.settings.templateLock,e.blockListSettings,e.editorMode])),Me=(0,c.createSelector)(((e,t,n=!1)=>Tt(e,t,n).filter((t=>"disabled"!==go(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function Pe(e){return e.removalPromptData}function Re(e){return e.blockRemovalRules}function Ne(e){return e.openedBlockSettingsMenu}const Le=(0,c.createSelector)((e=>{const t=gt(e).reduce(((e,t,n)=>(e[t]=n,e)),{});return[...e.styleOverrides].sort(((e,n)=>{var o,r;const[,{clientId:i}]=e,[,{clientId:s}]=n;return(null!==(o=t[i])&&void 0!==o?o:-1)-(null!==(r=t[s])&&void 0!==r?r:-1)}))}),(e=>[e.blocks.order,e.styleOverrides]));function Ae(e){return e.registeredInserterMediaCategories}const De=(0,c.createSelector)((e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:o},registeredInserterMediaCategories:r}=e;if(!t&&!r.length||!n)return;const i=t?.map((({name:e})=>e))||[];return[...t||[],...(r||[]).filter((({name:e})=>!i.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])),Oe=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n=null)=>{const{getAllPatterns:o}=te(e(ne)),r=o(),{allowedBlockTypes:i}=Zn(t);return r.some((e=>{const{inserter:o=!0}=e;if(!o)return!1;const r=le(e);return ce(r,i)&&r.every((({name:e})=>yn(t,e,n)))}))}),((t,n)=>[...ue(e)(t),...de(t,n)]))));function ze(e,t=[]){return{name:`core/block/${e.id}`,id:e.id,type:ge.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 Ve=(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=te(e(ne)).getReusableBlocks().find((({id:e})=>e===o));return r?ze(r,t.settings.__experimentalUserPatternCategories):null}return[...null!==(o=t.settings.__experimentalBlockPatterns)&&void 0!==o?o:[],...null!==(r=t.settings[Y]?.(e))&&void 0!==r?r:[]].find((({name:e})=>e===n))}),((t,n)=>n?.startsWith("core/block/")?[te(e(ne)).getReusableBlocks(),t.settings.__experimentalReusableBlocks]:[t.settings.__experimentalBlockPatterns,t.settings[Y]?.(e)])))),Fe=(0,c.createRegistrySelector)((e=>(0,c.createSelector)((t=>{var n,o;return[...te(e(ne)).getReusableBlocks().map((e=>ze(e,t.settings.__experimentalUserPatternCategories))),...null!==(n=t.settings.__experimentalBlockPatterns)&&void 0!==n?n:[],...null!==(o=t.settings[Y]?.(e))&&void 0!==o?o:[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))}),ue(e)))),He=(0,c.createRegistrySelector)((e=>(0,c.createSelector)((t=>{const n=t.settings[Y],o=t.settings[X];return!!n&&void 0===n(e)||!!o&&void 0===o(e)}),ue(e)))),Ge=[],$e=(0,c.createRegistrySelector)((e=>t=>{var n;const o=t.settings[X];return null!==(n=o?o(e):t.settings.__experimentalReusableBlocks)&&void 0!==n?n:Ge}));function Ue(e){return e.lastFocus}function We(e){return e.isDragging}function Ke(e){return e.expandedBlock}const Ze=(0,c.createSelector)(((e,t)=>{let n,o=t;for(;o=e.blocks.parents.get(o);)"core/block"!==it(e,o)&&"contentOnly"!==_n(e,o)||(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function qe(e){return e.temporarilyEditingAsBlocks}function Ye(e){return e.temporarilyEditingFocusModeRevert}const Xe=(0,c.createSelector)(((e,t)=>t.reduce(((t,n)=>(t[n]=e.blocks.attributes.get(n)?.style,t)),{})),((e,t)=>[...t.map((t=>e.blocks.attributes.get(t)?.style))]));function Qe(e){return"zoom-out"===e.editorMode}function Je(e){return e.settings?.[Q]}function et(e){return e.zoomLevel}function tt(e){return et(e)<100}const nt=[],ot=new Set,rt={};function it(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 st(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function lt(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function at(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const ct=(0,c.createSelector)(((e,t)=>{const n=e.blocks.byClientId.get(t);return n?{...n,attributes:lt(e,t)}:null}),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function ut(e,t){const n=t&&io(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||nt}const dt=(0,c.createSelector)(((e,t)=>(y()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:pt(e,t)})),(e=>[e.blocks.order])),pt=(0,c.createSelector)(((e,t="")=>(y()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),Jt(e,t).map((t=>dt(e,t))))),(e=>[e.blocks.order])),ht=(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])),gt=e=>ht(e,""),mt=(0,c.createSelector)(((e,t)=>{const n=gt(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])),ft=(0,c.createSelector)(((e,t)=>{if(!t)return nt;const n=Array.isArray(t)?t:[t],o=gt(e).filter((t=>{const o=e.blocks.byClientId.get(t);return n.includes(o.name)}));return o.length>0?o:nt}),(e=>[e.blocks.order,e.blocks.byClientId]));function bt(e,t){return y()("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",{since:"6.5",alternative:"wp.data.select( 'core/block-editor' ).getBlocksByName"}),ft(e,t)}const kt=(0,c.createSelector)(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>at(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),vt=(0,c.createSelector)(((e,t)=>kt(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>kt(e,t)));function _t(e,t){return Jt(e,t).length}function xt(e){return e.selection.selectionStart}function yt(e){return e.selection.selectionEnd}function St(e){return e.selection.selectionStart.clientId}function wt(e){return e.selection.selectionEnd.clientId}function Ct(e){const t=zt(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function Bt(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function It(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function jt(e){const t=It(e);return t?at(e,t):null}function Et(e,t){var n;return null!==(n=e.blocks.parents.get(t))&&void 0!==n?n:null}const Tt=(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():nt}),(e=>[e.blocks.parents])),Mt=(0,c.createSelector)(((e,t,n,o=!1)=>{const r=Tt(e,t,o),i=Array.isArray(n)?e=>n.includes(e):e=>n===e;return r.filter((t=>i(it(e,t))))}),(e=>[e.blocks.parents]));function Pt(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function Rt(e,t){const n=It(e),o=[...Tt(e,t),t],r=[...Tt(e,n),n];let i;const s=Math.min(o.length,r.length);for(let e=0;e<s&&o[e]===r[e];e++)i=o[e];return i}function Nt(e,t,n=1){if(void 0===t&&(t=It(e)),void 0===t&&(t=n<0?Ft(e):Ht(e)),!t)return null;const o=Et(e,t);if(null===o)return null;const{order:r}=e.blocks,i=r.get(o),s=i.indexOf(t)+1*n;return s<0||s===i.length?null:i[s]}function Lt(e,t){return Nt(e,t,-1)}function At(e,t){return Nt(e,t,1)}function Dt(e){return e.initialPosition}const Ot=(0,c.createSelector)((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return nt;if(t.clientId===n.clientId)return[t.clientId];const o=Et(e,t.clientId);if(null===o)return nt;const r=Jt(e,o),i=r.indexOf(t.clientId),s=r.indexOf(n.clientId);return i>s?r.slice(s,i+1):r.slice(i,s+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function zt(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?nt:Ot(e)}const Vt=(0,c.createSelector)((e=>{const t=zt(e);return t.length?t.map((t=>at(e,t))):nt}),(e=>[...Ot.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ft(e){return zt(e)[0]||null}function Ht(e){const t=zt(e);return t[t.length-1]||null}function Gt(e,t){return Ft(e)===t}function $t(e,t){return-1!==zt(e).indexOf(t)}const Ut=(0,c.createSelector)(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=Et(e,n),o=$t(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Wt(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Kt(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Zt(e){const t=xt(e),n=yt(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function qt(e){const t=xt(e),n=yt(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Yt(e){return Ot(e).some((t=>{const n=it(e,t);return!(0,l.getBlockType)(n).merge}))}function Xt(e,t){const n=xt(e),o=yt(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=Et(e,n.clientId);if(r!==Et(e,o.clientId))return!1;const i=Jt(e,r);let s,a;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,a=n):(s=n,a=o);const c=t?a.clientId:s.clientId,u=t?s.clientId:a.clientId,d=it(e,c);if(!(0,l.getBlockType)(d).merge)return!1;const p=at(e,u);if(p.name===d)return!0;const h=(0,l.switchToBlockType)(p,d);return h&&h.length}const Qt=e=>{const t=xt(e),n=yt(e);if(t.clientId===n.clientId)return nt;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return nt;const o=Et(e,t.clientId);if(o!==Et(e,n.clientId))return nt;const r=Jt(e,o),i=r.indexOf(t.clientId),s=r.indexOf(n.clientId),[l,a]=i>s?[n,t]:[t,n],c=at(e,l.clientId),u=at(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 Jt(e,t){return e.blocks.order.get(t||"")||nt}function en(e,t){return Jt(e,Et(e,t)).indexOf(t)}function tn(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function nn(e,t,n=!1){const o=Ot(e);return!!o.length&&(n?o.some((n=>Tt(e,n,!0).includes(t))):o.some((n=>Et(e,n)===t)))}function on(e,t,n=!1){return Jt(e,t).some((t=>hn(e,t)||n&&on(e,t,n)))}function rn(e,t){if(!t)return!1;const n=zt(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function sn(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function ln(e){return e.isMultiSelecting}function an(e){return e.isSelectionEnabled}function cn(e,t){return e.blocksMode[t]||"visual"}function un(e){return e.isTyping}function dn(e){return!!e.draggedBlocks.length}function pn(e){return e.draggedBlocks}function hn(e,t){return e.draggedBlocks.includes(t)}function gn(e,t){if(!dn(e))return!1;return Tt(e,t).some((t=>hn(e,t)))}function mn(){return y()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const fn=(0,c.createSelector)((e=>{let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:i}=r;return i?(t=Et(e,i)||void 0,n=en(e,r.clientId)+1):n=Jt(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function bn(e){return null!==e.insertionPoint}function kn(e){return e.template.isValid}function vn(e){return e.settings.template}function _n(e,t){var n,o;return t?null!==(n=Kn(e,t)?.templateLock)&&void 0!==n&&n:null!==(o=e.settings.templateLock)&&void 0!==o&&o}const xn=(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}=Zn(e);if(!ae(r,t,!0))return!1;if(!!_n(e,n))return!1;if("disabled"===go(e,null!=n?n:""))return!1;const i=Kn(e,n);if(n&&void 0===i)return!1;const s=it(e,n),a=(0,l.getBlockType)(s),c=a?.allowedBlocks;let u=ae(c,t);if(!1!==u){const e=i?.allowedBlocks,n=ae(e,t);null!==n&&(u=n)}const p=o.parent,h=ae(p,s);let g=!0;const m=o.ancestor;if(m){g=[n,...Tt(e,n)].some((t=>ae(m,it(e,t))))}const f=g&&(null===u&&null===h||!0===u||!0===h);return f?(0,d.applyFilters)("blockEditor.__unstableCanInsertBlockType",f,o,n,{getBlock:at.bind(null,e),getBlockParentsByBlockName:Mt.bind(null,e)}):f},yn=(0,c.createSelector)(xn,((e,t,n)=>de(e,n)));function Sn(e,t,n=null){return t.every((t=>yn(e,it(e,t),n)))}function wn(e,t){const n=lt(e,t);if(null===n)return!0;if(void 0!==n.lock?.remove)return!n.lock.remove;const o=Et(e,t);return!_n(e,o)&&"disabled"!==go(e,o)}function Cn(e,t){return t.every((t=>wn(e,t)))}function Bn(e,t){const n=lt(e,t);if(null===n)return!0;if(void 0!==n.lock?.move)return!n.lock.move;const o=Et(e,t);return"all"!==_n(e,o)&&"disabled"!==go(e,o)}function In(e,t){return t.every((t=>Bn(e,t)))}function jn(e,t){const n=lt(e,t);if(null===n)return!0;const{lock:o}=n;return!o?.edit}function En(e,t){return!!(0,l.hasBlockSupport)(t,"lock",!0)&&!!e.settings?.canLockBlocks}function Tn(e,t){var n;return null!==(n=e.preferences.insertUsage?.[t])&&void 0!==n?n:null}const Mn=(e,t,n)=>!!(0,l.hasBlockSupport)(t,"inserter",!0)&&xn(e,t.name,n),Pn=(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}},Rn=(e,{buildScope:t="inserter"})=>n=>{const o=n.name;let r=!1;(0,l.hasBlockSupport)(n.name,"multiple",!0)||(r=kt(e,gt(e)).some((({name:e})=>e===n.name)));const{time:i,count:s=0}=Tn(e,o)||{},a={id:o,name:n.name,title:n.title,icon:n.icon,isDisabled:r,frecency:Pn(i,s)};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}},Nn=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n=null,o=rt)=>{const r=xn(t,"core/block",n)?te(e(ne)).getReusableBlocks().map((e=>{const n=e.wp_pattern_sync_status?U:{src:U,foreground:"var(--wp-block-synced-color)"},o=`core/block/${e.id}`,{time:r,count:i=0}=Tn(t,o)||{},s=Pn(r,i);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:s,content:e.content?.raw,syncStatus:e.wp_pattern_sync_status}})):[],i=Rn(t,{buildScope:"inserter"});let s=(0,l.getBlockTypes)().filter((e=>(0,l.hasBlockSupport)(e,"inserter",!0))).map(i);s=o[oe]?s.reduce(((e,o)=>{for(o.rootClientId=null!=n?n:"";!xn(t,o.name,o.rootClientId);){if(!o.rootClientId){let e;try{e=Je(t)}catch(e){}e&&xn(t,o.name,e)?o.rootClientId=e:delete o.rootClientId;break}{const e=Et(t,o.rootClientId);o.rootClientId=e}}return o.hasOwnProperty("rootClientId")&&e.push(o),e}),[]):s.filter((e=>Mn(t,e,n)));const a=s.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:i=0}=Tn(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:Pn(r,i)}})(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)(),te(e(ne)).getReusableBlocks(),t.blocks.order,t.preferences.insertUsage,...de(t,n)])))),Ln=(0,c.createSelector)(((e,t,n=null)=>{const o=Array.isArray(t)?t:[t],r=Rn(e,{buildScope:"transform"}),i=(0,l.getBlockTypes)().filter((t=>Mn(e,t,n))).map(r),s=Object.fromEntries(Object.entries(i).map((([,e])=>[e.name,e]))),a=(0,l.getPossibleBlockTransformations)(o).reduce(((e,t)=>(s[t?.name]&&e.push(s[t.name]),e)),[]);return he(a,(e=>s[e.name].frecency),"desc")}),((e,t,n)=>[(0,l.getBlockTypes)(),e.preferences.insertUsage,...de(e,n)])),An=(0,c.createRegistrySelector)((e=>(t,n=null)=>{if((0,l.getBlockTypes)().some((e=>Mn(t,e,n))))return!0;return xn(t,"core/block",n)&&te(e(ne)).getReusableBlocks().length>0})),Dn=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n=null)=>{if(!n)return;const o=(0,l.getBlockTypes)().filter((e=>Mn(t,e,n)));return xn(t,"core/block",n)&&te(e(ne)).getReusableBlocks().length>0&&o.push("core/block"),o}),((t,n)=>[(0,l.getBlockTypes)(),te(e(ne)).getReusableBlocks(),...de(t,n)])))),On=(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"}),Dn(e,t))),((e,t)=>Dn.getDependants(e,t)));function zn(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 Vn(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"}),zn(e,t)}const Fn=(0,c.createRegistrySelector)((e=>(t,n)=>{const o=te(e(ne)).getPatternBySlug(n);return o?se(o):null})),Hn=e=>(t,n)=>[...ue(e)(t),...de(t,n)],Gn=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n=null)=>{const{getAllPatterns:o}=te(e(ne)),r=o(),{allowedBlockTypes:i}=Zn(t),s=r.filter((({inserter:e=!0})=>!!e)).map((e=>({...e,get blocks(){return se(e).blocks}})));return s.filter((e=>ce(le(e),i))).filter((e=>le(e).every((({blockName:e})=>yn(t,e,n)))))}),Hn(e)))),$n=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n,o=null)=>{if(!n)return nt;const r=e(ne).__experimentalGetAllowedPatterns(o),i=Array.isArray(n)?n:[n],s=r.filter((e=>e?.blockTypes?.some?.((e=>i.includes(e)))));return 0===s.length?nt:s}),((t,n,o)=>Hn(e)(t,o))))),Un=(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(ne).getPatternsByBlockTypes))),Wn=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,n,o=null)=>{if(!n)return nt;if(n.some((({clientId:e,innerBlocks:n})=>n.length||io(t,e))))return nt;const r=Array.from(new Set(n.map((({name:e})=>e))));return e(ne).getPatternsByBlockTypes(r,o)}),((t,n,o)=>Hn(e)(t,o)))));function Kn(e,t){return e.blockListSettings[t]}function Zn(e){return e.settings}function qn(e){return e.blocks.isPersistentChange}const Yn=(0,c.createSelector)(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),Xn=(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=te(e(ne)).getReusableBlocks().find((e=>e.id===n));return o?o.title?.raw:null}),(()=>[te(e(ne)).getReusableBlocks()]))));function Qn(e){return e.blocks.isIgnoredChange}function Jn(e){return e.lastBlockAttributesChange}function eo(e){return"navigation"===e.editorMode}function to(e){return e.editorMode}function no(e){return e.hasBlockMovingClientId}function oo(e){return!!e.automaticChangeStatus}function ro(e,t){return e.highlightedBlock===t}function io(e,t){return!!e.blocks.controlledInnerBlocks[t]}const so=(0,c.createSelector)(((e,t)=>{if(!t.length)return null;const n=It(e);if(t.includes(it(e,n)))return n;const o=zt(e),r=Mt(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function lo(e,t,n){const{lastBlockInserted:o}=e;return o.clientIds?.includes(t)&&o.source===n}function ao(e,t){var n;return null===(n=e.blockVisibility?.[t])||void 0===n||n}function co(e){return e.hoveredBlockClientId}const uo=(0,c.createSelector)((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?ot:t}),(e=>[e.blockVisibility]));function po(e,t){if("default"!==go(e,t))return!1;if(!jn(e,t))return!0;const n=to(e);if("zoom-out"===n){const n=Je(e);if(n){const o=Jt(e,n);if(o?.includes(t))return!0}else if(t&&!Et(e,t))return!0}const o=(0,l.hasBlockSupport)(it(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&io(e,t))&&!tn(e,t)&&!nn(e,t,!0)}function ho(e,t){let n=e.blocks.parents.get(t);for(;n;){if(po(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const go=(0,c.createRegistrySelector)((e=>(t,n="")=>{null===n&&(n="");if("zoom-out"===to(t)){const e=Je(t);if(""===n)return e?"disabled":"contentOnly";if(n===e)return"contentOnly";const o=Jt(t,e);return o?.includes(n)?"contentOnly":"disabled"}const o=t.blockEditingModes.get(n);if(o)return o;if(!n)return"default";const r=Et(t,n);if("contentOnly"===_n(t,r)){const o=it(t,n),{hasContentRoleAttribute:r}=te(e(l.store));return r(o)?"contentOnly":"disabled"}const i=go(t,r);return"contentOnly"===i?"default":i})),mo=(0,c.createRegistrySelector)((e=>(t,n="")=>{const o=n||It(t);if(!o)return!1;const{getGroupingBlockName:r}=e(l.store),i=at(t,o),s=r();return i&&(i.name===s||(0,l.getBlockType)(i.name)?.transforms?.ungroup)&&!!i.innerBlocks.length&&wn(t,o)})),fo=(0,c.createRegistrySelector)((e=>(t,n=nt)=>{const{getGroupingBlockName:o}=e(l.store),r=o(),i=n?.length?n:Ot(t),s=i?.length?Et(t,i[0]):void 0;return yn(t,r,s)&&i.length&&Cn(t,i)})),bo=(e,t)=>(y()("wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent",{since:"6.1",version:"6.7"}),Ze(e,t));function ko(e){return y()("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks",{since:"6.1",version:"6.7"}),qe(e)}function vo(e){return y()("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingFocusModeToRevert",{since:"6.5",version:"6.7"}),Ye(e)}const _o=["inserterMediaCategories","blockInspectorAnimation"];function xo(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let o=e;if(t&&"web"===a.Platform.OS){o={};for(const t in e)_o.includes(t)||(o[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:o,reset:n}}function yo(){return{type:"HIDE_BLOCK_INTERFACE"}}function So(){return{type:"SHOW_BLOCK_INTERFACE"}}const wo=(e,t=!0,n=!1)=>({select:o,dispatch:r,registry:i})=>{if(!e||!e.length)return;var s;s=e,e=Array.isArray(s)?s:[s];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(Bo(e,t,u))}t&&r.selectPreviousBlock(e[0],t),i.batch((()=>{r({type:"REMOVE_BLOCKS",clientIds:e}),r(Co())}))},Co=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function Bo(e,t,n){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,message:n}}function Io(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function jo(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function Eo(e){return{type:"SET_OPENED_BLOCK_SETTINGS_MENU",clientId:e}}function To(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function Mo(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function Po(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function Ro(e){return({select:t,dispatch:n,registry:o})=>{const r=te(o.select(oi)).getTemporarilyEditingFocusModeToRevert();n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:"contentOnly"}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:"contentOnly"}),n.updateSettings({focusMode:r}),n.__unstableSetTemporarilyEditingAsBlocks()}}function No(){return{type:"START_DRAGGING"}}function Lo(){return{type:"STOP_DRAGGING"}}function Ao(e){return{type:"SET_BLOCK_EXPANDED_IN_LIST_VIEW",clientId:e}}const Do=e=>({select:t,dispatch:n})=>{n.selectBlock(e),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)};function Oo(e=100){return{type:"SET_ZOOM_LEVEL",zoom:e}}function zo(){return{type:"RESET_ZOOM_LEVEL"}}const Vo=window.wp.a11y,Fo=window.wp.notices,Ho="†";function Go(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(Ho)}))}function $o(e){for(const[t,n]of Object.entries(e.attributes))if("rich-text"===n.source||"html"===n.source)return t}const Uo=e=>Array.isArray(e)?e:[e],Wo=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(Ko(e))},Ko=e=>({select:t,dispatch:n})=>{const o=t.getTemplate(),r=t.getTemplateLock(),i=!o||"all"!==r||(0,l.doBlocksMatchTemplate)(e,o);if(i!==t.isValidTemplate())return n.setTemplateValidity(i),i};function Zo(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function qo(e){return y()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Yo(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Uo(e),attributes:t,uniqueByBlock:n}}function Xo(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Qo(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}function Jo(e){return{type:"HOVER_BLOCK",clientId:e}}const er=(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)}},tr=e=>({select:t,dispatch:n})=>{const o=t.getNextBlockClientId(e);o&&n.selectBlock(o)};function nr(){return{type:"START_MULTI_SELECT"}}function or(){return{type:"STOP_MULTI_SELECT"}}const rr=(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 i=o.getSelectedBlockCount();(0,Vo.speak)((0,C.sprintf)((0,C._n)("%s block selected.","%s blocks selected.",i),i),"assertive")};function ir(){return{type:"CLEAR_SELECTED_BLOCK"}}function sr(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}const lr=(e,t,n,o=0,r)=>({select:i,dispatch:s,registry:l})=>{e=Uo(e),t=Uo(t);const a=i.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}l.batch((()=>{s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s.ensureDefaultBlock()}))};function ar(e,t){return lr(e,t)}const cr=e=>(t,n)=>({select:o,dispatch:r})=>{o.canMoveBlocks(t)&&r({type:e,clientIds:Uo(t),rootClientId:n})},ur=cr("MOVE_BLOCKS_DOWN"),dr=cr("MOVE_BLOCKS_UP"),pr=(e,t="",n="",o)=>({select:r,dispatch:i})=>{if(r.canMoveBlocks(e)){if(t!==n){if(!r.canRemoveBlocks(e))return;if(!r.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}};function hr(e,t="",n="",o){return pr([e],t,n,o)}function gr(e,t,n,o,r){return mr([e],t,n,o,0,r)}const mr=(e,t,n,o=!0,r=0,i)=>({select:s,dispatch:l})=>{null!==r&&"object"==typeof r&&(i=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=Uo(e);const a=[];for(const t of e){s.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:i})};function fr(e,t,n={}){const{__unstableWithInserter:o,operation:r,nearestSide:i}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:r,nearestSide:i}}const br=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function kr(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const vr=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=e.getBlocks(),o=e.getTemplate(),r=(0,l.synchronizeBlocksWithTemplate)(n,o);t.resetBlocks(r)},_r=e=>({registry:t,select:n,dispatch:o})=>{const r=n.getSelectionStart(),i=n.getSelectionEnd();if(r.clientId===i.clientId)return;if(!r.attributeKey||!i.attributeKey||void 0===r.offset||void 0===i.offset)return!1;const s=n.getBlockRootClientId(r.clientId);if(s!==n.getBlockRootClientId(i.clientId))return;const a=n.getBlockOrder(s);let c,u;a.indexOf(r.clientId)>a.indexOf(i.clientId)?(c=i,u=r):(c=r,u=i);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),k=f.attributes[g.attributeKey],v=b.attributes[m.attributeKey];let _=(0,W.create)({html:k}),x=(0,W.create)({html:v});_=(0,W.remove)(_,g.offset,_.text.length),x=(0,W.insert)(x,Ho,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=Go(B),j=B[I],E=(0,W.create)({html:j}),T=E.text.indexOf(Ho),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())}))},xr=(e=[])=>({registry:t,select:n,dispatch:o})=>{const r=n.getSelectionStart(),i=n.getSelectionEnd(),s=n.getBlockRootClientId(r.clientId),a=n.getBlockRootClientId(i.clientId);if(s!==a)return;const c=n.getBlockOrder(s);let u,d;c.indexOf(r.clientId)>c.indexOf(i.clientId)?(u=i,d=r):(u=r,d=i);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),k="string"==typeof p.attributeKey?p.attributeKey:$o(f),v="string"==typeof h.attributeKey?h.attributeKey:$o(b),_=n.getBlockAttributes(p.clientId),x=_?.metadata?.bindings;if(x?.[k]){if(e.length){const{createWarningNotice:O}=t.dispatch(Fo.store);return void O((0,C.__)("Blocks can't be inserted into other blocks with bindings"),{type:"snackbar"})}return void o.insertAfterBlock(p.clientId)}if(!k||!v||void 0===r.offset||void 0===i.offset)return;if(p.clientId===h.clientId&&k===v&&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,s)?(0,l.createBlock)(e):(0,l.createBlock)(n.getBlockName(p.clientId))}const V=_[k].length;if(0===p.offset&&V)return void o.insertBlocks([z()],n.getBlockIndex(p.clientId),s,!1);if(p.offset===V)return void o.insertBlocks([z()],n.getBlockIndex(p.clientId)+1,s)}const y=g.attributes[k],S=m.attributes[v];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,[k]:(0,W.toHTMLString)({value:w})}},j={...m,clientId:g.clientId===m.clientId?(0,l.createBlock)(m.name).clientId:m.clientId,attributes:{...m.attributes,[v]:(0,W.toHTMLString)({value:B})}};const E=(0,l.getDefaultBlockName)();if(g.clientId===m.clientId&&E&&j.name!==E&&n.canInsertBlockType(E,s)){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),L=N.merge&&R.name===N.name?[R]:(0,l.switchToBlockType)(R,N.name);if(L?.length){const H=L.shift();I={...I,attributes:{...I.attributes,...N.merge(I.attributes,H.attributes)}},M.push(I),T={clientId:I.clientId,attributeKey:k,offset:(0,W.create)({html:I.attributes[k]}).text.length},P.unshift(...L)}else(0,l.isUnmodifiedBlock)(I)||M.push(I),M.push(R);const A=P.pop(),D=(0,l.getBlockType)(j.name);if(P.length&&M.push(...P),A){const G=D.merge&&D.name===A.name?[A]:(0,l.switchToBlockType)(A,D.name);if(G?.length){const $=G.pop();M.push({...j,attributes:{...j.attributes,...D.merge($.attributes,j.attributes)}}),M.push(...G),T={clientId:j.clientId,attributeKey:v,offset:(0,W.create)({html:$.attributes[v]}).text.length}}else M.push(A),(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)}))},yr=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:o.clientId}})},Sr=(e,t)=>({registry:n,select:o,dispatch:r})=>{const i=e,s=t,a=o.getBlock(i),c=(0,l.getBlockType)(a.name);if(!c)return;const u=o.getBlock(s);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,i),r.removeBlock(s),r.selectBlock(t.innerBlocks[0].clientId);const e=o.getNextBlockClientId(i);if(e&&o.getBlockName(i)===o.getBlockName(e)){const t=o.getBlockAttributes(i),n=o.getBlockAttributes(e);Object.keys(t).every((e=>t[e]===n[e]))&&(r.moveBlocksToPosition(o.getBlockOrder(e),e,i),r.removeBlock(e,!1))}}))}if((0,l.isUnmodifiedDefaultBlock)(a))return void r.removeBlock(i,o.isBlockSelected(i));if((0,l.isUnmodifiedDefaultBlock)(u))return void r.removeBlock(s,o.isBlockSelected(s));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===i?c:d).attributes[h],f=(p===i||p===s)&&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),k=(0,l.cloneBlock)(u);if(f){const e=p===i?b:k,t=e.attributes[h],n=(0,W.insert)((0,W.create)({html:t}),Ho,g,g);e.attributes[h]=(0,W.toHTMLString)({value:n})}const v=a.name===u.name?[k]:(0,l.switchToBlockType)(k,a.name);if(!v||!v.length)return;const _=c.merge(b.attributes,v[0].attributes);if(f){const e=Go(_),t=_[e],n=(0,W.create)({html:t}),o=n.text.indexOf(Ho),i=(0,W.remove)(n,o,o+1),s=(0,W.toHTMLString)({value:i});_[e]=s,r.selectionChange(a.clientId,e,o,o)}r.replaceBlocks([a.clientId,u.clientId],[{...a,attributes:{...a.attributes,..._}},...v.slice(1)],0)},wr=(e,t=!0)=>wo(e,t);function Cr(e,t){return wr([e],t)}function Br(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 Ir(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function jr(){return{type:"START_TYPING"}}function Er(){return{type:"STOP_TYPING"}}function Tr(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Mr(){return{type:"STOP_DRAGGING_BLOCKS"}}function Pr(){return y()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Rr(){return y()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Nr(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Lr=(e,t,n)=>({dispatch:o})=>{const r=(0,l.getDefaultBlockName)();if(!r)return;const i=(0,l.createBlock)(r,e);return o.insertBlock(i,n,t)};function Ar(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Dr(e){return xo(e,{stripExperimentalSettings:!0})}function Or(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function zr(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Vr(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Fr=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Hr=(e=!0)=>({dispatch:t})=>{t.__unstableSetEditorMode(e?"navigation":"edit")},Gr=e=>({dispatch:t,select:n})=>{if("zoom-out"===e){const e=n.getBlockSelectionStart(),o=n.getSectionRootClientId();if(e){let r;if(o){const t=n.getBlockOrder(o);r=t?.includes(e)?e:n.getBlockParents(e).find((e=>t.includes(e)))}else r=n.getBlockHierarchyRootClientId(e);r?t.selectBlock(r):t.clearSelectedBlock()}}t({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,Vo.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,Vo.speak)((0,C.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,Vo.speak)((0,C.__)("You are currently in zoom-out mode."))},$r=(e=null)=>({dispatch:t})=>{t({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Vo.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."))},Ur=(e,t=!0)=>({select:n,dispatch:o})=>{if(!e||!e.length)return;const r=n.getBlocksByClientId(e);if(r.some((e=>!e)))return;const i=r.map((e=>e.name));if(i.some((e=>!(0,l.hasBlockSupport)(e,"multiple",!0))))return;const s=n.getBlockRootClientId(e[0]),a=Uo(e),c=n.getBlockIndex(a[a.length-1]),u=r.map((e=>(0,l.__experimentalCloneSanitizedBlock)(e)));return o.insertBlocks(u,c+1,s,t),u.length>1&&t&&o.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))},Wr=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e),i=o?t.getDirectInsertBlock(o):null;if(!i)return n.insertDefaultBlock({},o,r);const s={};if(i.attributesToCopy){const n=t.getBlockAttributes(e);i.attributesToCopy.forEach((e=>{n[e]&&(s[e]=n[e])}))}const a=(0,l.createBlock)(i.name,{...i.attributes,...s});return n.insertBlock(a,r,o)},Kr=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e),i=o?t.getDirectInsertBlock(o):null;if(!i)return n.insertDefaultBlock({},o,r+1);const s={};if(i.attributesToCopy){const n=t.getBlockAttributes(e);i.attributesToCopy.forEach((e=>{n[e]&&(s[e]=n[e])}))}const a=(0,l.createBlock)(i.name,{...i.attributes,...s});return n.insertBlock(a,r+1,o)};function Zr(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const qr=e=>async({dispatch:t})=>{t(Zr(e,!0)),await new Promise((e=>setTimeout(e,150))),t(Zr(e,!1))};function Yr(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Xr(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Qr(e,t){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e,focusModeToRevert:t}}const Jr=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 ei(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function ti(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}const ni={reducer:H,selectors:t,actions:i},oi=(0,c.createReduxStore)(ne,{...ni,persist:["preferences"]}),ri=(0,c.registerStore)(ne,{...ni,persist:["preferences"]});function ii(...e){const{clientId:t=null}=_();return(0,c.useSelect)((n=>te(n(oi)).getBlockSettings(t,...e)),[t,...e])}function si(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]=ii(e);return t}te(ri).registerPrivateActions(r),te(ri).registerPrivateSelectors(e),te(oi).registerPrivateActions(r),te(oi).registerPrivateSelectors(e);const li=window.wp.styleEngine,ai="1600px",ci="320px",ui=1,di=.25,pi=.75,hi="14px";function gi({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:o=ci,maximumViewportWidth:r=ai,scaleFactor:i=ui,minimumFontSizeLimit:s}){if(s=mi(s)?s:hi,n){const o=mi(n);if(!o?.unit)return null;const r=mi(s,{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),di),pi),i=fi(o.value*n,3);e=r?.value&&i<r?.value?`${r.value}${r.unit}`:`${i}${o.unit}`}}const l=mi(e),a=l?.unit||"rem",c=mi(t,{coerceTo:a});if(!l||!c)return null;const u=mi(e,{coerceTo:"rem"}),d=mi(r,{coerceTo:a}),p=mi(o,{coerceTo:a});if(!d||!p||!u)return null;const h=d.value-p.value;if(!h)return null;const g=fi(p.value/100,3),m=fi(g,3)+a,f=fi(((c.value-l.value)/h*100||1)*i,3);return`clamp(${e}, ${`${u.value}${u.unit} + ((1vw - ${m}) * ${f})`}, ${t})`}function mi(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},i=r?.join("|"),s=new RegExp(`^(\\d*\\.?\\d+)(${i}){1,1}$`),l=e.match(s);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:fi(u,3),unit:c}}function fi(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}function bi(e){if(!e)return{};if("object"==typeof e)return e;let t;switch(e){case"normal":case"400":t=(0,C._x)("Regular","font weight");break;case"bold":case"700":t=(0,C._x)("Bold","font weight");break;case"100":t=(0,C._x)("Thin","font weight");break;case"200":t=(0,C._x)("Extra Light","font weight");break;case"300":t=(0,C._x)("Light","font weight");break;case"500":t=(0,C._x)("Medium","font weight");break;case"600":t=(0,C._x)("Semi Bold","font weight");break;case"800":t=(0,C._x)("Extra Bold","font weight");break;case"900":t=(0,C._x)("Black","font weight");break;case"1000":t=(0,C._x)("Extra Black","font weight");break;default:t=e}return{name:t,value:e}}const ki=[{name:(0,C._x)("Regular","font style"),value:"normal"},{name:(0,C._x)("Italic","font style"),value:"italic"}],vi=[{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"},{name:(0,C._x)("Extra Black","font weight"),value:"1000"}];function _i(e){let t=[],n=[];const o=[],r=!e||0===e?.length;let i=!1;return e?.forEach((e=>{if("string"==typeof e.fontWeight&&/\s/.test(e.fontWeight.trim())){i=!0;let[t,o]=e.fontWeight.split(" ");t=parseInt(t.slice(0,1)),o="1000"===o?10:parseInt(o.slice(0,1));for(let e=t;e<=o;e++){const t=`${e.toString()}00`;n.some((e=>e.value===t))||n.push(bi(t))}}const o=bi("number"==typeof e.fontWeight?e.fontWeight.toString():e.fontWeight),r=function(e){if(!e)return{};if("object"==typeof e)return e;let t;switch(e){case"normal":t=(0,C._x)("Regular","font style");break;case"italic":t=(0,C._x)("Italic","font style");break;case"oblique":t=(0,C._x)("Oblique","font style");break;default:t=e}return{name:t,value:e}}(e.fontStyle);r&&Object.keys(r).length&&(t.some((e=>e.value===r.value))||t.push(r)),o&&Object.keys(o).length&&(n.some((e=>e.value===o.value))||i||n.push(o))})),n.some((e=>e.value>="600"))||n.push({name:(0,C._x)("Bold","font weight"),value:"700"}),t.some((e=>"italic"===e.value))||t.push({name:(0,C._x)("Italic","font style"),value:"italic"}),r&&(t=ki,n=vi),t=0===t.length?ki:t,n=0===n.length?vi:n,t.forEach((({name:e,value:t})=>{n.forEach((({name:n,value:r})=>{const i="normal"===t?n:(0,C.sprintf)((0,C.__)("%1$s %2$s"),n,e);o.push({key:`${t}-${r}`,name:i,style:{fontStyle:t,fontWeight:r}})}))})),{fontStyles:t,fontWeights:n,combinedStyleAndWeightOptions:o,isSystemFont:r,isVariableFont:i}}function xi(e,t){const{size:n}=e;if(!n||"0"===n||!1===e?.fluid)return n;if(!yi(t?.typography)&&!yi(e))return n;let o=function(e){const t=e?.typography,n=e?.layout,o=mi(n?.wideSize)?n?.wideSize:null;return yi(t)&&o?{fluid:{maxViewportWidth:o,...t.fluid}}:{fluid:t?.fluid}}(t);o="object"==typeof o?.fluid?o?.fluid:{};const r=gi({minimumFontSize:e?.fluid?.min,maximumFontSize:e?.fluid?.max,fontSize:n,minimumFontSizeLimit:o?.minFontSize,maximumViewportWidth:o?.maxViewportWidth,minimumViewportWidth:o?.minViewportWidth});return r||n}function yi(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function Si(e,t){if(!(t="number"==typeof t?t.toString():t)||"string"!=typeof t)return"";if(!e||0===e.length)return t;const n=e?.reduce(((e,{value:n})=>Math.abs(parseInt(n)-parseInt(t))<Math.abs(parseInt(e)-parseInt(t))?n:e),e[0]?.value);return n}const wi="body",Ci=":root",Bi=[{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)=>xi(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:[]}],Ii={"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 ji(){return(0,u.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function Ei(e,t,n,o,r){const i=[_e(e,["blocks",t,...n]),_e(e,n)];for(const s of i)if(s){const i=["custom","theme","default"];for(const l of i){const i=s[l];if(i){const s=i.find((e=>e[o]===r));if(s){if("slug"===o)return s;return Ei(e,t,n,"slug",s.slug)[o]===s[o]?s:void 0}}}}}function Ti(e,t,n){if(!n||"string"!=typeof n){if("string"!=typeof n?.ref)return n;if(!(n=_e(e,n.ref))||n?.ref)return n}const o="var:",r="var(--wp--";let i;if(n.startsWith(o))i=n.slice(4).split("|");else{if(!n.startsWith(r)||!n.endsWith(")"))return n;i=n.slice(10,-1).split("--")}const[s,...l]=i;return"preset"===s?function(e,t,n,[o,r]){const i=Bi.find((e=>e.cssVarInfix===o));if(!i)return n;const s=Ei(e.settings,t,i.path,"slug",r);if(s){const{valueKey:n}=i;return Ti(e,t,s[n])}return n}(e,t,n,l):"custom"===s?function(e,t,n,o){var r;const i=null!==(r=_e(e.settings,["blocks",t,"custom",...o]))&&void 0!==r?r:_e(e.settings,["custom",...o]);return i?Ti(e,t,i):n}(e,t,n,l):n}function Mi(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 Pi(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:w()(e?.styles,t?.styles)&&w()(e?.settings,t?.settings)}function Ri(e,t){if(!e||!t)return e;const n=function(e,t){if(!e||!t)return e;if("string"!=typeof e&&e?.ref){const n=(0,li.getCSSValueFromRawStyle)(_e(t,e.ref));if(n?.ref)return;return void 0===n?e:n}return e}(e,t);return n?.url&&(n.url=function(e,t){if(!e||!t||!Array.isArray(t))return e;const n=t.find((t=>t?.name===e));return n?.href?n?.href:e}(n.url,t?._links?.["wp:theme-file"])),n}const Ni=(0,a.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),Li={settings:{},styles:{}},Ai=["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"],Di=()=>{const{user:e,setUserConfig:t}=(0,a.useContext)(Ni),n={settings:e.settings,styles:e.styles};return[!!n&&!w()(n,Li),(0,a.useCallback)((()=>t(Li)),[t])]};function Oi(e,t,n="all"){const{setUserConfig:o,...r}=(0,a.useContext)(Ni),i=t?".blocks."+t:"",s=e?"."+e:"",l=`settings${i}${s}`,c=`settings${s}`,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=_e(t,l))&&void 0!==n?n:_e(t,c);let o={};return Ai.forEach((e=>{var n;const r=null!==(n=_e(t,`settings${i}.${e}`))&&void 0!==n?n:_e(t,`settings.${e}`);void 0!==r&&(o=ve(o,e.split("."),r))})),o}),[r,u,e,l,c,i]),e=>{o((t=>ve(t,l.split("."),e)))}]}function zi(e,t,n="all",{shouldDecodeEncode:o=!0}={}){const{merged:r,base:i,user:s,setUserConfig:l}=(0,a.useContext)(Ni),c=e?"."+e:"",u=t?`styles.blocks.${t}${c}`:`styles${c}`;let d,p;switch(n){case"all":d=_e(r,u),p=o?Ti(r,t,d):d;break;case"user":d=_e(s,u),p=o?Ti(r,t,d):d;break;case"base":d=_e(i,u),p=o?Ti(i,t,d):d;break;default:throw"Unsupported source"}return[p,n=>{l((i=>ve(i,u.split("."),o?function(e,t,n,o){if(!o)return o;const r=Ii[n],i=Bi.find((e=>e.cssVarInfix===r));if(!i)return o;const{valueKey:s,path:l}=i,a=Ei(e,t,l,s,o);return a?`var:preset|${r}|${a.slug}`:o}(r.settings,t,e,n):n)))}]}function Vi(e,t,n){const{supportedStyles:o,supports:r}=(0,c.useSelect)((e=>({supportedStyles:te(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})})),["backgroundImage","backgroundSize"].forEach((e=>{o.includes(e)||(t.background={...t.background,[e]:!1})})),t.shadow=!!o.includes("shadow")&&t.shadow,n&&(t.typography.textAlign=!1),t}),[e,o,r,n])}function Fi(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 Hi(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 Gi(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=Gi(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}const $i=function(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Gi(e))&&(o&&(o+=" "),o+=t);return o},Ui=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,Ui(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function Wi(e,t,n,o,r,i){if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===i.length&&n.innerBlocks.length===o.length)return n;let s=o[0]?.attributes;if(i.length>1&&o.length>1){if(!o[r])return n;s=o[r]?.attributes}let l=n;return Object.entries(e).forEach((([e,n])=>{n&&t[e].forEach((e=>{const t=_e(s,e);t&&(l={...l,attributes:ve(l.attributes,e,t)})}))})),l}function Ki(e,t,n){const o=(0,l.getBlockSupport)(e,t),r=o?.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}const Zi=new WeakMap;function qi({id:e,css:t}){return Yi({id:e,css:t})}function Yi({id:e,css:t,assets:n,__unstableType:o,variation:r,clientId:i}={}){const{setStyleOverride:s,deleteStyleOverride:l}=te((0,c.useDispatch)(oi)),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:i};return Zi.get(u)||Zi.set(u,[]),Zi.get(u).push([a,c]),window.queueMicrotask((()=>{Zi.get(u)?.length&&u.batch((()=>{Zi.get(u).forEach((e=>{s(...e)})),Zi.set(u,[])}))})),()=>{const e=Zi.get(u)?.find((([e])=>e===a));e?Zi.set(u,Zi.get(u).filter((([e])=>e!==a))):l(a)}}),[e,t,i,n,o,d,s,l,u])}function Xi(e,t){const[n,o,r,i,s,l,c,u,d,p,h,g,m,f,b,k,v,_,x,y,S,w,C,B,I,j,E,T,M,P,R,N,L,A,D,O,z,V,F,H,G,$,U,W,K,Z,q,Y,X,Q,J,ee,te,ne,oe,re]=ii("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 Vi((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:U,theme:W,default:K},defaultGradients:X,defaultPalette:G,defaultDuotone:$,custom:O,customGradient:Q,customDuotone:V,background:J,link:ee,heading:ne,button:oe,text:te},typography:{fontFamilies:{custom:r,default:i,theme:s},fontSizes:{custom:c,default:u,theme:d},customFontSize:p,defaultFontSizes:l,fontStyle:h,fontWeight:g,lineHeight:m,textAlign:f,textColumns:b,textDecoration:k,textTransform:_,letterSpacing:x,writingMode:v},spacing:{spacingSizes:{custom:I,default:j,theme:E},customSpacingSize:B,defaultSpacingSizes:C,padding:y,margin:S,blockGap:w,units:T},border:{color:N,radius:L,style:A,width:D},dimensions:{aspectRatio:M,minHeight:P},layout:R,parentLayout:t,shadow:re})),[n,o,r,i,s,l,c,u,d,p,h,g,m,f,b,k,_,x,v,y,S,w,C,B,I,j,E,T,M,P,R,t,N,L,A,D,O,z,V,F,H,G,$,U,W,K,Z,q,Y,X,Q,J,ee,te,ne,oe,re]),e)}const Qi=(0,a.memo)((function({index:e,useBlockProps:t,setAllWrapperProps:n,...o}){const r=t(o),i=t=>n((n=>{const o=[...n];return o[e]=t,o}));return(0,a.useEffect)((()=>(i(r),()=>{i(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 Ji=window.wp.components,es={default:(0,Ji.createSlotFill)("BlockControls"),block:(0,Ji.createSlotFill)("BlockControlsBlock"),inline:(0,Ji.createSlotFill)("BlockFormatControls"),other:(0,Ji.createSlotFill)("BlockControlsOther"),parent:(0,Ji.createSlotFill)("BlockControlsParent")};function ts({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const r=function(e,t){const n=_();return n[p]?es[e]?.Fill:n[h]&&t?es.parent.Fill:null}(e,o);if(!r)return null;const i=(0,$.jsxs)($.Fragment,{children:["default"===e&&(0,$.jsx)(Ji.ToolbarGroup,{controls:t}),n]});return(0,$.jsx)(Ji.__experimentalStyleProvider,{document,children:(0,$.jsx)(r,{children:e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,$.jsx)(t,{...n,children:e})),i)}})})}window.wp.warning;const{ComponentsContext:ns}=te(Ji.privateApis);function os({group:e="default",...t}){const n=(0,a.useContext)(Ji.__experimentalToolbarContext),o=(0,a.useContext)(ns),r=(0,a.useMemo)((()=>({forwardedContext:[[Ji.__experimentalToolbarContext.Provider,{value:n}],[ns.Provider,{value:o}]]})),[n,o]),i=es[e]?.Slot,s=(0,Ji.__experimentalUseSlotFills)(i?.__unstableName);if(!i)return null;if(!s?.length)return null;const l=(0,$.jsx)(i,{...t,bubblesVirtually:!0,fillProps:r});return"default"===e?l:(0,$.jsx)(Ji.ToolbarGroup,{children:l})}const rs=ts;rs.Slot=os;const is=e=>(0,$.jsx)(ts,{group:"inline",...e});is.Slot=e=>(0,$.jsx)(os,{group:"inline",...e});const ss=rs,ls=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})}),as=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})}),cs=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})}),us=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})}),ds=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"})}),ps=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),hs=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),gs={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 ms(e,t=""){return e.split(",").map((e=>`${e}${t?` ${t}`:""}`)).join(",")}function fs(e,t=gs,n,o){let r="";return t?.[n]?.spacingStyles?.length&&o&&t[n].spacingStyles.forEach((t=>{r+=`${ms(e,t.selector.trim())} { `,r+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||o}`)).join("; "),r+="; }"})),r}function bs(e){const{contentSize:t,wideSize:n,type:o="default"}=e,r={},i=/^(?!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 i.test(t)&&"constrained"===o&&(r.none=(0,C.sprintf)((0,C.__)("Max %s wide"),t)),i.test(n)&&(r.wide=(0,C.sprintf)((0,C.__)("Max %s wide"),n)),r}const ks=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),vs=(0,$.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,$.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,$.jsx)(G.Path,{d:"m4.5 7.5v9h1.5v-9z"}),(0,$.jsx)(G.Path,{d:"m18 7.5v9h1.5v-9z"})]}),_s=(0,$.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,$.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,$.jsx)(G.Path,{d:"m7.5 6h9v-1.5h-9z"}),(0,$.jsx)(G.Path,{d:"m7.5 19.5h9v-1.5h-9z"})]}),xs=(0,$.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,$.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,$.jsx)(G.Path,{d:"m16.5 6h-9v-1.5h9z"})]}),ys=(0,$.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,$.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,$.jsx)(G.Path,{d:"m18 16.5v-9h1.5v9z"})]}),Ss=(0,$.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,$.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,$.jsx)(G.Path,{d:"m16.5 19.5h-9v-1.5h9z"})]}),ws=(0,$.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,$.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,$.jsx)(G.Path,{d:"m4.5 16.5v-9h1.5v9z"})]}),Cs=8,Bs=["top","right","bottom","left"],Is={top:void 0,right:void 0,bottom:void 0,left:void 0},js={custom:ks,axial:ks,horizontal:vs,vertical:_s,top:xs,right:ys,bottom:Ss,left:ws},Es={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")},Ts={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function Ms(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}function Ps(e,t){if(!Ms(e))return e;const n=Ls(e),o=t.find((e=>String(e.slug)===n));return o?.size}function Rs(e,t){if(!e||Ms(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 Ns(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function Ls(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 As(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 Ds(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=Ns(n?.top)||t,r=Ns(n?.left)||t;return o===r?o:`${o} ${r}`}const Os=(0,$.jsx)(Ji.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(Ji.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})}),zs=(0,$.jsx)(Ji.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(Ji.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})}),Vs=(0,$.jsx)(Ji.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(Ji.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})}),Fs=(0,$.jsx)(Ji.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(Ji.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})}),Hs=(0,$.jsx)(Ji.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(Ji.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})}),Gs={top:{icon:Vs,title:(0,C._x)("Align top","Block vertical alignment setting")},center:{icon:zs,title:(0,C._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Os,title:(0,C._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:Fs,title:(0,C._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:Hs,title:(0,C._x)("Space between","Block vertical alignment setting")}},$s=["top","center","bottom"];const Us=function({value:e,onChange:t,controls:n=$s,isCollapsed:o=!0,isToolbar:r}){function i(n){return()=>t(e===n?void 0:n)}const s=Gs[e],l=Gs.top,a=r?Ji.ToolbarGroup:Ji.ToolbarDropdownMenu,c=r?{isCollapsed:o}:{};return(0,$.jsx)(a,{icon:s?s.icon:l.icon,label:(0,C._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((t=>({...Gs[t],isActive:e===t,role:o?"menuitemradio":void 0,onClick:i(t)}))),...c})},Ws=e=>(0,$.jsx)(Us,{...e,isToolbar:!1}),Ks=e=>(0,$.jsx)(Us,{...e,isToolbar:!0}),Zs={left:ls,center:as,right:cs,"space-between":us,stretch:ds};const qs=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:r,isToolbar:i}){const s=e=>{n(e===o?void 0:e)},l=o?Zs[o]:Zs.left,a=[{name:"left",icon:ls,title:(0,C.__)("Justify items left"),isActive:"left"===o,onClick:()=>s("left")},{name:"center",icon:as,title:(0,C.__)("Justify items center"),isActive:"center"===o,onClick:()=>s("center")},{name:"right",icon:cs,title:(0,C.__)("Justify items right"),isActive:"right"===o,onClick:()=>s("right")},{name:"space-between",icon:us,title:(0,C.__)("Space between items"),isActive:"space-between"===o,onClick:()=>s("space-between")},{name:"stretch",icon:ds,title:(0,C.__)("Stretch items"),isActive:"stretch"===o,onClick:()=>s("stretch")}],c=i?Ji.ToolbarGroup:Ji.ToolbarDropdownMenu,u=i?{isCollapsed:t}:{};return(0,$.jsx)(c,{icon:l,popoverProps:r,label:(0,C.__)("Change items justification"),controls:a.filter((t=>e.includes(t.name))),...u})},Ys=e=>(0,$.jsx)(qs,{...e,isToolbar:!1}),Xs=e=>(0,$.jsx)(qs,{...e,isToolbar:!0}),Qs={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Js={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},el={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},tl=["wrap","nowrap"],nl={name:"flex",label:(0,C.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:o=!0}=n;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Ji.Flex,{children:[(0,$.jsx)(Ji.FlexItem,{children:(0,$.jsx)(il,{layout:e,onChange:t})}),(0,$.jsx)(Ji.FlexItem,{children:o&&(0,$.jsx)(ll,{layout:e,onChange:t})})]}),(0,$.jsx)(sl,{layout:e,onChange:t})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){if(n?.allowSwitching)return null;const{allowVerticalAlignment:o=!0}=n;return(0,$.jsxs)(ss,{group:"block",__experimentalShareWithChildBlocks:!0,children:[(0,$.jsx)(il,{layout:e,onChange:t,isToolbar:!0}),o&&(0,$.jsx)(ol,{layout:e,onChange:t,isToolbar:!0})]})},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:i=gs}){const{orientation:s="horizontal"}=t,l=n?.spacing?.blockGap&&!Ki(o,"spacing","blockGap")?Ds(n?.spacing?.blockGap,"0.5em"):void 0,a=Qs[t.justifyContent],c=tl.includes(t.flexWrap)?t.flexWrap:"wrap",u=el[t.verticalAlignment],d=Js[t.justifyContent]||Js.left;let p="";const h=[];return c&&"wrap"!==c&&h.push(`flex-wrap: ${c}`),"horizontal"===s?(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=`${ms(e)} {\n\t\t\t\t${h.join("; ")};\n\t\t\t}`),r&&l&&(p+=fs(e,i,"flex",l)),p},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function ol({layout:e,onChange:t,isToolbar:n=!1}){const{orientation:o="horizontal"}=e,r="horizontal"===o?el.center:el.top,{verticalAlignment:i=r}=e,s=n=>{t({...e,verticalAlignment:n})};if(n)return(0,$.jsx)(Ws,{onChange:s,value:i,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,$.jsxs)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control",children:[(0,$.jsx)("legend",{children:(0,C.__)("Vertical alignment")}),(0,$.jsx)("div",{children:l.map(((e,t,n)=>(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,label:n,icon:t,isPressed:i===e,onClick:()=>s(e)},e)))})]})}const rl={placement:"bottom-start"};function il({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:o="left",orientation:r="horizontal"}=e,i=n=>{t({...e,justifyContent:n})},s=["left","center","right"];if("horizontal"===r?s.push("space-between"):s.push("stretch"),n)return(0,$.jsx)(Ys,{allowedControls:s,value:o,onChange:i,popoverProps:rl});const l=[{value:"left",icon:ls,label:(0,C.__)("Justify items left")},{value:"center",icon:as,label:(0,C.__)("Justify items center")},{value:"right",icon:cs,label:(0,C.__)("Justify items right")}];return"horizontal"===r?l.push({value:"space-between",icon:us,label:(0,C.__)("Space between items")}):l.push({value:"stretch",icon:ds,label:(0,C.__)("Stretch items")}),(0,$.jsx)(Ji.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,C.__)("Justification"),value:o,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls",children:l.map((({value:e,icon:t,label:n})=>(0,$.jsx)(Ji.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:n},e)))})}function sl({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,$.jsx)(Ji.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function ll({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:o,justifyContent:r}=e;return(0,$.jsxs)(Ji.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,C.__)("Orientation"),value:n,onChange:n=>{let i=o,s=r;return"horizontal"===n?("space-between"===o&&(i="center"),"stretch"===r&&(s="left")):("stretch"===o&&(i="top"),"space-between"===r&&(s="left")),t({...e,orientation:n,verticalAlignment:i,justifyContent:s})},children:[(0,$.jsx)(Ji.__experimentalToggleGroupControlOptionIcon,{icon:ps,value:"horizontal",label:(0,C.__)("Horizontal")}),(0,$.jsx)(Ji.__experimentalToggleGroupControlOptionIcon,{icon:hs,value:"vertical",label:(0,C.__)("Vertical")})]})}const al={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=gs}){const i=Ds(t?.spacing?.blockGap);let s="";Ki(n,"spacing","blockGap")||(i?.top?s=Ds(i?.top):"string"==typeof i&&(s=Ds(i)));let l="";return o&&s&&(l+=fs(e,r,"default",s)),l},getOrientation:()=>"vertical",getAlignments(e,t){const n=bs(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 cl=(0,a.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,a.cloneElement)(e,{width:t,height:t,...n,ref:o})})),ul=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"})}),dl=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z"})}),pl={name:"constrained",label:(0,C.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:o,contentSize:r,justifyContent:i="center"}=e,{allowJustification:s=!0,allowCustomContentAndWideSize:l=!0}=n,a=[{value:"left",icon:ls,label:(0,C.__)("Justify items left")},{value:"center",icon:as,label:(0,C.__)("Justify items center")},{value:"right",icon:cs,label:(0,C.__)("Justify items right")}],[c]=ii("spacing.units"),u=(0,Ji.__experimentalUseCustomUnits)({availableUnits:c||["%","px","em","rem","vw"]});return(0,$.jsxs)(Ji.__experimentalVStack,{spacing:4,className:"block-editor-hooks__layout-constrained",children:[l&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,C.__)("Content width"),labelPosition:"top",value:r||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:u,prefix:(0,$.jsx)(Ji.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,$.jsx)(cl,{icon:ul})})}),(0,$.jsx)(Ji.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,C.__)("Wide width"),labelPosition:"top",value:o||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:u,prefix:(0,$.jsx)(Ji.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,$.jsx)(cl,{icon:dl})})}),(0,$.jsx)("p",{className:"block-editor-hooks__layout-constrained-helptext",children:(0,C.__)("Customize the width for all elements that are assigned to the center or wide columns.")})]}),s&&(0,$.jsx)(Ji.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,C.__)("Justification"),value:i,onChange:n=>{t({...e,justifyContent:n})},children:a.map((({value:e,icon:t,label:n})=>(0,$.jsx)(Ji.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:n},e)))})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){const{allowJustification:o=!0}=n;return o?(0,$.jsx)(ss,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,$.jsx)(gl,{layout:e,onChange:t})}):null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:i=gs}){const{contentSize:s,wideSize:l,justifyContent:a}=t,c=Ds(n?.spacing?.blockGap);let u="";Ki(o,"spacing","blockGap")||(c?.top?u=Ds(c?.top):"string"==typeof c&&(u=Ds(c)));const d="left"===a?"0 !important":"auto !important",p="right"===a?"0 !important":"auto !important";let h=s||l?`\n\t\t\t\t\t${ms(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=s?s: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${ms(e,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=l?l:s};\n\t\t\t\t\t}\n\t\t\t\t\t${ms(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+=`${ms(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===a&&(h+=`${ms(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${p}; }`),n?.spacing?.padding){(0,li.getCSSRules)(n).forEach((t=>{if("paddingRight"===t.key){const n="0"===t.value?"0px":t.value;h+=`\n\t\t\t\t\t${ms(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${ms(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+=fs(e,i,"constrained",u)),h},getOrientation:()=>"vertical",getAlignments(e){const t=bs(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}},hl={placement:"bottom-start"};function gl({layout:e,onChange:t}){const{justifyContent:n="center"}=e;return(0,$.jsx)(Ys,{allowedControls:["left","center","right"],value:n,onChange:n=>{t({...e,justifyContent:n})},popoverProps:hl})}const ml={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},fl=[{value:"px",label:"px",default:0},{value:"rem",label:"rem",default:0},{value:"em",label:"em",default:0}],bl={name:"grid",label:(0,C.__)("Grid"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowSizingOnChildren:o=!1}=n,r=window.__experimentalEnableGridInteractivity||!!e?.columnCount,i=window.__experimentalEnableGridInteractivity||!e?.columnCount;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_l,{layout:e,onChange:t}),(0,$.jsxs)(Ji.__experimentalVStack,{spacing:4,children:[r&&(0,$.jsx)(vl,{layout:e,onChange:t,allowSizingOnChildren:o}),i&&(0,$.jsx)(kl,{layout:e,onChange:t})]})]})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:i=gs}){const{minimumColumnWidth:s=null,columnCount:l=null,rowCount:a=null}=t;const c=n?.spacing?.blockGap&&!Ki(o,"spacing","blockGap")?Ds(n?.spacing?.blockGap,"0.5em"):void 0;let u="";const d=[];if(s&&l>0){const e=`max(${s}, ( 100% - (${c||"1.2rem"}*${l-1}) ) / ${l})`;d.push(`grid-template-columns: repeat(auto-fill, minmax(${e}, 1fr))`,"container-type: inline-size"),a&&d.push(`grid-template-rows: repeat(${a}, minmax(1rem, auto))`)}else l?(d.push(`grid-template-columns: repeat(${l}, minmax(0, 1fr))`),a&&d.push(`grid-template-rows: repeat(${a}, minmax(1rem, auto))`)):d.push(`grid-template-columns: repeat(auto-fill, minmax(min(${s||"12rem"}, 100%), 1fr))`,"container-type: inline-size");return d.length&&(u=`${ms(e)} { ${d.join("; ")}; }`),r&&c&&(u+=fs(e,i,"grid",c)),u},getOrientation:()=>"horizontal",getAlignments:()=>[]};function kl({layout:e,onChange:t}){const{minimumColumnWidth:n,columnCount:o,isManualPlacement:r}=e,i=n||(r||o?null:"12rem"),[s,l="rem"]=(0,Ji.__experimentalParseQuantityAndUnitFromRawValue)(i);return(0,$.jsxs)("fieldset",{children:[(0,$.jsx)(Ji.BaseControl.VisualLabel,{as:"legend",children:(0,C.__)("Minimum column width")}),(0,$.jsxs)(Ji.Flex,{gap:4,children:[(0,$.jsx)(Ji.FlexItem,{isBlock:!0,children:(0,$.jsx)(Ji.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:""===n?void 0:n})},onUnitChange:n=>{let o;["em","rem"].includes(n)&&"px"===l?o=(s/16).toFixed(2)+n:["em","rem"].includes(l)&&"px"===n&&(o=Math.round(16*s)+n),t({...e,minimumColumnWidth:o})},value:i,units:fl,min:0,label:(0,C.__)("Minimum column width"),hideLabelFromVision:!0})}),(0,$.jsx)(Ji.FlexItem,{isBlock:!0,children:(0,$.jsx)(Ji.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:n=>{t({...e,minimumColumnWidth:[n,l].join("")})},value:s||0,min:0,max:ml[l]||600,withInputField:!1,label:(0,C.__)("Minimum column width"),hideLabelFromVision:!0})})]})]})}function vl({layout:e,onChange:t,allowSizingOnChildren:n}){const o=window.__experimentalEnableGridInteractivity?void 0:3,{columnCount:r=o,rowCount:i,isManualPlacement:s}=e;return(0,$.jsx)($.Fragment,{children:(0,$.jsxs)("fieldset",{children:[(!window.__experimentalEnableGridInteractivity||!s)&&(0,$.jsx)(Ji.BaseControl.VisualLabel,{as:"legend",children:(0,C.__)("Columns")}),(0,$.jsxs)(Ji.Flex,{gap:4,children:[(0,$.jsx)(Ji.FlexItem,{isBlock:!0,children:(0,$.jsx)(Ji.__experimentalNumberControl,{size:"__unstable-large",onChange:n=>{if(window.__experimentalEnableGridInteractivity){const o=""===n||"0"===n?s?1:void 0:parseInt(n,10);t({...e,columnCount:o})}else{const o=""===n||"0"===n?1:parseInt(n,10);t({...e,columnCount:o})}},value:r,min:1,label:(0,C.__)("Columns"),hideLabelFromVision:!window.__experimentalEnableGridInteractivity||!s})}),(0,$.jsx)(Ji.FlexItem,{isBlock:!0,children:window.__experimentalEnableGridInteractivity&&n&&s?(0,$.jsx)(Ji.__experimentalNumberControl,{size:"__unstable-large",onChange:n=>{const o=""===n||"0"===n?1:parseInt(n,10);t({...e,rowCount:o})},value:i,min:1,label:(0,C.__)("Rows")}):(0,$.jsx)(Ji.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:null!=r?r:1,onChange:n=>t({...e,columnCount:""===n||"0"===n?1:n}),min:1,max:16,withInputField:!1,label:(0,C.__)("Columns"),hideLabelFromVision:!0})})]})]})})}function _l({layout:e,onChange:t}){const{columnCount:n,rowCount:o,minimumColumnWidth:r,isManualPlacement:i}=e,[s,l]=(0,a.useState)(n||3),[c,u]=(0,a.useState)(o),[d,p]=(0,a.useState)(r||"12rem"),h=i||n&&!window.__experimentalEnableGridInteractivity?"manual":"auto",g="manual"===h?(0,C.__)("Grid items can be manually placed in any position on the grid."):(0,C.__)("Grid items are placed automatically depending on their order.");return(0,$.jsxs)(Ji.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,C.__)("Grid item position"),value:h,onChange:i=>{"manual"===i?p(r||"12rem"):(l(n||3),u(o)),t({...e,columnCount:"manual"===i?s:null,rowCount:"manual"===i&&window.__experimentalEnableGridInteractivity?c:void 0,isManualPlacement:!("manual"!==i||!window.__experimentalEnableGridInteractivity)||void 0,minimumColumnWidth:"auto"===i?d:null})},isBlock:!0,help:window.__experimentalEnableGridInteractivity?g:void 0,children:[(0,$.jsx)(Ji.__experimentalToggleGroupControlOption,{value:"auto",label:(0,C.__)("Auto")},"auto"),(0,$.jsx)(Ji.__experimentalToggleGroupControlOption,{value:"manual",label:(0,C.__)("Manual")},"manual")]})}const xl=[al,nl,pl,bl];function yl(e="default"){return xl.find((t=>t.name===e))}const Sl={type:"default"},wl=(0,a.createContext)(Sl),Cl=wl.Provider;function Bl(){return(0,a.useContext)(wl)}const Il=[],jl=["none","left","center","right","wide","full"],El=["wide","full"];function Tl(e=jl){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(oi).getSettings();return[null!==(n=o.alignWide)&&void 0!==n&&n,o.supportsLayout,o.__unstableIsBlockBasedTheme]}),[t]),i=Bl();if(t)return Il;const s=yl(i?.type);if(o){const t=s.getAlignments(i,r).filter((t=>e.includes(t.name)));return 1===t.length&&"none"===t[0].name?Il:t}if("default"!==s.name&&"constrained"!==s.name)return Il;const l=e.filter((e=>i.alignments?i.alignments.includes(e):!(!n&&El.includes(e))&&jl.includes(e))).map((e=>({name:e})));return 1===l.length&&"none"===l[0].name?Il:l}const Ml=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"})}),Pl=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"})}),Rl=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z"})}),Nl=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z"})}),Ll={none:{icon:ul,title:(0,C._x)("None","Alignment option")},left:{icon:Ml,title:(0,C.__)("Align left")},center:{icon:Pl,title:(0,C.__)("Align center")},right:{icon:Rl,title:(0,C.__)("Align right")},wide:{icon:dl,title:(0,C.__)("Wide width")},full:{icon:Nl,title:(0,C.__)("Full width")}};const Al=function({value:e,onChange:t,controls:n,isToolbar:o,isCollapsed:r=!0}){const i=Tl(n);if(!!!i.length)return null;function s(n){t([e,"none"].includes(n)?void 0:n)}const l=Ll[e],a=Ll.none,c=o?Ji.ToolbarGroup:Ji.ToolbarDropdownMenu,u={icon:l?l.icon:a.icon,label:(0,C.__)("Align")},d=o?{isCollapsed:r,controls:i.map((({name:t})=>({...Ll[t],isActive:e===t||!e&&"none"===t,role:r?"menuitemradio":void 0,onClick:()=>s(t)})))}:{toggleProps:{description:(0,C.__)("Change alignment")},children:({onClose:t})=>(0,$.jsx)($.Fragment,{children:(0,$.jsx)(Ji.MenuGroup,{className:"block-editor-block-alignment-control__menu-group",children:i.map((({name:n,info:o})=>{const{icon:r,title:i}=Ll[n],l=n===e||!e&&"none"===n;return(0,$.jsx)(Ji.MenuItem,{icon:r,iconPosition:"left",className:$i("components-dropdown-menu__menu-item",{"is-active":l}),isSelected:l,onClick:()=>{s(n),t()},role:"menuitemradio",info:o,children:i},n)}))})})};return(0,$.jsx)(c,{...u,...d})},Dl=e=>(0,$.jsx)(Al,{...e,isToolbar:!1}),Ol=e=>(0,$.jsx)(Al,{...e,isToolbar:!0});function zl(e){const t=_(),{clientId:n=""}=t,{setBlockEditingMode:o,unsetBlockEditingMode:r}=(0,c.useDispatch)(oi),i=(0,c.useSelect)((e=>n?null:e(oi).getBlockEditingMode()),[n]);return(0,a.useEffect)((()=>(e&&o(n,e),()=>{e&&r(n)})),[n,e,o,r]),n?t[g]:i}const Vl=["left","center","right","wide","full"],Fl=["wide","full"];function Hl(e,t=!0,n=!0){let o;return o=Array.isArray(e)?Vl.filter((t=>e.includes(t))):!0===e?[...Vl]:[],!n||!0===e&&!t?o.filter((e=>!Fl.includes(e))):o}const Gl={shareWithChildBlocks:!0,edit:function({name:e,align:t,setAttributes:n}){const o=Tl(Hl((0,l.getBlockSupport)(e,"align"),(0,l.hasBlockSupport)(e,"alignWide",!0))).map((({name:e})=>e)),r=zl();return o.length&&"default"===r?(0,$.jsx)(ss,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,$.jsx)(Dl,{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=Hl((0,l.getBlockSupport)(e,"align"),(0,l.hasBlockSupport)(e,"alignWide",!0));if(Tl(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"),i=(0,l.hasBlockSupport)(t,"alignWide",!0),s=Hl(r,i).includes(o);s&&(e.className=$i(`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:[...Vl,""]}}),e}));const $l=(0,Ji.createSlotFill)("InspectorControls"),Ul=(0,Ji.createSlotFill)("InspectorAdvancedControls"),Wl=(0,Ji.createSlotFill)("InspectorControlsBindings"),Kl=(0,Ji.createSlotFill)("InspectorControlsBackground"),Zl=(0,Ji.createSlotFill)("InspectorControlsBorder"),ql=(0,Ji.createSlotFill)("InspectorControlsColor"),Yl=(0,Ji.createSlotFill)("InspectorControlsFilter"),Xl=(0,Ji.createSlotFill)("InspectorControlsDimensions"),Ql=(0,Ji.createSlotFill)("InspectorControlsPosition"),Jl=(0,Ji.createSlotFill)("InspectorControlsTypography"),ea=(0,Ji.createSlotFill)("InspectorControlsListView"),ta=(0,Ji.createSlotFill)("InspectorControlsStyles"),na={default:$l,advanced:Ul,background:Kl,bindings:Wl,border:Zl,color:ql,dimensions:Xl,effects:(0,Ji.createSlotFill)("InspectorControlsEffects"),filter:Yl,list:ea,position:Ql,settings:$l,styles:ta,typography:Jl};function oa({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=_(),i=na[t]?.Fill;return i&&r[p]?(0,$.jsx)(Ji.__experimentalStyleProvider,{document,children:(0,$.jsx)(i,{children:t=>(0,$.jsx)(ia,{fillProps:t,children:e,resetAllFilter:o})})}):null}function ra({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:o}=(0,a.useContext)(Ji.__experimentalToolsPanelContext);return(0,a.useEffect)((()=>{if(e&&n&&o)return n(e),()=>{o(e)}}),[e,n,o]),t}function ia({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:o=[]}=n,r=(0,$.jsx)(ra,{resetAllFilter:t,children:e});return o.reduce(((e,[t,n])=>(0,$.jsx)(t,{...n,children:e})),r)}function sa({children:e,group:t,label:n}){const{updateBlockAttributes:o}=(0,c.useDispatch)(oi),{getBlockAttributes:r,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:l}=(0,c.useSelect)(oi),u=ji(),d=s(),p=(0,a.useCallback)(((e=[])=>{const t={},n=l()?i():[d];n.forEach((n=>{const{style:o}=r(n);let i={style:o};e.forEach((e=>{i={...i,...e(i)}})),i={...i,style:Ui(i.style)},t[n]=i})),o(n,t,!0)}),[r,i,l,d,o]);return(0,$.jsx)(Ji.__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 la({Slot:e,fillProps:t,...n}){const o=(0,a.useContext)(Ji.__experimentalToolsPanelContext),r=(0,a.useMemo)((()=>{var e;return{...null!=t?t:{},forwardedContext:[...null!==(e=t?.forwardedContext)&&void 0!==e?e:[],[Ji.__experimentalToolsPanelContext.Provider,{value:o}]]}}),[o,t]);return(0,$.jsx)(e,{...n,fillProps:r,bubblesVirtually:!0})}function aa({__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 i=na[t]?.Slot,s=(0,Ji.__experimentalUseSlotFills)(i?.__unstableName),l=(0,a.useContext)(Ji.__unstableMotionContext),c=(0,a.useMemo)((()=>{var e;return{...null!=o?o:{},forwardedContext:[...null!==(e=o?.forwardedContext)&&void 0!==e?e:[],[Ji.__unstableMotionContext.Provider,{value:l}]]}}),[l,o]);return i&&s?.length?n?(0,$.jsx)(sa,{group:t,label:n,children:(0,$.jsx)(la,{...r,fillProps:c,Slot:i})}):(0,$.jsx)(i,{...r,fillProps:c,bubblesVirtually:!0}):null}const ca=oa;ca.Slot=aa;const ua=e=>(0,$.jsx)(oa,{...e,group:"advanced"});ua.Slot=e=>(0,$.jsx)(aa,{...e,group:"advanced"}),ua.slotName="InspectorAdvancedControls";const da=ca,pa=window.wp.url,ha=window.wp.dom,ga=window.wp.blob,ma=window.wp.keycodes,fa=(0,$.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,$.jsx)(G.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,$.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"})]}),ba=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),ka=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),va=(0,Ji.withFilters)("editor.MediaUpload")((()=>null));const _a=function({fallback:e=null,children:t}){const n=(0,c.useSelect)((e=>{const{getSettings:t}=e(oi);return!!t().mediaUpload}),[]);return n?t:e},xa=window.wp.isShallowEqual;var ya=n.n(xa);const Sa=window.wp.preferences,wa=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",children:(0,$.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"})}),Ca=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),Ba=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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 Ia=function e({children:t,settingsOpen:n,setSettingsOpen:o}){const r=(0,u.useReducedMotion)(),i=r?a.Fragment:Ji.__unstableAnimatePresence,s=r?"div":Ji.__unstableMotion.div,l=`link-control-settings-drawer-${(0,u.useInstanceId)(e)}`;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>o(!n),icon:(0,C.isRTL)()?Ca:Ba,"aria-controls":l,children:(0,C._x)("Advanced","Additional link settings")}),(0,$.jsx)(i,{children:n&&(0,$.jsx)(s,{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,$.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:t})})})]})};var ja=n(1609);function Ea(e){return"function"==typeof e}class Ta 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,pa.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)}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 ma.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case ma.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case ma.ENTER:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case ma.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case ma.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case ma.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(i),this.props.speak((0,C.__)("Link selected.")));break;case ma.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,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 i=r;const s=e&&e.length;return o||s||(i=!1),!0===n&&(i=!1),{showSuggestions:i,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,$.jsxs)($.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){const{label:e=null,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,C.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:s="",hideLabelFromVision:l=!1}=this.props,{loading:a,showSuggestions:c,selectedSuggestion:u,suggestionsListboxId:d,suggestionOptionIdPrefix:p}=this.state,h=`url-input-control-${o}`,g={id:h,label:e,className:$i("block-editor-url-input",t,{"is-full-width":n}),hideLabelFromVision:l},m={id:h,value:s,required:!0,type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:r,onKeyDown:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,C.__)("URL"),"aria-expanded":c,"aria-autocomplete":"list","aria-owns":d,"aria-activedescendant":null!==u?`${p}-${u}`:void 0,ref:this.inputRef,suffix:this.props.suffix};return i?i(g,m,a):(0,$.jsxs)(Ji.BaseControl,{__nextHasNoMarginBottom:!0,...g,children:[(0,$.jsx)(Ji.__experimentalInputControl,{...m,__next40pxDefaultSize:!0}),a&&(0,$.jsx)(Ji.Spinner,{})]})}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:o,suggestionsValue:r,selectedSuggestion:i,suggestionsListboxId:s,suggestionOptionIdPrefix:l,loading:a}=this.state;if(!n||0===o.length)return null;const c={id:s,ref:this.autocompleteRef,role:"listbox"},u=(e,t)=>({role:"option",tabIndex:"-1",id:`${l}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===i||void 0});return Ea(t)?t({suggestions:o,selectedSuggestion:i,suggestionsListProps:c,buildSuggestionItemProps:u,isLoading:a,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!r?.length,currentInputValue:r}):(0,$.jsx)(Ji.Popover,{placement:"bottom",focusOnMount:!1,children:(0,$.jsx)("div",{...c,className:$i("block-editor-url-input__suggestions",`${e}__suggestions`),children:o.map(((e,t)=>(0,ja.createElement)(Ji.Button,{__next40pxDefaultSize:!1,...u(0,t),key:e.id,className:$i("block-editor-url-input__suggestion",{"is-selected":t===i}),onClick:()=>this.handleOnClick(e)},e.title)))})})}}const Ma=(0,u.compose)(u.withSafeTimeout,Ji.withSpokenMessages,u.withInstanceId,(0,c.withSelect)(((e,t)=>{if(Ea(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(oi);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(Ta),Pa=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),Ra=({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,$.jsx)("mark",{})}),(0,$.jsx)(Ji.MenuItem,{...n,iconPosition:"left",icon:Pa,className:"block-editor-link-control__search-item",onClick:t,children:r})},Na=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.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"})}),La=(0,$.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,$.jsx)(G.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,$.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"})]}),Aa=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),Da=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.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"})}),Oa=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.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"})}),za=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),Va=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}),Fa=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.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"})}),Ha={post:Na,page:La,post_tag:Aa,category:Da,attachment:Oa};function Ga({isURL:e,suggestion:t}){let n=null;return e?n=za:t.type in Ha&&(n=Ha[t.type],"page"===t.type&&(t.isFrontPage&&(n=Va),t.isBlogHome&&(n=Fa))),n?(0,$.jsx)(cl,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function $a(e){const t=e?.trim();return t?.length?e?.replace(/^\/?/,"/"):e}function Ua(e){const t=e?.trim();return t?.length?e?.replace(/\/$/,""):e}function Wa(e){return e.isFrontPage?"front page":e.isBlogHome?"blog home":"post_tag"===e.type?"tag":e.type}const Ka=({itemProps:e,suggestion:t,searchTerm:n,onClick:o,isURL:r=!1,shouldShowType:i=!1})=>{const s=r?(0,C.__)("Press ENTER to add this link"):(l=t.url)?(0,u.pipe)(pa.safeDecodeURI,pa.getPath,(e=>t=>null==t||t!=t?e:t)(""),((e,...t)=>(...n)=>e(...n,...t))(pa.filterURLForDisplay,24),Ua,$a)(l):l;var l;return(0,$.jsx)(Ji.MenuItem,{...e,info:s,iconPosition:"left",icon:(0,$.jsx)(Ga,{suggestion:t,isURL:r}),onClick:o,shortcut:i&&Wa(t),className:"block-editor-link-control__search-item",children:(0,$.jsx)(Ji.TextHighlight,{text:(0,ha.__unstableStripHTML)(t.title),highlight:n})})},Za="__CREATE__",qa="link",Ya="mailto",Xa="internal",Qa=[qa,Ya,"tel",Xa],Ja=[{id:"opensInNewTab",title:(0,C.__)("Open in new tab")}];function ec({instanceId:e,withCreateSuggestion:t,currentInputValue:n,handleSuggestionClick:o,suggestionsListProps:r,buildSuggestionItemProps:i,suggestions:s,selectedSuggestion:l,isLoading:a,isInitialSuggestions:c,createSuggestionButtonText:u,suggestionsQuery:d}){const p=$i("block-editor-link-control__search-results",{"is-loading":a}),h=1===s.length&&Qa.includes(s[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),k=(0,$.jsx)(Ji.VisuallyHidden,{id:f,children:b});return(0,$.jsxs)("div",{className:"block-editor-link-control__search-results-wrapper",children:[k,(0,$.jsx)("div",{...r,className:p,"aria-labelledby":f,children:(0,$.jsx)(Ji.MenuGroup,{children:s.map(((e,t)=>g&&Za===e.type?(0,$.jsx)(Ra,{searchTerm:n,buttonText:u,onClick:()=>o(e),itemProps:i(e,t),isSelected:t===l},e.type):Za===e.type?null:(0,$.jsx)(Ka,{itemProps:i(e,t),suggestion:e,index:t,onClick:()=>{o(e)},isSelected:t===l,isURL:Qa.includes(e.type),searchTerm:n,shouldShowType:m,isFrontPage:e?.isFrontPage,isBlogHome:e?.isBlogHome},`${e.id}-${e.type}`)))})})]})}function tc(e){if(e.includes(" "))return!1;const t=(0,pa.getProtocol)(e),n=(0,pa.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."),i=e?.startsWith("#")&&(0,pa.isValidFragment)(e);return n||r||i||o}const nc=()=>Promise.resolve([]),oc=e=>{let t=qa;const n=(0,pa.getProtocol)(e)||"";return n.includes("mailto")&&(t=Ya),n.includes("tel")&&(t="tel"),e?.startsWith("#")&&(t=Xa),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,pa.prependHTTP)(e):e,type:t}])};function rc(e,t,n){const{fetchSearchSuggestions:o,pageOnFront:r,pageForPosts:i}=(0,c.useSelect)((e=>{const{getSettings:t}=e(oi);return{pageOnFront:t().pageOnFront,pageForPosts:t().pageForPosts,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),s=t?oc:nc;return(0,a.useCallback)(((t,{isInitialSuggestions:l})=>tc(t)?s(t,{isInitialSuggestions:l}):(async(e,t,n,o,r,i)=>{const{isInitialSuggestions:s}=t,l=await n(e,t);return l.map((e=>Number(e.id)===r?(e.isFrontPage=!0,e):Number(e.id)===i?(e.isBlogHome=!0,e):e)),s||tc(e)||!o?l:l.concat({title:e,url:e,type:Za})})(t,{...e,isInitialSuggestions:l},o,n,r,i)),[s,o,r,i,e,n])}const ic=()=>Promise.resolve([]),sc=()=>{},lc=(0,a.forwardRef)((({value:e,children:t,currentLink:n={},className:o=null,placeholder:r=null,withCreateSuggestion:i=!1,onCreateSuggestion:s=sc,onChange:l=sc,onSelect:c=sc,showSuggestions:d=!0,renderSuggestions:p=(e=>(0,$.jsx)(ec,{...e})),fetchSuggestions:h=null,allowDirectEntry:g=!0,showInitialSuggestions:m=!1,suggestionsQuery:f={},withURLSuggestion:b=!0,createSuggestionButtonText:k,hideLabelFromVision:v=!1,suffix:_},x)=>{const y=rc(f,g,i),S=d?h||y:ic,w=(0,u.useInstanceId)(lc),[B,I]=(0,a.useState)(),j=async e=>{let t=e;if(Za!==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 s(e.title),t?.url&&c(t)}catch(e){}};return(0,$.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,$.jsx)(Ma,{disableSuggestions:n?.url===e,label:(0,C.__)("Link"),hideLabelFromVision:v,className:o,value:e,onChange:(e,t)=>{l(e),I(t)},placeholder:null!=r?r:(0,C.__)("Search or type URL"),__experimentalRenderSuggestions:d?e=>p({...e,instanceId:w,withCreateSuggestion:i,createSuggestionButtonText:k,suggestionsQuery:f,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),j(t)}}):null,__experimentalFetchLinkSuggestions:S,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:m,onSubmit:(t,n)=>{const o=t||B;o||e?.trim()?.length?j(o||{url:e}):n.preventDefault()},ref:x,suffix:_}),t]})})),ac=lc,cc=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),uc=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),dc=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),pc=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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:hc,Fill:gc}=(0,Ji.createSlotFill)("BlockEditorLinkControlViewer");function mc(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 fc=function(e){const[t,n]=(0,a.useReducer)(mc,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,c.useSelect)((e=>{const{getSettings:t}=e(oi);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 bc({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:o=!1,onRemove:r}){const i=(0,c.useSelect)((e=>e(Sa.store).get("core","showIconLabels")),[]),s=n?e?.url:null,{richData:l,isFetching:a}=fc(s),d=l&&Object.keys(l).length,p=e&&(0,pa.filterURLForDisplay)((0,pa.safeDecodeURI)(e.url),24)||"",h=!e?.url?.length,g=!h&&(0,ha.__unstableStripHTML)(l?.title||e?.title||p),m=!e?.url||g.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i,"").replace(/^www\./i,"")===p;let f;f=l?.icon?(0,$.jsx)("img",{src:l?.icon,alt:""}):h?(0,$.jsx)(cl,{icon:cc,size:32}):(0,$.jsx)(cl,{icon:za});const{createNotice:b}=(0,c.useDispatch)(Fo.store),k=(0,u.useCopyToClipboard)(e.url,(()=>{b("info",(0,C.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,$.jsx)("div",{"aria-label":(0,C.__)("Currently selected"),className:$i("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,$.jsxs)("div",{className:"block-editor-link-control__search-item-top",children:[(0,$.jsxs)("span",{className:"block-editor-link-control__search-item-header",children:[(0,$.jsx)("span",{className:$i("block-editor-link-control__search-item-icon",{"is-image":l?.icon}),children:f}),(0,$.jsx)("span",{className:"block-editor-link-control__search-item-details",children:h?(0,$.jsx)("span",{className:"block-editor-link-control__search-item-error-notice",children:(0,C.__)("Link is empty")}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.ExternalLink,{className:"block-editor-link-control__search-item-title",href:e.url,children:(0,$.jsx)(Ji.__experimentalTruncate,{numberOfLines:1,children:g})}),!m&&(0,$.jsx)("span",{className:"block-editor-link-control__search-item-info",children:(0,$.jsx)(Ji.__experimentalTruncate,{numberOfLines:1,children:p})})]})})]}),(0,$.jsx)(Ji.Button,{icon:uc,label:(0,C.__)("Edit link"),onClick:t,size:"compact"}),o&&(0,$.jsx)(Ji.Button,{icon:dc,label:(0,C.__)("Remove link"),onClick:r,size:"compact"}),(0,$.jsx)(Ji.Button,{icon:pc,label:(0,C.sprintf)((0,C.__)("Copy link%s"),h||i?"":": "+e.url),ref:k,accessibleWhenDisabled:!0,disabled:h,size:"compact"}),(0,$.jsx)(hc,{fillProps:e})]})})}const kc=()=>{},vc=({value:e,onChange:t=kc,settings:n})=>{if(!n||!n.length)return null;const o=n=>o=>{t({...e,[n.id]:o})},r=n.map((t=>(0,$.jsx)(Ji.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,$.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,$.jsx)(Ji.VisuallyHidden,{as:"legend",children:(0,C.__)("Currently selected link settings")}),r]})};const _c=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 xc=n(5215),yc=n.n(xc);const Sc=()=>{},wc="core/block-editor",Cc="linkControlSettingsDrawer";function Bc({searchInputPlaceholder:e,value:t,settings:n=Ja,onChange:o=Sc,onRemove:r,onCancel:i,noDirectEntry:s=!1,showSuggestions:l=!0,showInitialSuggestions:u,forceIsEditingLink:d,createSuggestion:p,withCreateSuggestion:h,inputValue:g="",suggestionsQuery:m={},noURLSuggestion:f=!1,createSuggestionButtonText:b,hasRichPreviews:k=!1,hasTextControl:v=!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(Sa.store).get(wc,Cc))&&void 0!==t&&t}}),[]),{set:w}=(0,c.useDispatch)(Sa.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,L,A]=function(e){const[t,n]=(0,a.useState)(e||{}),[o,r]=(0,a.useState)(e);return yc()(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),D=t&&!(0,xa.isShallowEqualObjects)(P,t),[O,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,i]=(0,a.useState)(null);return(0,a.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),i(null);try{return t.current=_c(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw i(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;(ha.focus.focusable.find(j.current)[0]||j.current).focus(),T.current=!1}),[O,F]),(0,a.useEffect)((()=>(I.current=!1,()=>{I.current=!0})),[]);const G=t?.url?.trim()?.length>0,U=()=>{T.current=!!j.current?.contains(j.current.ownerDocument.activeElement),z(!1)},W=()=>{D&&o({...t,...P,url:K}),U()},K=g||P?.url||"",Z=!K?.trim()?.length,q=r&&t&&!O&&!F,Y=O&&G,X=G&&v,Q=(O||!t)&&!F,J=!D||Z,ee=!!n?.length&&O&&G;return(0,$.jsxs)("div",{tabIndex:-1,ref:j,className:"block-editor-link-control",children:[F&&(0,$.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,$.jsx)(Ji.Spinner,{})," ",(0,C.__)("Creating"),"…"]}),Q&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{className:$i({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":X,"has-actions":Y}),children:[X&&(0,$.jsx)(Ji.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:L,onKeyDown:e=>{const{keyCode:t}=e;t!==ma.ENTER||Z||(e.preventDefault(),W())},__next40pxDefaultSize:!0}),(0,$.jsx)(ac,{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}),U()},showInitialSuggestions:u,allowDirectEntry:!s,showSuggestions:l,suggestionsQuery:m,withURLSuggestion:!f,createSuggestionButtonText:b,hideLabelFromVision:!X,suffix:Y?void 0:(0,$.jsx)(Ji.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,$.jsx)(Ji.Button,{onClick:J?Sc:W,label:(0,C.__)("Submit"),icon:wa,className:"block-editor-link-control__search-submit","aria-disabled":J,size:"small"})}),props:!0})]}),H&&(0,$.jsx)(Ji.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:H})]}),t&&!O&&!F&&(0,$.jsx)(bc,{value:t,onEditClick:()=>z(!0),hasRichPreviews:k,hasUnlinkControl:q,onRemove:()=>{r(),z(!0)}},t?.url),ee&&(0,$.jsx)("div",{className:"block-editor-link-control__tools",children:!Z&&(0,$.jsx)(Ia,{settingsOpen:B,setSettingsOpen:e=>{w&&w(wc,Cc,e),y(e)},children:(0,$.jsx)(vc,{value:P,settings:n,onChange:A(M)})})}),Y&&(0,$.jsxs)(Ji.__experimentalHStack,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),R(t),G?U():r?.(),i?.()},children:(0,C.__)("Cancel")}),(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,variant:"primary",onClick:J?Sc:W,className:"block-editor-link-control__search-submit","aria-disabled":J,children:(0,C.__)("Save")})]}),!F&&_&&_()]})}Bc.ViewerFill=gc,Bc.DEFAULT_LINK_SETTINGS=Ja;const Ic=Bc,jc=()=>{};let Ec=0;const Tc=(0,u.compose)([(0,c.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Fo.store);return{createNotice:t,removeNotice:n}})),(0,Ji.withFilters)("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:o,accept:r,onError:i,onSelect:s,onSelectURL:l,onReset:u,onToggleFeaturedImage:d,useFeaturedImage:p,onFilesUpload:h=jc,name:g=(0,C.__)("Replace"),createNotice:m,removeNotice:f,children:b,multiple:k=!1,addToGallery:v,handleUpload:_=!0,popoverProps:x})=>{const y=(0,c.useSelect)((e=>e(oi).getSettings().mediaUpload),[]),S=!!y,w=(0,a.useRef)(),B="block-editor/media-replace-flow/error-notice/"+ ++Ec,I=e=>{const t=(0,ha.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{m("error",t,{speak:!0,id:B,isDismissible:!0})}),1e3)},j=(e,t)=>{p&&d&&d(),t(),s(e),(0,Vo.speak)((0,C.__)("The media file has been replaced")),f(B)},E=e=>{e.keyCode===ma.DOWN&&(e.preventDefault(),e.target.click())},T=k&&!(!o||0===o.length)&&o.every((e=>"image"===e||e.startsWith("image/")));return(0,$.jsx)(Ji.Dropdown,{popoverProps:x,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>(0,$.jsx)(Ji.ToolbarButton,{ref:w,"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:E,children:g}),renderContent:({onClose:i})=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Ji.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,$.jsxs)(_a,{children:[(0,$.jsx)(va,{gallery:T,addToGallery:v,multiple:k,value:k?n:t,onSelect:e=>j(e,i),allowedTypes:o,render:({open:e})=>(0,$.jsx)(Ji.MenuItem,{icon:fa,onClick:e,children:(0,C.__)("Open Media Library")})}),(0,$.jsx)(Ji.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!_)return t(),s(n);h(n),y({allowedTypes:o,filesList:n,onFileChange:([e])=>{j(e,t)},onError:I})})(e,i)},accept:r,multiple:!!k,render:({openFileDialog:e})=>(0,$.jsx)(Ji.MenuItem,{icon:ba,onClick:()=>{e()},children:(0,C.__)("Upload")})})]}),d&&(0,$.jsx)(Ji.MenuItem,{icon:ka,onClick:d,isPressed:p,children:(0,C.__)("Use featured image")}),e&&u&&(0,$.jsx)(Ji.MenuItem,{onClick:()=>{u(),i()},children:(0,C.__)("Reset")}),"function"==typeof b?b({onClose:i}):b]}),l&&(0,$.jsxs)("form",{className:$i("block-editor-media-flow__url-input",{"has-siblings":S||d}),children:[(0,$.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,C.__)("Current media URL:")}),(0,$.jsx)(Ic,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{l(e),w.current.focus()}})]})]})})})),Mc="image",Pc={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},Rc=()=>{};const Nc=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)}%`},Lc=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 Ac({as:e="span",imgUrl:t,toggleProps:n={},filename:o,label:r,className:i,onToggleCallback:s=Rc}){return(0,a.useEffect)((()=>{void 0!==n?.isOpen&&s(n?.isOpen)}),[n?.isOpen,s]),(0,$.jsx)(Ji.__experimentalItemGroup,{as:e,className:i,...n,children:(0,$.jsxs)(Ji.__experimentalHStack,{justify:"flex-start",as:"span",className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[t&&(0,$.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator-wrapper","aria-hidden":!0,children:(0,$.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:`url(${t})`}})}),(0,$.jsxs)(Ji.FlexItem,{as:"span",style:t?{}:{flexGrow:1},children:[(0,$.jsx)(Ji.__experimentalTruncate,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:r}),(0,$.jsx)(Ji.VisuallyHidden,{as:"span",children:t?(0,C.sprintf)((0,C.__)("Background image: %s"),o||r):(0,C.__)("No background image selected")})]})]})})}function Dc({label:e,filename:t,url:n,children:o,onToggle:r=Rc,hasImageValue:i}){if(!i)return;const s=e||(0,pa.getFilename)(n)||(0,C.__)("Add background image");return(0,$.jsx)(Ji.Dropdown,{popoverProps:Pc,renderToggle:({onToggle:e,isOpen:o})=>{const i={onClick:e,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":o,"aria-label":(0,C.__)("Background size, position and repeat options."),isOpen:o};return(0,$.jsx)(Ac,{imgUrl:n,filename:t,label:s,toggleProps:i,as:"button",onToggleCallback:r})},renderContent:()=>(0,$.jsx)(Ji.__experimentalDropdownContentWrapper,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:o})})}function Oc(){return(0,$.jsx)(Ji.Placeholder,{className:"block-editor-global-styles-background-panel__loading",children:(0,$.jsx)(Ji.Spinner,{})})}function zc({onChange:e,style:t,inheritedValue:n,onRemoveImage:o=Rc,onResetImage:r=Rc,displayInPanel:i,defaultValues:s}){const[l,u]=(0,a.useState)(!1),{getSettings:d}=(0,c.useSelect)(oi),{id:p,title:h,url:g}=t?.background?.backgroundImage||{...n?.background?.backgroundImage},m=(0,a.useRef)(),{createErrorNotice:f}=(0,c.useDispatch)(Fo.store),b=e=>{f(e,{type:"snackbar"}),u(!1)},k=n=>{if(!n||!n.url)return e(ve(t,["background","backgroundImage"],void 0)),void u(!1);if((0,ga.isBlobURL)(n.url))return void u(!0);if(n.media_type&&n.media_type!==Mc||!n.media_type&&n.type&&n.type!==Mc)return void b((0,C.__)("Only images can be used as a background image."));const o=t?.background?.backgroundSize||s?.backgroundSize,r=t?.background?.backgroundPosition;e(ve(t,["background"],{...t?.background,backgroundImage:{url:n.url,id:n.id,source:"file",title:n.title||void 0},backgroundPosition:r||"auto"!==o&&o?r:"50% 0",backgroundSize:o})),u(!1)},v=$c(t),_=()=>{const[e]=ha.focus.tabbable.find(m.current);e?.focus(),e?.click()},x=!v&&$c(n),y=h||(0,pa.getFilename)(g)||(0,C.__)("Add background image");return(0,$.jsxs)("div",{ref:m,className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[l&&(0,$.jsx)(Oc,{}),(0,$.jsx)(Tc,{mediaId:p,mediaURL:g,allowedTypes:[Mc],accept:"image/*",onSelect:k,popoverProps:{className:$i({"block-editor-global-styles-background-panel__media-replace-popover":i})},name:(0,$.jsx)(Ac,{className:"block-editor-global-styles-background-panel__image-preview",imgUrl:g,filename:h,label:y}),variant:"secondary",onError:b,onReset:()=>{_(),r()},children:x&&(0,$.jsx)(Ji.MenuItem,{onClick:()=>{_(),e(ve(t,["background"],{backgroundImage:"none"})),o()},children:(0,C.__)("Remove")})}),(0,$.jsx)(Ji.DropZone,{onFilesDrop:e=>{e?.length>1?b((0,C.__)("Only one image can be used as a background image.")):d().mediaUpload({allowedTypes:[Mc],filesList:e,onFileChange([e]){k(e)},onError:b})},label:(0,C.__)("Drop to upload")})]})}function Vc({onChange:e,style:t,inheritedValue:n,defaultValues:o}){const r=t?.background?.backgroundSize||n?.background?.backgroundSize,i=t?.background?.backgroundRepeat||n?.background?.backgroundRepeat,s=t?.background?.backgroundImage?.url||n?.background?.backgroundImage?.url,l=t?.background?.backgroundImage?.id,a=t?.background?.backgroundPosition||n?.background?.backgroundPosition,c=t?.background?.backgroundAttachment||n?.background?.backgroundAttachment;let u=!r&&l?o?.backgroundSize:r||"auto";u=["cover","contain","auto"].includes(u)?u:"auto";const d=!("no-repeat"===i||"cover"===u&&void 0===i),p=n=>{let o=i,r=a;"contain"===n&&(o="no-repeat",r=void 0),"cover"===n&&(o=void 0,r=void 0),"cover"!==u&&"contain"!==u||"auto"!==n||(o=void 0,t?.background?.backgroundImage?.id&&(r="50% 0")),n||"auto"!==u||(n="auto"),e(ve(t,["background"],{...t?.background,backgroundPosition:r,backgroundRepeat:o,backgroundSize:n}))},h=!a&&l&&"contain"===r?o?.backgroundPosition:a;return(0,$.jsxs)(Ji.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,$.jsx)(Ji.FocalPointPicker,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Focal point"),url:s,value:Lc(h),onChange:n=>{e(ve(t,["background","backgroundPosition"],Nc(n)))}}),(0,$.jsx)(Ji.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Fixed background"),checked:"fixed"===c,onChange:()=>e(ve(t,["background","backgroundAttachment"],"fixed"===c?"scroll":"fixed"))}),(0,$.jsxs)(Ji.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:(0,C.__)("Size"),value:u,onChange:p,isBlock:!0,help:(g=r||o?.backgroundSize,"cover"===g||void 0===g?(0,C.__)("Image covers the space evenly."):"contain"===g?(0,C.__)("Image is contained without distortion."):(0,C.__)("Image has a fixed width.")),children:[(0,$.jsx)(Ji.__experimentalToggleGroupControlOption,{value:"cover",label:(0,C._x)("Cover","Size option for background image control")},"cover"),(0,$.jsx)(Ji.__experimentalToggleGroupControlOption,{value:"contain",label:(0,C._x)("Contain","Size option for background image control")},"contain"),(0,$.jsx)(Ji.__experimentalToggleGroupControlOption,{value:"auto",label:(0,C._x)("Tile","Size option for background image control")},"tile")]}),(0,$.jsxs)(Ji.__experimentalHStack,{justify:"flex-start",spacing:2,as:"span",children:[(0,$.jsx)(Ji.__experimentalUnitControl,{"aria-label":(0,C.__)("Background image width"),onChange:p,value:r,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,C.__)("Auto"),disabled:"auto"!==u||void 0===u}),(0,$.jsx)(Ji.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Repeat"),checked:d,onChange:()=>e(ve(t,["background","backgroundRepeat"],!0===d?"no-repeat":"repeat")),disabled:"cover"===u})]})]});var g}function Fc({value:e,onChange:t,inheritedValue:n=e,settings:o,defaultValues:r={}}){const{globalStyles:i,_links:s}=(0,c.useSelect)((e=>{const{getSettings:t}=e(oi),n=t();return{globalStyles:n[Z],_links:n[q]}}),[]),l=(0,a.useMemo)((()=>{const e={background:{}};return n?.background?(Object.entries(n?.background).forEach((([t,n])=>{e.background[t]=Ri(n,{styles:i,_links:s})})),e):n}),[i,s,n]),u=()=>t(ve(e,["background"],{})),{title:d,url:p}=e?.background?.backgroundImage||{...l?.background?.backgroundImage},h=$c(e)||$c(l),g=h&&"none"!==(e?.background?.backgroundImage||n?.background?.backgroundImage)&&(o?.background?.backgroundSize||o?.background?.backgroundPosition||o?.background?.backgroundRepeat),[m,f]=(0,a.useState)(!1);return(0,$.jsx)("div",{className:$i("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":m}),children:g?(0,$.jsx)(Dc,{label:d,filename:d,url:p,onToggle:f,hasImageValue:h,children:(0,$.jsxs)(Ji.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,$.jsx)(zc,{onChange:t,style:e,inheritedValue:l,displayInPanel:!0,onResetImage:()=>{f(!1),u()},onRemoveImage:()=>f(!1),defaultValues:r}),(0,$.jsx)(Vc,{onChange:t,style:e,defaultValues:r,inheritedValue:l})]})}):(0,$.jsx)(zc,{onChange:t,style:e,inheritedValue:l,defaultValues:r,onResetImage:()=>{f(!1),u()},onRemoveImage:()=>f(!1)})})}const Hc={backgroundImage:!0};function Gc(e){return"web"===a.Platform.OS&&e?.background?.backgroundImage}function $c(e){return!!e?.background?.backgroundImage?.id||"string"==typeof e?.background?.backgroundImage||!!e?.background?.backgroundImage?.url}function Uc({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r,headerLabel:i}){const s=ji();return(0,$.jsx)(Ji.__experimentalToolsPanel,{label:i,resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:s,children:r})}function Wc({as:e=Uc,value:t,onChange:n,inheritedValue:o,settings:r,panelId:i,defaultControls:s=Hc,defaultValues:l={},headerLabel:c=(0,C.__)("Background image")}){const u=Gc(r),d=(0,a.useCallback)((e=>({...e,background:{}})),[]);return(0,$.jsx)(e,{resetAllFilter:d,value:t,onChange:n,panelId:i,headerLabel:c,children:u&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{hasValue:()=>!!t?.background,label:(0,C.__)("Image"),onDeselect:()=>n(ve(t,["background"],{})),isShownByDefault:s.backgroundImage,panelId:i,children:(0,$.jsx)(Fc,{value:t,onChange:n,settings:r,inheritedValue:o,defaultControls:s,defaultValues:l})})})}const Kc="background",Zc={backgroundSize:"cover",backgroundPosition:"50% 50%"};function qc(e,t="any"){const n=(0,l.getBlockSupport)(e,Kc);return!0===n||("any"===t?!!n?.backgroundImage||!!n?.backgroundSize||!!n?.backgroundRepeat:!!n?.[t])}function Yc(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:Zc.backgroundSize}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(t={backgroundPosition:Zc.backgroundPosition}),t}function Xc(e){return $c(e)?"has-background":""}function Qc({children:e}){const t=(0,a.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]);return(0,$.jsx)(da,{group:"background",resetAllFilter:t,children:e})}function Jc({clientId:e,name:t,setAttributes:n,settings:o}){const{style:r,inheritedValue:i}=(0,c.useSelect)((n=>{const{getBlockAttributes:o,getSettings:r}=n(oi),i=r();return{style:o(e)?.style,inheritedValue:i[Z]?.blocks?.[t]}}),[e,t]);if(!Gc(o)||!qc(t,"backgroundImage"))return null;const s={...o,background:{...o.background,backgroundSize:o?.background?.backgroundSize&&qc(t,"backgroundSize")}};return(0,$.jsx)(Wc,{inheritedValue:i,as:Qc,panelId:e,defaultValues:Zc,settings:s,onChange:e=>{n({style:Ui(e)})},value:r})}const eu={useBlockProps:function({name:e,style:t}){if(!qc(e)||!t?.background?.backgroundImage)return;const n=Yc(t?.background);return n?{style:{...n}}:void 0},attributeKeys:["style"],hasSupport:qc};(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 tu=/[\s#]/g,nu={type:"string",source:"attribute",attribute:"id",selector:"*"};const ou={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"!==zl())return null;const n="web"===a.Platform.OS;return(0,$.jsx)(da,{group:"advanced",children:(0,$.jsx)(Ji.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,C.__)("HTML anchor"),help:(0,$.jsxs)($.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, youll be able to link directly to this section of your page."),n&&(0,$.jsxs)($.Fragment,{children:[" ",(0,$.jsx)(Ji.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(tu,"-"),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:nu}),e}));const ru={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};const iu={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:ru}),e}));const su={edit:function({className:e,setAttributes:t}){return"default"!==zl()?null:(0,$.jsx)(da,{group:"advanced",children:(0,$.jsx)(Ji.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=$i(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 lu={grad:.9,turn:360,rad:360/(2*Math.PI)},au=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},cu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},uu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},du=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},pu=function(e){return{r:uu(e.r,0,255),g:uu(e.g,0,255),b:uu(e.b,0,255),a:uu(e.a)}},hu=function(e){return{r:cu(e.r),g:cu(e.g),b:cu(e.b),a:cu(e.a,3)}},gu=/^#([0-9a-f]{3,8})$/i,mu=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},fu=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,i=Math.max(t,n,o),s=i-Math.min(t,n,o),l=s?i===t?(n-o)/s:i===n?2+(o-t)/s:4+(t-n)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*100:0,v:i/255*100,a:r}},bu=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var i=Math.floor(t),s=o*(1-n),l=o*(1-(t-i)*n),a=o*(1-(1-t+i)*n),c=i%6;return{r:255*[o,l,s,s,a,o][c],g:255*[a,o,o,l,s,s][c],b:255*[s,s,a,o,o,l][c],a:r}},ku=function(e){return{h:du(e.h),s:uu(e.s,0,100),l:uu(e.l,0,100),a:uu(e.a)}},vu=function(e){return{h:cu(e.h),s:cu(e.s),l:cu(e.l),a:cu(e.a,3)}},_u=function(e){return bu((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},xu=function(e){return{h:(t=fu(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},yu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Su=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Cu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Bu={string:[[function(e){var t=gu.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?cu(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?cu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=wu.exec(e)||Cu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:pu({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=yu.exec(e)||Su.exec(e);if(!t)return null;var n,o,r=ku({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(lu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return _u(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,i=void 0===r?1:r;return au(t)&&au(n)&&au(o)?pu({r:Number(t),g:Number(n),b:Number(o),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,i=void 0===r?1:r;if(!au(t)||!au(n)||!au(o))return null;var s=ku({h:Number(t),s:Number(n),l:Number(o),a:Number(i)});return _u(s)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,i=void 0===r?1:r;if(!au(t)||!au(n)||!au(o))return null;var s=function(e){return{h:du(e.h),s:uu(e.s,0,100),v:uu(e.v,0,100),a:uu(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(i)});return bu(s)},"hsv"]]},Iu=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]},ju=function(e){return"string"==typeof e?Iu(e.trim(),Bu.string):"object"==typeof e&&null!==e?Iu(e,Bu.object):[null,void 0]},Eu=function(e,t){var n=xu(e);return{h:n.h,s:uu(n.s+100*t,0,100),l:n.l,a:n.a}},Tu=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Mu=function(e,t){var n=xu(e);return{h:n.h,s:n.s,l:uu(n.l+100*t,0,100),a:n.a}},Pu=function(){function e(e){this.parsed=ju(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 cu(Tu(this.rgba),2)},e.prototype.isDark=function(){return Tu(this.rgba)<.5},e.prototype.isLight=function(){return Tu(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=hu(this.rgba)).r,n=e.g,o=e.b,i=(r=e.a)<1?mu(cu(255*r)):"","#"+mu(t)+mu(n)+mu(o)+i;var e,t,n,o,r,i},e.prototype.toRgb=function(){return hu(this.rgba)},e.prototype.toRgbString=function(){return t=(e=hu(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 vu(xu(this.rgba))},e.prototype.toHslString=function(){return t=(e=vu(xu(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=fu(this.rgba),{h:cu(e.h),s:cu(e.s),v:cu(e.v),a:cu(e.a,3)};var e},e.prototype.invert=function(){return Ru({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),Ru(Eu(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Ru(Eu(this.rgba,-e))},e.prototype.grayscale=function(){return Ru(Eu(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Ru(Mu(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Ru(Mu(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?Ru({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):cu(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=xu(this.rgba);return"number"==typeof e?Ru({h:e,s:t.s,l:t.l,a:t.a}):cu(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Ru(e).toHex()},e}(),Ru=function(e){return e instanceof Pu?e:new Pu(e)},Nu=[],Lu=function(e){e.forEach((function(e){Nu.indexOf(e)<0&&(e(Pu,Bu),Nu.push(e))}))};function Au(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 i={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,s,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(!i.length)for(var d in n)i[d]=new e(n[d]).toRgb();for(var p in n){var h=(r=a,s=i[p],Math.pow(r.r-s.r,2)+Math.pow(r.g-s.g,2)+Math.pow(r.b-s.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 Du=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Ou=function(e){return.2126*Du(e.r)+.7152*Du(e.g)+.0722*Du(e.b)};function zu(e){e.prototype.luminance=function(){return e=Ou(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,i,s,l,a,c=t instanceof e?t:new e(t);return i=this.rgba,s=c.toRgb(),n=(l=Ou(i))>(a=Ou(s))?(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)>=(s=void 0===(i=(n=t).size)?"normal":i,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===s?7:"AA"===r&&"large"===s?3:4.5);var n,o,r,i,s}}Lu([Au,zu]);const{kebabCase:Vu}=te(Ji.privateApis),Fu=(e,t,n)=>{if(t){const n=e?.find((e=>e.slug===t));if(n)return n}return{color:n}},Hu=(e,t)=>e?.find((e=>e.color===t));function Gu(e,t){if(e&&t)return`has-${Vu(t)}-${e}`}function $u(){const[e,t,n,o,r,i,s,l,c,u]=ii("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:!i};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}),s&&s.length&&e.push({name:(0,C._x)("Custom","Indicates this palette is created by the user."),gradients:s}),e}),[s,l,c,u]),d.hasColorsOrGradients=!!d.colors.length||!!d.gradients.length,d}function Uu(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Wu(e={}){const{flat:t,...n}=e;return t||Uu(Object.values(n).filter(Boolean))||"px"}function Ku(e={}){if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,Ji.__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]:"",i=Uu(o);return 0===r||r?`${r}${i}`:void 0}function Zu(e={}){const t=Ku(e);return"string"!=typeof e&&isNaN(parseFloat(t))}function qu(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function Yu({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){let i=Ku(o);void 0===i&&(i=Wu(t));const s=qu(o)&&Zu(o),l=s?(0,C.__)("Mixed"):null;return(0,$.jsx)(Ji.__experimentalUnitControl,{...r,"aria-label":(0,C.__)("Border radius"),disableUnits:s,isOnly:!0,value:i,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 Xu={topLeft:(0,C.__)("Top left"),topRight:(0,C.__)("Top right"),bottomLeft:(0,C.__)("Bottom left"),bottomRight:(0,C.__)("Bottom right")};function Qu({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){const i=t=>n=>{if(!e)return;const o=!isNaN(parseFloat(n))?n:void 0;e({...s,[t]:o})},s="string"!=typeof o?o:{topLeft:o,topRight:o,bottomLeft:o,bottomRight:o};return(0,$.jsx)("div",{className:"components-border-radius-control__input-controls-wrapper",children:Object.entries(Xu).map((([e,o])=>{const[l,a]=(0,Ji.__experimentalParseQuantityAndUnitFromRawValue)(s[e]),c=s[e]?a:t[e]||t.flat;return(0,$.jsx)(Ji.Tooltip,{text:o,placement:"top",children:(0,$.jsx)("div",{className:"components-border-radius-control__tooltip-wrapper",children:(0,$.jsx)(Ji.__experimentalUnitControl,{...r,"aria-label":o,value:[l,c].join(""),onChange:i(e),onUnitChange:(u=e,e=>{const o={...t};o[u]=e,n(o)}),size:"__unstable-large"})})},e);var u}))})}const Ju=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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 ed({isLinked:e,...t}){const n=e?(0,C.__)("Unlink radii"):(0,C.__)("Link radii");return(0,$.jsx)(Ji.Tooltip,{text:n,children:(0,$.jsx)(Ji.Button,{...t,className:"component-border-radius-control__linked-button",size:"small",icon:e?Ju:dc,iconSize:24,"aria-label":n})})}const td={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},nd=0,od={px:100,em:20,rem:20};function rd({onChange:e,values:t}){const[n,o]=(0,a.useState)(!qu(t)||!Zu(t)),[r,i]=(0,a.useState)({flat:"string"==typeof t?(0,Ji.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,Ji.__experimentalParseQuantityAndUnitFromRawValue)(t?.topLeft)[1],topRight:(0,Ji.__experimentalParseQuantityAndUnitFromRawValue)(t?.topRight)[1],bottomLeft:(0,Ji.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomLeft)[1],bottomRight:(0,Ji.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomRight)[1]}),[s]=ii("spacing.units"),l=(0,Ji.__experimentalUseCustomUnits)({availableUnits:s||["px","em","rem"]}),c=Wu(r),u=l&&l.find((e=>e.value===c)),d=u?.step||1,[p]=(0,Ji.__experimentalParseQuantityAndUnitFromRawValue)(Ku(t));return(0,$.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,$.jsx)(Ji.BaseControl.VisualLabel,{as:"legend",children:(0,C.__)("Radius")}),(0,$.jsxs)("div",{className:"components-border-radius-control__wrapper",children:[n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Yu,{className:"components-border-radius-control__unit-control",values:t,min:nd,onChange:e,selectedUnits:r,setSelectedUnits:i,units:l}),(0,$.jsx)(Ji.RangeControl,{__next40pxDefaultSize:!0,label:(0,C.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=p?p:"",min:nd,max:od[c],initialPosition:0,withInputField:!1,onChange:t=>{e(void 0!==t?`${t}${c}`:void 0)},step:d,__nextHasNoMarginBottom:!0})]}):(0,$.jsx)(Qu,{min:nd,onChange:e,selectedUnits:r,setSelectedUnits:i,values:t||td,units:l}),(0,$.jsx)(ed,{onClick:()=>o(!n),isLinked:n})]})]})}const id=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),sd=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.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"})}),ld=[];function ad({shadow:e,onShadowChange:t,settings:n}){const o=pd(n);return(0,$.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,$.jsxs)(Ji.__experimentalVStack,{spacing:4,children:[(0,$.jsx)(Ji.__experimentalHeading,{level:5,children:(0,C.__)("Drop shadow")}),(0,$.jsx)(cd,{presets:o,activeShadow:e,onSelect:t}),(0,$.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,variant:"tertiary",onClick:()=>t(void 0),children:(0,C.__)("Clear")})})]})})}function cd({presets:e,activeShadow:t,onSelect:n}){return e?(0,$.jsx)(Ji.Composite,{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,$.jsx)(ud,{label:e,isActive:r===t,type:"unset"===o?"unset":"preset",onSelect:()=>n(r===t?void 0:r),shadow:r},o)))}):null}function ud({type:e,label:t,isActive:n,onSelect:o,shadow:r}){return(0,$.jsx)(Ji.Composite.Item,{role:"option","aria-label":t,"aria-selected":n,className:$i("block-editor-global-styles__shadow__item",{"is-active":n}),render:(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,className:$i("block-editor-global-styles__shadow-indicator",{unset:"unset"===e}),onClick:o,label:t,style:{boxShadow:r},showTooltip:!0,children:n&&(0,$.jsx)(cl,{icon:id})})})}function dd({shadow:e,onShadowChange:t,settings:n}){return(0,$.jsx)(Ji.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:$i({"is-open":t}),"aria-expanded":t};return(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,...n,children:(0,$.jsxs)(Ji.__experimentalHStack,{justify:"flex-start",children:[(0,$.jsx)(cl,{className:"block-editor-global-styles__toggle-icon",icon:sd,size:24}),(0,$.jsx)(Ji.FlexItem,{children:(0,C.__)("Drop shadow")})]})})},renderContent:()=>(0,$.jsx)(Ji.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,$.jsx)(ad,{shadow:e,onShadowChange:t,settings:n})})})}function pd(e){return(0,a.useMemo)((()=>{var t;if(!e?.shadow)return ld;const n=e?.shadow?.defaultPresets,{default:o,theme:r,custom:i}=null!==(t=e?.shadow?.presets)&&void 0!==t?t:{},s={name:(0,C.__)("Unset"),slug:"unset",shadow:"none"},l=[...n&&o||ld,...r||ld,...i||ld];return l.length&&l.unshift(s),l}),[e])}function hd(e){return Object.values(gd(e)).some(Boolean)}function gd(e){return{hasBorderColor:md(e),hasBorderRadius:fd(e),hasBorderStyle:bd(e),hasBorderWidth:kd(e),hasShadow:vd(e)}}function md(e){return e?.border?.color}function fd(e){return e?.border?.radius}function bd(e){return e?.border?.style}function kd(e){return e?.border?.width}function vd(e){const t=pd(e);return!!e?.shadow&&t.length>0}function _d({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r,label:i}){const s=ji();return(0,$.jsx)(Ji.__experimentalToolsPanel,{label:i,resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:s,children:r})}const xd={radius:!0,color:!0,width:!0,shadow:!0};function yd({as:e=_d,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,name:s,defaultControls:l=xd}){var c,u,d,p;const h=Fi(r),g=(0,a.useCallback)((e=>Ti({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,Ji.__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}),k=md(r),v=bd(r),_=kd(r),x=fd(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=vd(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(ve(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=k||v||_||x,N=Rd({blockName:s,hasShadowControl:B,hasBorderControl:R});return(0,$.jsxs)(e,{resetAllFilter:M,value:t,onChange:n,panelId:i,label:N,children:[(_||k)&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{hasValue:()=>(0,Ji.__experimentalIsDefinedBorder)(t?.border),label:(0,C.__)("Border"),onDeselect:()=>(()=>{if(w())return b({radius:t?.border?.radius});b(void 0)})(),isShownByDefault:P,panelId:i,children:(0,$.jsx)(Ji.__experimentalBorderBoxControl,{colors:h,enableAlpha:!0,enableStyle:v,onChange:e=>{const t={...e};(0,Ji.__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,$.jsx)(Ji.__experimentalToolsPanelItem,{hasValue:w,label:(0,C.__)("Radius"),onDeselect:()=>S(void 0),isShownByDefault:l.radius,panelId:i,children:(0,$.jsx)(rd,{values:y,onChange:e=>{S(e||void 0)}})}),B&&(0,$.jsxs)(Ji.__experimentalToolsPanelItem,{label:(0,C.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>T(void 0),isShownByDefault:l.shadow,panelId:i,children:[R?(0,$.jsx)(Ji.BaseControl.VisualLabel,{as:"legend",children:(0,C.__)("Shadow")}):null,(0,$.jsx)(Ji.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:(0,$.jsx)(dd,{shadow:I,onShadowChange:T,settings:r})})]})]})}const Sd="__experimentalBorder",wd="shadow",Cd=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},Bd=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=Cd(e,"slug",t);if(n)return n}if(!n)return{color:void 0};const o=Cd(e,"color",n);return o||{color:n}};function Id(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function jd(e){if((0,Ji.__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:Ui(o),borderColor:n}}function Ed(e){return(0,Ji.__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 Td({label:e,children:t,resetAllFilter:n}){const o=(0,a.useCallback)((e=>{const t=Ed(e),o=n(t);return{...e,...jd(o)}}),[n]);return(0,$.jsx)(da,{group:"border",resetAllFilter:o,label:e,children:t})}function Md({clientId:e,name:t,setAttributes:n,settings:o}){const r=hd(o);const{style:i,borderColor:s}=(0,c.useSelect)((function(t){const{style:n,borderColor:o}=t(oi).getBlockAttributes(e)||{};return{style:n,borderColor:o}}),[e]),u=(0,a.useMemo)((()=>Ed({style:i,borderColor:s})),[i,s]);if(!r)return null;const d={...(0,l.getBlockSupport)(t,[Sd,"__experimentalDefaultControls"]),...(0,l.getBlockSupport)(t,[wd,"__experimentalDefaultControls"])};return(0,$.jsx)(yd,{as:Td,panelId:e,settings:o,value:u,onChange:e=>{n(jd(e))},defaultControls:d})}function Pd(e,t="any"){if("web"!==a.Platform.OS)return!1;const n=(0,l.getBlockSupport)(e,Sd);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function Rd({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const o=gd(Xi(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 Nd(e,t,n){if(!Pd(t,"color")||Ki(t,Sd,"color"))return e;const o=Ld(n),r=$i(e.className,o);return e.className=r||void 0,e}function Ld(e){const{borderColor:t,style:n}=e,o=Gu("border-color",t);return $i({"has-border-color":t||n?.border?.color,[o]:!!o})}const Ad={useBlockProps:function({name:e,borderColor:t,style:n}){const{colors:o}=$u();if(!Pd(e,"color")||Ki(e,Sd,"color"))return{};const{color:r}=Bd({colors:o,namedColor:t}),{color:i}=Bd({colors:o,namedColor:Id(n?.border?.top?.color)}),{color:s}=Bd({colors:o,namedColor:Id(n?.border?.right?.color)}),{color:l}=Bd({colors:o,namedColor:Id(n?.border?.bottom?.color)}),{color:a}=Bd({colors:o,namedColor:Id(n?.border?.left?.color)});return Nd({style:Ui({borderTopColor:i||r,borderRightColor:s||r,borderBottomColor:l||r,borderLeftColor:a||r})||{}},e,{borderColor:t,style:n})},addSaveProps:Nd,attributeKeys:["borderColor","style"],hasSupport:e=>Pd(e,"color")};function Dd(e){if(e)return`has-${e}-gradient-background`}function Od(e,t){const n=e?.find((e=>e.slug===t));return n&&n.gradient}function zd(e,t){const n=e?.find((e=>e.gradient===t));return n}function Vd(e,t){const n=zd(e,t);return n&&n.slug}function Fd({gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}={}){const{clientId:n}=_(),[o,r,i]=ii("color.gradients.custom","color.gradients.theme","color.gradients.default"),s=(0,a.useMemo)((()=>[...o||[],...r||[],...i||[]]),[o,r,i]),{gradient:l,customGradient:u}=(0,c.useSelect)((o=>{const{getBlockAttributes:r}=o(oi),i=r(n)||{};return{customGradient:i[t],gradient:i[e]}}),[n,e,t]),{updateBlockAttributes:d}=(0,c.useDispatch)(oi),p=(0,a.useCallback)((o=>{const r=Vd(s,o);d(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[s,n,d]),h=Dd(l);let g;return g=l?Od(s,l):u,{gradientClass:h,gradientValue:g,setGradient:p}}(0,d.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Pd(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e}));const{Tabs:Hd}=te(Ji.privateApis),Gd=["colors","disableCustomColors","gradients","disableCustomGradients"],$d={color:"color",gradient:"gradient"};function Ud({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,className:i,label:s,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={[$d.color]:(0,$.jsx)(Ji.ColorPalette,{value:c,onChange:f?e=>{l(e),a()}:l,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:r,clearable:d,enableAlpha:h,headingLevel:g}),[$d.gradient]:(0,$.jsx)(Ji.GradientPicker,{value:u,onChange:m?e=>{a(e),l()}:a,gradients:t,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,clearable:d,headingLevel:g})},k=e=>(0,$.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:b[e]});return(0,$.jsx)(Ji.BaseControl,{__nextHasNoMarginBottom:!0,className:$i("block-editor-color-gradient-control",i),children:(0,$.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,$.jsxs)(Ji.__experimentalVStack,{spacing:1,children:[p&&(0,$.jsx)("legend",{children:(0,$.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,$.jsx)(Ji.BaseControl.VisualLabel,{children:s})})}),m&&f&&(0,$.jsx)("div",{children:(0,$.jsxs)(Hd,{defaultTabId:u?$d.gradient:!!m&&$d.color,children:[(0,$.jsxs)(Hd.TabList,{children:[(0,$.jsx)(Hd.Tab,{tabId:$d.color,children:(0,C.__)("Color")}),(0,$.jsx)(Hd.Tab,{tabId:$d.gradient,children:(0,C.__)("Gradient")})]}),(0,$.jsx)(Hd.TabPanel,{tabId:$d.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.color}),(0,$.jsx)(Hd.TabPanel,{tabId:$d.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.gradient})]})}),!f&&k($d.color),!m&&k($d.gradient)]})})})}function Wd(e){const[t,n,o,r]=ii("color.palette","color.gradients","color.custom","color.customGradient");return(0,$.jsx)(Ud,{colors:t,gradients:n,disableCustomColors:!o,disableCustomGradients:!r,...e})}const Kd=function(e){return Gd.every((t=>e.hasOwnProperty(t)))?(0,$.jsx)(Ud,{...e}):(0,$.jsx)(Wd,{...e})};function Zd(e){const t=qd(e),n=ep(e),o=Yd(e),r=Qd(e),i=Jd(e),s=Xd(e);return t||n||o||r||i||s}function qd(e){const t=Fi(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function Yd(e){const t=Fi(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function Xd(e){const t=Fi(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function Qd(e){const t=Fi(e),n=Hi(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function Jd(e){const t=Fi(e),n=Hi(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function ep(e){const t=Fi(e),n=Hi(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function tp({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const i=ji();return(0,$.jsx)(Ji.__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:i,children:(0,$.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:r})})}const np={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},op={placement:"left-start",offset:36,shift:!0},{Tabs:rp}=te(Ji.privateApis),ip=({indicators:e,label:t})=>(0,$.jsxs)(Ji.__experimentalHStack,{justify:"flex-start",children:[(0,$.jsx)(Ji.__experimentalZStack,{isLayered:!1,offset:-8,children:e.map(((e,t)=>(0,$.jsx)(Ji.Flex,{expanded:!1,children:(0,$.jsx)(Ji.ColorIndicator,{colorValue:e})},t)))}),(0,$.jsx)(Ji.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]});function sp({isGradient:e,inheritedValue:t,userValue:n,setValue:o,colorGradientControlSettings:r}){return(0,$.jsx)(Kd,{...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 lp({label:e,hasValue:t,resetValue:n,isShownByDefault:o,indicators:r,tabs:i,colorGradientControlSettings:s,panelId:l}){var a;const c=i.find((e=>void 0!==e.userValue)),{key:u,...d}=null!==(a=i[0])&&void 0!==a?a:{};return(0,$.jsx)(Ji.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:o,panelId:l,children:(0,$.jsx)(Ji.Dropdown,{popoverProps:op,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:t,isOpen:n})=>{const o={onClick:t,className:$i("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,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,...o,children:(0,$.jsx)(ip,{indicators:r,label:e})})},renderContent:()=>(0,$.jsx)(Ji.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,$.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[1===i.length&&(0,$.jsx)(sp,{...d,colorGradientControlSettings:s},u),i.length>1&&(0,$.jsxs)(rp,{defaultTabId:c?.key,children:[(0,$.jsx)(rp.TabList,{children:i.map((e=>(0,$.jsx)(rp.Tab,{tabId:e.key,children:e.label},e.key)))}),i.map((e=>{const{key:t,...n}=e;return(0,$.jsx)(rp.TabPanel,{tabId:t,focusable:!1,children:(0,$.jsx)(sp,{...n,colorGradientControlSettings:s},t)},t)}))]})]})})})})}function ap({as:e=tp,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:s=np,children:l}){const c=Fi(r),u=Hi(r),d=r?.color?.custom,p=r?.color?.customGradient,h=c.length>0||d,g=u.length>0||p,m=e=>Ti({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},k=ep(r),v=m(o?.color?.background),_=m(t?.color?.background),x=m(o?.color?.gradient),y=m(t?.color?.gradient),S=Yd(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=qd(r),T=m(o?.color?.text),M=m(t?.color?.text),P=e=>{let o=ve(t,["color","text"],f(e));T===w&&(o=ve(o,["elements","link","color","text"],f(e))),n(o)},R=[{name:"caption",label:(0,C.__)("Captions"),showPanel:Xd(r)},{name:"button",label:(0,C.__)("Button"),showPanel:Jd(r)},{name:"heading",label:(0,C.__)("Heading"),showPanel:Qd(r)},{name:"h1",label:(0,C.__)("H1"),showPanel:Qd(r)},{name:"h2",label:(0,C.__)("H2"),showPanel:Qd(r)},{name:"h3",label:(0,C.__)("H3"),showPanel:Qd(r)},{name:"h4",label:(0,C.__)("H4"),showPanel:Qd(r)},{name:"h5",label:(0,C.__)("H5"),showPanel:Qd(r)},{name:"h6",label:(0,C.__)("H6"),showPanel:Qd(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}})),{})}})),[]),L=[E&&{key:"text",label:(0,C.__)("Text"),hasValue:()=>!!M,resetValue:()=>P(void 0),isShownByDefault:s.text,indicators:[T],tabs:[{key:"text",label:(0,C.__)("Text"),inheritedValue:T,setValue:P,userValue:M}]},k&&{key:"background",label:(0,C.__)("Background"),hasValue:()=>!!_||!!y,resetValue:()=>{const e=ve(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:s.background,indicators:[null!=x?x:v],tabs:[h&&{key:"background",label:(0,C.__)("Color"),inheritedValue:v,setValue:e=>{const o=ve(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=ve(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=ve(t,["elements","link",":hover","color","text"],void 0);e=ve(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:s.link,indicators:[w,I],tabs:[{key:"link",label:(0,C.__)("Default"),inheritedValue:w,setValue:e=>{n(ve(t,["elements","link","color","text"],f(e)))},userValue:B},{key:"hover",label:(0,C.__)("Hover"),inheritedValue:I,setValue:e=>{n(ve(t,["elements","link",":hover","color","text"],f(e)))},userValue:j}]}].filter(Boolean);return R.forEach((({name:e,label:r,showPanel:i})=>{if(!i)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),k="caption"!==e;L.push({key:e,label:r,hasValue:()=>!!(p||u||d),resetValue:()=>{const o=ve(t,["elements",e,"color","background"],void 0);o.elements[e].color.gradient=void 0,o.elements[e].color.text=void 0,n(o)},isShownByDefault:s[e],indicators:k?[c,null!=a?a:l]:[c],tabs:[h&&{key:"text",label:(0,C.__)("Text"),inheritedValue:c,setValue:o=>{n(ve(t,["elements",e,"color","text"],f(o)))},userValue:p},h&&k&&{key:"background",label:(0,C.__)("Background"),inheritedValue:l,setValue:o=>{const r=ve(t,["elements",e,"color","background"],f(o));r.elements[e].color.gradient=void 0,n(r)},userValue:u},g&&k&&{key:"gradient",label:(0,C.__)("Gradient"),inheritedValue:a,setValue:o=>{const r=ve(t,["elements",e,"color","gradient"],b(o));r.elements[e].color.background=void 0,n(r)},userValue:d,isGradient:!0}].filter(Boolean)})})),(0,$.jsxs)(e,{resetAllFilter:N,value:t,onChange:n,panelId:i,children:[L.map((e=>{const{key:t,...n}=e;return(0,$.jsx)(lp,{...n,colorGradientControlSettings:{colors:c,disableCustomColors:!d,gradients:u,disableCustomGradients:!p},panelId:i},t)})),l]})}Lu([Au,zu]);const cp=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:o,fontSize:r,isLargeText:i,textColor:s,linkColor:l,enableAlphaChecker:a=!1}){const c=e||t;if(!c)return null;const u=s||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=Ru(c),g=h.alpha()<1,m=h.brightness(),f={level:"AA",size:i||!1!==i&&r>=24?"large":"small"};let b="",k="";for(const e of p){if(!e.color)continue;const t=Ru(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),k=(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."),k=(0,C.__)("Transparent text may be hard for people to read."))}return b?((0,Vo.speak)(k),(0,$.jsx)("div",{className:"block-editor-contrast-checker",children:(0,$.jsx)(Ji.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:b})})):null},up=(0,a.createContext)({refsMap:(0,u.observableMap)()});function dp({children:e}){const t=(0,a.useMemo)((()=>({refsMap:(0,u.observableMap)()})),[]);return(0,$.jsx)(up.Provider,{value:t,children:e})}function pp(e){const{refsMap:t}=(0,a.useContext)(up);return(0,u.useRefEffect)((n=>(t.set(e,n),()=>t.delete(e))),[e])}function hp(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function gp(e,t){const{refsMap:n}=(0,a.useContext)(up);(0,a.useLayoutEffect)((()=>{hp(t,n.get(e));const o=n.subscribe(e,(()=>hp(t,n.get(e))));return()=>{o(),hp(t,null)}}),[n,e,t])}function mp(e){const[t,n]=(0,a.useState)(null);return gp(e,n),t}function fp(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function bp({clientId:e}){const[t,n]=(0,a.useState)(),[o,r]=(0,a.useState)(),[i,s]=(0,a.useState)(),l=mp(e);return(0,a.useEffect)((()=>{if(!l)return;r(fp(l).color);const e=l.querySelector("a");e&&e.innerText&&s(fp(e).color);let t=l,o=fp(t).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&t.parentNode&&t.parentNode.nodeType===t.parentNode.ELEMENT_NODE;)t=t.parentNode,o=fp(t).backgroundColor;n(o)}),[l]),(0,$.jsx)(cp,{backgroundColor:t,textColor:o,enableAlphaChecker:!0,linkColor:i})}const kp="color",vp=e=>{const t=(0,l.getBlockSupport)(e,kp);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},_p=e=>{if("web"!==a.Platform.OS)return!1;const t=(0,l.getBlockSupport)(e,kp);return null!==t&&"object"==typeof t&&!!t.link},xp=e=>{const t=(0,l.getBlockSupport)(e,kp);return null!==t&&"object"==typeof t&&!!t.gradients},yp=e=>{const t=(0,l.getBlockSupport)(e,kp);return t&&!1!==t.background},Sp=e=>{const t=(0,l.getBlockSupport)(e,kp);return t&&!1!==t.text};function wp(e,t,n){if(!vp(t)||Ki(t,kp))return e;const o=xp(t),{backgroundColor:r,textColor:i,gradient:s,style:l}=n,a=e=>!Ki(t,kp,e),c=a("text")?Gu("color",i):void 0,u=a("gradients")?Dd(s):void 0,d=a("background")?Gu("background-color",r):void 0,p=a("background")||a("gradients"),h=r||l?.color?.background||o&&(s||l?.color?.gradient),g=$i(e.className,c,u,{[d]:!(o&&l?.color?.gradient||!d),"has-text-color":a("text")&&(i||l?.color?.text),"has-background":p&&h,"has-link-color":a("link")&&l?.elements?.link?.color});return e.className=g||void 0,e}function Cp(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,i=e?.color?.gradient,s=i?.startsWith("var:preset|gradient|")?i.substring(20):void 0,l={...e};return l.color={...l.color,text:n?void 0:t,background:r?void 0:o,gradient:s?void 0:i},{style:Ui(l),textColor:n,backgroundColor:r,gradient:s}}function Bp(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 Ip({children:e,resetAllFilter:t}){const n=(0,a.useCallback)((e=>{const n=Bp(e),o=t(n);return{...e,...Cp(o)}}),[t]);return(0,$.jsx)(da,{group:"color",resetAllFilter:n,children:e})}function jp({clientId:e,name:t,setAttributes:n,settings:o}){const r=Zd(o);const{style:i,textColor:s,backgroundColor:u,gradient:d}=(0,c.useSelect)((function(t){const{style:n,textColor:o,backgroundColor:r,gradient:i}=t(oi).getBlockAttributes(e)||{};return{style:n,textColor:o,backgroundColor:r,gradient:i}}),[e]),p=(0,a.useMemo)((()=>Bp({style:i,textColor:s,backgroundColor:u,gradient:d})),[i,s,u,d]);if(!r)return null;const h=(0,l.getBlockSupport)(t,[kp,"__experimentalDefaultControls"]),g="web"===a.Platform.OS&&!p?.color?.gradient&&(o?.color?.text||o?.color?.link)&&!1!==(0,l.getBlockSupport)(t,[kp,"enableContrastChecker"]);return(0,$.jsx)(ap,{as:Ip,panelId:e,settings:o,value:p,onChange:e=>{n(Cp(e))},defaultControls:h,enableContrastChecker:!1!==(0,l.getBlockSupport)(t,[kp,"enableContrastChecker"]),children:g&&(0,$.jsx)(bp,{clientId:e})})}const Ep={useBlockProps:function({name:e,backgroundColor:t,textColor:n,gradient:o,style:r}){const[i,s,l]=ii("color.palette.custom","color.palette.theme","color.palette.default"),c=(0,a.useMemo)((()=>[...i||[],...s||[],...l||[]]),[i,s,l]);if(!vp(e)||Ki(e,kp))return{};const u={};n&&!Ki(e,kp,"text")&&(u.color=Fu(c,n)?.color),t&&!Ki(e,kp,"background")&&(u.backgroundColor=Fu(c,t)?.color);const d=wp({style:u},e,{textColor:n,backgroundColor:t,gradient:o,style:r}),p=t||r?.color?.background||o||r?.color?.gradient;return{...d,className:$i(d.className,!p&&Xc(r))}},addSaveProps:wp,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:vp},Tp={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function Mp({__next40pxDefaultSize:e=!1,__nextHasNoMarginBottom:t=!1,value:n="",onChange:o,fontFamilies:r,...i}){const[s]=ii("typography.fontFamilies");if(r||(r=s),!r||0===r.length)return null;const l=[{value:"",label:(0,C.__)("Default")},...r.map((({fontFamily:e,name:t})=>({value:e,label:t||e})))];return t||y()("Bottom margin styles for wp.blockEditor.FontFamilyControl",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,$.jsx)(Ji.SelectControl,{__next40pxDefaultSize:e,__nextHasNoMarginBottom:t,label:(0,C.__)("Font"),options:l,value:n,onChange:o,labelPosition:"top",...i})}(0,d.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return vp(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),xp(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 Wi({linkColor:_p(r),textColor:Sp(r),backgroundColor:yp(r),gradient:xp(r)},Tp,e,t,n,o)}));const Pp=(e,t)=>e?t?(0,C.__)("Appearance"):(0,C.__)("Font style"):(0,C.__)("Font weight");function Rp(e){const{__next40pxDefaultSize:t=!1,onChange:n,hasFontStyles:o=!0,hasFontWeights:r=!0,fontFamilyFaces:i,value:{fontStyle:s,fontWeight:l},...c}=e,u=o||r,d=Pp(o,r),p={key:"default",name:(0,C.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:h,fontWeights:g,combinedStyleAndWeightOptions:m}=_i(i),f=(0,a.useMemo)((()=>o&&r?(()=>{const e=[p];return m&&e.push(...m),e})():o?(()=>{const e=[p];return h.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[p];return g.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options,h,g,m]),b=f.find((e=>e.style.fontStyle===s&&e.style.fontWeight===l))||f[0];return u&&(0,$.jsx)(Ji.CustomSelectControl,{...c,className:"components-font-appearance-control",__next40pxDefaultSize:t,label:d,describedBy:b?o?r?(0,C.sprintf)((0,C.__)("Currently selected font appearance: %s"),b.name):(0,C.sprintf)((0,C.__)("Currently selected font style: %s"),b.name):(0,C.sprintf)((0,C.__)("Currently selected font weight: %s"),b.name):(0,C.__)("No selected font appearance"),options:f,value:b,onChange:({selectedItem:e})=>n(e.style)})}const Np=1.5;const Lp=({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",...r})=>{const i=function(e){return void 0!==e&&""!==e}(t),s=(e,t)=>{if(i)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return Np;default:return e}},l=i?t:"";return(0,$.jsx)("div",{className:"block-editor-line-height-control",children:(0,$.jsx)(Ji.__experimentalNumberControl,{...r,__next40pxDefaultSize:e,__unstableInputWidth:o,__unstableStateReducer:(e,t)=>{const n=["insertText","insertFromPaste"].includes(t.payload.event.nativeEvent?.inputType),o=s(e.value,n);return{...e,value:o}},onChange:(e,{event:t})=>{""!==e?"click"!==t.type?n(`${e}`):n(s(`${e}`,!1)):n()},label:(0,C.__)("Line height"),placeholder:Np,step:.01,spinFactor:10,value:l,min:0,spinControls:"custom"})})};function Ap({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",...r}){const[i]=ii("spacing.units"),s=(0,Ji.__experimentalUseCustomUnits)({availableUnits:i||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,$.jsx)(Ji.__experimentalUnitControl,{__next40pxDefaultSize:e,...r,label:(0,C.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:s,onChange:n})}const Dp=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})}),Op=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})}),zp=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})}),Vp=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z"})}),Fp=[{label:(0,C.__)("Align text left"),value:"left",icon:Dp},{label:(0,C.__)("Align text center"),value:"center",icon:Op},{label:(0,C.__)("Align text right"),value:"right",icon:zp},{label:(0,C.__)("Justify text"),value:"justify",icon:Vp}],Hp=["left","center","right"];function Gp({className:e,value:t,onChange:n,options:o=Hp}){const r=(0,a.useMemo)((()=>Fp.filter((e=>o.includes(e.value)))),[o]);return r.length?(0,$.jsx)(Ji.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,C.__)("Text alignment"),className:$i("block-editor-text-alignment-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:r.map((e=>(0,$.jsx)(Ji.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))}):null}const $p=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M7 11.5h10V13H7z"})}),Up=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),Wp=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),Kp=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),Zp=[{label:(0,C.__)("None"),value:"none",icon:$p},{label:(0,C.__)("Uppercase"),value:"uppercase",icon:Up},{label:(0,C.__)("Lowercase"),value:"lowercase",icon:Wp},{label:(0,C.__)("Capitalize"),value:"capitalize",icon:Kp}];function qp({className:e,value:t,onChange:n}){return(0,$.jsx)(Ji.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,C.__)("Letter case"),className:$i("block-editor-text-transform-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:Zp.map((e=>(0,$.jsx)(Ji.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))})}const Yp=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),Xp=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),Qp=[{label:(0,C.__)("None"),value:"none",icon:$p},{label:(0,C.__)("Underline"),value:"underline",icon:Yp},{label:(0,C.__)("Strikethrough"),value:"line-through",icon:Xp}];function Jp({value:e,onChange:t,className:n}){return(0,$.jsx)(Ji.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,C.__)("Decoration"),className:$i("block-editor-text-decoration-control",n),value:e,onChange:n=>{t(n===e?void 0:n)},children:Qp.map((e=>(0,$.jsx)(Ji.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))})}const eh=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),th=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),nh=[{label:(0,C.__)("Horizontal"),value:"horizontal-tb",icon:eh},{label:(0,C.__)("Vertical"),value:(0,C.isRTL)()?"vertical-lr":"vertical-rl",icon:th}];function oh({className:e,value:t,onChange:n}){return(0,$.jsx)(Ji.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,C.__)("Orientation"),className:$i("block-editor-writing-mode-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:nh.map((e=>(0,$.jsx)(Ji.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))})}const rh=1,ih=6;function sh(e){const t=ah(e),n=ch(e),o=uh(e),r=dh(e),i=hh(e),s=ph(e),l=gh(e),a=mh(e),c=fh(e),u=lh(e);return t||n||o||r||i||s||u||l||a||c}function lh(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 ah(e){return["default","theme","custom"].some((t=>e?.typography?.fontFamilies?.[t]?.length))}function ch(e){return e?.typography?.lineHeight}function uh(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function dh(e){return e?.typography?.letterSpacing}function ph(e){return e?.typography?.textTransform}function hh(e){return e?.typography?.textAlign}function gh(e){return e?.typography?.textDecoration}function mh(e){return e?.typography?.writingMode}function fh(e){return e?.typography?.textColumns}function bh({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const i=ji();return(0,$.jsx)(Ji.__experimentalToolsPanel,{label:(0,C.__)("Typography"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:i,children:r})}const kh={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function vh({as:e=bh,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:s=kh}){const l=e=>Ti({settings:r},"",e),c=ah(r),u=l(o?.typography?.fontFamily),{fontFamilies:d,fontFamilyFaces:p}=(0,a.useMemo)((()=>function(e,t){var n;const o=e?.typography?.fontFamilies,r=["default","theme","custom"].flatMap((e=>{var t;return null!==(t=o?.[e])&&void 0!==t?t:[]})),i=null!==(n=r.find((e=>e.fontFamily===t))?.fontFace)&&void 0!==n?n:[];return{fontFamilies:r,fontFamilyFaces:i}}(r,u)),[r,u]),h=e=>{const o=d?.find((({fontFamily:t})=>t===e))?.slug;n(ve(t,["typography","fontFamily"],o?`var:preset|font-family|${o}`:e||void 0))},g=lh(r),m=!r?.typography?.customFontSize,f=function(e){var t,n,o;const r=e?.typography?.fontSizes,i=!!e?.typography?.defaultFontSizes;return[...null!==(t=r?.custom)&&void 0!==t?t:[],...null!==(n=r?.theme)&&void 0!==n?n:[],...i&&null!==(o=r?.default)&&void 0!==o?o:[]]}(r),b=l(o?.typography?.fontSize),k=(e,o)=>{n(ve(t,["typography","fontSize"],(o?.slug?`var:preset|font-size|${o?.slug}`:e)||void 0))},v=uh(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),{nearestFontStyle:B,nearestFontWeight:I}=function(e,t,n){let o=t,r=n;const{fontStyles:i,fontWeights:s,combinedStyleAndWeightOptions:l}=_i(e),a=i?.some((({value:e})=>e===t)),c=s?.some((({value:e})=>e?.toString()===n?.toString()));var u,d;return a||(o=t?(u=i,"string"==typeof(d=t)&&d&&["normal","italic","oblique"].includes(d)?!u||0===u.length||u.find((e=>e.value===d))?d:"oblique"!==d||u.find((e=>"oblique"===e.value))?"":"italic":""):l?.find((e=>e.style.fontWeight===Si(s,n)))?.style?.fontStyle),c||(r=n?Si(s,n):l?.find((e=>e.style.fontStyle===(o||t)))?.style?.fontWeight),{nearestFontStyle:o,nearestFontWeight:r}}(p,S,w),j=(0,a.useCallback)((({fontStyle:e,fontWeight:o})=>{e===S&&o===w||n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:o||void 0}})}),[S,w,n,t]),E=(0,a.useCallback)((()=>{j({})}),[j]);(0,a.useEffect)((()=>{B&&I?j({fontStyle:B,fontWeight:I}):E()}),[B,I,E,j]);const T=ch(r),M=l(o?.typography?.lineHeight),P=e=>{n(ve(t,["typography","lineHeight"],e||void 0))},R=dh(r),N=l(o?.typography?.letterSpacing),L=e=>{n(ve(t,["typography","letterSpacing"],e||void 0))},A=fh(r),D=l(o?.typography?.textColumns),O=e=>{n(ve(t,["typography","textColumns"],e||void 0))},z=ph(r),V=l(o?.typography?.textTransform),F=e=>{n(ve(t,["typography","textTransform"],e||void 0))},H=gh(r),G=l(o?.typography?.textDecoration),U=e=>{n(ve(t,["typography","textDecoration"],e||void 0))},W=mh(r),K=l(o?.typography?.writingMode),Z=e=>{n(ve(t,["typography","writingMode"],e||void 0))},q=hh(r),Y=l(o?.typography?.textAlign),X=e=>{n(ve(t,["typography","textAlign"],e||void 0))},Q=(0,a.useCallback)((e=>({...e,typography:{}})),[]);return(0,$.jsxs)(e,{resetAllFilter:Q,value:t,onChange:n,panelId:i,children:[c&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{label:(0,C.__)("Font"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>h(void 0),isShownByDefault:s.fontFamily,panelId:i,children:(0,$.jsx)(Mp,{fontFamilies:d,value:u,onChange:h,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),g&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{label:(0,C.__)("Size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>k(void 0),isShownByDefault:s.fontSize,panelId:i,children:(0,$.jsx)(Ji.FontSizePicker,{value:b,onChange:k,fontSizes:f,disableCustomFontSizes:m,withReset:!1,withSlider:!0,size:"__unstable-large"})}),v&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{className:"single-column",label:_,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:E,isShownByDefault:s.fontAppearance,panelId:i,children:(0,$.jsx)(Rp,{value:{fontStyle:S,fontWeight:w},onChange:j,hasFontStyles:x,hasFontWeights:y,fontFamilyFaces:p,size:"__unstable-large"})}),T&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{className:"single-column",label:(0,C.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>P(void 0),isShownByDefault:s.lineHeight,panelId:i,children:(0,$.jsx)(Lp,{__unstableInputWidth:"auto",value:M,onChange:P,size:"__unstable-large"})}),R&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{className:"single-column",label:(0,C.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>L(void 0),isShownByDefault:s.letterSpacing,panelId:i,children:(0,$.jsx)(Ap,{value:N,onChange:L,size:"__unstable-large",__unstableInputWidth:"auto"})}),A&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{className:"single-column",label:(0,C.__)("Columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>O(void 0),isShownByDefault:s.textColumns,panelId:i,children:(0,$.jsx)(Ji.__experimentalNumberControl,{label:(0,C.__)("Columns"),max:ih,min:rh,onChange:O,size:"__unstable-large",spinControls:"custom",value:D,initialPosition:1})}),H&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{className:"single-column",label:(0,C.__)("Decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>U(void 0),isShownByDefault:s.textDecoration,panelId:i,children:(0,$.jsx)(Jp,{value:G,onChange:U,size:"__unstable-large",__unstableInputWidth:"auto"})}),W&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{className:"single-column",label:(0,C.__)("Orientation"),hasValue:()=>!!t?.typography?.writingMode,onDeselect:()=>Z(void 0),isShownByDefault:s.writingMode,panelId:i,children:(0,$.jsx)(oh,{value:K,onChange:Z,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),z&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{label:(0,C.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>F(void 0),isShownByDefault:s.textTransform,panelId:i,children:(0,$.jsx)(qp,{value:V,onChange:F,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),q&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{label:(0,C.__)("Text alignment"),hasValue:()=>!!t?.typography?.textAlign,onDeselect:()=>X(void 0),isShownByDefault:s.textAlign,panelId:i,children:(0,$.jsx)(Gp,{value:Y,onChange:X,size:"__unstable-large",__nextHasNoMarginBottom:!0})})]})}const _h="typography.lineHeight";const xh=window.wp.tokenList;var yh=n.n(xh);const Sh="typography.__experimentalFontFamily",{kebabCase:wh}=te(Ji.privateApis);function Ch(e,t,n){if(!(0,l.hasBlockSupport)(t,Sh))return e;if(Ki(t,Kh,"fontFamily"))return e;if(!n?.fontFamily)return e;const o=new(yh())(e.className);o.add(`has-${wh(n?.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}const Bh={useBlockProps:function({name:e,fontFamily:t}){return Ch({},e,{fontFamily:t})},addSaveProps:Ch,attributeKeys:["fontFamily"],hasSupport:e=>(0,l.hasBlockSupport)(e,Sh)};(0,d.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,l.hasBlockSupport)(e,Sh)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e}));const{kebabCase:Ih}=te(Ji.privateApis),jh=(e,t,n)=>{if(t){const n=e?.find((({slug:e})=>e===t));if(n)return n}return{size:n}};function Eh(e,t){const n=e?.find((({size:e})=>e===t));return n||{size:t}}function Th(e){if(e)return`has-${Ih(e)}-font-size`}const Mh="typography.fontSize";function Ph(e,t,n){if(!(0,l.hasBlockSupport)(t,Mh))return e;if(Ki(t,Kh,"fontSize"))return e;const o=new(yh())(e.className);o.add(Th(n.fontSize));const r=o.value;return e.className=r||void 0,e}const Rh={useBlockProps:function({name:e,fontSize:t,style:n}){const[o,r,i]=ii("typography.fontSizes","typography.fluid","layout");if(!(0,l.hasBlockSupport)(e,Mh)||Ki(e,Kh,"fontSize")||!t&&!n?.typography?.fontSize)return;let s;return n?.typography?.fontSize&&(s={style:{fontSize:xi({size:n.typography.fontSize},{typography:{fluid:r},layout:i})}}),t&&(s={style:{fontSize:jh(o,t,n?.typography?.fontSize).size}}),s?Ph(s,e,{fontSize:t}):void 0},addSaveProps:Ph,attributeKeys:["fontSize","style"],hasSupport:e=>(0,l.hasBlockSupport)(e,Mh)},Nh={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,d.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,l.hasBlockSupport)(e,Mh)?(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 Wi({fontSize:(0,l.hasBlockSupport)(r,Mh)},Nh,e,t,n,o)}));const Lh=[{icon:Dp,title:(0,C.__)("Align text left"),align:"left"},{icon:Op,title:(0,C.__)("Align text center"),align:"center"},{icon:zp,title:(0,C.__)("Align text right"),align:"right"}],Ah={placement:"bottom-start"};const Dh=function({value:e,onChange:t,alignmentControls:n=Lh,label:o=(0,C.__)("Align text"),description:r=(0,C.__)("Change text alignment"),isCollapsed:i=!0,isToolbar:s}){function l(n){return()=>t(e===n?void 0:n)}const a=n.find((t=>t.align===e)),c=s?Ji.ToolbarGroup:Ji.ToolbarDropdownMenu,u=s?{isCollapsed:i}:{toggleProps:{description:r},popoverProps:Ah};return(0,$.jsx)(c,{icon:a?a.icon:(0,C.isRTL)()?zp:Dp,label:o,controls:n.map((t=>{const{align:n}=t,o=e===n;return{...t,isActive:o,role:i?"menuitemradio":void 0,onClick:l(n)}})),...u})},Oh=e=>(0,$.jsx)(Dh,{...e,isToolbar:!1}),zh=e=>(0,$.jsx)(Dh,{...e,isToolbar:!0}),Vh="typography.textAlign",Fh=[{icon:Dp,title:(0,C.__)("Align text left"),align:"left"},{icon:Op,title:(0,C.__)("Align text center"),align:"center"},{icon:zp,title:(0,C.__)("Align text right"),align:"right"}],Hh=["left","center","right"],Gh=[];function $h(e){return Array.isArray(e)?Hh.filter((t=>e.includes(t))):!0===e?Hh:Gh}const Uh={edit:function({style:e,name:t,setAttributes:n}){const o=Xi(t),r=o?.typography?.textAlign,i=zl();if(!r||"default"!==i)return null;const s=$h((0,l.getBlockSupport)(t,Vh));if(!s.length)return null;const a=Fh.filter((e=>s.includes(e.align)));return(0,$.jsx)(ss,{group:"block",children:(0,$.jsx)(Oh,{value:e?.typography?.textAlign,onChange:t=>{const o={...e,typography:{...e?.typography,textAlign:t}};n({style:Ui(o)})},alignmentControls:a})})},useBlockProps:function({name:e,style:t}){if(!t?.typography?.textAlign)return null;if(!$h((0,l.getBlockSupport)(e,Vh)).length)return null;if(Ki(e,Kh,"textAlign"))return null;const n=t.typography.textAlign;return{className:$i({[`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,Vh);$h(r).includes(o)&&!Ki(t,Kh,"textAlign")&&(e.className=$i(`has-text-align-${o}`,e.className));return e},attributeKeys:["style"],hasSupport:e=>(0,l.hasBlockSupport)(e,Vh,!1)};function Wh(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const Kh="typography",Zh=[_h,Mh,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",Sh,Vh,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function qh(e){const t={...Wh(e,["fontFamily"])},n=e?.typography?.fontSize,o=e?.typography?.fontFamily,r=n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,i=o?.startsWith("var:preset|font-family|")?o.substring(23):void 0;return t.typography={...Wh(t.typography,["fontFamily"]),fontSize:r?void 0:n},{style:Ui(t),fontFamily:i,fontSize:r}}function Yh(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 Xh({children:e,resetAllFilter:t}){const n=(0,a.useCallback)((e=>{const n=Yh(e),o=t(n);return{...e,...qh(o)}}),[t]);return(0,$.jsx)(da,{group:"typography",resetAllFilter:n,children:e})}function Qh({clientId:e,name:t,setAttributes:n,settings:o}){const{style:r,fontFamily:i,fontSize:s}=(0,c.useSelect)((function(t){const{style:n,fontFamily:o,fontSize:r}=t(oi).getBlockAttributes(e)||{};return{style:n,fontFamily:o,fontSize:r}}),[e]),u=sh(o),d=(0,a.useMemo)((()=>Yh({style:r,fontFamily:i,fontSize:s})),[r,s,i]);if(!u)return null;const p=(0,l.getBlockSupport)(t,[Kh,"__experimentalDefaultControls"]);return(0,$.jsx)(vh,{as:Xh,panelId:e,settings:o,value:d,onChange:e=>{n(qh(e))},defaultControls:p})}const Jh=(0,$.jsxs)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,$.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,$.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"})]}),eg={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 tg({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:o,onMouseOut:r,onMouseOver:i,showSideInLabel:s=!0,side:l,spacingSizes:d,type:p,value:h}){var g,m;h=Rs(h,d);let f=d;const b=d.length<=Cs,k=(0,c.useSelect)((e=>{const t=e(oi).getSettings();return t?.disableCustomSpacingSizes})),[v,_]=(0,a.useState)(!k&&void 0!==h&&!Ms(h)),[x,y]=(0,a.useState)(n),S=(0,u.usePrevious)(h);h&&S!==h&&!Ms(h)&&!0!==v&&_(!0);const[w]=ii("spacing.units"),B=(0,Ji.__experimentalUseCustomUnits)({availableUnits:w||["px","em","rem"]});let I=null;!b&&!v&&void 0!==h&&(!Ms(h)||Ms(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=v?Ps(h,d):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":Ls(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(h,d));const j=(0,a.useMemo)((()=>(0,Ji.__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.slice(1,d.length-1).map(((e,t)=>({value:t+1,label:void 0}))),N=Bs.includes(l)&&s?Es[l]:"",L=s?p?.toLowerCase():p,A=(0,C.sprintf)((0,C.__)("%1$s %2$s"),N,L).trim();return(0,$.jsxs)(Ji.__experimentalHStack,{className:"spacing-sizes-control__wrapper",children:[e&&(0,$.jsx)(Ji.Icon,{className:"spacing-sizes-control__icon",icon:e,size:24}),v&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.__experimentalUnitControl,{onMouseOver:i,onMouseOut:r,onFocus:i,onBlur:r,onChange:e=>o((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:I,units:B,min:x,placeholder:M,disableUnits:t,label:A,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,$.jsx)(Ji.RangeControl,{__next40pxDefaultSize:!0,onMouseOver:i,onMouseOut:r,onFocus:i,onBlur:r,value:E,min:0,max:null!==(g=eg[j]?.max)&&void 0!==g?g:10,step:null!==(m=eg[j]?.steps)&&void 0!==m?m:.1,withInputField:!1,onChange:e=>{o([e,j].join(""))},className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0,label:A,hideLabelFromVision:!0})]}),b&&!v&&(0,$.jsx)(Ji.RangeControl,{__next40pxDefaultSize:!0,onMouseOver:i,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:A,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:i,onBlur:r}),!b&&!v&&(0,$.jsx)(Ji.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:A,hideLabelFromVision:!0,size:"__unstable-large",onMouseOver:i,onMouseOut:r,onFocus:i,onBlur:r}),!k&&(0,$.jsx)(Ji.Button,{label:v?(0,C.__)("Use size preset"):(0,C.__)("Set custom size"),icon:Jh,onClick:()=>{_(!v)},isPressed:v,size:"small",className:"spacing-sizes-control__custom-toggle",iconSize:24})]})}const ng=["vertical","horizontal"];function og({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:i,type:s,values:l}){const a=e=>n=>{if(!t)return;const o={...Object.keys(l).reduce(((e,t)=>(e[t]=Rs(l[t],i),e)),{})};"vertical"===e&&(o.top=n,o.bottom=n),"horizontal"===e&&(o.left=n,o.right=n),t(o)},c=r?.length?ng.filter((e=>As(r,e))):ng;return(0,$.jsx)($.Fragment,{children:c.map((t=>{const r="vertical"===t?l.top:l.left;return(0,$.jsx)(tg,{icon:js[t],label:Es[t],minimumCustomValue:e,onChange:a(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:i,type:s,value:r,withInputField:!1},`spacing-sizes-control-${t}`)}))})}function rg({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:i,type:s,values:l}){const a=r?.length?Bs.filter((e=>r.includes(e))):Bs,c=e=>n=>{const o={...Object.keys(l).reduce(((e,t)=>(e[t]=Rs(l[t],i),e)),{})};o[e]=n,t(o)};return(0,$.jsx)($.Fragment,{children:a.map((t=>(0,$.jsx)(tg,{icon:js[t],label:Es[t],minimumCustomValue:e,onChange:c(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:i,type:s,value:l[t],withInputField:!1},`spacing-sizes-control-${t}`)))})}function ig({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:i,spacingSizes:s,type:l,values:a}){return(0,$.jsx)(tg,{label:Es[i],minimumCustomValue:e,onChange:(c=i,e=>{const n={...Object.keys(a).reduce(((e,t)=>(e[t]=Rs(a[t],s),e)),{})};n[c]=e,t(n)}),onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:i,spacingSizes:s,type:l,value:a[i],withInputField:!1});var c}function sg({isLinked:e,...t}){const n=e?(0,C.sprintf)((0,C.__)("Unlink %1$s"),t.label.toLowerCase()).trim():(0,C.sprintf)((0,C.__)("Link %1$s"),t.label.toLowerCase()).trim();return(0,$.jsx)(Ji.Tooltip,{text:n,children:(0,$.jsx)(Ji.Button,{...t,size:"small",icon:e?Ju:dc,iconSize:24,"aria-label":n})})}const lg=[],ag=new Intl.Collator("und",{numeric:!0}).compare;function cg(){const[e,t,n,o]=ii("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),r=null!=e?e:lg,i=null!=t?t:lg,s=n&&!1!==o?n:lg;return(0,a.useMemo)((()=>{const e=[{name:(0,C.__)("None"),slug:"0",size:0},...r,...i,...s];return e.every((({slug:e})=>/^[0-9]/.test(e)))&&e.sort(((e,t)=>ag(e.slug,t.slug))),e.length>Cs?[{name:(0,C.__)("Default"),slug:"default",size:void 0},...e]:e}),[r,i,s])}function ug({inputProps:e,label:t,minimumCustomValue:n=0,onChange:o,onMouseOut:r,onMouseOver:i,showSideInLabel:s=!0,sides:l=Bs,useSelect:c,values:u}){const d=cg(),p=u||Is,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:i}=e,s=[n,o,r,i].filter(Boolean),l=!(n!==r||i!==o||!n&&!i),a=!s.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),c=t?.includes("horizontal")&&t?.includes("vertical")&&2===t?.length;if(As(t)&&(l||a))return Ts.axial;if(c&&1===s.length){let t;return Object.entries(e).some((([e,n])=>(t=e,void 0!==n))),t}return 1!==t?.length||s.length?Ts.custom:t[0]}(p,l)),b={...e,minimumCustomValue:n,onChange:e=>{const t={...u,...e};o(t)},onMouseOut:r,onMouseOver:i,sides:l,spacingSizes:d,type:t,useSelect:c,values:p},k=Bs.includes(m)&&s?Es[m]:"",v=(0,C.sprintf)((0,C.__)("%1$s %2$s"),t,k).trim();return(0,$.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,$.jsxs)(Ji.__experimentalHStack,{className:"spacing-sizes-control__header",children:[(0,$.jsx)(Ji.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:v}),!h&&!g&&(0,$.jsx)(sg,{label:t,onClick:()=>{f(m===Ts.axial?Ts.custom:Ts.axial)},isLinked:m===Ts.axial})]}),(0,$.jsx)(Ji.__experimentalVStack,{spacing:.5,children:m===Ts.axial?(0,$.jsx)(og,{...b}):m===Ts.custom?(0,$.jsx)(rg,{...b}):(0,$.jsx)(ig,{side:m,...b,showSideInLabel:s})})]})}const dg={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 pg({label:e=(0,C.__)("Height"),onChange:t,value:n}){var o,r;const i=parseFloat(n),[s]=ii("spacing.units"),l=(0,Ji.__experimentalUseCustomUnits)({availableUnits:s||["%","px","em","rem","vh","vw"]}),c=(0,a.useMemo)((()=>(0,Ji.__experimentalParseQuantityAndUnitFromRawValue)(n)),[n])[1]||l[0]?.value||"px";return(0,$.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,$.jsx)(Ji.BaseControl.VisualLabel,{as:"legend",children:e}),(0,$.jsxs)(Ji.Flex,{children:[(0,$.jsx)(Ji.FlexItem,{isBlock:!0,children:(0,$.jsx)(Ji.__experimentalUnitControl,{value:n,units:l,onChange:t,onUnitChange:e=>{const[o,r]=(0,Ji.__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,$.jsx)(Ji.FlexItem,{isBlock:!0,children:(0,$.jsx)(Ji.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,$.jsx)(Ji.RangeControl,{__next40pxDefaultSize:!0,value:i,min:0,max:null!==(o=dg[c]?.max)&&void 0!==o?o:100,step:null!==(r=dg[c]?.step)&&void 0!==r?r:.1,withInputField:!1,onChange:e=>{t([e,c].join(""))},__nextHasNoMarginBottom:!0,label:e,hideLabelFromVision:!0})})})]})]})}function hg(e,t){const{getBlockOrder:n,getBlockAttributes:o}=(0,c.useSelect)(oi);return(r,i)=>{const s=(i-1)*t+r-1;let l=0;for(const r of n(e)){var a;const{columnStart:e,rowStart:n}=null!==(a=o(r).style?.layout)&&void 0!==a?a:{};(n-1)*t+e-1<s&&l++}return l}}function gg(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 mg({value:e={},onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}){const{type:i,default:{type:s="default"}={}}=null!=n?n:{},l=i||s;return"flex"===l?(0,$.jsx)(fg,{childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}):"grid"===l?(0,$.jsx)(kg,{childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}):null}function fg({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}){const{selfStretch:i,flexSize:s}=e,{orientation:l="horizontal"}=null!=n?n:{},c="horizontal"===l?(0,C.__)("Width"):(0,C.__)("Height");return(0,a.useEffect)((()=>{"fixed"!==i||s||t({...e,selfStretch:"fit"})}),[]),(0,$.jsxs)(Ji.__experimentalVStack,{as:Ji.__experimentalToolsPanelItem,spacing:2,hasValue:()=>!!i,label:c,onDeselect:()=>{t({selfStretch:void 0,flexSize:void 0})},isShownByDefault:o,panelId:r,children:[(0,$.jsxs)(Ji.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:bg(n),value:i||"fit",help:gg(i,n),onChange:e=>{t({selfStretch:e,flexSize:"fixed"!==e?null:s})},isBlock:!0,children:[(0,$.jsx)(Ji.__experimentalToggleGroupControlOption,{value:"fit",label:(0,C._x)("Fit","Intrinsic block width in flex layout")},"fit"),(0,$.jsx)(Ji.__experimentalToggleGroupControlOption,{value:"fill",label:(0,C._x)("Grow","Block with expanding width in flex layout")},"fill"),(0,$.jsx)(Ji.__experimentalToggleGroupControlOption,{value:"fixed",label:(0,C._x)("Fixed","Block with fixed width in flex layout")},"fixed")]}),"fixed"===i&&(0,$.jsx)(Ji.__experimentalUnitControl,{size:"__unstable-large",onChange:e=>{t({selfStretch:i,flexSize:e})},value:s,label:c,hideLabelFromVision:!0})]})}function bg(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,C.__)("Width"):(0,C.__)("Height")}function kg({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}){const{columnStart:i,rowStart:s,columnSpan:l,rowSpan:a}=e,{columnCount:u=3,rowCount:d}=null!=n?n:{},p=(0,c.useSelect)((e=>e(oi).getBlockRootClientId(r))),{moveBlocksToPosition:h,__unstableMarkNextChangeAsNotPersistent:g}=(0,c.useDispatch)(oi),m=hg(p,u);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Ji.__experimentalHStack,{as:Ji.__experimentalToolsPanelItem,hasValue:()=>!!l||!!a,label:(0,C.__)("Grid span"),onDeselect:()=>{t({columnSpan:void 0,rowSpan:void 0})},isShownByDefault:o,panelId:r,children:[(0,$.jsx)(Ji.__experimentalInputControl,{size:"__unstable-large",label:(0,C.__)("Column span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:i,rowStart:s,rowSpan:a,columnSpan:n})},value:null!=l?l:1,min:1}),(0,$.jsx)(Ji.__experimentalInputControl,{size:"__unstable-large",label:(0,C.__)("Row span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:i,rowStart:s,columnSpan:l,rowSpan:n})},value:null!=a?a:1,min:1})]}),window.__experimentalEnableGridInteractivity&&u&&(0,$.jsxs)(Ji.Flex,{as:Ji.__experimentalToolsPanelItem,hasValue:()=>!!i||!!s,label:(0,C.__)("Grid placement"),onDeselect:()=>{t({columnStart:void 0,rowStart:void 0})},isShownByDefault:!1,panelId:r,children:[(0,$.jsx)(Ji.FlexItem,{style:{width:"50%"},children:(0,$.jsx)(Ji.__experimentalInputControl,{size:"__unstable-large",label:(0,C.__)("Column"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:n,rowStart:s,columnSpan:l,rowSpan:a}),g(),h([r],p,p,m(n,s))},value:null!=i?i:1,min:1,max:u?u-(null!=l?l:1)+1:void 0})}),(0,$.jsx)(Ji.FlexItem,{style:{width:"50%"},children:(0,$.jsx)(Ji.__experimentalInputControl,{size:"__unstable-large",label:(0,C.__)("Row"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:i,rowStart:n,columnSpan:l,rowSpan:a}),g(),h([r],p,p,m(i,n))},value:null!=s?s:1,min:1,max:d?d-(null!=a?a:1)+1:void 0})})]})]})}function vg({panelId:e,value:t,onChange:n=(()=>{}),options:o,defaultValue:r="auto",hasValue:i,isShownByDefault:s=!0}){const l=null!=t?t:"auto",[a,c,u]=ii("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,$.jsx)(Ji.__experimentalToolsPanelItem,{hasValue:i||(()=>l!==r),label:(0,C.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:s,panelId:e,children:(0,$.jsx)(Ji.SelectControl,{label:(0,C.__)("Aspect ratio"),value:l,options:null!=o?o:h,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0})})}const _g=["horizontal","vertical"];function xg(e){const t=yg(e),n=Sg(e),o=wg(e),r=Cg(e),i=Bg(e),s=Ig(e),l=jg(e),c=Eg(e);return"web"===a.Platform.OS&&(t||n||o||r||i||s||l||c)}function yg(e){return e?.layout?.contentSize}function Sg(e){return e?.layout?.wideSize}function wg(e){return e?.spacing?.padding}function Cg(e){return e?.spacing?.margin}function Bg(e){return e?.spacing?.blockGap}function Ig(e){return e?.dimensions?.minHeight}function jg(e){return e?.dimensions?.aspectRatio}function Eg(e){var t;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=null!==(t=e?.parentLayout)&&void 0!==t?t:{},i=("flex"===o||"flex"===n||"grid"===o||"grid"===n)&&r;return!!e?.layout&&i}function Tg(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 Mg(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function Pg({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const i=ji();return(0,$.jsx)(Ji.__experimentalToolsPanel,{label:(0,C.__)("Dimensions"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:i,children:r})}const Rg={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,aspectRatio:!0,childLayout:!0};function Ng({as:e=Pg,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:s=Rg,onVisualize:l=(()=>{}),includeLayoutControls:c=!1}){var u,d,p,h,g,m,f,b;const{dimensions:k,spacing:v}=r,_=e=>e&&"object"==typeof e?Object.keys(e).reduce(((t,n)=>(t[n]=Ti({settings:{dimensions:k,spacing:v}},"",e[n]),t)),{}):Ti({settings:{dimensions:k,spacing:v}},"",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,Ji.__experimentalUseCustomUnits)({availableUnits:r?.spacing?.units||["%","px","em","rem","vw"]}),S=-1/0,[w,B]=(0,a.useState)(S),I=yg(r)&&c,j=_(o?.layout?.contentSize),E=e=>{n(ve(t,["layout","contentSize"],e||void 0))},T=Sg(r)&&c,M=_(o?.layout?.wideSize),P=e=>{n(ve(t,["layout","wideSize"],e||void 0))},R=wg(r),N=Mg(_(o?.spacing?.padding)),L=Array.isArray(r?.spacing?.padding)?r?.spacing?.padding:r?.spacing?.padding?.sides,A=L&&L.some((e=>_g.includes(e))),D=e=>{const o=Tg(e,L);n(ve(t,["spacing","padding"],o))},O=()=>l("padding"),z=Cg(r),V=Mg(_(o?.spacing?.margin)),F=Array.isArray(r?.spacing?.margin)?r?.spacing?.margin:r?.spacing?.margin?.sides,H=F&&F.some((e=>_g.includes(e))),G=e=>{const o=Tg(e,F);n(ve(t,["spacing","margin"],o))},U=()=>l("margin"),W=Bg(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=>_g.includes(e))),X=e=>{n(ve(t,["spacing","blockGap"],e))},Q=e=>{e||X(null),!Y&&e?.hasOwnProperty("top")?X(e.top):X({top:e?.top,left:e?.left})},J=Ig(r),ee=_(o?.dimensions?.minHeight),te=e=>{const o=ve(t,["dimensions","minHeight"],e);n(ve(o,["dimensions","aspectRatio"],void 0))},ne=jg(r),oe=_(o?.dimensions?.aspectRatio),re=Eg(r),ie=o?.layout,se=(0,a.useCallback)((e=>({...e,layout:Ui({...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,$.jsxs)(e,{resetAllFilter:se,value:t,onChange:n,panelId:i,children:[(I||T)&&(0,$.jsx)("span",{className:"span-columns",children:(0,C.__)("Set the width of the main content area.")}),I&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{label:(0,C.__)("Content width"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>E(void 0),isShownByDefault:null!==(u=s.contentSize)&&void 0!==u?u:Rg.contentSize,panelId:i,children:(0,$.jsx)(Ji.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,C.__)("Content width"),labelPosition:"top",value:j||"",onChange:e=>{E(e)},units:y,prefix:(0,$.jsx)(Ji.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,$.jsx)(cl,{icon:ul})})})}),T&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{label:(0,C.__)("Wide width"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>P(void 0),isShownByDefault:null!==(d=s.wideSize)&&void 0!==d?d:Rg.wideSize,panelId:i,children:(0,$.jsx)(Ji.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,C.__)("Wide width"),labelPosition:"top",value:M||"",onChange:e=>{P(e)},units:y,prefix:(0,$.jsx)(Ji.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,$.jsx)(cl,{icon:dl})})})}),R&&(0,$.jsxs)(Ji.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,C.__)("Padding"),onDeselect:()=>D(void 0),isShownByDefault:null!==(p=s.padding)&&void 0!==p?p:Rg.padding,className:$i({"tools-panel-item-spacing":x}),panelId:i,children:[!x&&(0,$.jsx)(Ji.__experimentalBoxControl,{__next40pxDefaultSize:!0,values:N,onChange:D,label:(0,C.__)("Padding"),sides:L,units:y,allowReset:!1,splitOnAxis:A,onMouseOver:O,onMouseOut:le}),x&&(0,$.jsx)(ug,{values:N,onChange:D,label:(0,C.__)("Padding"),sides:L,units:y,allowReset:!1,onMouseOver:O,onMouseOut:le})]}),z&&(0,$.jsxs)(Ji.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,C.__)("Margin"),onDeselect:()=>G(void 0),isShownByDefault:null!==(h=s.margin)&&void 0!==h?h:Rg.margin,className:$i({"tools-panel-item-spacing":x}),panelId:i,children:[!x&&(0,$.jsx)(Ji.__experimentalBoxControl,{__next40pxDefaultSize:!0,values:V,onChange:G,inputProps:ae,label:(0,C.__)("Margin"),sides:F,units:y,allowReset:!1,splitOnAxis:H,onMouseOver:U,onMouseOut:le}),x&&(0,$.jsx)(ug,{values:V,onChange:G,minimumCustomValue:-1/0,label:(0,C.__)("Margin"),sides:F,units:y,allowReset:!1,onMouseOver:U,onMouseOut:le})]}),W&&(0,$.jsxs)(Ji.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,C.__)("Block spacing"),onDeselect:()=>X(void 0),isShownByDefault:null!==(g=s.blockGap)&&void 0!==g?g:Rg.blockGap,className:$i({"tools-panel-item-spacing":x,"single-column":!x&&!Y}),panelId:i,children:[!x&&(Y?(0,$.jsx)(Ji.__experimentalBoxControl,{__next40pxDefaultSize:!0,label:(0,C.__)("Block spacing"),min:0,onChange:Q,units:y,sides:q,values:Z,allowReset:!1,splitOnAxis:Y}):(0,$.jsx)(Ji.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,C.__)("Block spacing"),min:0,onChange:X,units:y,value:K})),x&&(0,$.jsx)(ug,{label:(0,C.__)("Block spacing"),min:0,onChange:Q,showSideInLabel:!1,sides:Y?q:["top"],values:Z,allowReset:!1})]}),re&&(0,$.jsx)(mg,{value:ie,onChange:e=>{n({...t,layout:{...e}})},parentLayout:r?.parentLayout,panelId:i,isShownByDefault:null!==(m=s.childLayout)&&void 0!==m?m:Rg.childLayout}),J&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,C.__)("Minimum height"),onDeselect:()=>{te(void 0)},isShownByDefault:null!==(f=s.minHeight)&&void 0!==f?f:Rg.minHeight,panelId:i,children:(0,$.jsx)(pg,{label:(0,C.__)("Minimum height"),value:ee,onChange:te})}),ne&&(0,$.jsx)(vg,{hasValue:()=>!!t?.dimensions?.aspectRatio,value:oe,onChange:e=>{const o=ve(t,["dimensions","aspectRatio"],e);n(ve(o,["dimensions","minHeight"],void 0))},panelId:i,isShownByDefault:null!==(b=s.aspectRatio)&&void 0!==b?b:Rg.aspectRatio})]})}const Lg=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])},Ag=".block-editor-block-list__block",Dg=".block-list-appender",Og=".block-editor-button-block-appender";function zg(e,t){return e.closest(Ag)===t.closest(Ag)}function Vg(e,t){return t.closest([Ag,Dg,Og].join(","))===e}function Fg(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Ag);return t?t.id.slice(6):void 0}function Hg(e,t){const n=Math.min(e.left,t.left),o=Math.max(e.right,t.right),r=Math.max(e.bottom,t.bottom),i=Math.min(e.top,t.top);return new window.DOMRectReadOnly(n,i,o-n,r-i)}function Gg(e){const t=e.ownerDocument.defaultView;if(!t)return!1;if(e.classList.contains("components-visually-hidden"))return!1;const n=e.getBoundingClientRect();if(0===n.width||0===n.height)return!1;if(e.checkVisibility)return e.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0,visibilityProperty:!0});const o=t.getComputedStyle(e);return"none"!==o.display&&"hidden"!==o.visibility&&"0"!==o.opacity}function $g(e){const t=e.ownerDocument.defaultView;if(!t)return new window.DOMRectReadOnly;let n=e.getBoundingClientRect();const o=[e];let r;for(;r=o.pop();)for(const e of r.children)if(Gg(e)){n=Hg(n,e.getBoundingClientRect()),o.push(e)}const i=Math.max(n.left,0),s=Math.min(n.right,t.innerWidth);return n=new window.DOMRectReadOnly(i,n.top,s-i,n.height),n}const Ug=Number.MAX_SAFE_INTEGER;const Wg=(0,a.forwardRef)((function({clientId:e,bottomClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,shift:i=!0,...s},l){const c=mp(e),d=mp(null!=t?t:e),p=(0,u.useMergeRefs)([l,Lg(r)]),[h,g]=(0,a.useReducer)((e=>(e+1)%Ug),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:()=>d?Hg($g(c),$g(d)):$g(c),contextElement:c}}),[t,d,c,h]);return!c||t&&!d?null:(0,$.jsx)(Ji.Popover,{ref:p,animate:!1,focusOnMount:!1,anchor:m,__unstableSlotName:o,inline:!o,placement:"top-start",resize:!1,flip:!1,shift:i,...s,className:$i("block-editor-block-popover",s.className),variant:"unstyled",children:n})})),Kg=(0,a.forwardRef)((({clientId:e,bottomClientId:t,children:n,...o},r)=>(0,$.jsx)(Wg,{...o,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:r,children:n})));function Zg({selectedElement:e,additionalStyles:t={},children:n}){const[o,r]=(0,a.useState)(e.offsetWidth),[i,s]=(0,a.useState)(e.offsetHeight);(0,a.useEffect)((()=>{const t=new window.ResizeObserver((()=>{r(e.offsetWidth),s(e.offsetHeight)}));return t.observe(e,{box:"border-box"}),()=>t.disconnect()}),[e]);const l=(0,a.useMemo)((()=>({position:"absolute",width:o,height:i,...t})),[o,i,t]);return(0,$.jsx)("div",{style:l,children:n})}const qg=(0,a.forwardRef)((function({clientId:e,bottomClientId:t,children:n,shift:o=!1,additionalStyles:r,...i},s){var l;null!==(l=t)&&void 0!==l||(t=e);const a=mp(e);return(0,$.jsx)(Wg,{ref:s,clientId:e,bottomClientId:t,shift:o,...i,children:a&&e===t?(0,$.jsx)(Zg,{selectedElement:a,additionalStyles:r,children:n}):n})}));function Yg({clientId:e,value:t,computeStyle:n,forceShow:o}){const r=mp(e),[i,s]=(0,a.useReducer)((()=>n(r)));(0,a.useLayoutEffect)((()=>{r&&window.requestAnimationFrame((()=>window.requestAnimationFrame(s)))}),[r,t]);const l=(0,a.useRef)(t),[c,u]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{if(ya()(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,$.jsx)(qg,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,$.jsx)("div",{className:"block-editor__spacing-visualizer",style:i})}):null}function Xg(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Qg({clientId:e,value:t,forceShow:n}){return(0,$.jsx)(Yg,{clientId:e,value:t?.spacing?.margin,computeStyle:e=>{const t=Xg(e,"margin-top"),n=Xg(e,"margin-right"),o=Xg(e,"margin-bottom"),r=Xg(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 Jg({clientId:e,value:t,forceShow:n}){return(0,$.jsx)(Yg,{clientId:e,value:t?.spacing?.padding,computeStyle:e=>({borderTopWidth:Xg(e,"padding-top"),borderRightWidth:Xg(e,"padding-right"),borderBottomWidth:Xg(e,"padding-bottom"),borderLeftWidth:Xg(e,"padding-left")}),forceShow:n})}const em="dimensions",tm="spacing";function nm({children:e,resetAllFilter:t}){const n=(0,a.useCallback)((e=>{const n=e.style,o=t(n);return{...e,style:o}}),[t]);return(0,$.jsx)(da,{group:"dimensions",resetAllFilter:n,children:e})}function om({clientId:e,name:t,setAttributes:n,settings:o}){const r=xg(o),i=(0,c.useSelect)((t=>t(oi).getBlockAttributes(e)?.style),[e]),[s,u]=function(){const[e,t]=(0,a.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=te((0,c.useDispatch)(oi));return(0,a.useEffect)((()=>{e?n():o()}),[e,o,n]),[e,t]}();if(!r)return null;const d={...(0,l.getBlockSupport)(t,[em,"__experimentalDefaultControls"]),...(0,l.getBlockSupport)(t,[tm,"__experimentalDefaultControls"])};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ng,{as:nm,panelId:e,settings:o,value:i,onChange:e=>{n({style:Ui(e)})},defaultControls:d,onVisualize:u}),!!o?.spacing?.padding&&(0,$.jsx)(Jg,{forceShow:"padding"===s,clientId:e,value:i}),!!o?.spacing?.margin&&(0,$.jsx)(Qg,{forceShow:"margin"===s,clientId:e,value:i})]})}function rm(e,t="any"){if("web"!==a.Platform.OS)return!1;const n=(0,l.getBlockSupport)(e,em);return!0===n||("any"===t?!(!n?.aspectRatio&&!n?.minHeight):!!n?.[t])}const im={useBlockProps:function({name:e,minHeight:t,style:n}){if(!rm(e,"aspectRatio")||Ki(e,em,"aspectRatio"))return{};const o=$i({"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=>rm(e,"aspectRatio")};function sm(){y()("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}const lm=[...Zh,Sd,kp,em,Kc,tm,wd],am=e=>lm.some((t=>(0,l.hasBlockSupport)(e,t)));function cm(e={}){const t={};return(0,li.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const um={[`${Sd}.__experimentalSkipSerialization`]:["border"],[`${kp}.__experimentalSkipSerialization`]:[kp],[`${Kh}.__experimentalSkipSerialization`]:[Kh],[`${em}.__experimentalSkipSerialization`]:[em],[`${tm}.__experimentalSkipSerialization`]:[tm],[`${wd}.__experimentalSkipSerialization`]:[wd]},dm={...um,[`${em}.aspectRatio`]:[`${em}.aspectRatio`],[`${Kc}`]:[Kc]},pm={[`${em}.aspectRatio`]:!0,[`${Kc}`]:!0},hm={gradients:"gradient"};function gm(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;gm(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function mm(e,t,n,o=dm){if(!am(t))return e;let{style:r}=n;return Object.entries(o).forEach((([e,n])=>{const o=pm[e]||(0,l.getBlockSupport)(t,e);!0===o&&(r=gm(r,n)),Array.isArray(o)&&o.forEach((e=>{const t=hm[e]||e;r=gm(r,[[...n,t]])}))})),e.style={...cm(r),...e.style},e}const fm={edit:function({clientId:e,name:t,setAttributes:n,__unstableParentLayout:o}){const r=Xi(t,o),i=zl(),s={clientId:e,name:t,setAttributes:n,settings:{...r,typography:{...r.typography,textAlign:!1}}};return"default"!==i?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(jp,{...s}),(0,$.jsx)(Jc,{...s}),(0,$.jsx)(Qh,{...s}),(0,$.jsx)(Md,{...s}),(0,$.jsx)(om,{...s})]})},hasSupport:am,addSaveProps:mm,attributeKeys:["style"],useBlockProps:function e({name:t,style:n}){const o=`wp-elements-${(0,u.useInstanceId)(e)}`,r=`.${o}`,i=n?.elements,s=(0,a.useMemo)((()=>{if(!i)return;const e=[];return bm.forEach((({elementType:n,pseudo:o,elements:s})=>{if(Ki(t,kp,n))return;const a=i?.[n];if(a){const t=Mi(r,l.__EXPERIMENTAL_ELEMENTS[n]);e.push((0,li.compileCSS)(a,{selector:t})),o&&o.forEach((t=>{a[t]&&e.push((0,li.compileCSS)(a[t],{selector:Mi(r,`${l.__EXPERIMENTAL_ELEMENTS[n]}${t}`)}))}))}s&&s.forEach((t=>{i[t]&&e.push((0,li.compileCSS)(i[t],{selector:Mi(r,l.__EXPERIMENTAL_ELEMENTS[t])}))}))})),e.length>0?e.join(""):void 0}),[r,i,t]);return qi({css:s}),mm({className:o},t,{style:n},um)}},bm=[{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 am(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 km=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})});const vm=function e({id:t,colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:i,value:s,onChange:l}){let a;a="unset"===s?(0,$.jsx)(Ji.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):s?(0,$.jsx)(Ji.DuotoneSwatch,{values:s}):(0,$.jsx)(cl,{icon:km});const c=(0,C.__)("Apply duotone filter"),d=`${(0,u.useInstanceId)(e,"duotone-control",t)}__description`;return(0,$.jsx)(Ji.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,C.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,$.jsx)(Ji.ToolbarButton,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==ma.DOWN||(n.preventDefault(),t())},label:c,icon:a}),renderContent:()=>(0,$.jsxs)(Ji.MenuGroup,{label:(0,C.__)("Duotone"),children:[(0,$.jsx)("p",{children:(0,C.__)("Create a two-tone color effect without losing your original image.")}),(0,$.jsx)(Ji.DuotonePicker,{"aria-label":c,"aria-describedby":d,colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:i,value:s,onChange:l})]})})};function _m(e){return`${e}{filter:none}`}function xm(e,t){return`${e}{filter:url(#${t})}`}function ym(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Ru(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 Sm(e,t="root",n={}){if(!t)return null;const{fallback:o=!1}=n,{name:r,selectors:i,supports:s}=e,l=i&&Object.keys(i).length>0,a=Array.isArray(t)?t.join("."):t;let c=null;if(c=l&&i.root?i?.root:s?.__experimentalSelector?s.__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 _e(i,`${a}.root`,null)||_e(i,a,null)||e}const t=_e(s,`${a}.__experimentalSelector`,null);return t?Mi(c,t):e}let d;return l&&(d=_e(i,a,null)),d||(o?Sm(e,u[0],n):null)}const wm=[];function Cm(e,{presetSetting:t,defaultSetting:n}){const o=!e?.color?.[n],r=e?.color?.[t]?.custom||wm,i=e?.color?.[t]?.theme||wm,s=e?.color?.[t]?.default||wm;return(0,a.useMemo)((()=>[...r,...i,...o?wm:s]),[o,r,i,s])}function Bm(e){return Im(e)}function Im(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function jm({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const i=ji();return(0,$.jsx)(Ji.__experimentalToolsPanel,{label:(0,C._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:i,children:r})}const Em={duotone:!0},Tm={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,C.__)("Duotone")},Mm=({indicator:e,label:t})=>(0,$.jsxs)(Ji.__experimentalHStack,{justify:"flex-start",children:[(0,$.jsx)(Ji.__experimentalZStack,{isLayered:!1,offset:-8,children:(0,$.jsx)(Ji.Flex,{expanded:!1,children:"unset"!==e&&e?(0,$.jsx)(Ji.DuotoneSwatch,{values:e}):(0,$.jsx)(Ji.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"})})}),(0,$.jsx)(Ji.FlexItem,{title:t,children:t})]});function Pm({as:e=jm,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:s=Em}){const l=Im(r),c=Cm(r,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),u=Cm(r,{presetSetting:"palette",defaultSetting:"defaultPalette"}),d=(p=o?.filter?.duotone,Ti({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(ve(t,["filter","duotone"],r))},g=(0,a.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,$.jsx)(e,{resetAllFilter:g,value:t,onChange:n,panelId:i,children:l&&(0,$.jsx)(Ji.__experimentalToolsPanelItem,{label:(0,C.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:()=>h(void 0),isShownByDefault:s.duotone,panelId:i,children:(0,$.jsx)(Ji.Dropdown,{popoverProps:Tm,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:$i({"is-open":t}),"aria-expanded":t};return(0,$.jsx)(Ji.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,...n,children:(0,$.jsx)(Mm,{indicator:d,label:(0,C.__)("Duotone")})})})},renderContent:()=>(0,$.jsx)(Ji.__experimentalDropdownContentWrapper,{paddingSize:"small",children:(0,$.jsxs)(Ji.MenuGroup,{label:(0,C.__)("Duotone"),children:[(0,$.jsx)("p",{children:(0,C.__)("Create a two-tone color effect without losing your original image.")}),(0,$.jsx)(Ji.DuotonePicker,{colorPalette:u,duotonePalette:c,disableCustomColors:!0,disableCustomDuotone:!0,value:d,onChange:h})]})})})})})}const Rm=[],Nm=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,i]=ii(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,a.useMemo)((()=>[...o||Rm,...r||Rm,...n&&i||Rm]),[n,o,r,i])}function Am(e,t){if(!e)return;const n=t?.find((({slug:t})=>e===`var:preset|duotone|${t}`));return n?n.colors:void 0}Lu([Au]);const Dm={shareWithChildBlocks:!0,edit:function({style:e,setAttributes:t,name:n}){const o=e?.color?.duotone,r=Xi(n),i=zl(),s=Lm({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),l=Lm({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[a,c]=ii("color.custom","color.customDuotone"),u=!a,d=!c||0===l?.length&&u;if(0===s?.length&&d)return null;if("default"!==i)return null;const p=Array.isArray(o)?o:Am(o,s);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(da,{group:"filter",children:(0,$.jsx)(Pm,{value:{filter:{duotone:p}},onChange:n=>{const o={...e,color:{...n?.filter}};t({style:o})},settings:r})}),(0,$.jsx)(ss,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,$.jsx)(vm,{duotonePalette:s,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,s),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),i=(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=Sm(e);return"string"==typeof t?Mi(n,t):n}return Sm(e,"filter.duotone",{fallback:!0})}}),[n]),s=o?.color?.duotone,c=`wp-duotone-${r}`,d=i&&s;return Om({clientId:t,id:c,selector:i,attribute:s}),{className:d?c:""}},attributeKeys:["style"],hasSupport:e=>(0,l.hasBlockSupport)(e,"filter.duotone")};function Om({clientId:e,id:t,selector:n,attribute:o}){const r=Lm({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=Array.isArray(o),s=i?void 0:Am(o,r),l="string"==typeof o&&s;let c=null;l?c=s:("string"==typeof o&&!l||i)&&(c=o);const u=n.split(",").map((e=>`.${t}${e.trim()}`)).join(", "),d=Array.isArray(c)||"unset"===c;Yi(d?{css:"unset"!==c?xm(u,t):_m(u),__unstableType:"presets"}:void 0),Yi(d?{assets:"unset"!==c?ym(t,c):"",__unstableType:"svgs"}:void 0);const p=mp(e);(0,a.useEffect)((()=>{if(d&&p&&Nm){const e=p.style.display;p.style.display="inline-block",p.offsetHeight,p.style.display=e}}),[d,p,c])}function zm(e){return(0,c.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(oi),{getBlockType:r,getActiveBlockVariation:i}=t(l.store),s=n(e),a=r(s);if(!a)return null;const c=o(e),u=i(s,c),d=(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 Vm="position",Fm={key:"default",value:"",name:(0,C.__)("Default")},Hm={key:"sticky",value:"sticky",name:(0,C._x)("Sticky","Name for the value of the CSS position property"),hint:(0,C.__)("The block will stick to the top of the window instead of scrolling.")},Gm={key:"fixed",value:"fixed",name:(0,C._x)("Fixed","Name for the value of the CSS position property"),hint:(0,C.__)("The block will not move when the page is scrolled.")},$m=["top","right","bottom","left"],Um=["sticky","fixed"];function Wm(e){const t=e?.style?.position?.type;return"sticky"===t||"fixed"===t}function Km({name:e}={}){const[t,n]=ii("position.fixed","position.sticky"),o=!t&&!n;return r=e,!(0,l.getBlockSupport)(r,Vm)||o;var r}function Zm({style:e={},clientId:t,name:n,setAttributes:o}){const r=function(e){const t=(0,l.getBlockSupport)(e,Vm);return!(!0!==t&&!t?.fixed)}(n),i=function(e){const t=(0,l.getBlockSupport)(e,Vm);return!(!0!==t&&!t?.sticky)}(n),s=e?.position?.type,{firstParentClientId:u}=(0,c.useSelect)((e=>{const{getBlockParents:n}=e(oi),o=n(t);return{firstParentClientId:o[o.length-1]}}),[t]),d=zm(u),p=i&&s===Hm.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=[Fm];return(i||s===Hm.value)&&e.push(Hm),(r||s===Gm.value)&&e.push(Gm),e}),[r,i,s]),g=s&&h.find((e=>e.value===s))||Fm;return a.Platform.select({web:h.length>1?(0,$.jsx)(da,{group:"position",children:(0,$.jsx)(Ji.BaseControl,{__nextHasNoMarginBottom:!0,help:p,children:(0,$.jsx)(Ji.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,C.__)("Position"),hideLabelFromVision:!0,describedBy:(0,C.sprintf)((0,C.__)("Currently selected position: %s"),g.name),options:h,value:g,onChange:({selectedItem:t})=>{(t=>{const n={...e,position:{...e?.position,type:t,top:"sticky"===t||"fixed"===t?"0px":void 0}};o({style:Ui(n)})})(t.value)},size:"__unstable-large"})})}):null,native:null})}const qm={edit:function(e){return Km(e)?null:(0,$.jsx)(Zm,{...e})},useBlockProps:function e({name:t,style:n}){const o=(0,l.hasBlockSupport)(t,Vm),r=Km({name:t}),i=o&&!r,s=(0,u.useInstanceId)(e),a=`.wp-container-${s}.wp-container-${s}`;let c;i&&(c=function({selector:e,style:t}){let n="";const{type:o}=t?.position||{};return Um.includes(o)?(n+=`${e} {`,n+=`position: ${o};`,$m.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=$i({[`wp-container-${s}`]:i&&!!c,[`is-position-${n?.position?.type}`]:i&&!!c&&!!n?.position?.type});return qi({css:c}),{className:d}},attributeKeys:["style"],hasSupport:e=>(0,l.hasBlockSupport)(e,Vm)};const Ym={button:"wp-element-button",caption:"wp-element-caption"},Xm={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"},{kebabCase:Qm}=te(Ji.privateApis);function Jm(e={},t,n){let o=[];return Object.keys(e).forEach((r=>{const i=t+Qm(r.replace("/","-")),s=e[r];if(s instanceof Object){const e=i+n;o=[...o,...Jm(s,e,n)]}else o.push(`${i}: ${s}`)})),o}const ef=(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 i=tf({[e]:{[o]:t[e][o]}});n[r]=[...n[r]||[],...i],delete t[e][o]})),r||o.root){const i=r?o:o.root,s=tf({[e]:t[e]});n[i]=[...n[i]||[],...s],delete t[e]}})),n};function tf(e={},t="",n,o={},r=!1){const i=wi===t,s=Object.entries(l.__EXPERIMENTAL_STYLE_PROPERTY).reduce(((t,[o,{value:r,properties:s,useEngine:l,rootOnly:a}])=>{if(a&&!i)return t;const c=r;if("elements"===c[0]||l)return t;const u=_e(e,c);if("--wp--style--root--padding"===o&&("string"==typeof u||!n))return t;if(s&&"string"!=typeof u)Object.entries(s).forEach((e=>{const[n,o]=e;if(!_e(u,[o],!1))return;const r=n.startsWith("--")?n:Qm(n);t.push(`${r}: ${(0,li.getCSSValueFromRawStyle)(_e(u,[o]))}`)}));else if(_e(e,c,!1)){const n=o.startsWith("--")?o:Qm(o);t.push(`${n}: ${(0,li.getCSSValueFromRawStyle)(_e(e,c))}`)}return t}),[]);e.background&&(e.background?.backgroundImage&&(e.background.backgroundImage=Ri(e.background.backgroundImage,o)),!i&&e.background?.backgroundImage?.id&&(e={...e,background:{...e.background,...Yc(e.background)}}));return(0,li.getCSSRules)(e).forEach((e=>{if(i&&(n||r)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:Qm(e.key);let l=Ri(e.value,o);"font-size"===t&&(l=xi({size:l},o?.settings)),"aspect-ratio"===t&&s.push("min-height: unset"),s.push(`${t}: ${l}`)})),s}function nf({layoutDefinitions:e=gs,style:t,selector:n,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:i}){let s="",l=o?Ds(t?.spacing?.blockGap):"";if(r&&(n===wi?l=l||"0.5em":!o&&i&&(l=i)),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 i="";i=o?n===wi?`:root :where(.${e})${t?.selector||""}`:`:root :where(${n}-${e})${t?.selector||""}`:n===wi?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,s+=`${i} { ${r.join("; ")}; }`}}))})),n===wi&&o&&(s+=`${Ci} { --wp--style--block-gap: ${l}; }`)),n===wi&&e){const t=["block","flex","grid"];Object.values(e).forEach((({className:e,displayMode:o,baseStyles:r})=>{o&&t.includes(o)&&(s+=`${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){s+=`${`.${e}${t?.selector||""}`} { ${n.join("; ")}; }`}}))}))}return s}const of=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function rf(e){if(!e)return{};const t=Object.entries(e).filter((([e])=>of.includes(e))).map((([e,t])=>[e,JSON.parse(JSON.stringify(t))]));return Object.fromEntries(t)}const sf=(e,t)=>{var n;const o=[];if(!e?.styles)return o;const r=rf(e.styles);return r&&o.push({styles:r,selector:wi,skipSelectorWrapper:!0}),Object.entries(l.__EXPERIMENTAL_ELEMENTS).forEach((([t,n])=>{e.styles?.elements?.[t]&&o.push({styles:e.styles?.elements?.[t],selector:n,skipSelectorWrapper:!Ym[t]})})),Object.entries(null!==(n=e.styles?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{var r;const i=rf(n);if(n?.variations){const r={};Object.entries(n.variations).forEach((([n,i])=>{var s,a;r[n]=rf(i),i?.css&&(r[n].css=i.css);const c=t[e]?.styleVariationSelectors?.[n];Object.entries(null!==(s=i?.elements)&&void 0!==s?s:{}).forEach((([e,t])=>{t&&l.__EXPERIMENTAL_ELEMENTS[e]&&o.push({styles:t,selector:Mi(c,l.__EXPERIMENTAL_ELEMENTS[e])})})),Object.entries(null!==(a=i?.blocks)&&void 0!==a?a:{}).forEach((([e,n])=>{var r;const i=Mi(c,t[e]?.selector),s=Mi(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]=Mi(e,o)),"object"==typeof o&&(n[t]={},Object.entries(o).forEach((([o,r])=>{n[t][o]=Mi(e,r)})))})),n}(c,t[e]?.featureSelectors),u=rf(n);n?.css&&(u.css=n.css),o.push({selector:i,duotoneSelector:s,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:Mi(i,l.__EXPERIMENTAL_ELEMENTS[e])})}))}))})),i.variations=r}t?.[e]?.selector&&o.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:i,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},lf=(e,t)=>{var n;const o=[];if(!e?.settings)return o;const r=e=>{let t={};return Bi.forEach((({path:n})=>{const o=_e(e,n,!1);!1!==o&&(t=ve(t,n,o))})),t},i=r(e.settings),s=e.settings?.custom;return(Object.keys(i).length>0||s)&&o.push({presets:i,custom:s,selector:Ci}),Object.entries(null!==(n=e.settings?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{const i=r(n),s=n.custom;(Object.keys(i).length>0||s)&&o.push({presets:i,custom:s,selector:t[e]?.selector})})),o},af=(e,t)=>{const n=lf(e,t);let o="";return n.forEach((({presets:t,custom:n,selector:r})=>{const i=function(e={},t){return Bi.reduce(((n,{path:o,valueKey:r,valueFunc:i,cssVarInfix:s})=>{const l=_e(e,o,[]);return["default","theme","custom"].forEach((e=>{l[e]&&l[e].forEach((e=>{r&&!i?n.push(`--wp--preset--${s}--${Qm(e.slug)}: ${e[r]}`):i&&"function"==typeof i&&n.push(`--wp--preset--${s}--${Qm(e.slug)}: ${i(e,t)}`)}))})),n}),[])}(t,e?.settings),s=Jm(n,"--wp--custom--","--");s.length>0&&i.push(...s),i.length>0&&(o+=`${r}{${i.join(";")};}`)})),o},cf=(e,t,n,o,r=!1,i=!1,s=void 0)=>{const l={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...s},a=sf(e,t),c=lf(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+=`${Ci} {`,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:s,styles:a,fallbackGapValue:c,hasLayoutSupport:d,featureSelectors:p,styleVariationSelectors:h,skipSelectorWrapper:m})=>{if(p){const e=ef(p,a);Object.entries(e).forEach((([e,t])=>{if(t.length){const n=t.join(";");g+=`:root :where(${e}){${n};}`}}))}if(s){const e={};a?.filter&&(e.filter=a.filter,delete a.filter);const t=tf(e);t.length&&(g+=`${s}{${t.join(";")};}`)}r||wi!==t&&!d||(g+=nf({style:a,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:c}));const f=tf(a,t,u,e,i);if(f?.length){g+=`${m?t:`:root :where(${t})`}{${f.join(";")};}`}a?.css&&(g+=pf(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=ef(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=tf(o,n,u,e);t.length&&(g+=`:root :where(${n}){${t.join(";")};}`),o?.css&&(g+=pf(o.css,`:root :where(${n})`))}}));const b=Object.entries(a).filter((([e])=>e.startsWith(":")));b?.length&&b.forEach((([e,n])=>{const o=tf(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=Ds(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})=>{wi!==e&&Ci!==e||(e="");const n=function(e="*",t={}){return Bi.reduce(((n,{path:o,cssVarInfix:r,classes:i})=>{if(!i)return n;const s=_e(t,o,[]);return["default","theme","custom"].forEach((t=>{s[t]&&s[t].forEach((({slug:t})=>{i.forEach((({classSuffix:o,propertyName:i})=>{const s=`.has-${Qm(t)}-${o}`,l=e.split(",").map((e=>`${e}${s}`)).join(","),a=`var(--wp--preset--${r}--${Qm(t)})`;n+=`${l}{${i}: ${a} !important;}`}))}))})),n}),"")}(e,t);n.length>0&&(g+=n)})),g};function uf(e,t){return lf(e,t).flatMap((({presets:e})=>function(e={}){return Bi.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=_e(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>ym(`wp-duotone-${e.slug}`,e.colors))))).join("")}))}(e)))}const df=(e,t,n)=>{const o={};return e.forEach((e=>{const r=e.name,i=Sm(e);let s=Sm(e,"filter.duotone");if(!s){const t=Sm(e),n=(0,l.getBlockSupport)(e,"color.__experimentalDuotone",!1);s=n&&Mi(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,i);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(Xm).forEach((([t,o])=>{const r=Sm(e,t);r&&(n[o]=r)})),n})(e,i);o[r]={duotoneSelector:s,fallbackGapValue:c,featureSelectors:Object.keys(p).length?p:void 0,hasLayoutSupport:a,name:r,selector:i,styleVariationSelectors:u?.length?d:void 0}})),o};function pf(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,i]=o,s=r.match(/([>+~\s]*::[a-zA-Z-]+)/),l=s?s[1]:"",a=s?r.replace(l,"").trim():r.trim();let c;c=""===a?t:r.startsWith(" ")?Mi(t,a):function(e,t){return e.includes(",")?e.split(",").map((e=>e+t)).join(","):e+t}(t,a),n+=`:root :where(${c})${l}{${i.trim()}}`}})),n}function hf(e={},t){const[n]=Oi("spacing.blockGap"),o=null!==n,r=!o,i=(0,c.useSelect)((e=>{const{getSettings:t}=e(oi);return!!t().disableLayoutStyles})),{getBlockStyles:s}=(0,c.useSelect)(l.store);return(0,a.useMemo)((()=>{var n;if(!e?.styles||!e?.settings)return[];const a=(c=e,c.styles?.blocks?.["core/separator"]&&c.styles?.blocks?.["core/separator"].color?.background&&!c.styles?.blocks?.["core/separator"].color?.text&&!c.styles?.blocks?.["core/separator"].border?.color?{...c,styles:{...c.styles,blocks:{...c.styles.blocks,"core/separator":{...c.styles.blocks["core/separator"],color:{...c.styles.blocks["core/separator"].color,text:c.styles?.blocks["core/separator"].color.background}}}}}:c);var c;const u=df((0,l.getBlockTypes)(),s),d=af(a,u),p=cf(a,u,o,r,i,t),h=uf(a,u),g=[{css:d,isGlobalStyles:!0},{css:p,isGlobalStyles:!0},{css:null!==(n=a.styles.css)&&void 0!==n?n:"",isGlobalStyles:!0},{assets:h,__unstableType:"svg",isGlobalStyles:!0}];return(0,l.getBlockTypes)().forEach((e=>{if(a.styles.blocks[e.name]?.css){const t=u[e.name].selector;g.push({css:pf(a.styles.blocks[e.name]?.css,t),isGlobalStyles:!0})}})),[g,a.settings]}),[o,r,e,i,t,s])}function gf(e=!1){const{merged:t}=(0,a.useContext)(Ni);return hf(t,e)}const mf="is-style-";function ff(e){return e?e.split(/\s+/).reduce(((e,t)=>{if(t.startsWith(mf)){const n=t.slice(mf.length);"default"!==n&&e.push(n)}return e}),[]):[]}function bf({override:e}){Yi(e)}function kf(e,t,n){const{merged:o}=(0,a.useContext)(Ni),{globalSettings:r,globalStyles:i}=(0,c.useSelect)((e=>{const t=e(oi).getSettings();return{globalSettings:t.__experimentalFeatures,globalStyles:t[Z]}}),[]);return(0,a.useMemo)((()=>{var s,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=_e(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!==(s=o?.settings)&&void 0!==s?s:r,styles:null!==(l=o?.styles)&&void 0!==l?l:i},e,t);return{settings:null!==(a=o?.settings)&&void 0!==a?a:r,styles:{blocks:{[e]:{variations:{[`${t}-${n}`]:c}}}}}}),[o,r,i,t,n,e])}const vf={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>ff(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=ff(e);if(!n)return null;for(const e of n)if(t.some((t=>t.name===e)))return e;return null}(t,o(e)),i=`${mf}${r}-${n}`,{settings:s,styles:u}=kf(e,r,n),d=(0,a.useMemo)((()=>{if(!r)return;const e={settings:s,styles:u},t=df((0,l.getBlockTypes)(),o,n);return cf(e,t,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})}),[r,s,u,o,n]);return Yi({id:`variation-${n}`,css:d,__unstableType:"variation",variation:r,clientId:n}),r?{className:i}:{}}},_f="layout",{kebabCase:xf}=te(Ji.privateApis);function yf(e){return(0,l.hasBlockSupport)(e,"layout")||(0,l.hasBlockSupport)(e,"__experimentalLayout")}function Sf(e={},t=""){const{layout:n}=e,{default:o}=(0,l.getBlockSupport)(t,_f)||{},r=n?.inherit||n?.contentSize||n?.wideSize?{...n,type:"constrained"}:n||o||{},i=[];if(gs[r?.type||"default"]?.className){const e=gs[r?.type||"default"]?.className,n=t.split("/"),o=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;i.push(e,o)}return(0,c.useSelect)((e=>(r?.inherit||r?.contentSize||"constrained"===r?.type)&&e(oi).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments),[r?.contentSize,r?.inherit,r?.type])&&i.push("has-global-padding"),r?.orientation&&i.push(`is-${xf(r.orientation)}`),r?.justifyContent&&i.push(`is-content-justification-${xf(r.justifyContent)}`),r?.flexWrap&&"nowrap"===r.flexWrap&&i.push("is-nowrap"),i}const wf={shareWithChildBlocks:!0,edit:function({layout:e,setAttributes:t,name:n,clientId:o}){const r=Xi(n),{layout:i}=r,{themeSupportsLayout:s}=(0,c.useSelect)((e=>{const{getSettings:t}=e(oi);return{themeSupportsLayout:t().supportsLayout}}),[]);if("default"!==zl())return null;const a=(0,l.getBlockSupport)(n,_f,{}),u={...i,...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,k=f||b,v=!(!h||k&&"default"!==k&&"constrained"!==k&&!m.inherit),_=e||g||{},{inherit:x=!1,contentSize:y=null}=_;if(("default"===k||"constrained"===k)&&!s)return null;const S=yl(k),w=yl("constrained"),B=!_.type&&(y||x),I=!!x||!!y,j=e=>t({layout:e});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(da,{children:(0,$.jsxs)(Ji.PanelBody,{title:(0,C.__)("Layout"),children:[v&&(0,$.jsx)($.Fragment,{children:(0,$.jsx)(Ji.ToggleControl,{__nextHasNoMarginBottom:!0,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,$.jsx)(Cf,{type:k,onChange:e=>t({layout:{type:e}})}),S&&"default"!==S.name&&(0,$.jsx)(S.inspectorControls,{layout:_,onChange:j,layoutBlockSupport:u,name:n,clientId:o}),w&&B&&(0,$.jsx)(w.inspectorControls,{layout:_,onChange:j,layoutBlockSupport:u,name:n,clientId:o})]})}),!x&&S&&(0,$.jsx)(S.toolBarControls,{layout:_,onChange:j,layoutBlockSupport:a,name:n,clientId:o})]})},attributeKeys:["layout"],hasSupport:e=>yf(e)};function Cf({type:e,onChange:t}){return(0,$.jsx)(Ji.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,isBlock:!0,label:(0,C.__)("Layout type"),__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onChange:t,children:xl.map((({name:e,label:t})=>(0,$.jsx)(Ji.__experimentalToggleGroupControlOption,{value:e,label:t},e)))})}function Bf({block:e,props:t,blockGapSupport:n,layoutClasses:o}){const{name:r,attributes:i}=t,s=(0,u.useInstanceId)(e),{layout:a}=i,{default:c}=(0,l.getBlockSupport)(r,_f)||{},d=a?.inherit||a?.contentSize||a?.wideSize?{...a,type:"constrained"}:a||c||{},p=`wp-container-${xf(r)}-is-layout-`,h=`.${p}${s}`,g=null!==n,m=yl(d?.type||"default"),f=m?.getLayoutStyle?.({blockName:r,selector:h,layout:d,style:i?.style,hasBlockGapSupport:g}),b=$i({[`${p}${s}`]:!!f},o);return qi({css:f}),(0,$.jsx)(e,{...t,__unstableLayoutClassNames:b})}const If=(0,u.createHigherOrderComponent)((e=>t=>{const{clientId:n,name:o,attributes:r}=t,i=yf(o),s=Sf(r,o),l=(0,c.useSelect)((e=>{if(!i)return;const{getSettings:t,getBlockSettings:o}=te(e(oi)),{disableLayoutStyles:r}=t();if(r)return;const[s]=o(n,"spacing.blockGap");return{blockGapSupport:s}}),[i,n]);return l?(0,$.jsx)(Bf,{block:e,props:t,layoutClasses:s,...l}):(0,$.jsx)(e,{...t,__unstableLayoutClassNames:i?s:void 0})}),"withLayoutStyles");function jf(e,t){return Array.from({length:t},((t,n)=>e+n))}(0,d.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.layout)&&void 0!==t?t:{})||yf(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,d.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",If);class Ef{constructor({columnStart:e,rowStart:t,columnEnd:n,rowEnd:o,columnSpan:r,rowSpan:i}={}){this.columnStart=null!=e?e:1,this.rowStart=null!=t?t:1,this.columnEnd=void 0!==r?this.columnStart+r-1:null!=n?n:this.columnStart,this.rowEnd=void 0!==i?this.rowStart+i-1:null!=o?o:this.rowStart}get columnSpan(){return this.columnEnd-this.columnStart+1}get rowSpan(){return this.rowEnd-this.rowStart+1}contains(e,t){return e>=this.columnStart&&e<=this.columnEnd&&t>=this.rowStart&&t<=this.rowEnd}containsRect(e){return this.contains(e.columnStart,e.rowStart)&&this.contains(e.columnEnd,e.rowEnd)}intersectsRect(e){return this.columnStart<=e.columnEnd&&this.columnEnd>=e.columnStart&&this.rowStart<=e.rowEnd&&this.rowEnd>=e.rowStart}}function Tf(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Mf(e,t){const n=[];for(const o of e.split(" ")){const e=n[n.length-1],r=e?e.end+t:0,i=r+parseFloat(o);n.push({start:r,end:i})}return n}function Pf(e,t,n="start"){return e.reduce(((o,r,i)=>Math.abs(r[n]-t)<Math.abs(e[o][n]-t)?i:o),0)}function Rf(e){const t=Tf(e,"grid-template-columns"),n=Tf(e,"grid-template-rows"),o=t.split(" ").length,r=n.split(" ").length;return{numColumns:o,numRows:r,numItems:o*r,currentColor:Tf(e,"color"),style:{gridTemplateColumns:t,gridTemplateRows:n,gap:Tf(e,"gap"),padding:Tf(e,"padding")}}}const Nf=[(0,a.createInterpolateElement)((0,C.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,$.jsx)("kbd",{})}),(0,a.createInterpolateElement)((0,C.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,$.jsx)("kbd",{})}),(0,a.createInterpolateElement)((0,C.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,$.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 Lf=function(){const[e]=(0,a.useState)(Math.floor(Math.random()*Nf.length));return(0,$.jsx)(Ji.Tip,{children:Nf[e]})},Af=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),Df=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})}),Of=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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 zf=(0,a.memo)((function({icon:e,showColors:t=!1,className:n,context:o}){"block-default"===e?.src&&(e={src:Of});const r=(0,$.jsx)(Ji.Icon,{icon:e&&e.src?e.src:e,context:o}),i=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,$.jsx)("span",{style:i,className:$i("block-editor-block-icon",n,{"has-colors":t}),children:r})}));const Vf=function({title:e,icon:t,description:n,blockType:o,className:r,name:i}){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(oi);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:l}=(0,c.useDispatch)(oi);return(0,$.jsxs)("div",{className:$i("block-editor-block-card",r),children:[s&&(0,$.jsx)(Ji.Button,{onClick:()=>l(s),label:(0,C.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,C.isRTL)()?Af:Df,size:"small"}),(0,$.jsx)(zf,{icon:t,showColors:!0}),(0,$.jsxs)(Ji.__experimentalVStack,{spacing:1,children:[(0,$.jsx)("h2",{className:"block-editor-block-card__title",children:i?.length?(0,C.sprintf)((0,C.__)("%1$s (%2$s)"),i,e):e}),n&&(0,$.jsx)(Ji.__experimentalText,{className:"block-editor-block-card__description",children:n})]})]})};const Ff=(0,u.createHigherOrderComponent)((e=>({useSubRegistry:t=!0,...n})=>{const o=(0,c.useRegistry)(),[r]=(0,a.useState)((()=>new WeakMap)),i=function(e,t,n){if(!n)return t;let o=e.get(t);return o||(o=(0,c.createRegistry)({},t),o.registerStore(ne,ni),e.set(t,o)),o}(r,o,t);return i===o?(0,$.jsx)(e,{registry:o,...n}):(0,$.jsx)(c.RegistryProvider,{value:i,children:(0,$.jsx)(e,{registry:i,...n})})}),"withRegistryProvider"),Hf=()=>{};function Gf({clientId:e=null,value:t,selection:n,onChange:o=Hf,onInput:r=Hf}){const i=(0,c.useRegistry)(),{resetBlocks:s,resetSelection:u,replaceInnerBlocks:d,setHasControlledInnerBlocks:p,__unstableMarkNextChangeAsNotPersistent:h}=i.dispatch(oi),{getBlockName:g,getBlocks:m,getSelectionStart:f,getSelectionEnd:b}=i.select(oi),k=(0,c.useSelect)((t=>!e||t(oi).areInnerBlocksControlled(e)),[e]),v=(0,a.useRef)({incoming:null,outgoing:[]}),_=(0,a.useRef)(!1),x=()=>{t&&(h(),e?i.batch((()=>{p(e,!0);const n=t.map((e=>(0,l.cloneBlock)(e)));_.current&&(v.current.incoming=n),h(),d(e,n)})):(_.current&&(v.current.incoming=t),s(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)((()=>{v.current.outgoing.includes(t)?v.current.outgoing[v.current.outgoing.length-1]===t&&(v.current.outgoing=[]):m(e)!==t&&(v.current.outgoing=[],x(),n&&u(n.selectionStart,n.selectionEnd,n.initialPosition))}),[t,e]);const w=(0,a.useRef)(!1);(0,a.useEffect)((()=>{w.current?k||(v.current.outgoing=[],x()):w.current=!0}),[k]),(0,a.useEffect)((()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:o,areInnerBlocksControlled:r}=i.select(oi);let s=m(e),l=n(),a=!1;_.current=!0;const c=i.subscribe((()=>{if(null!==e&&null===g(e))return;if(!(!e||r(e)))return;const i=n(),c=m(e),u=c!==s;if(s=c,u&&(v.current.incoming||o()))return v.current.incoming=null,void(l=i);if(u||a&&!u&&i&&!l){l=i,v.current.outgoing.push(s);(l?S.current:y.current)(s,{selection:{selectionStart:f(),selectionEnd:b(),initialPosition:t()}})}a=u}),oi);return()=>{_.current=!1,c()}}),[i,e]),(0,a.useEffect)((()=>()=>{h(),e?(p(e,!1),h(),d(e,[])):s([])}),[])}const $f=window.wp.keyboardShortcuts;function Uf(){return null}Uf.Register=function(){const{registerShortcut:e}=(0,c.useDispatch)($f.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 Wf=Uf,Kf=Ff((e=>{const{children:t,settings:n,stripExperimentalSettings:o=!1}=e,{__experimentalUpdateSettings:r}=te((0,c.useDispatch)(oi));return(0,a.useEffect)((()=>{r({...n,__internalIsInitialized:!0},{stripExperimentalSettings:o,reset:!0})}),[n,o,r]),Gf(e),(0,$.jsxs)(Ji.SlotFillProvider,{passthrough:!0,children:[!n?.__unstableIsPreviewMode&&(0,$.jsx)(Wf.Register,{}),(0,$.jsx)(dp,{children:t})]})})),Zf=e=>(0,$.jsx)(Kf,{...e,stripExperimentalSettings:!0,children:e.children}),qf=(0,a.createContext)({});function Yf({value:e,children:t}){const n=(0,a.useContext)(qf),o=(0,a.useMemo)((()=>({...n,...e})),[n,e]);return(0,$.jsx)(qf.Provider,{value:o,children:t})}const Xf=qf,Qf={},Jf=(0,Ji.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,$.jsx)(o,{...e})})),eb=e=>{const{attributes:t={},name:n}=e,o=(0,l.getBlockType)(n),r=(0,a.useContext)(Xf),i=(0,a.useMemo)((()=>o&&o.usesContext?Object.fromEntries(Object.entries(r).filter((([e])=>o.usesContext.includes(e)))):Qf),[o,r]);if(!o)return null;if(o.apiVersion>1)return(0,$.jsx)(Jf,{...e,context:i});const s=(0,l.hasBlockSupport)(o,"className",!0)?(0,l.getBlockDefaultClassName)(n):null,c=$i(s,t.className,e.className);return(0,$.jsx)(Jf,{...e,context:i,className:c})},tb=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});const nb=function({className:e,actions:t,children:n,secondaryActions:o}){return(0,$.jsx)("div",{style:{display:"contents",all:"initial"},children:(0,$.jsx)("div",{className:$i(e,"block-editor-warning"),children:(0,$.jsxs)("div",{className:"block-editor-warning__contents",children:[(0,$.jsx)("p",{className:"block-editor-warning__message",children:n}),(a.Children.count(t)>0||o)&&(0,$.jsxs)("div",{className:"block-editor-warning__actions",children:[a.Children.count(t)>0&&a.Children.map(t,((e,t)=>(0,$.jsx)("span",{className:"block-editor-warning__action",children:e},t))),o&&(0,$.jsx)(Ji.DropdownMenu,{className:"block-editor-warning__secondary",icon:tb,label:(0,C.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0,children:()=>(0,$.jsx)(Ji.MenuGroup,{children:o.map(((e,t)=>(0,$.jsx)(Ji.MenuItem,{onClick:e.onClick,children:e.title},t)))})})]})]})})})};function ob({originalBlockClientId:e,name:t,onReplace:n}){const{selectBlock:o}=(0,c.useDispatch)(oi),r=(0,l.getBlockType)(t);return(0,$.jsxs)(nb,{actions:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>o(e),children:(0,C.__)("Find original")},"find-original"),(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>n([]),children:(0,C.__)("Remove")},"remove")],children:[(0,$.jsxs)("strong",{children:[r?.title,": "]}),(0,C.__)("This block can only be used once.")]})}const rb=(0,a.createContext)({});function ib({mayDisplayControls:e,mayDisplayParentControls:t,blockEditingMode:n,isPreviewMode:o,...r}){const{name:i,isSelected:s,clientId:c,attributes:u={},__unstableLayoutClassNames:d}=r,{layout:b=null,metadata:k={}}=u,{bindings:_}=k,x=(0,l.hasBlockSupport)(i,"layout",!1)||(0,l.hasBlockSupport)(i,"__experimentalLayout",!1),{originalBlockClientId:y}=(0,a.useContext)(rb);return(0,$.jsxs)(v,{value:(0,a.useMemo)((()=>({name:i,isSelected:s,clientId:c,layout:x?b:null,__unstableLayoutClassNames:d,[p]:e,[h]:t,[g]:n,[m]:_,[f]:o})),[i,s,c,x,b,d,e,t,n,_,o]),children:[(0,$.jsx)(eb,{...r}),y&&(0,$.jsx)(ob,{originalBlockClientId:y,name:i,onReplace:r.onReplace})]})}var sb=n(8021);function lb({title:e,rawContent:t,renderedContent:n,action:o,actionText:r,className:i}){return(0,$.jsxs)("div",{className:i,children:[(0,$.jsxs)("div",{className:"block-editor-block-compare__content",children:[(0,$.jsx)("h2",{className:"block-editor-block-compare__heading",children:e}),(0,$.jsx)("div",{className:"block-editor-block-compare__html",children:t}),(0,$.jsx)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor",children:(0,$.jsx)(a.RawHTML,{children:(0,ha.safeHTML)(n)})})]}),(0,$.jsx)("div",{className:"block-editor-block-compare__action",children:(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,variant:"secondary",tabIndex:"0",onClick:o,children:r})})]})}const ab=function({block:e,onKeep:t,onConvert:n,convertor:o,convertButtonText:r}){const i=(s=o(e),(Array.isArray(s)?s:[s]).map((e=>(0,l.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var s;const a=(c=e.originalContent,u=i,(0,sb.JJ)(c,u).map(((e,t)=>{const n=$i({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,$.jsx)("span",{className:n,children:e.value},t)})));var c,u;return(0,$.jsxs)("div",{className:"block-editor-block-compare__wrapper",children:[(0,$.jsx)(lb,{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,$.jsx)(lb,{title:(0,C.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:r,rawContent:a,renderedContent:i})]})},cb=e=>(0,l.rawHandler)({HTML:e.originalContent});function ub({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:o}=(0,c.useSelect)((t=>{const{canInsertBlockType:n,getBlock:o,getBlockRootClientId:r}=t(oi),i=r(e);return{block:o(e),canInsertHTMLBlock:n("core/html",i),canInsertClassicBlock:n("core/freeform",i)}}),[e]),{replaceBlock:r}=(0,c.useDispatch)(oi),[i,s]=(0,a.useState)(!1),u=(0,a.useCallback)((()=>s(!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=cb(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:()=>s(!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,$.jsxs)($.Fragment,{children:[(0,$.jsx)(nb,{actions:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,onClick:d.toRecoveredBlock,variant:"primary",children:(0,C.__)("Attempt recovery")},"recover")],secondaryActions:p,children:(0,C.__)("Block contains unexpected or invalid content.")}),i&&(0,$.jsx)(Ji.Modal,{title:(0,C.__)("Resolve Block"),onRequestClose:u,className:"block-editor-block-compare",children:(0,$.jsx)(ab,{block:t,onKeep:d.toHTML,onConvert:d.toBlocks,convertor:cb,convertButtonText:(0,C.__)("Convert to Blocks")})})]})}const db=(0,$.jsx)(nb,{className:"block-editor-block-list__block-crash-warning",children:(0,C.__)("This block has encountered an error and cannot be previewed.")}),pb=()=>db;class hb 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 gb=hb;var mb=n(4132);const fb=function({clientId:e}){const[t,n]=(0,a.useState)(""),o=(0,c.useSelect)((t=>t(oi).getBlock(e)),[e]),{updateBlock:r}=(0,c.useDispatch)(oi);return(0,a.useEffect)((()=>{n((0,l.getBlockContent)(o))}),[o]),(0,$.jsx)(mb.A,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const i=(0,l.getBlockType)(o.name);if(!i)return;const s=(0,l.getBlockAttributes)(i,t,o.attributes),a=t||(0,l.getSaveContent)(i,s),[c]=t?(0,l.validateBlock)({...o,attributes:s,originalContent:a}):[!0];r(e,{attributes:s,originalContent:a,isValid:c}),t||n(a)},onChange:e=>n(e.target.value)})};var bb=Rb(),kb=e=>Eb(e,bb),vb=Rb();kb.write=e=>Eb(e,vb);var _b=Rb();kb.onStart=e=>Eb(e,_b);var xb=Rb();kb.onFrame=e=>Eb(e,xb);var yb=Rb();kb.onFinish=e=>Eb(e,yb);var Sb=[];kb.setTimeout=(e,t)=>{let n=kb.now()+t,o=()=>{let e=Sb.findIndex((e=>e.cancel==o));~e&&Sb.splice(e,1),Ib-=~e?1:0},r={time:n,handler:e,cancel:o};return Sb.splice(wb(n),0,r),Ib+=1,Tb(),r};var wb=e=>~(~Sb.findIndex((t=>t.time>e))||~Sb.length);kb.cancel=e=>{_b.delete(e),xb.delete(e),yb.delete(e),bb.delete(e),vb.delete(e)},kb.sync=e=>{jb=!0,kb.batchedUpdates(e),jb=!1},kb.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,kb.onStart(n)}return o.handler=e,o.cancel=()=>{_b.delete(n),t=null},o};var Cb=typeof window<"u"?window.requestAnimationFrame:()=>{};kb.use=e=>Cb=e,kb.now=typeof performance<"u"?()=>performance.now():Date.now,kb.batchedUpdates=e=>e(),kb.catch=console.error,kb.frameLoop="always",kb.advance=()=>{"demand"!==kb.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Pb()};var Bb=-1,Ib=0,jb=!1;function Eb(e,t){jb?(t.delete(e),e(0)):(t.add(e),Tb())}function Tb(){Bb<0&&(Bb=0,"demand"!==kb.frameLoop&&Cb(Mb))}function Mb(){~Bb&&(Cb(Mb),kb.batchedUpdates(Pb))}function Pb(){let e=Bb;Bb=kb.now();let t=wb(Bb);t&&(Nb(Sb.splice(0,t),(e=>e.handler())),Ib-=t),Ib?(_b.flush(),bb.flush(e?Math.min(64,Bb-e):16.667),xb.flush(),vb.flush(),yb.flush()):Bb=-1}function Rb(){let e=new Set,t=e;return{add(n){Ib+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Ib-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Ib-=t.size,Nb(t,(t=>t(n)&&e.add(t))),Ib+=e.size,t=e)}}}function Nb(e,t){e.forEach((e=>{try{t(e)}catch(e){kb.catch(e)}}))}var Lb=Object.defineProperty,Ab={};function Db(){}((e,t)=>{for(var n in t)Lb(e,n,{get:t[n],enumerable:!0})})(Ab,{assign:()=>Xb,colors:()=>Zb,createStringInterpolator:()=>$b,skipAnimation:()=>qb,to:()=>Ub,willAdvance:()=>Yb});var Ob={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 zb(e,t){if(Ob.arr(e)){if(!Ob.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 Vb=(e,t)=>e.forEach(t);function Fb(e,t,n){if(Ob.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 Hb=e=>Ob.und(e)?[]:Ob.arr(e)?e:[e];function Gb(e,t){if(e.size){let n=Array.from(e);e.clear(),Vb(n,t)}}var $b,Ub,Wb=(e,...t)=>Gb(e,(e=>e(...t))),Kb=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Zb=null,qb=!1,Yb=Db,Xb=e=>{e.to&&(Ub=e.to),e.now&&(kb.now=e.now),void 0!==e.colors&&(Zb=e.colors),null!=e.skipAnimation&&(qb=e.skipAnimation),e.createStringInterpolator&&($b=e.createStringInterpolator),e.requestAnimationFrame&&kb.use(e.requestAnimationFrame),e.batchedUpdates&&(kb.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Yb=e.willAdvance),e.frameLoop&&(kb.frameLoop=e.frameLoop)},Qb=new Set,Jb=[],ek=[],tk=0,nk={get idle(){return!Qb.size&&!Jb.length},start(e){tk>e.priority?(Qb.add(e),kb.onStart(ok)):(rk(e),kb(sk))},advance:sk,sort(e){if(tk)kb.onFrame((()=>nk.sort(e)));else{let t=Jb.indexOf(e);~t&&(Jb.splice(t,1),ik(e))}},clear(){Jb=[],Qb.clear()}};function ok(){Qb.forEach(rk),Qb.clear(),kb(sk)}function rk(e){Jb.includes(e)||ik(e)}function ik(e){Jb.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(Jb,(t=>t.priority>e.priority)),0,e)}function sk(e){let t=ek;for(let n=0;n<Jb.length;n++){let o=Jb[n];tk=o.priority,o.idle||(Yb(o),o.advance(e),o.idle||t.push(o))}return tk=0,(ek=Jb).length=0,(Jb=t).length>0}var lk="[-+]?\\d*\\.?\\d+",ak=lk+"%";function ck(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var uk=new RegExp("rgb"+ck(lk,lk,lk)),dk=new RegExp("rgba"+ck(lk,lk,lk,lk)),pk=new RegExp("hsl"+ck(lk,ak,ak)),hk=new RegExp("hsla"+ck(lk,ak,ak,lk)),gk=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,mk=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,fk=/^#([0-9a-fA-F]{6})$/,bk=/^#([0-9a-fA-F]{8})$/;function kk(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,i=kk(r,o,e+1/3),s=kk(r,o,e),l=kk(r,o,e-1/3);return Math.round(255*i)<<24|Math.round(255*s)<<16|Math.round(255*l)<<8}function _k(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function xk(e){return(parseFloat(e)%360+360)%360/360}function yk(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Sk(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function wk(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=fk.exec(e))?parseInt(t[1]+"ff",16)>>>0:Zb&&void 0!==Zb[e]?Zb[e]:(t=uk.exec(e))?(_k(t[1])<<24|_k(t[2])<<16|_k(t[3])<<8|255)>>>0:(t=dk.exec(e))?(_k(t[1])<<24|_k(t[2])<<16|_k(t[3])<<8|yk(t[4]))>>>0:(t=gk.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=bk.exec(e))?parseInt(t[1],16)>>>0:(t=mk.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=pk.exec(e))?(255|vk(xk(t[1]),Sk(t[2]),Sk(t[3])))>>>0:(t=hk.exec(e))?(vk(xk(t[1]),Sk(t[2]),Sk(t[3]))|yk(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 Ck=(e,t,n)=>{if(Ob.fun(e))return e;if(Ob.arr(e))return Ck({range:e,output:t,extrapolate:n});if(Ob.str(e.output[0]))return $b(e);let o=e,r=o.output,i=o.range||[0,1],s=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,i);return function(e,t,n,o,r,i,s,l,a){let c=a?a(e):e;if(c<t){if("identity"===s)return c;"clamp"===s&&(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=i(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,i[t],i[t+1],r[t],r[t+1],a,s,l,o.map)}};var Bk=1.70158,Ik=1.525*Bk,jk=Bk+1,Ek=2*Math.PI/3,Tk=2*Math.PI/4.5,Mk=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,Pk={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=>jk*e*e*e-Bk*e*e,easeOutBack:e=>1+jk*Math.pow(e-1,3)+Bk*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(Ik+1)*e-Ik)/2:(Math.pow(2*e-2,2)*((Ik+1)*(2*e-2)+Ik)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Ek),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Ek)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Tk)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Tk)/2+1,easeInBounce:e=>1-Mk(1-e),easeOutBounce:Mk,easeInOutBounce:e=>e<.5?(1-Mk(1-2*e))/2:(1+Mk(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)}},Rk=Symbol.for("FluidValue.get"),Nk=Symbol.for("FluidValue.observers"),Lk=e=>Boolean(e&&e[Rk]),Ak=e=>e&&e[Rk]?e[Rk]():e,Dk=e=>e[Nk]||null;function Ok(e,t){let n=e[Nk];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var zk=class{[Rk];[Nk];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Vk(this,e)}},Vk=(e,t)=>$k(e,Rk,t);function Fk(e,t){if(e[Rk]){let n=e[Nk];n||$k(e,Nk,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Hk(e,t){let n=e[Nk];if(n&&n.has(t)){let o=n.size-1;o?n.delete(t):e[Nk]=null,e.observerRemoved&&e.observerRemoved(o,t)}}var Gk,$k=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Uk=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Wk=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Kk=new RegExp(`(${Uk.source})(%|[a-z]+)`,"i"),Zk=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,qk=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Yk=e=>{let[t,n]=Xk(e);if(!t||Kb())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&&qk.test(n)?Yk(n):n||e},Xk=e=>{let t=qk.exec(e);if(!t)return[,];let[,n,o]=t;return[n,o]},Qk=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Jk=e=>{Gk||(Gk=Zb?new RegExp(`(${Object.keys(Zb).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>Ak(e).replace(qk,Yk).replace(Wk,wk).replace(Gk,wk))),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=>Ck({...e,output:t})));return e=>{let n=!Kk.test(t[0])&&t.find((e=>Kk.test(e)))?.replace(Uk,""),r=0;return t[0].replace(Uk,(()=>`${o[r++](e)}${n||""}`)).replace(Zk,Qk)}},ev="react-spring: ",tv=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${ev}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},nv=tv(console.warn);tv(console.warn);function ov(e){return Ob.str(e)&&("#"==e[0]||/\d/.test(e)||!Kb()&&qk.test(e)||e in(Zb||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var rv=Kb()?ja.useEffect:ja.useLayoutEffect;function iv(){let e=(0,ja.useState)()[1],t=(()=>{let e=(0,ja.useRef)(!1);return rv((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}var sv=[];var lv=Symbol.for("Animated:node"),av=e=>e&&e[lv],cv=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,lv,t),uv=e=>e&&e[lv]&&e[lv].getPayload(),dv=class{payload;constructor(){cv(this,this)}getPayload(){return this.payload||[]}},pv=class extends dv{constructor(e){super(),this._value=e,Ob.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new pv(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Ob.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,Ob.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},hv=class extends pv{_string=null;_toString;constructor(e){super(0),this._toString=Ck({output:[e,e]})}static create(e){return new hv(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(Ob.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=Ck({output:[this.getValue(),e]})),this._value=0,super.reset()}},gv={dependencies:null},mv=class extends dv{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return Fb(this.source,((n,o)=>{(e=>!!e&&e[lv]===e)(n)?t[o]=n.getValue(e):Lk(n)?t[o]=Ak(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Vb(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return Fb(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){gv.dependencies&&Lk(e)&&gv.dependencies.add(e);let t=uv(e);t&&Vb(t,(e=>this.add(e)))}},fv=class extends mv{constructor(e){super(e)}static create(e){return new fv(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(bv)),!0)}};function bv(e){return(ov(e)?hv:pv).create(e)}function kv(e){let t=av(e);return t?t.constructor:Ob.arr(e)?fv:ov(e)?hv:pv}var vv=(e,t)=>{let n=!Ob.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,ja.forwardRef)(((o,r)=>{let i=(0,ja.useRef)(null),s=n&&(0,ja.useCallback)((e=>{i.current=function(e,t){return e&&(Ob.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[l,a]=function(e,t){let n=new Set;return gv.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new mv(e),gv.dependencies=null,[e,n]}(o,t),c=iv(),u=()=>{let e=i.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,l.getValue(!0)))&&c()},d=new _v(u,a),p=(0,ja.useRef)();rv((()=>(p.current=d,Vb(a,(e=>Fk(e,d))),()=>{p.current&&(Vb(p.current.deps,(e=>Hk(e,p.current))),kb.cancel(p.current.update))}))),(0,ja.useEffect)(u,[]),(e=>{(0,ja.useEffect)(e,sv)})((()=>()=>{let e=p.current;Vb(e.deps,(t=>Hk(t,e)))}));let h=t.getComponentProps(l.getValue());return ja.createElement(e,{...h,ref:s})}))},_v=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&kb.write(this.update)}};var xv=Symbol.for("AnimatedComponent"),yv=e=>Ob.str(e)?e:e&&Ob.str(e.displayName)?e.displayName:Ob.fun(e)&&e.name||null;function Sv(e,...t){return Ob.fun(e)?e(...t):e}var wv=(e,t)=>!0===e||!!(t&&e&&(Ob.fun(e)?e(t):Hb(e).includes(t))),Cv=(e,t)=>Ob.obj(e)?t&&e[t]:e,Bv=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Iv=e=>e,jv=(e,t=Iv)=>{let n=Ev;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);Ob.und(n)||(o[r]=n)}return o},Ev=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Tv={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 Mv(e){let t=function(e){let t={},n=0;if(Fb(e,((e,o)=>{Tv[o]||(t[o]=e,n++)})),n)return t}(e);if(t){let n={to:t};return Fb(e,((e,o)=>o in t||(n[o]=e))),n}return{...e}}function Pv(e){return e=Ak(e),Ob.arr(e)?e.map(Pv):ov(e)?Ab.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Rv(e){return Ob.fun(e)||Ob.arr(e)&&Ob.obj(e[0])}var Nv={tension:170,friction:26,mass:1,damping:1,easing:Pk.linear,clamp:!1},Lv=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,Nv)}};function Av(e,t){if(Ob.und(t.decay)){let n=!Ob.und(t.tension)||!Ob.und(t.friction);(n||!Ob.und(t.frequency)||!Ob.und(t.damping)||!Ob.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var Dv=[],Ov=class{changed=!1;values=Dv;toValues=null;fromValues=Dv;to;from;config=new Lv;immediate=!1};function zv(e,{key:t,props:n,defaultProps:o,state:r,actions:i}){return new Promise(((s,l)=>{let a,c,u=wv(n.cancel??o?.cancel,t);if(u)h();else{Ob.und(n.pause)||(r.paused=wv(n.pause,t));let e=o?.pause;!0!==e&&(e=r.paused||wv(e,t)),a=Sv(n.delay||0,t),e?(r.resumeQueue.add(p),i.pause()):(i.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),a=c.time-kb.now()}function p(){a>0&&!Ab.skipAnimation?(r.delayed=!0,c=kb.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{i.start({...n,callId:e,cancel:u},s)}catch(e){l(e)}}}))}var Vv=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Gv(e.get()):t.every((e=>e.noop))?Fv(e.get()):Hv(e.get(),t.every((e=>e.finished))),Fv=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Hv=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Gv=e=>({value:e,cancelled:!0,finished:!1});function $v(e,t,n,o){let{callId:r,parentId:i,onRest:s}=t,{asyncTo:l,promise:a}=n;return i||e!==l||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;let c,u,d,p=jv(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)&&Gv(o)||r!==n.asyncId&&Hv(o,!1);if(t)throw e.result=t,u(e),e},m=(e,t)=>{let i=new Wv,s=new Kv;return(async()=>{if(Ab.skipAnimation)throw Uv(n),s.result=Hv(o,!1),u(s),s;g(i);let l=Ob.obj(e)?{...e}:{...t,to:e};l.parentId=r,Fb(p,((e,t)=>{Ob.und(l[t])&&(l[t]=e)}));let a=await o.start(l);return g(i),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};if(Ab.skipAnimation)return Uv(n),Hv(o,!1);try{let t;t=Ob.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=Hv(o.get(),!0,!1)}catch(e){if(e instanceof Wv)d=e.result;else{if(!(e instanceof Kv))throw e;d=e.result}}finally{r==n.asyncId&&(n.asyncId=i,n.asyncTo=i?l:void 0,n.promise=i?a:void 0)}return Ob.fun(s)&&kb.batchedUpdates((()=>{s(d,o,o.item)})),d})():a}function Uv(e,t){Gb(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var Wv=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.")}},Kv=class extends Error{result;constructor(){super("SkipAnimationSignal")}},Zv=e=>e instanceof Yv,qv=1,Yv=class extends zk{id=qv++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=av(this);return e&&e.getValue()}to(...e){return Ab.to(this,e)}interpolate(...e){return nv(`${ev}The "interpolate" function is deprecated in v9 (use "to" instead)`),Ab.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||nk.sort(this),Ok(this,{type:"priority",parent:this,priority:e})}},Xv=Symbol.for("SpringPhase"),Qv=e=>(1&e[Xv])>0,Jv=e=>(2&e[Xv])>0,e_=e=>(4&e[Xv])>0,t_=(e,t)=>t?e[Xv]|=3:e[Xv]&=-3,n_=(e,t)=>t?e[Xv]|=4:e[Xv]&=-5,o_=class extends Yv{key;animation=new Ov;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(),!Ob.und(e)||!Ob.und(t)){let n=Ob.obj(e)?{...e}:{...t,from:e};Ob.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Jv(this)||this._state.asyncTo)||e_(this)}get goal(){return Ak(this.animation.to)}get velocity(){let e=av(this);return e instanceof pv?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Qv(this)}get isAnimating(){return Jv(this)}get isPaused(){return e_(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,o=this.animation,{config:r,toValues:i}=o,s=uv(o.to);!s&&Lk(o.to)&&(i=Hb(Ak(o.to))),o.values.forEach(((l,a)=>{if(l.done)return;let c=l.constructor==hv?1:s?s[a].lastPosition:i[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,i=o.fromValues[a],s=null!=l.v0?l.v0:l.v0=Ob.arr(r.velocity)?r.velocity[a]:r.velocity,p=r.precision||(i==c?.005:Math.min(1,.001*Math.abs(c-i)));if(Ob.und(r.duration))if(r.decay){let e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*n);d=i+s/(1-e)*(1-o),u=Math.abs(l.lastPosition-d)<=p,t=s*o}else{t=null==l.lastVelocity?s:l.lastVelocity;let n,o=r.restVelocity||p/10,a=r.clamp?0:r.bounce,h=!Ob.und(a),g=i==c?l.v0>0:i<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=i+r.easing(o)*(c-i),t=(d-l.lastPosition)/e,u=1==o}l.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}s&&!s[a].done&&(u=!1),u?l.done=!0:t=!1,l.setValue(d,r.round)&&(n=!0)}));let l=av(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 kb.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Jv(this)){let{to:e,config:t}=this.animation;kb.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 Ob.und(e)?(n=this.queue||[],this.queue=[]):n=[Ob.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>Vv(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),Uv(this._state,e&&this._lastCallId),kb.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=Ob.obj(n)?n[t]:n,(null==n||Rv(n))&&(n=void 0),o=Ob.obj(o)?o[t]:o,null==o&&(o=void 0);let r={to:n,from:o};return Qv(this)||(e.reverse&&([n,o]=[o,n]),o=Ak(o),Ob.und(o)?av(this)||this._set(n):this._set(o)),r}_update({...e},t){let{key:n,defaultProps:o}=this;e.default&&Object.assign(o,jv(e,((e,t)=>/^on/.test(t)?Cv(e,n):e))),c_(this,e,"onProps"),u_(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 i=this._state;return zv(++this._lastCallId,{key:n,props:e,defaultProps:o,state:i,actions:{pause:()=>{e_(this)||(n_(this,!0),Wb(i.pauseQueue),u_(this,"onPause",Hv(this,r_(this,this.animation.to)),this))},resume:()=>{e_(this)&&(n_(this,!1),Jv(this)&&this._resume(),Wb(i.resumeQueue),u_(this,"onResume",Hv(this,r_(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=i_(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Gv(this));let o=!Ob.und(e.to),r=!Ob.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Gv(this));this._lastToId=t.callId}let{key:i,defaultProps:s,animation:l}=this,{to:a,from:c}=l,{to:u=a,from:d=c}=e;r&&!o&&(!t.default||Ob.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let p=!zb(d,c);p&&(l.from=d),d=Ak(d);let h=!zb(u,a);h&&this._focus(u);let g=Rv(t.to),{config:m}=l,{decay:f,velocity:b}=m;(o||r)&&(m.velocity=0),t.config&&!g&&function(e,t,n){n&&(Av(n={...n},t),t={...n,...t}),Av(e,t),Object.assign(e,t);for(let t in Nv)null==e[t]&&(e[t]=Nv[t]);let{mass:o,frequency:r,damping:i}=e;Ob.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*i*o/r)}(m,Sv(t.config,i),t.config!==s.config?Sv(s.config,i):void 0);let k=av(this);if(!k||Ob.und(u))return n(Hv(this,!0));let v=Ob.und(t.reset)?r&&!t.default:!Ob.und(d)&&wv(t.reset,i),_=v?d:this.get(),x=Pv(u),y=Ob.num(x)||Ob.arr(x)||ov(x),S=!g&&(!y||wv(s.immediate||t.immediate,i));if(h){let e=kv(u);if(e!==k.constructor){if(!S)throw Error(`Cannot animate between ${k.constructor.name} and ${e.name}, as the "to" prop suggests`);k=this._set(x)}}let w=k.constructor,C=Lk(u),B=!1;if(!C){let e=v||!Qv(this)&&p;(h||e)&&(B=zb(Pv(_),x),C=!B),(!zb(l.immediate,S)&&!S||!zb(m.decay,f)||!zb(m.velocity,b))&&(C=!0)}if(B&&Jv(this)&&(l.changed&&!v?C=!0:C||this._stop(a)),!g&&((C||Lk(a))&&(l.values=k.getPayload(),l.toValues=Lk(u)?null:w==hv?[1]:Hb(x)),l.immediate!=S&&(l.immediate=S,!S&&!v&&this._set(a)),C)){let{onRest:e}=l;Vb(a_,(e=>c_(this,t,e)));let o=Hv(this,r_(this,a));Wb(this._pendingCalls,o),this._pendingCalls.add(n),l.changed&&kb.batchedUpdates((()=>{l.changed=!v,e?.(o,this),v?Sv(s.onRest,o):l.onStart?.(o,this)}))}v&&this._set(_),g?n($v(t.to,t,this._state,this)):C?this._start():Jv(this)&&!h?this._pendingCalls.add(n):n(Fv(_))}_focus(e){let t=this.animation;e!==t.to&&(Dk(this)&&this._detach(),t.to=e,Dk(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;Lk(t)&&(Fk(t,this),Zv(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Lk(e)&&Hk(e,this)}_set(e,t=!0){let n=Ak(e);if(!Ob.und(n)){let e=av(this);if(!e||!zb(n,e.getValue())){let o=kv(n);e&&e.constructor==o?e.setValue(n):cv(this,o.create(n)),e&&kb.batchedUpdates((()=>{this._onChange(n,t)}))}}return av(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,u_(this,"onStart",Hv(this,r_(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Sv(this.animation.onChange,e,this)),Sv(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;av(this).reset(Ak(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Jv(this)||(t_(this,!0),e_(this)||this._resume())}_resume(){Ab.skipAnimation?this.finish():nk.start(this)}_stop(e,t){if(Jv(this)){t_(this,!1);let n=this.animation;Vb(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?Gv(this.get()):Hv(this.get(),r_(this,e??n.to));Wb(this._pendingCalls,o),n.changed&&(n.changed=!1,u_(this,"onRest",o,this))}}};function r_(e,t){let n=Pv(t);return zb(Pv(e.get()),n)}function i_(e,t=e.loop,n=e.to){let o=Sv(t);if(o){let r=!0!==o&&Mv(o),i=(r||e).reverse,s=!r||r.reset;return s_({...e,loop:t,default:!1,pause:void 0,to:!i||Rv(n)?n:void 0,from:s?e.from:void 0,reset:s,...r})}}function s_(e){let{to:t,from:n}=e=Mv(e),o=new Set;return Ob.obj(t)&&l_(t,o),Ob.obj(n)&&l_(n,o),e.keys=o.size?Array.from(o):null,e}function l_(e,t){Fb(e,((e,n)=>null!=e&&t.add(n)))}var a_=["onStart","onRest","onChange","onPause","onResume"];function c_(e,t,n){e.animation[n]=t[n]!==Bv(t,n)?Cv(t[n],e.key):void 0}function u_(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var d_=["onStart","onChange","onRest"],p_=1,h_=class{id=p_++;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];Ob.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(s_(e)),this}start(e){let{queue:t}=this;return e?t=Hb(e).map(s_):this.queue=[],this._flush?this._flush(this,t):(k_(this,t),g_(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;Vb(Hb(t),(t=>n[t].stop(!!e)))}else Uv(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Ob.und(e))this.start({pause:!0});else{let t=this.springs;Vb(Hb(e),(e=>t[e].pause()))}return this}resume(e){if(Ob.und(e))this.start({pause:!1});else{let t=this.springs;Vb(Hb(e),(e=>t[e].resume()))}return this}each(e){Fb(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,Gb(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let i=!o&&this._started,s=r||i&&n.size?this.get():null;r&&t.size&&Gb(t,(([e,t])=>{t.value=s,e(t,this,this._item)})),i&&(this._started=!1,Gb(n,(([e,t])=>{t.value=s,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)}kb.onFrame(this._onFrame)}};function g_(e,t){return Promise.all(t.map((t=>m_(e,t)))).then((t=>Vv(e,t)))}async function m_(e,t,n){let{keys:o,to:r,from:i,loop:s,onRest:l,onResolve:a}=t,c=Ob.obj(t.default)&&t.default;s&&(t.loop=!1),!1===r&&(t.to=null),!1===i&&(t.from=null);let u=Ob.arr(r)||Ob.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Vb(d_,(n=>{let o=t[n];if(Ob.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,Wb(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===Bv(t,"cancel");(u||h&&d.asyncId)&&p.push(zv(++e._lastAsyncId,{props:t,state:d,actions:{pause:Db,resume:Db,start(t,n){h?(Uv(d,e._lastAsyncId),n(Gv(e))):(t.onRest=l,n($v(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let g=Vv(e,await Promise.all(p));if(s&&g.finished&&(!n||!g.noop)){let n=i_(t,s,r);if(n)return k_(e,[n]),m_(e,n,!0)}return a&&kb.batchedUpdates((()=>a(g,e,e.item))),g}function f_(e,t){let n=new o_;return n.key=e,t&&Fk(n,t),n}function b_(e,t,n){t.keys&&Vb(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function k_(e,t){Vb(t,(t=>{b_(e.springs,t,(t=>f_(t,e)))}))}var v_=({children:e,...t})=>{let n=(0,ja.useContext)(__),o=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,ja.useState)((()=>({inputs:t,result:e()}))),o=(0,ja.useRef)(),r=o.current,i=r;return i?Boolean(t&&i.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,i.inputs))||(i={inputs:t,result:e()}):i=n,(0,ja.useEffect)((()=>{o.current=i,r==n&&(n.inputs=n.result=void 0)}),[i]),i.result}((()=>({pause:o,immediate:r})),[o,r]);let{Provider:i}=__;return ja.createElement(i,{value:t},e)},__=function(e,t){return Object.assign(e,ja.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(v_,{});v_.Provider=__.Provider,v_.Consumer=__.Consumer;var x_=class extends Yv{constructor(e,t){super(),this.source=e,this.calc=Ck(...t);let n=this._get(),o=kv(n);cv(this,o.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();zb(t,this.get())||(av(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&S_(this._active)&&w_(this)}_get(){let e=Ob.arr(this.source)?this.source.map(Ak):Hb(Ak(this.source));return this.calc(...e)}_start(){this.idle&&!S_(this._active)&&(this.idle=!1,Vb(uv(this),(e=>{e.done=!1})),Ab.skipAnimation?(kb.batchedUpdates((()=>this.advance())),w_(this)):nk.start(this))}_attach(){let e=1;Vb(Hb(this.source),(t=>{Lk(t)&&Fk(t,this),Zv(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Vb(Hb(this.source),(e=>{Lk(e)&&Hk(e,this)})),this._active.clear(),w_(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=Hb(this.source).reduce(((e,t)=>Math.max(e,(Zv(t)?t.priority:0)+1)),0))}};function y_(e){return!1!==e.idle}function S_(e){return!e.size||Array.from(e).every(y_)}function w_(e){e.idle||(e.idle=!0,Vb(uv(e),(e=>{e.done=!0})),Ok(e,{type:"idle",parent:e}))}Ab.assign({createStringInterpolator:Jk,to:(e,t)=>new x_(e,t)});nk.advance;const C_=window.ReactDOM;var B_=/^--/;function I_(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||B_.test(e)||E_.hasOwnProperty(e)&&E_[e]?(""+t).trim():t+"px"}var j_={};var E_={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},T_=["Webkit","Ms","Moz","O"];E_=Object.keys(E_).reduce(((e,t)=>(T_.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),E_);var M_=/^(matrix|translate|scale|rotate|skew)/,P_=/^(translate)/,R_=/^(rotate|skew)/,N_=(e,t)=>Ob.num(e)&&0!==e?e+t:e,L_=(e,t)=>Ob.arr(e)?e.every((e=>L_(e,t))):Ob.num(e)?e===t:parseFloat(e)===t,A_=class extends mv{constructor({x:e,y:t,z:n,...o}){let r=[],i=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),i.push((e=>[`translate3d(${e.map((e=>N_(e,"px"))).join(",")})`,L_(e,0)]))),Fb(o,((e,t)=>{if("transform"===t)r.push([e||""]),i.push((e=>[e,""===e]));else if(M_.test(t)){if(delete o[t],Ob.und(e))return;let n=P_.test(t)?"px":R_.test(t)?"deg":"";r.push(Hb(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${N_(r,n)})`,L_(r,0)]:e=>[`${t}(${e.map((e=>N_(e,n))).join(",")})`,L_(e,t.startsWith("scale")?1:0)])}})),r.length&&(o.transform=new D_(r,i)),super(o)}},D_=class extends zk{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 Vb(this.inputs,((n,o)=>{let r=Ak(n[0]),[i,s]=this.transforms[o](Ob.arr(r)?r:n.map(Ak));e+=" "+i,t=t&&s})),t?"none":e}observerAdded(e){1==e&&Vb(this.inputs,(e=>Vb(e,(e=>Lk(e)&&Fk(e,this)))))}observerRemoved(e){0==e&&Vb(this.inputs,(e=>Vb(e,(e=>Lk(e)&&Hk(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Ok(this,e)}};Ab.assign({batchedUpdates:C_.unstable_batchedUpdates,createStringInterpolator:Jk,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 O_=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new mv(e)),getComponentProps:o=(e=>e)}={})=>{let r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},i=e=>{let t=yv(e)||"Anonymous";return(e=Ob.str(e)?i[e]||(i[e]=vv(e,r)):e[xv]||(e[xv]=vv(e,r))).displayName=`Animated(${t})`,e};return Fb(e,((t,n)=>{Ob.arr(e)&&(n=yv(t)),i[n]=i(t)})),{animated:i}})(["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:i,scrollLeft:s,viewBox:l,...a}=t,c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:j_[t]||(j_[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=I_(t,o[t]);B_.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s),void 0!==l&&e.setAttribute("viewBox",l)},createAnimatedStyle:e=>new A_(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),z_=O_.animated;function V_(e){return{top:e.offsetTop,left:e.offsetLeft}}const F_=function({triggerAnimationOnChange:e,clientId:t}){const n=(0,a.useRef)(),{isTyping:o,getGlobalBlockCount:r,isBlockSelected:i,isFirstMultiSelectedBlock:s,isBlockMultiSelected:l,isAncestorMultiSelected:u}=(0,c.useSelect)(oi),{previous:d,prevRect:p}=(0,a.useMemo)((()=>({previous:n.current&&V_(n.current),prevRect:n.current&&n.current.getBoundingClientRect()})),[e]);return(0,a.useLayoutEffect)((()=>{if(!d||!n.current)return;const e=(0,ha.getScrollContainer)(n.current),a=i(t),c=a||s(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 h_({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=V_(n.current),b=Math.round(d.left-f.left),k=Math.round(d.top-f.top);return m.start({x:0,y:0,from:{x:b,y:k}}),()=>{m.stop(),m.set({x:0,y:0})}}),[d,p,t,o,r,i,s,l,u]),n};function H_({clientId:e,initialPosition:t}){const n=(0,a.useRef)(),{isBlockSelected:o,isMultiSelecting:r,__unstableGetEditorMode:i}=(0,c.useSelect)(oi);return(0,a.useEffect)((()=>{if(!o(e)||r()||"zoom-out"===i())return;if(null==t)return;if(!n.current)return;const{ownerDocument:s}=n.current;if(Vg(n.current,s.activeElement))return;const l=ha.focus.tabbable.find(n.current).filter((e=>(0,ha.isTextField)(e))),a=-1===t,c=l[a?l.length-1:0]||n.current;if(Vg(n.current,c)){if(!n.current.getAttribute("contenteditable")){const e=ha.focus.tabbable.findNext(n.current);if(e&&Vg(n.current,e)&&(0,ha.isFormElement)(e))return void e.focus()}(0,ha.placeCaretAtHorizontalEdge)(c,a)}else n.current.focus()}),[t,e]),n}function G_({clientId:e}){const{hoverBlock:t}=(0,c.useDispatch)(oi);function n(n){if(n.defaultPrevented)return;const o="mouseover"===n.type?"add":"remove";n.preventDefault(),n.currentTarget.classList[o]("is-hovered"),t("add"===o?e:null)}return(0,u.useRefEffect)((e=>(e.addEventListener("mouseout",n),e.addEventListener("mouseover",n),()=>{e.removeEventListener("mouseout",n),e.removeEventListener("mouseover",n),e.classList.remove("is-hovered"),t(null)})),[])}function $_(e){const{isBlockSelected:t}=(0,c.useSelect)(oi),{selectBlock:n,selectionChange:o}=(0,c.useDispatch)(oi);return(0,u.useRefEffect)((r=>{function i(i){r.parentElement.closest('[contenteditable="true"]')||(t(e)?i.target.isContentEditable||o(e):Vg(r,i.target)&&n(e))}return r.addEventListener("focusin",i),()=>{r.removeEventListener("focusin",i)}}),[t,n])}function U_({clientId:e,isSelected:t}){const{getBlockRootClientId:n,getBlockIndex:o}=(0,c.useSelect)(oi),{insertAfterBlock:r,removeBlock:i}=(0,c.useDispatch)(oi);return(0,u.useRefEffect)((n=>{if(t)return n.addEventListener("keydown",o),n.addEventListener("dragstart",s),()=>{n.removeEventListener("keydown",o),n.removeEventListener("dragstart",s)};function o(t){const{keyCode:o,target:s}=t;o!==ma.ENTER&&o!==ma.BACKSPACE&&o!==ma.DELETE||s!==n||(0,ha.isTextField)(s)||(t.preventDefault(),o===ma.ENTER?r(e):i(e))}function s(e){e.preventDefault()}}),[e,t,n,o,r,i])}function W_(e){const{isNavigationMode:t,isBlockSelected:n}=(0,c.useSelect)(oi),{setNavigationMode:o,selectBlock:r}=(0,c.useDispatch)(oi);return(0,u.useRefEffect)((i=>{function s(i){t()&&!i.defaultPrevented&&(i.preventDefault(),n(e)?o(!1):r(e))}return i.addEventListener("mousedown",s),()=>{i.removeEventListener("mousedown",s)}}),[e,t,n,o])}function K_({editorMode:e}){const{getSettings:t,isZoomOut:n}=te((0,c.useSelect)(oi)),{__unstableSetEditorMode:o,resetZoomLevel:r}=te((0,c.useDispatch)(oi));return(0,u.useRefEffect)((i=>{if("zoom-out"===e&&n())return i.addEventListener("dblclick",s),()=>{i.removeEventListener("dblclick",s)};function s(e){if(!e.defaultPrevented){e.preventDefault();const{__experimentalSetIsInserterOpened:n}=t();"function"==typeof n&&n(!1),o("edit"),r()}}}),[e,t,o])}function Z_(){const e=(0,a.useContext)(Zx);return(0,u.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function q_({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 Y_({clientId:e="",isEnabled:t=!0}={}){const{getEnabledClientIdsTree:n}=te((0,c.useSelect)(oi));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])}const X_={"core/paragraph":["content"],"core/heading":["content"],"core/image":["id","url","title","alt"],"core/button":["url","text","linkTarget","rel"]},Q_="__default";function J_(e){return e in X_}function ex(e,t){return J_(e)&&X_[e].includes(t)}const tx=(0,u.createHigherOrderComponent)((e=>t=>{const n=(0,c.useRegistry)(),o=(0,a.useContext)(Xf),r=(0,c.useSelect)((e=>te(e(l.store)).getAllBlockBindingsSources())),{name:i,clientId:s,context:u,setAttributes:d}=t,p=(0,a.useMemo)((()=>function(e,t){if("core/pattern-overrides"===t?.[Q_]?.source){const n=X_[e],o={};for(const e of n){const n=t[e]?t[e]:{source:"core/pattern-overrides"};o[e]=n}return o}return t}(i,t.attributes.metadata?.bindings)),[t.attributes.metadata?.bindings,i]),h={},g=(0,c.useSelect)((e=>{if(!p)return;const t={},n=new Map;for(const[e,t]of Object.entries(p)){const{source:s,args:l}=t,a=r[s];if(a&&ex(i,e)){for(const e of a.usesContext||[])h[e]=o[e];n.set(a,{...n.get(a),[e]:{args:l}})}}if(n.size)for(const[o,r]of n){let n={};o.getValues?n=o.getValues({select:e,context:h,clientId:s,bindings:r}):Object.keys(r).forEach((e=>{n[e]=o.label}));for(const[e,o]of Object.entries(n))"url"!==e||o&&tc(o)?t[e]=o:t[e]=null}return t}),[p,i,s,h,r]),m=!!h["pattern/overrides"],f="core/pattern-overrides"===t.attributes.metadata?.bindings?.[Q_]?.source,b=(0,a.useCallback)((e=>{n.batch((()=>{if(!p)return void d(e);const t={...e},o=new Map;for(const[e,n]of Object.entries(t)){if(!p[e]||!ex(i,e))continue;const s=p[e],l=r[s?.source];l?.setValues&&(o.set(l,{...o.get(l),[e]:{args:s.args,newValue:n}}),delete t[e])}if(o.size)for(const[e,t]of o)e.setValues({select:n.select,dispatch:n.dispatch,context:h,clientId:s,bindings:t});f&&m||!Object.keys(t).length||(f&&(delete t?.caption,delete t?.href),d(t))}))}),[n,p,i,s,h,d,r,f,m]);return(0,$.jsx)($.Fragment,{children:(0,$.jsx)(e,{...t,attributes:{...t.attributes,...g},setAttributes:b,context:{...u,...h}})})}),"withBlockBindingSupport");function nx(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:o,wrapperProps:r={},isAligned:i,index:s,mode:l,name:c,blockApiVersion:d,blockTitle:p,editorMode:h,isSelected:g,isSubtreeDisabled:f,hasOverlay:b,initialPosition:k,blockEditingMode:v,isHighlighted:x,isMultiSelected:y,isPartiallySelected:S,isReusable:w,isDragging:B,hasChildSelected:I,isBlockMovingMode:j,canInsertMovingBlock:E,isEditingDisabled:T,hasEditableOutline:M,isTemporarilyEditingAsBlocks:P,defaultClassName:R,templateLock:N}=(0,a.useContext)(rb),L=(0,C.sprintf)((0,C.__)("Block: %s"),p),A="html"!==l||t?"":"-visual",D=(0,u.useMergeRefs)([e.ref,H_({clientId:n,initialPosition:k}),pp(n),$_(n),U_({clientId:n,isSelected:g}),W_(n),K_({editorMode:h}),G_({clientId:n}),Z_(),F_({triggerAnimationOnChange:s,clientId:n}),(0,u.useDisabled)({isDisabled:!b}),Y_({clientId:n,isEnabled:"core/block"===c||"contentOnly"===N}),q_({isSelected:g})]),O=_(),z=!!O[m]&&J_(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 V=!1;return"-"!==r?.style?.marginTop?.charAt(0)&&"-"!==r?.style?.marginBottom?.charAt(0)&&"-"!==r?.style?.marginLeft?.charAt(0)&&"-"!==r?.style?.marginRight?.charAt(0)||(V=!0),{tabIndex:"disabled"===v?-1:0,...r,...e,ref:D,id:`block-${n}${A}`,role:"document","aria-label":L,"data-block":n,"data-type":c,"data-title":p,inert:f?"true":void 0,className:$i("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":b,"is-selected":g,"is-highlighted":x,"is-multi-selected":y,"is-partially-selected":S,"is-reusable":w,"is-dragging":B,"has-child-selected":I,"is-block-moving-mode":j,"can-insert-moving-block":E,"is-editing-disabled":T,"has-editable-outline":M,"has-negative-margin":V,"is-content-locked-temporarily-editing-as-blocks":P},o,e.className,r.className,R),style:{...r.style,...e.style,...z}}}(0,d.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e,t){return J_(t)?{...e,edit:tx(e.edit)}:e})),nx.save=l.__unstableGetBlockProps;const{isUnmodifiedBlockContent:ox}=te(l.privateApis);function rx({children:e,isHtml:t,...n}){return(0,$.jsx)("div",{...nx(n,{__unstableIsHtml:t}),children:e})}function ix({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:o,clientId:r,isSelected:i,isSelectionEnabled:s,className:u,__unstableLayoutClassNames:d,name:p,isValid:h,attributes:g,wrapperProps:m,setAttributes:f,onReplace:b,onInsertBlocksAfter:k,onMerge:v,toggleSelection:_}){var x;const{mayDisplayControls:y,mayDisplayParentControls:S,themeSupportsLayout:w,...C}=(0,a.useContext)(rb),{removeBlock:B}=(0,c.useDispatch)(oi),I=(0,a.useCallback)((()=>B(r)),[r,B]),j=Bl()||{};let E=(0,$.jsx)(ib,{name:p,isSelected:i,attributes:g,setAttributes:f,insertBlocksAfter:n?void 0:k,onReplace:o?b:void 0,onRemove:o?I:void 0,mergeBlocks:o?v:void 0,clientId:r,isSelectionEnabled:s,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=$i(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,$.jsx)("div",{className:$i("wp-block",P&&u),"data-align":m["data-align"],children:E})),h)R="html"===t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("div",{style:{display:"none"},children:E}),(0,$.jsx)(rx,{isHtml:!0,children:(0,$.jsx)(fb,{clientId:r})})]}):T?.apiVersion>1?E:(0,$.jsx)(rx,{children:E});else{const t=e?(0,l.serializeRawBlock)(e):(0,l.getSaveContent)(T,g);R=(0,$.jsxs)(rx,{className:"has-warning",children:[(0,$.jsx)(ub,{clientId:r}),(0,$.jsx)(a.RawHTML,{children:(0,ha.safeHTML)(t)})]})}const{"data-align":N,...L}=null!==(x=m)&&void 0!==x?x:{},A={...L,className:$i(L.className,N&&w&&`align${N}`,!(N&&P)&&u)};return(0,$.jsx)(rb.Provider,{value:{wrapperProps:A,isAligned:M,...C},children:(0,$.jsx)(gb,{fallback:(0,$.jsx)(rx,{className:"has-warning",children:(0,$.jsx)(pb,{})}),children:R})})}const sx=(0,c.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:i,replaceBlocks:s,toggleSelection:a,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d,selectBlock:p}=e(oi);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(oi),i=r(),{clientId:s}=t,l=i.length?i:[s];o(l,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:i}=t,{getBlockIndex:s}=n.select(oi),l=s(o);r(e,l+1,i)},onMerge(e){const{clientId:o,rootClientId:a}=t,{getPreviousBlockClientId:c,getNextBlockClientId:h,getBlock:g,getBlockAttributes:m,getBlockName:f,getBlockOrder:b,getBlockIndex:k,getBlockRootClientId:v,canInsertBlockType:_}=n.select(oi);function x(){const e=g(o),t=(0,l.getDefaultBlockName)();if(f(o)!==t){const n=(0,l.switchToBlockType)(e,t);n&&n.length&&s(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 i=v(e),a=b(e),[c]=a;1===a.length&&(0,l.isUnmodifiedBlock)(g(c))?d(e):n.batch((()=>{const n=g(c),a=ox(n),m=(0,l.getDefaultBlockName)(),f=(0,l.switchToBlockType)(n,m),v=!!f?.length&&f.every((t=>_(t.name,e)));if(a&&v)s(c,f,t);else if(a&&n.name===m){d(c);const e=h(o);e&&p(e)}else if(_(n.name,i))u([c],e,i,k(e));else{const n=!!f?.length&&f.every((e=>_(e.name,i)));n?(r(f,k(e),i,t),d(c,!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 i(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):i(o,e)}else{const e=c(o);if(e)i(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;s([t.clientId],r,n,o)},toggleSelection(e){a(e)}}}));ix=(0,u.compose)(sx,(0,Ji.withFilters)("editor.BlockListBlock"))(ix);const lx=(0,a.memo)((function(e){const{clientId:t,rootClientId:n}=e,o=(0,c.useSelect)((e=>{const{isBlockSelected:o,getBlockMode:r,isSelectionEnabled:i,getTemplateLock:s,getBlockWithoutAttributes:a,getBlockAttributes:c,canRemoveBlock:u,canMoveBlock:d,getSettings:p,getTemporarilyEditingAsBlocks:h,getBlockEditingMode:g,getBlockName:m,isFirstMultiSelectedBlock:f,getMultiSelectedBlockClientIds:b,hasSelectedInnerBlock:k,getBlocksByName:v,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}=te(e(oi)),R=a(t);if(!R)return;const{hasBlockSupport:N,getActiveBlockVariation:L}=e(l.store),A=c(t),{name:D,isValid:O}=R,z=(0,l.getBlockType)(D),{supportsLayout:V,__unstableIsPreviewMode:F}=p(),H=z?.apiVersion>1,G={isPreviewMode:F,blockWithoutAttributes:R,name:D,attributes:A,isValid:O,themeSupportsLayout:V,index:_(t),isReusable:(0,l.isReusableBlock)(z),className:H?A.className:void 0,defaultClassName:H?(0,l.getBlockDefaultClassName)(D):void 0,blockTitle:z?.title};if(F)return G;const $=o(t),U=u(t),W=d(t),K=L(D,A),Z=x(t),q=k(t,!0),Y=j(),X=g(t),Q=(0,l.hasBlockSupport)(D,"multiple",!0)?[]:v(D),J=Q.length&&Q[0]!==t,ee=M();return{...G,mode:r(t),isSelectionEnabled:i(),isLocked:!!s(n),templateLock:s(t),canRemove:U,canMove:W,isSelected:$,isTemporarilyEditingAsBlocks:h()===t,blockEditingMode:X,mayDisplayControls:$||f(t)&&b().every((e=>m(e)===D)),mayDisplayParentControls:N(m(t),"__experimentalExposeControlsToChildren",!1)&&k(t),blockApiVersion:z?.apiVersion||1,blockTitle:K?.title||z?.title,editorMode:ee,isSubtreeDisabled:"disabled"===X&&y(t),hasOverlay:T(t)&&!I(),initialPosition:!$||"edit"!==ee&&"zoom-out"!==ee?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:!!J&&Q[0]}}),[t,n]),{isPreviewMode:r,mode:i="visual",isSelectionEnabled:s=!1,isLocked:u=!1,canRemove:d=!1,canMove:p=!1,blockWithoutAttributes:h,name:g,attributes:m,isValid:f,isSelected:b=!1,themeSupportsLayout:k,isTemporarilyEditingAsBlocks:v,blockEditingMode:_,editorMode:x,mayDisplayControls:y,mayDisplayParentControls:S,index:w,blockApiVersion:C,blockTitle:B,isSubtreeDisabled:I,hasOverlay:j,initialPosition:E,isHighlighted:T,isMultiSelected:M,isPartiallySelected:P,isReusable:R,isDragging:N,hasChildSelected:L,isBlockMovingMode:A,canInsertMovingBlock:D,templateLock:O,isEditingDisabled:z,hasEditableOutline:V,className:F,defaultClassName:H,originalBlockClientId:G}=o,U=(0,a.useMemo)((()=>({...h,attributes:m})),[h,m]);if(!o)return null;const W={isPreviewMode:r,clientId:t,className:F,index:w,mode:i,name:g,blockApiVersion:C,blockTitle:B,isSelected:b,isSubtreeDisabled:I,hasOverlay:j,initialPosition:E,blockEditingMode:_,editorMode:x,isHighlighted:T,isMultiSelected:M,isPartiallySelected:P,isReusable:R,isDragging:N,hasChildSelected:L,isBlockMovingMode:A,canInsertMovingBlock:D,templateLock:O,isEditingDisabled:z,hasEditableOutline:V,isTemporarilyEditingAsBlocks:v,defaultClassName:H,mayDisplayControls:y,mayDisplayParentControls:S,originalBlockClientId:G,themeSupportsLayout:k};return(0,$.jsx)(rb.Provider,{value:W,children:(0,$.jsx)(ix,{...e,mode:i,isSelectionEnabled:s,isLocked:u,canRemove:d,canMove:p,block:U,name:g,attributes:m,isValid:f,isSelected:b})})})),ax=window.wp.htmlEntities,cx="\ufeff";function ux({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:o,isManualGrid:r}=(0,c.useSelect)((t=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r,getBlockAttributes:i}=t(oi),s=!n(e),{bodyPlaceholder:l}=o();return{showPrompt:s,isLocked:!!r(e),placeholder:l,isManualGrid:i(e)?.layout?.isManualPlacement}}),[e]),{insertDefaultBlock:i,startTyping:s}=(0,c.useDispatch)(oi);if(n||r)return null;const l=(0,ax.decodeEntities)(o)||(0,C.__)("Type / to choose a block"),a=()=>{i(void 0,e),s()};return(0,$.jsxs)("div",{"data-root-client-id":e||"",className:$i("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,$.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,C.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{ma.ENTER!==e.keyCode&&ma.SPACE!==e.keyCode||a()},onClick:()=>a(),onFocus:()=>{t&&a()},children:t?l:cx}),(0,$.jsx)(Zw,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}function dx({rootClientId:e}){return(0,c.useSelect)((t=>t(oi).canInsertBlockType((0,l.getDefaultBlockName)(),e)))?(0,$.jsx)(ux,{rootClientId:e}):(0,$.jsx)(Xw,{rootClientId:e,className:"block-list-appender__toggle"})}function px({rootClientId:e,CustomAppender:t,className:n,tagName:o="div"}){const r=(0,c.useSelect)((t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:o,getBlockCount:r}=t(oi),i=n();return o()&&e===i?.rootClientId&&0===r(e)}),[e]);return(0,$.jsx)(o,{tabIndex:-1,className:$i("block-list-appender wp-block",n,{"is-drag-over":r}),contentEditable:!1,"data-block":!0,children:t?(0,$.jsx)(t,{}):(0,$.jsx)(dx,{rootClientId:e})})}const hx=Number.MAX_SAFE_INTEGER;(0,a.createContext)();const gx=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,operation:i="insert",nearestSide:s="right",...l}){const[u,d]=(0,a.useReducer)((e=>(e+1)%hx),0),{orientation:p,rootClientId:h,isVisible:g}=(0,c.useSelect)((n=>{const{getBlockListSettings:o,getBlockRootClientId:r,isBlockVisible:i}=n(oi),s=r(null!=e?e:t);return{orientation:o(s)?.orientation||"vertical",rootClientId:s,isVisible:i(e)&&i(t)}}),[e,t]),m=mp(e),f=mp(t),b="vertical"===p,k=(0,a.useMemo)((()=>{if(u<0||!m&&!f||!g)return;return{contextElement:"group"===i?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"===i){const i=t||e;o=i.top,r=0,l=i.bottom-i.top,n="left"===s?i.left-2:i.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,i,s]),v=Lg(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,$.jsx)(Ji.Popover,{ref:v,animate:!1,anchor:k,focusOnMount:!1,__unstableSlotName:o,inline:!o,...l,className:$i("block-editor-block-popover","block-editor-block-popover__inbetween",l.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,$.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:n})},t+"--"+h):null},mx={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};const fx=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,c.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(oi),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}}),[]),o=(0,u.useReducedMotion)();return(0,$.jsx)(qg,{clientId:n,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,$.jsx)(Ji.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:o?mx.show:mx.hide,animate:mx.show,exit:o?mx.show:mx.exit,className:"block-editor-block-popover__drop-zone-foreground"})})},bx=(0,a.createContext)();function kx({__unstablePopoverSlot:e,__unstableContentRef:t,operation:n="insert",nearestSide:o="right"}){const{selectBlock:r,hideInsertionPoint:i}=(0,c.useDispatch)(oi),s=(0,a.useContext)(bx),l=(0,a.useRef)(),{orientation:d,previousClientId:p,nextClientId:h,rootClientId:g,isInserterShown:m,isDistractionFree:f,isNavigationMode:b,isZoomOutMode:k}=(0,c.useSelect)((e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:o,isBlockBeingDragged:r,getPreviousBlockClientId:i,getNextBlockClientId:s,getSettings:l,isNavigationMode:a,__unstableGetEditorMode:c}=e(oi),u=o(),d=t(u.rootClientId);if(!d.length)return{};let p=d[u.index-1],h=d[u.index];for(;r(p);)p=i(p);for(;r(h);)h=s(h);const g=l();return{previousClientId:p,nextClientId:h,orientation:n(u.rootClientId)?.orientation||"vertical",rootClientId:u.rootClientId,isNavigationMode:a(),isDistractionFree:g.isDistractionFree,isInserterShown:u?.__unstableWithInserter,isZoomOutMode:"zoom-out"===c()}}),[]),{getBlockEditingMode:v}=(0,c.useSelect)(oi),_=(0,u.useReducedMotion)();const x={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"}}},y={start:{scale:_?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(f&&!b)return null;if(k&&"insert"!==n)return null;const S=$i("block-editor-block-list__insertion-point","horizontal"===d||"group"===n?"is-horizontal":"is-vertical");return(0,$.jsx)(gx,{previousClientId:p,nextClientId:h,__unstablePopoverSlot:e,__unstableContentRef:t,operation:n,nearestSide:o,children:(0,$.jsxs)(Ji.__unstableMotion.div,{layout:!_,initial:_?"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&&(s.current=!0)},className:$i(S,{"is-with-inserter":m}),onHoverEnd:function(e){e.target!==l.current||s.current||i()},children:[(0,$.jsx)(Ji.__unstableMotion.div,{variants:x,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),m&&(0,$.jsx)(Ji.__unstableMotion.div,{variants:y,className:$i("block-editor-block-list__insertion-point-inserter"),children:(0,$.jsx)(Zw,{position:"bottom center",clientId:h,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{s.current=e},onSelectOrClose:()=>{s.current=!1}})})]})})}function vx(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:o}=(0,c.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:o}=e(oi),r=t();return{insertionPoint:r,isVisible:n(),isBlockListEmpty:0===o(r?.rootClientId)}}),[]);return!n||o?null:"replace"===t.operation?(0,$.jsx)(fx,{...e},`${t.rootClientId}-${t.index}`):(0,$.jsx)(kx,{operation:t.operation,nearestSide:t.nearestSide,...e})}function _x(){const e=(0,a.useContext)(bx),t=(0,c.useSelect)((e=>e(oi).getSettings().isDistractionFree||"zoom-out"===e(oi).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockIndex:o,isMultiSelecting:r,getSelectedBlockClientIds:i,getSettings:s,getTemplateLock:l,__unstableIsWithinBlockOverlay:d,getBlockEditingMode:p,getBlockName:h,getBlockAttributes:g}=(0,c.useSelect)(oi),{showInsertionPoint:m,hideInsertionPoint:f}=(0,c.useDispatch)(oi);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 f();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(l(a)||"disabled"===p(a)||"core/block"===h(a)||a&&g(a).layout?.isManualPlacement)return;const c=n(a),u=c?.orientation||"vertical",b=!!c?.__experimentalCaptureToolbars,k=t.clientY,v=t.clientX;let _=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===u&&t.top>k||e.classList.contains("wp-block")&&"horizontal"===u&&((0,C.isRTL)()?t.right<v:t.left>v)}));if(!_)return void f();if(!_.id&&(_=_.firstElementChild,!_))return void f();const x=_.id.slice(6);if(!x||d(x))return;if(i().includes(x)&&"vertical"===u&&!b&&!s().hasFixedToolbar)return;const y=_.getBoundingClientRect();if("horizontal"===u&&(t.clientY>y.bottom||t.clientY<y.top)||"vertical"===u&&(t.clientX>y.right||t.clientX<y.left))return void f();const S=o(x);0!==S?m(a,S,{__unstableWithInserter:!0}):f()}}),[e,n,o,r,m,f,i,t])}function xx(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,c.useSelect)(oi),{clearSelectedBlock:o}=(0,c.useDispatch)(oi),{clearBlockSelection:r}=e();return(0,u.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",i)};function i(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function yx(e){return(0,$.jsx)("div",{ref:xx(),...e})}const Sx=new WeakMap;function wx(e,t,n,o,r,i,s,l,u,d,p,h){const g=(0,c.useRegistry)(),m=function(e){const[t,n]=(0,a.useState)(e);return ya()(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=yl(h?.type);t.orientation=e.getOrientation(h)}void 0!==s&&(y()("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),t.defaultBlock=s),void 0!==r&&(t.defaultBlock=r),void 0!==l&&(y()("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),t.directInsert=l),void 0!==i&&(t.directInsert=i),void 0!==t.directInsert&&"boolean"!=typeof t.directInsert&&y()("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),Sx.get(g)||Sx.set(g,{}),Sx.get(g)[e]=t,window.queueMicrotask((()=>{const e=Sx.get(g);if(Object.keys(e).length){const{updateBlockListSettings:t}=g.dispatch(oi);t(e),Sx.set(g,{})}}))}),[e,m,f,b,r,i,s,l,d,p,h,g])}function Cx(e,t,n,o,r,i,s,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){s();const e=g.map((e=>(0,l.cloneBlock)(e)));i(e,!0,null)}if("block"===h){const s=n(p[0]);if(d===e&&s===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 i(e,!0,null,p)}const l=d===e,u=p.length;r(p,d,l&&s<t?t-u:t)}}}function Bx(e,t,n={}){const{operation:o="insert",nearestSide:r="right"}=n,{canInsertBlockType:i,getBlockIndex:s,getClientIdsOfDescendants:u,getBlockOrder:d,getBlocksByClientId:p,getSettings:h,getBlock:g}=(0,c.useSelect)(oi),{getGroupingBlockName:m}=(0,c.useSelect)(l.store),{insertBlocks:f,moveBlocksToPosition:b,updateBlockAttributes:k,clearSelectedBlock:v,replaceBlocks:_,removeBlocks:x}=(0,c.useDispatch)(oi),y=(0,c.useRegistry)(),S=(0,a.useCallback)(((n,s=!0,a=0,c=[])=>{Array.isArray(n)||(n=[n]);const u=d(e)[t];if("replace"===o)_(u,n,void 0,a);else if("group"===o){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))),s=n.every((e=>"core/image"===e.name)),d=i("core/gallery",e),p=(0,l.createBlock)(s&&d?"core/gallery":m(),{layout:{type:"flex",flexWrap:s&&d?null:"nowrap"}},o);_([u,...c],p,void 0,a)}else f(n,t,e,s,a)}),[d,e,t,o,_,g,r,i,m,f]),w=(0,a.useCallback)(((n,r,i)=>{if("replace"===o){const o=p(n),r=d(e)[t];y.batch((()=>{x(n,!1),_(r,o,void 0,0)}))}else b(n,r,e,i)}),[o,d,p,b,y,x,_,t,e]),C=Cx(e,t,s,u,w,S,v,o,g),B=function(e,t,n,o,r){return i=>{if(!t().mediaUpload)return;const s=(0,l.findTransform)((0,l.getBlockTransforms)("from"),(t=>"files"===t.type&&o(t.blockName,e)&&t.isMatch(i)));if(s){const e=s.transform(i,n);r(e)}}}(e,h,k,i,S),I=function(e){return t=>{const n=(0,l.pasteHandler)({HTML:t,mode:"BLOCKS"});n.length&&e(n)}}(S);return e=>{const t=(0,ha.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?I(n):t.length?B(t):C(e)}}function Ix(e,t,n=["top","bottom","left","right"]){let o,r;return n.forEach((n=>{const i=function(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:i}=e,s=o?r:i,l=o?i:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=s>=a&&s<=c?s:s<c?a:c,Math.sqrt((s-d)**2+(l-u)**2)}(e,t,n);(void 0===o||i<o)&&(o=i,r=n)})),[o,r]}function jx(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const Ex=30,Tx=120,Mx=120;function Px(e,t,n,o){let r=!0;if(t){const e=t?.map((({name:e})=>e));r=n.every((t=>e?.includes(t)))}const i=n.map((t=>e(t))).every((e=>{const[t]=e?.parent||[];return!t||t===o}));return r&&i}function Rx(e,t){const{defaultView:n}=t;return!!(n&&e instanceof n.HTMLElement&&e.dataset.isInsertionPoint)}function Nx({dropZoneElement:e,rootClientId:t="",parentClientId:n="",isDisabled:o=!1}={}){const r=(0,c.useRegistry)(),[i,s]=(0,a.useState)({index:null,operation:"insert"}),{getBlockType:d,getBlockVariations:p,getGroupingBlockName:h}=(0,c.useSelect)(l.store),{canInsertBlockType:g,getBlockListSettings:m,getBlocks:f,getBlockIndex:b,getDraggedBlockClientIds:k,getBlockNamesByClientId:v,getAllowedBlocks:_,isDragging:x,isGroupable:y,isZoomOutMode:S,getSectionRootClientId:w}=te((0,c.useSelect)(oi)),{showInsertionPoint:B,hideInsertionPoint:I,startDragging:j,stopDragging:E}=te((0,c.useDispatch)(oi)),T=Bx("before"===i.operation||"after"===i.operation?n:t,i.index,{operation:i.operation,nearestSide:i.nearestSide}),M=(0,u.useThrottle)((0,a.useCallback)(((o,i)=>{x()||j();const a=_(t),c=v([t])[0],u=v(k());if(!Px(d,a,u,c))return;const I=w();if(S()&&I!==t)return;const E=f(t);if(0===E.length)return void r.batch((()=>{s({index:0,operation:"insert"}),B(t,0,{operation:"insert"})}));const T=E.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,l.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>i.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:b(t),blockOrientation:m(t)?.orientation}})),M=function(e,t,n="vertical",o={}){const r="horizontal"===n?["left","right"]:["top","bottom"];let i=0,s="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]=Ix(t,e,["top","bottom"]);if(e.height>Tx&&n<Ex){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]=Ix(t,e,["left","right"]);if(e.width>Mx&&n<Ex){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]=Ix(t,p,r);const[f,b]=Ix(t,p,["left","right"]),k=jx(t,p);e&&k?g=0:"vertical"===n&&"horizontal"!==d&&(k&&f<Ex||!k&&function(e,t){return t.top<=e.y&&t.bottom>=e.y}(t,p))&&(a=u,c=b),g<l&&(s="bottom"===m||!h&&"right"===m||h&&"left"===m?"after":"before",l=g,i=u)}));const g=i+("after"===s?1:-1),m=!!e[i]?.isUnmodifiedDefaultBlock,f=!!e[g]?.isUnmodifiedDefaultBlock;if(null!==a)return[a,"group",c];if(!m&&!f)return["after"===s?i+1:i,"insert"];return[m?i:g,"replace"]}(T,{x:o.clientX,y:o.clientY},m(t)?.orientation,{dropZoneElement:e,parentBlockClientId:n,parentBlockOrientation:n?m(n)?.orientation:void 0,rootBlockIndex:b(t)}),[P,R,N]=M;if(!S()||"insert"===R){if("group"===R){const e=E[P],n=[e.name,...u].every((e=>"core/image"===e)),o=g("core/gallery",t),r=y([e.clientId,k()]),i=p(h(),"block"),s=i&&i.find((({name:e})=>"group-row"===e));if(n&&!o&&(!r||!s))return;if(!(n||r&&s))return}r.batch((()=>{s({index:P,operation:R,nearestSide:N});const e=["before","after"].includes(R)?n:t;B(e,P,{operation:R,nearestSide:N})}))}}),[x,_,t,v,k,d,w,S,f,m,e,n,b,r,j,B,g,y,p,h]),200);return(0,u.__experimentalUseDropZone)({dropZoneElement:e,isDisabled:o,onDrop:T,onDragOver(e){M(e,e.currentTarget.ownerDocument)},onDragLeave(e){const{ownerDocument:t}=e.currentTarget;Rx(e.relatedTarget,t)||Rx(e.target,t)||(M.cancel(),I())},onDragEnd(){M.cancel(),E(),I()}})}const Lx={};function Ax({children:e,clientId:t}){const n=function(e){return(0,c.useSelect)((t=>{const n=t(oi).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,$.jsx)(Yf,{value:n,children:e})}const Dx=(0,a.memo)(ny);function Ox(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:o,defaultBlock:r,directInsert:i,__experimentalDefaultBlock:s,__experimentalDirectInsert:u,template:d,templateLock:p,wrapperRef:h,templateInsertUpdatesSelection:g,__experimentalCaptureToolbars:m,__experimentalAppenderTagName:f,renderAppender:b,orientation:k,placeholder:v,layout:_,name:x,blockType:y,parentLock:S,defaultLayout:C}=e;wx(t,S,n,o,r,i,s,u,p,m,k,_),function(e,t,n,o){const{getBlocks:r,getSelectedBlocksInitialCaretPosition:i,isBlockSelected:s}=(0,c.useSelect)(oi),{replaceInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:d}=(0,c.useDispatch)(oi),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&&s(e),i()))})),()=>{a=!0}}),[t,n,e])}(t,d,p,g);const B=(0,l.getBlockSupport)(x,"layout")||(0,l.getBlockSupport)(x,"__experimentalLayout")||Lx,{allowSizingOnChildren:I=!1}=B,j=_||B,E=(0,a.useMemo)((()=>({...C,...j,...I&&{allowSizingOnChildren:!0}})),[C,j,I]),T=(0,$.jsx)(Dx,{rootClientId:t,renderAppender:b,__experimentalAppenderTagName:f,layout:E,wrapperRef:h,placeholder:v});return y?.providesContext&&0!==Object.keys(y.providesContext).length?(0,$.jsx)(Ax,{clientId:t,children:T}):T}function zx(e){return Gf(e),(0,$.jsx)(Ox,{...e})}const Vx=(0,a.forwardRef)(((e,t)=>{const n=Fx({ref:t},e);return(0,$.jsx)("div",{className:"block-editor-inner-blocks",children:(0,$.jsx)("div",{...n})})}));function Fx(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o,dropZoneElement:r}=t,{clientId:i,layout:s=null,__unstableLayoutClassNames:a=""}=_(),d=(0,c.useSelect)((e=>{const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:o,__unstableGetEditorMode:r,getTemplateLock:s,getBlockRootClientId:a,getBlockEditingMode:c,getBlockSettings:u,isDragging:d,getSectionRootClientId:p}=te(e(oi));let h;if(!i)return{isDropZoneDisabled:h};const{hasBlockSupport:g,getBlockType:m}=e(l.store),f=t(i),b="navigation"===r(),k=c(i),v=a(i),[_]=u(i,"layout");if(h="disabled"===k,"zoom-out"===r()){const e=p();h=i!==e}return{__experimentalCaptureToolbars:g(f,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==f&&!n(i)&&!o(i,!0)&&b&&!d(),name:f,blockType:m(f),parentLock:s(v),parentClientId:v,isDropZoneDisabled:h,defaultLayout:_}}),[i]),{__experimentalCaptureToolbars:p,hasOverlay:h,name:g,blockType:m,parentLock:f,parentClientId:b,isDropZoneDisabled:k,defaultLayout:v}=d,x=Nx({dropZoneElement:r,rootClientId:i,parentClientId:b}),y=(0,u.useMergeRefs)([e.ref,o||k||s?.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:x]),S={__experimentalCaptureToolbars:p,layout:s,name:g,blockType:m,parentLock:f,defaultLayout:v,...t},w=S.value&&S.onChange?zx:Ox;return{...e,ref:y,className:$i(e.className,"block-editor-block-list__layout",n?"":a,{"has-overlay":h}),children:i?(0,$.jsx)(w,{...S,clientId:i}):(0,$.jsx)(ny,{...t})}}Fx.save=l.__unstableGetInnerBlocksProps,Vx.DefaultBlockAppender=function(){const{clientId:e}=_();return(0,$.jsx)(ux,{rootClientId:e})},Vx.ButtonBlockAppender=function({showSeparator:e,isFloating:t,onAddBlock:n,isToggle:o}){const{clientId:r}=_();return(0,$.jsx)(Xw,{className:$i({"block-list-appender__toggle":o}),rootClientId:r,showSeparator:e,isFloating:t,onAddBlock:n})},Vx.Content=()=>Fx.save().children;const Hx=Vx,Gx=new Set([ma.UP,ma.RIGHT,ma.DOWN,ma.LEFT,ma.ENTER,ma.BACKSPACE]);function $x(){const e=(0,c.useSelect)((e=>e(oi).isTyping()),[]),{stopTyping:t}=(0,c.useDispatch)(oi);return(0,u.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,i;function s(e){const{clientX:n,clientY:o}=e;r&&i&&(r!==n||i!==o)&&t(),r=n,i=o}return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)}}),[e,t])}function Ux(){const{isTyping:e}=(0,c.useSelect)((e=>{const{isTyping:t}=e(oi);return{isTyping:t()}}),[]),{startTyping:t,stopTyping:n}=(0,c.useDispatch)(oi),o=$x(),r=(0,u.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:i}=r,s=i.getSelection();if(e){let a;function c(e){const{target:t}=e;a=i.setTimeout((()=>{(0,ha.isTextField)(t)||n()}))}function u(e){const{keyCode:t}=e;t!==ma.ESCAPE&&t!==ma.TAB||n()}function d(){s.isCollapsed||n()}return o.addEventListener("focus",c),o.addEventListener("keydown",u),r.addEventListener("selectionchange",d),()=>{i.clearTimeout(a),o.removeEventListener("focus",c),o.removeEventListener("keydown",u),r.removeEventListener("selectionchange",d)}}function l(e){const{type:n,target:r}=e;(0,ha.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Gx.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 Wx=function({children:e}){return(0,$.jsx)("div",{ref:Ux(),children:e})};function Kx({clientId:e,rootClientId:t="",position:n="top"}){const[o,r]=(0,a.useState)(!1),{sectionRootClientId:i,sectionClientIds:s,blockInsertionPoint:l,blockInsertionPointVisible:d}=(0,c.useSelect)((e=>{const{getBlockInsertionPoint:t,getBlockOrder:n,isBlockInsertionPointVisible:o,getSectionRootClientId:r}=te(e(oi)),i=r();return{sectionRootClientId:i,sectionClientIds:n(i),blockOrder:n(i),blockInsertionPoint:t(),blockInsertionPointVisible:o()}}),[]),p=(0,u.useReducedMotion)();if(!e)return;let h=!1;return t===i&&s&&s.includes(e)?("top"===n&&(h=d&&0===l.index&&e===s[l.index]),"bottom"===n&&(h=d&&e===s[l.index-1]),(0,$.jsx)(Ji.__unstableAnimatePresence,{children:h&&(0,$.jsx)(Ji.__unstableMotion.div,{as:"button",layout:!p,initial:{height:0},animate:{height:"120px"},exit:{height:0},transition:{type:"tween",duration:.2,ease:[.6,0,.4,1]},className:$i("block-editor-block-list__zoom-out-separator",{"is-dragged-over":o}),"data-is-insertion-point":"true",onDragOver:()=>r(!0),onDragLeave:()=>r(!1),children:(0,$.jsx)(Ji.__unstableMotion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{type:"tween",duration:.1},children:(0,C.__)("Drop pattern.")})})})):null}const Zx=(0,a.createContext)(),qx=new WeakMap;function Yx({className:e,...t}){const n=(0,u.useViewportMatch)("medium"),{isOutlineMode:o,isFocusMode:r,editorMode:i,temporarilyEditingAsBlocks:s}=(0,c.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n,getTemporarilyEditingAsBlocks:o,isTyping:r}=te(e(oi)),{outlineMode:i,focusMode:s}=t();return{isOutlineMode:i&&!r(),isFocusMode:s,editorMode:n(),temporarilyEditingAsBlocks:o()}}),[]),l=(0,c.useRegistry)(),{setBlockVisibility:d}=(0,c.useDispatch)(oi),p=(0,u.useDebounce)((0,a.useCallback)((()=>{const e={};qx.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=>{qx.get(l)||qx.set(l,[]);for(const t of e){const e=t.target.getAttribute("data-block");qx.get(l).push([e,t.isIntersecting])}p()}))}),[]),g=Fx({ref:(0,u.useMergeRefs)([xx(),_x(),Ux()]),className:$i("is-root-container",e,{"is-outline-mode":o,"is-focus-mode":r&&n,"is-navigate-mode":"navigation"===i})},t);return(0,$.jsxs)(Zx.Provider,{value:h,children:[(0,$.jsx)("div",{...g}),!!s&&(0,$.jsx)(Xx,{clientId:s})]})}function Xx({clientId:e}){const{stopEditingAsBlocks:t}=te((0,c.useDispatch)(oi)),n=(0,c.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t(oi);return n(e)||o(e,!0)}),[e]);return(0,a.useEffect)((()=>{n||t(e)}),[n,e,t]),null}function Qx(e){return(0,$.jsx)(v,{value:b,children:(0,$.jsx)(Yx,{...e})})}const Jx=[],ey=new Set;function ty({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:o,layout:r=Sl}){const i=!1!==n,s=!!n,{order:l,isZoomOut:a,selectedBlocks:u,visibleBlocks:d,shouldRenderAppender:p}=(0,c.useSelect)((e=>{const{getSettings:n,getBlockOrder:o,getSelectedBlockClientId:r,getSelectedBlockClientIds:l,__unstableGetVisibleBlocks:a,getTemplateLock:c,getBlockEditingMode:u,__unstableGetEditorMode:d}=e(oi),p=o(t);if(n().__unstableIsPreviewMode)return{order:p,selectedBlocks:Jx,visibleBlocks:ey};const h=r();return{order:p,selectedBlocks:l(),visibleBlocks:a(),isZoomOut:"zoom-out"===d(),shouldRenderAppender:i&&"zoom-out"!==d()&&(s?!c(t)&&"disabled"!==u(t):t===h||!t&&!h&&!p.length)}}),[t,i,s]);return(0,$.jsxs)(Cl,{value:r,children:[l.map((e=>(0,$.jsxs)(c.AsyncModeProvider,{value:!d.has(e)&&!u.includes(e),children:[a&&(0,$.jsx)(Kx,{clientId:e,rootClientId:t,position:"top"}),(0,$.jsx)(lx,{rootClientId:t,clientId:e}),a&&(0,$.jsx)(Kx,{clientId:e,rootClientId:t,position:"bottom"})]},e))),l.length<1&&e,p&&(0,$.jsx)(px,{tagName:o,rootClientId:t,CustomAppender:n})]})}function ny(e){return(0,$.jsx)(c.AsyncModeProvider,{value:!1,children:(0,$.jsx)(ty,{...e})})}function oy(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:i,__unstableIsFullySelected:s}=e(oi);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:i(),isFullSelection:s()}}function ry(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:i}=(0,c.useSelect)(oy,[]);return(0,u.useRefEffect)((r=>{const{ownerDocument:s}=r,{defaultView:l}=s;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||i&&(r.contentEditable=!0,r.focus(),l.getSelection().removeAllRanges())}),[o,t,n,r,e,i])}function iy(e,t,n,o){let r,i=ha.focus.focusable.find(n);return t&&i.reverse(),i=i.slice(i.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),i.find((function(e){if(!(e.closest("[inert]")||1===e.children.length&&zg(e,e.firstElementChild)&&"true"===e.firstElementChild.getAttribute("contenteditable"))){if(!ha.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 sy(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,c.useSelect)(oi),{selectBlock:i}=(0,c.useDispatch)(oi);return(0,u.useRefEffect)((s=>{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===ma.UP,f=c===ma.DOWN,b=c===ma.LEFT,k=c===ma.RIGHT,v=m||b,_=b||k,x=m||f,y=_||x,S=d||p||h||g,w=x?ha.isVerticalEdge:ha.isHorizontalEdge,{ownerDocument:C}=s,{defaultView:B}=C;if(!y)return;if(o()){if(d)return;if(!r())return;return a.preventDefault(),void(v?i(e()):i(t(),-1))}if(!function(e,t,n){const o=t===ma.UP||t===ma.DOWN,{tagName:r}=e,i=e.getAttribute("type");if(o&&!n)return"INPUT"!==r||!["date","datetime-local","month","number","range","time","week"].includes(i);if("INPUT"===r)return["button","checkbox","number","color","file","image","radio","reset","submit"].includes(i);return"TEXTAREA"!==r}(u,c,S))return;x?l||(l=(0,ha.computeCaretRect)(B)):l=null;const I=(0,ha.isRTL)(u)?!v:v,{keepCaretInsideBlock:j}=n();if(d)(function(e,t){const n=iy(e,t,s);return n&&Fg(n)})(u,v)&&w(u,v)&&(s.contentEditable=!0,s.focus());else if(!x||!(0,ha.isVerticalEdge)(u,v)||h&&!(0,ha.isHorizontalEdge)(u,I)||j){if(_&&B.getSelection().isCollapsed&&(0,ha.isHorizontalEdge)(u,I)&&!j){const e=iy(u,I,s);(0,ha.placeCaretAtHorizontalEdge)(e,v),a.preventDefault()}}else{const e=iy(u,v,s,!0);e&&((0,ha.placeCaretAtVerticalEdge)(e,h?!v:v,h?void 0:l),a.preventDefault())}}return s.addEventListener("mousedown",a),s.addEventListener("keydown",c),()=>{s.removeEventListener("mousedown",a),s.removeEventListener("keydown",c)}}),[])}function ly(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,c.useSelect)(oi),{multiSelect:o,selectBlock:r}=(0,c.useDispatch)(oi),i=(0,$f.__unstableUseShortcutEventMatch)();return(0,u.useRefEffect)((s=>{function l(l){if(!i("core/block-editor/select-all",l))return;const a=t();if(a.length<2&&!(0,ha.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&&(s.ownerDocument.defaultView.getSelection().removeAllRanges(),r(u))}return s.addEventListener("keydown",l),()=>{s.removeEventListener("keydown",l)}}),[])}function ay(e,t){e.contentEditable=t,t&&e.focus()}function cy(){const{startMultiSelect:e,stopMultiSelect:t}=(0,c.useDispatch)(oi),{isSelectionEnabled:n,hasSelectedBlock:o,isDraggingBlocks:r,isMultiSelecting:i}=(0,c.useSelect)(oi);return(0,u.useRefEffect)((s=>{const{ownerDocument:l}=s,{defaultView:a}=l;let c,u;function d(){t(),a.removeEventListener("mouseup",d),u=a.requestAnimationFrame((()=>{if(!o())return;ay(s,!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&&(i()||s!==o&&"true"===o.getAttribute("contenteditable")&&n()&&(c=o,e(),a.addEventListener("mouseup",d),ay(s,!0)))}return s.addEventListener("mouseout",p),()=>{s.removeEventListener("mouseout",p),a.removeEventListener("mouseup",d),a.cancelAnimationFrame(u)}}),[e,t,n,o])}function uy(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function dy(e){const t=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;return t?.closest("[data-wp-block-attribute-key]")}function py(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,c.useDispatch)(oi),{getBlockParents:o,getBlockSelectionStart:r,isMultiSelecting:i}=(0,c.useSelect)(oi);return(0,u.useRefEffect)((s=>{const{ownerDocument:l}=s,{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:0===n&&(0,ha.isSelectionForward)(e)?null!==(o=t.previousSibling)&&void 0!==o?o:t.parentElement:t.childNodes[n];var o}(c);if(!s.contains(u)||!s.contains(d))return;const p=l.shiftKey&&"mouseup"===l.type;if(c.isCollapsed&&!p){if("true"===s.contentEditable&&!i()){uy(s,!1);let e=u.nodeType===u.ELEMENT_NODE?u:u.parentElement;e=e?.closest("[contenteditable]"),e?.focus()}return}let h=Fg(u),g=Fg(d);if(p){const e=r(),t=Fg(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 uy(s,!1);if(h===g)i()?e(h,h):t(h);else{const t=[...o(h),h],r=[...o(g),g],i=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,r);if(t[i]!==h||r[i]!==g)return void e(t[i],r[i]);const s=dy(u),l=dy(d);if(s&&l){var m,f;const e=c.getRangeAt(0),t=(0,W.create)({element:s,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,i=null!==(f=o.start)&&void 0!==f?f:o.end;n({start:{clientId:h,attributeKey:s.dataset.wpBlockAttributeKey,offset:r},end:{clientId:g,attributeKey:l.dataset.wpBlockAttributeKey,offset:i}})}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 hy(){const{selectBlock:e}=(0,c.useDispatch)(oi),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,c.useSelect)(oi);return(0,u.useRefEffect)((r=>{function i(i){if(!t()||0!==i.button)return;const s=n(),l=Fg(i.target);i.shiftKey?s!==l&&(r.contentEditable=!0,r.focus()):o()&&e(l)}return r.addEventListener("mousedown",i),()=>{r.removeEventListener("mousedown",i)}}),[e,t,n,o])}function gy(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,getSelectedBlockClientId:n,__unstableIsSelectionMergeable:o,hasMultiSelection:r,getBlockName:i,canInsertBlockType:s,getBlockRootClientId:a,getSelectionStart:d,getSelectionEnd:p,getBlockAttributes:h}=(0,c.useSelect)(oi),{replaceBlocks:g,__unstableSplitSelection:m,removeBlocks:f,__unstableDeleteSelection:b,__unstableExpandSelection:k,__unstableMarkAutomaticChange:v}=(0,c.useDispatch)(oi);return(0,u.useRefEffect)((c=>{function u(e){"true"===c.contentEditable&&e.preventDefault()}function _(u){if(!u.defaultPrevented)if(r())u.keyCode===ma.ENTER?(c.contentEditable=!1,u.preventDefault(),e()?g(t(),(0,l.createBlock)((0,l.getDefaultBlockName)())):m()):u.keyCode===ma.BACKSPACE||u.keyCode===ma.DELETE?(c.contentEditable=!1,u.preventDefault(),e()?f(t()):o()?b(u.keyCode===ma.DELETE):k()):1!==u.key.length||u.metaKey||u.ctrlKey||(c.contentEditable=!1,o()?b(u.keyCode===ma.DELETE):(u.preventDefault(),c.ownerDocument.defaultView.getSelection().removeAllRanges()));else if(u.keyCode===ma.ENTER){if(u.shiftKey||e())return;const t=n(),o=i(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 v()}if(!(0,l.hasBlockSupport)(o,"splitting",!1)&&!u.__deprecatedOnSplit)return;s(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 my(){const{getBlockName:e}=(0,c.useSelect)(oi),{getBlockType:t}=(0,c.useSelect)(l.store),{createSuccessNotice:n}=(0,c.useDispatch)(Fo.store);return(0,a.useCallback)(((o,r)=>{let i="";if(1===r.length){const n=r[0],s=t(e(n))?.title;i="copy"===o?(0,C.sprintf)((0,C.__)('Copied "%s" to clipboard.'),s):(0,C.sprintf)((0,C.__)('Moved "%s" to clipboard.'),s)}else i="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(i,{type:"snackbar"})}),[])}function fy({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}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,ha.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 by=Symbol("requiresWrapperOnCopy");function ky(e,t,n){let o=t;const[r]=t;if(r){if(n.select(l.store).getBlockType(r.name)[by]){const{getBlockRootClientId:e,getBlockName:t,getBlockAttributes:i}=n.select(oi),s=e(r.clientId),a=t(s);a&&(o=(0,l.createBlock)(a,i(s),o))}}const i=(0,l.serialize)(o);e.clipboardData.setData("text/plain",function(e){e=e.replace(/<br>/g,"\n");return(0,ha.__unstableStripHTML)(e).trim().replace(/\n\n+/g,"\n\n")}(i)),e.clipboardData.setData("text/html",i)}function vy(){const e=(0,c.useRegistry)(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:o,getSettings:r,getBlockName:i,__unstableIsFullySelected:s,__unstableIsSelectionCollapsed:a,__unstableIsSelectionMergeable:d,__unstableGetSelectedBlocksWithPartialSelection:p,canInsertBlockType:h,getBlockRootClientId:g}=(0,c.useSelect)(oi),{flashBlock:m,removeBlocks:f,replaceBlocks:b,__unstableDeleteSelection:k,__unstableExpandSelection:v,__unstableSplitSelection:_}=(0,c.useDispatch)(oi),x=my();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,ha.documentHasUncollapsedSelection)(t):(0,ha.documentHasSelection)(t)&&!t.activeElement.isContentEditable)return}const{activeElement:S}=u.target.ownerDocument;if(!c.contains(S))return;const w=d(),C=a()||s(),B=!C&&!w;if("copy"===u.type||"cut"===u.type)if(u.preventDefault(),1===y.length&&m(y[0]),B)v();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]}ky(u,n,e)}if("cut"===u.type)C&&!B?f(y):(u.target.ownerDocument.activeElement.contentEditable=!1,k());else if("paste"===u.type){const{__experimentalCanUserUseUnfilteredHTML:e}=r();if("true"===u.clipboardData.getData("rich-text"))return;const{plainText:t,html:n,files:a}=fy(u),c=s();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)(i(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=i(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 _y(){const[e,t,n]=function(){const e=(0,a.useRef)(),t=(0,a.useRef)(),n=(0,a.useRef)(),{hasMultiSelection:o,getSelectedBlockClientId:r,getBlockCount:i}=(0,c.useSelect)(oi),{setNavigationMode:s,setLastFocus:l}=te((0,c.useDispatch)(oi)),d=(0,c.useSelect)((e=>e(oi).isNavigationMode()),[]),{getLastFocus:p}=te((0,c.useSelect)(oi)),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{s(!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=ha.focus.tabbable.find(e.current);r.length&&(o?r[0]:r[r.length-1]).focus()}}const f=(0,$.jsx)("div",{ref:t,tabIndex:h,onFocus:m}),b=(0,$.jsx)("div",{ref:n,tabIndex:h,onFocus:m}),k=(0,u.useRefEffect)((a=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===ma.ESCAPE&&!o())return e.preventDefault(),void s(!0);if(e.keyCode!==ma.TAB)return;const i=e.shiftKey,l=i?"findPrevious":"findNext";if(!o()&&!r())return void(e.target===a&&s(!0));const c=ha.focus.tabbable[l](e.target),u=e.target.closest("[data-block]"),d=u&&c&&(zg(u,c)||Vg(u,c));if((0,ha.isFormElement)(c)&&d)return;const p=i?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!==i()||a.focus()}function d(o){if(o.keyCode!==ma.TAB)return;if("region"===o.target?.getAttribute("role"))return;if(e.current===o.target)return;const r=o.shiftKey?"findPrevious":"findNext",i=ha.focus.tabbable[r](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.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,k]),b]}(),o=(0,c.useSelect)((e=>e(oi).hasMultiSelection()),[]);return[e,(0,u.useMergeRefs)([t,vy(),gy(),cy(),py(),hy(),ry(),ly(),sy(),(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 xy=(0,a.forwardRef)((function({children:e,...t},n){const[o,r,i]=_y();return(0,$.jsxs)($.Fragment,{children:[o,(0,$.jsx)("div",{...t,ref:(0,u.useMergeRefs)([r,n]),className:$i(t.className,"block-editor-writing-flow"),children:e}),i]})}));let yy=null;function Sy(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 wy(e){return(0,u.useRefEffect)((()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,o=e.documentElement,r=["dragover","mousemove"],i={};for(const e of r)i[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;Sy(e,window[t],n)},o.addEventListener(e,i[e]);return()=>{for(const e of r)o.removeEventListener(e,i[e])}}))}function Cy({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:r=0,readonly:i,forwardedRef:s,title:l=(0,C.__)("Editor canvas"),...d}){const{resolvedAssets:p,isPreviewMode:h}=(0,c.useSelect)((e=>{const{getSettings:t}=e(oi),n=t();return{resolvedAssets:n.__unstableResolvedAssets,isPreviewMode:n.__unstableIsPreviewMode}}),[]),{styles:g="",scripts:m=""}=p,[f,b]=(0,a.useState)(),k=(0,a.useRef)(),[v,_]=(0,a.useState)([]),x=xx(),[y,S,w]=_y(),[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:i}=o;t=o,i.classList.add("block-editor-iframe__html"),x(i),_(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 yy||(yy=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","wp-reset-editor-styles-rtl-css"].includes(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}),[]),yy))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,L]=(0,a.useState)(),A=(0,u.useRefEffect)((e=>{const t=e.ownerDocument.defaultView;L(t.innerWidth);const n=()=>{L(t.innerWidth)};return t.addEventListener("resize",n),()=>{t.removeEventListener("resize",n)}}),[]),D=1!==o;(0,a.useEffect)((()=>{D||(k.current=E)}),[E,D]);const O=(0,u.useDisabled)({isDisabled:!i}),z=(0,u.useMergeRefs)([wy(f),e,x,S,O,D?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||!D)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,750)/k.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",`${k.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,D]);const G=n>=0&&!h,U=(0,$.jsxs)($.Fragment,{children:[G&&y,(0,$.jsx)("iframe",{...d,style:{...d.style,height:d.style?.height},ref:(0,u.useMergeRefs)([s,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,Sy(e,window.KeyboardEvent,e.currentTarget)}},children:f&&(0,a.createPortal)((0,$.jsxs)("body",{ref:z,className:$i("block-editor-iframe__body","editor-styles-wrapper",...v),children:[B,(0,$.jsx)(Ji.__experimentalStyleProvider,{document:f,children:t})]}),f.documentElement)}),G&&w]});return(0,$.jsxs)("div",{className:"block-editor-iframe__container",ref:A,children:[j,(0,$.jsx)("div",{className:$i("block-editor-iframe__scale-container",D&&"is-zoomed-out"),style:{"--wp-block-editor-iframe-zoom-out-container-width":D&&`${E}px`,"--wp-block-editor-iframe-zoom-out-prev-container-width":D&&`${k.current}px`},children:U})]})}const By=(0,a.forwardRef)((function(e,t){return(0,c.useSelect)((e=>e(oi).getSettings().__internalIsInitialized),[])?(0,$.jsx)(Cy,{...e,forwardedRef:t}):null})),Iy={attribute:/\[\s*(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)\s*(?:(?<operator>\W?=)\s*(?<value>.+?)\s*(\s(?<caseSensitive>[iIsS]))?\s*)?\]/gu,id:/#(?<name>[-\w\P{ASCII}]+)/gu,class:/\.(?<name>[-\w\P{ASCII}]+)/gu,comma:/\s*,\s*/g,combinator:/\s*[\s>+~]\s*/g,"pseudo-element":/::(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,"pseudo-class":/:(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,universal:/(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?\*/gu,type:/(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)/gu},jy=new Set(["combinator","comma"]),Ey=(new Set(["not","is","where","has","matches","-moz-any","-webkit-any","nth-child","nth-last-child"]),e=>{switch(e){case"pseudo-element":case"pseudo-class":return new RegExp(Iy[e].source.replace("(?<argument>¶*)","(?<argument>.*)"),"gu");default:return Iy[e]}});function Ty(e,t){let n=0,o="";for(;t<e.length;t++){const r=e[t];switch(r){case"(":++n;break;case")":--n}if(o+=r,0===n)return o}return o}const My=/(['"])([^\\\n]+?)\1/g,Py=/\\./g;function Ry(e,t=Iy){if(""===(e=e.trim()))return[];const n=[];e=(e=e.replace(Py,((e,t)=>(n.push({value:e,offset:t}),"".repeat(e.length))))).replace(My,((e,t,o,r)=>(n.push({value:e,offset:r}),`${t}${"".repeat(o.length)}${t}`)));{let t,o=0;for(;(t=e.indexOf("(",o))>-1;){const r=Ty(e,t);n.push({value:r,offset:t}),e=`${e.substring(0,t)}(${"¶".repeat(r.length-2)})${e.substring(t+r.length)}`,o=t+r.length}}const o=function(e,t=Iy){if(!e)return[];const n=[e];for(const[e,o]of Object.entries(t))for(let t=0;t<n.length;t++){const r=n[t];if("string"!=typeof r)continue;o.lastIndex=0;const i=o.exec(r);if(!i)continue;const s=i.index-1,l=[],a=i[0],c=r.slice(0,s+1);c&&l.push(c),l.push({...i.groups,type:e,content:a});const u=r.slice(s+a.length+1);u&&l.push(u),n.splice(t,1,...l)}let o=0;for(const e of n)switch(typeof e){case"string":throw new Error(`Unexpected sequence ${e} found at index ${o}`);case"object":o+=e.content.length,e.pos=[o-e.content.length,o],jy.has(e.type)&&(e.content=e.content.trim()||" ")}return n}(e,t),r=new Set;for(const e of n.reverse())for(const t of o){const{offset:n,value:o}=e;if(!(t.pos[0]<=n&&n+o.length<=t.pos[1]))continue;const{content:i}=t,s=n-t.pos[0];t.content=i.slice(0,s)+o+i.slice(s+o.length),t.content!==i&&r.add(t)}for(const e of r){const t=Ey(e.type);if(!t)throw new Error(`Unknown token type: ${e.type}`);t.lastIndex=0;const n=t.exec(e.content);if(!n)throw new Error(`Unable to parse content for ${e.type}: ${e.content}`);Object.assign(e,n.groups)}return o}function*Ny(e,t){switch(e.type){case"list":for(let t of e.list)yield*Ny(t,e);break;case"complex":yield*Ny(e.left,e),yield*Ny(e.right,e);break;case"compound":yield*e.list.map((t=>[t,e]));break;default:yield[e,t]}}var Ly=n(4529);const Ay=Ly,Dy=(Ly.stringify,Ly.fromJSON,Ly.plugin,Ly.parse,Ly.list,Ly.document,Ly.comment,Ly.atRule,Ly.rule,Ly.decl,Ly.root,Ly.CssSyntaxError);Ly.Declaration,Ly.Container,Ly.Processor,Ly.Document,Ly.Comment,Ly.Warning,Ly.AtRule,Ly.Result,Ly.Input,Ly.Rule,Ly.Root,Ly.Node;var Oy=n(1443),zy=n.n(Oy),Vy=n(5404),Fy=n.n(Vy);const Hy=new Map,Gy=[{type:"type",content:"body"},{type:"type",content:"html"},{type:"pseudo-class",content:":root"},{type:"pseudo-class",content:":where(body)"},{type:"pseudo-class",content:":where(:root)"},{type:"pseudo-class",content:":where(html)"}];function $y(e,t){const n=Ry(t);let o=-1;for(let e=n.findLastIndex((({content:e,type:t})=>Gy.some((n=>e===n.content&&t===n.type))))+1;e<n.length;e++)if("combinator"===n[e].type){o=e;break}const r=Ry(e);return n.splice(-1===o?n.length:o,0,{type:"combinator",content:" "},...r),function(e){let t;return t=Array.isArray(e)?e:[...Ny(e)].map((([e])=>e)),t.map((e=>e.content)).join("")}(n)}const Uy=(e,t="",n)=>{let o=Hy.get(t);return o||(o=new WeakMap,Hy.set(t,o)),e.map((e=>{let r=o.get(e);return r||(r=function({css:e,ignoredSelectors:t=[],baseURL:n},o="",r){if(!o&&!n)return e;try{var i;const s=[...t,...null!==(i=r?.ignoredSelectors)&&void 0!==i?i:[],o];return Ay([o&&zy()({prefix:o,transform:(e,t,n)=>s.some((e=>e instanceof RegExp?t.match(e):t.includes(e)))?t:Gy.some((e=>t.startsWith(e.content)))?$y(e,t):n}),n&&Fy()({rootUrl:n})].filter(Boolean)).process(e,{}).css}catch(e){return e instanceof Dy?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),o.set(e,r)),r}))};function Wy(e,t){return(0,a.useCallback)((e=>{if(!e)return;const{ownerDocument:n}=e,{defaultView:o,body:r}=n,i=t?n.querySelector(t):r;let s;if(i)s=o?.getComputedStyle(i,null).getPropertyValue("background-color");else{const e=n.createElement("div");e.classList.add("editor-styles-wrapper"),r.appendChild(e),s=o?.getComputedStyle(e,null).getPropertyValue("background-color"),r.removeChild(e)}const l=Ru(s);l.luminance()>.5||0===l.alpha()?r.classList.remove("is-dark-theme"):r.classList.add("is-dark-theme")}),[e,t])}Lu([Au,zu]);const Ky=(0,a.memo)((function({styles:e,scope:t,transformOptions:n}){const o=(0,c.useSelect)((e=>te(e(oi)).getStyleOverrides()),[]),[r,i]=(0,a.useMemo)((()=>{const r=Object.values(null!=e?e:[]);for(const[e,t]of o){const n=r.findIndex((({id:t})=>e===t)),o={...t,id:e};-1===n?r.push(o):r[n]=o}return[Uy(r.filter((e=>e?.css)),t,n),r.filter((e=>"svgs"===e.__unstableType)).map((e=>e.assets)).join("")]}),[e,o,t,n]);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("style",{ref:Wy(r,t)}),r.map(((e,t)=>(0,$.jsx)("style",{children:e},t))),(0,$.jsx)(Ji.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:i}})]})}));let Zy;const qy=2e3,Yy=[];function Xy({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:o=Yy}){e||(e=t);const[r,{height:i}]=(0,u.useResizeObserver)(),{styles:s}=(0,c.useSelect)((e=>({styles:e(oi).getSettings().styles})),[]),l=(0,a.useMemo)((()=>s?[...s,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o]:s),[s,o]);Zy=Zy||(0,a.memo)(Qx);const d=t/e,p=i?t/(i*d):0;return(0,$.jsx)(Ji.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${d})`,aspectRatio:p,maxHeight:i>qy?qy*d:void 0,minHeight:n},children:(0,$.jsxs)(By,{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:i,pointerEvents:"none",maxHeight:qy,minHeight:0!==d&&d<1&&n?n/d:n},children:[(0,$.jsx)(Ky,{styles:l}),r,(0,$.jsx)(Zy,{renderAppender:!1})]})})}function Qy(e){const[t,{width:n}]=(0,u.useResizeObserver)();return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("div",{style:{position:"relative",width:"100%",height:0},children:t}),(0,$.jsx)("div",{className:"block-editor-block-preview__container",children:!!n&&(0,$.jsx)(Xy,{...e,containerWidth:n})})]})}const Jy=[];const eS=(0,a.memo)((function({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:o=Jy,__experimentalMinHeight:r,__experimentalPadding:i}){r&&(n=r,y()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(o=[...o,{css:`body { padding: ${i}px; }`}],y()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const s=(0,c.useSelect)((e=>e(oi).getSettings()),[]),l=(0,a.useMemo)((()=>({...s,focusMode:!1,__unstableIsPreviewMode:!0})),[s]),u=(0,a.useMemo)((()=>Array.isArray(e)?e:[e]),[e]);return e&&0!==e.length?(0,$.jsx)(Kf,{value:u,settings:l,children:(0,$.jsx)(Qy,{viewportWidth:t,minHeight:n,additionalStyles:o})}):null}));function tS({blocks:e,props:t={},layout:n}){const o=(0,c.useSelect)((e=>e(oi).getSettings()),[]),r=(0,a.useMemo)((()=>({...o,styles:void 0,focusMode:!1,__unstableIsPreviewMode:!0})),[o]),i=(0,u.useDisabled)(),s=(0,u.useMergeRefs)([t.ref,i]),l=(0,a.useMemo)((()=>Array.isArray(e)?e:[e]),[e]),d=(0,$.jsxs)(Kf,{value:l,settings:r,children:[(0,$.jsx)(Ky,{}),(0,$.jsx)(ny,{renderAppender:!1,layout:n})]});return{...t,ref:s,className:$i(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?d:null}}const nS=function({item:e}){var t;const{name:n,title:o,icon:r,description:i,initialAttributes:s,example:c}=e,u=(0,l.isReusableBlock)(e),d=(0,a.useMemo)((()=>c?(0,l.getBlockFromExample)(n,{attributes:{...c.attributes,...s},innerBlocks:c.innerBlocks}):(0,l.createBlock)(n,s)),[n,c,s]),p=144,h=null!==(t=c?.viewportWidth)&&void 0!==t?t:500,g=280/h,m=0!==g&&g<1?p/g:p;return(0,$.jsxs)("div",{className:"block-editor-inserter__preview-container",children:[(0,$.jsx)("div",{className:"block-editor-inserter__preview",children:u||c?(0,$.jsx)("div",{className:"block-editor-inserter__preview-content",children:(0,$.jsx)(eS,{blocks:d,viewportWidth:h,minHeight:p,additionalStyles:[{css:`\n\t\t\t\t\t\t\t\t\t\tbody { \n\t\t\t\t\t\t\t\t\t\t\tpadding: 24px;\n\t\t\t\t\t\t\t\t\t\t\tmin-height:${Math.round(m)}px;\n\t\t\t\t\t\t\t\t\t\t\tdisplay:flex;\n\t\t\t\t\t\t\t\t\t\t\talign-items:center;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.is-root-container { width: 100%; }\n\t\t\t\t\t\t\t\t\t`}]})}):(0,$.jsx)("div",{className:"block-editor-inserter__preview-content-missing",children:(0,C.__)("No preview available.")})}),!u&&(0,$.jsx)(Vf,{title:o,icon:r,description:i})]})};const oS=(0,a.forwardRef)((function({isFirst:e,as:t,children:n,...o},r){return(0,$.jsx)(Ji.Composite.Item,{ref:r,role:"option",accessibleWhenDisabled:!0,...o,render:o=>{const r={...o,tabIndex:e?0:o.tabIndex};return t?(0,$.jsx)(t,{...r,children:n}):"function"==typeof n?n(r):(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,...r,children:n})}})})),rS=(0,$.jsx)(G.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"})});function iS({count:e,icon:t,isPattern:n,fadeWhenDisabled:o}){const r=n&&(0,C.__)("Pattern");return(0,$.jsx)("div",{className:"block-editor-block-draggable-chip-wrapper",children:(0,$.jsx)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:(0,$.jsxs)(Ji.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[(0,$.jsx)(Ji.FlexItem,{children:t?(0,$.jsx)(zf,{icon:t}):r||(0,C.sprintf)((0,C._n)("%d block","%d blocks",e),e)}),(0,$.jsx)(Ji.FlexItem,{children:(0,$.jsx)(zf,{icon:rS})}),o&&(0,$.jsx)(Ji.FlexItem,{className:"block-editor-block-draggable-chip__disabled",children:(0,$.jsx)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}const sS=({isEnabled:e,blocks:t,icon:n,children:o,pattern:r})=>{const i={type:"inserter",blocks:t},s=(0,c.useSelect)((e=>{const{getBlockType:n}=e(l.store);return 1===t.length&&n(t[0].name)?.icon}),[t]),{startDragging:a,stopDragging:u}=te((0,c.useDispatch)(oi));return e?(0,$.jsx)(Ji.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:i,onDragStart:e=>{a();const n=r?.type===ge.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,$.jsx)(iS,{count:t.length,icon:n||!r&&s,isPattern:!!r}),children:({onDraggableStart:e,onDraggableEnd:t})=>o({draggable:!0,onDragStart:e,onDragEnd:t})}):o({draggable:!1,onDragStart:void 0,onDragEnd:void 0})};const lS=(0,a.memo)((function({className:e,isFirst:t,item:n,onSelect:o,onHover:r,isDraggable:i,...s}){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,$.jsx)(sS,{isEnabled:i&&!n.isDisabled,blocks:d,icon:n.icon,children:({draggable:i,onDragStart:l,onDragEnd:a})=>(0,$.jsx)("div",{className:$i("block-editor-block-types-list__list-item",{"is-synced":p}),draggable:i,onDragStart:e=>{c.current=!0,l&&(r(null),l(e))},onDragEnd:e=>{c.current=!1,a&&a(e)},children:(0,$.jsxs)(oS,{isFirst:t,className:$i("block-editor-block-types-list__item",e),disabled:n.isDisabled,onClick:e=>{e.preventDefault(),o(n,(0,ma.isAppleOS)()?e.metaKey:e.ctrlKey),r(null)},onKeyDown:e=>{const{keyCode:t}=e;t===ma.ENTER&&(e.preventDefault(),o(n,(0,ma.isAppleOS)()?e.metaKey:e.ctrlKey),r(null))},onMouseEnter:()=>{c.current||r(n)},onMouseLeave:()=>r(null),...s,children:[(0,$.jsx)("span",{className:"block-editor-block-types-list__item-icon",style:u,children:(0,$.jsx)(zf,{icon:n.icon,showColors:!0})}),(0,$.jsx)("span",{className:"block-editor-block-types-list__item-title",children:(0,$.jsx)(Ji.__experimentalTruncate,{numberOfLines:3,children:n.title})})]})})})}));const aS=(0,a.forwardRef)((function(e,t){const[n,o]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{n&&(0,Vo.speak)((0,C.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,$.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)},...e})}));const cS=(0,a.forwardRef)((function(e,t){return(0,$.jsx)(Ji.Composite.Group,{role:"presentation",ref:t,...e})}));function uS(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 dS=function e({items:t=[],onSelect:n,onHover:o=(()=>{}),children:r,label:i,isDraggable:s=!0}){const a="block-editor-block-types-list",c=(0,u.useInstanceId)(e,a);return(0,$.jsxs)(aS,{className:a,"aria-label":i,children:[uS(t,3).map(((e,t)=>(0,$.jsx)(cS,{children:e.map(((e,r)=>(0,$.jsx)(lS,{item:e,className:(0,l.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:s&&!e.isDisabled,isFirst:0===t&&0===r,rowId:`${c}-${t}`},e.id)))},t))),r]})};const pS=function({title:e,icon:t,children:n}){return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,$.jsx)("h2",{className:"block-editor-inserter__panel-title",children:e}),(0,$.jsx)(Ji.Icon,{icon:t})]}),(0,$.jsx)("div",{className:"block-editor-inserter__panel-content",children:n})]})},hS=(e,t,n)=>{const o=(0,a.useMemo)((()=>({[oe]:!n})),[n]),[r]=(0,c.useSelect)((t=>[t(oi).getInserterItems(e,o)]),[e,o]),[i,s]=(0,c.useSelect)((e=>{const{getCategories:t,getCollections:n}=e(l.store);return[t(),n()]}),[]);return[r,i,s,(0,a.useCallback)((({name:e,initialAttributes:n,innerBlocks:o,syncStatus:r,content:i,rootClientId:s},a)=>{const c="unsynced"===r?(0,l.parse)(i,{__unstableSkipMigrationLogs:!0}):(0,l.createBlock)(e,n,(0,l.createBlocksFromInnerBlocksTemplate)(o));t(c,void 0,a,s)}),[t])]};const gS=function({children:e}){return(0,$.jsx)(Ji.Composite,{focusShift:!0,focusWrap:"horizontal",render:(0,$.jsx)($.Fragment,{}),children:e})};const mS=function(){return(0,$.jsxs)("div",{className:"block-editor-inserter__no-results",children:[(0,$.jsx)(cl,{className:"block-editor-inserter__no-results-icon",icon:Of}),(0,$.jsx)("p",{children:(0,C.__)("No results found.")})]})},fS=e=>e.name.split("/")[0],bS=6,kS=[];function vS({items:e,collections:t,categories:n,onSelectItem:o,onHover:r,showMostUsedBlocks:i,className:s}){const l=(0,a.useMemo)((()=>he(e,"frecency","desc").slice(0,bS)),[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=>fS(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:kS);return(0,$.jsxs)("div",{className:s,children:[i&&e.length>3&&!!l.length&&(0,$.jsx)(pS,{title:(0,C._x)("Most used","blocks"),children:(0,$.jsx)(dS,{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,$.jsx)(pS,{title:t.title,icon:t.icon,children:(0,$.jsx)(dS,{items:n,onSelect:o,onHover:r,label:t.title})},t.slug):null})),h&&c.length>0&&(0,$.jsx)(pS,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,C.__)("Uncategorized"),children:(0,$.jsx)(dS,{items:c,onSelect:o,onHover:r,label:(0,C.__)("Uncategorized")})}),m.map((([e,t])=>{const n=d[e];return n&&n.length?(0,$.jsx)(pS,{title:t.title,icon:t.icon,children:(0,$.jsx)(dS,{items:n,onSelect:o,onHover:r,label:t.title})},e):null}))]})}const _S=(0,a.forwardRef)((function({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:o},r){const[i,s,l,a]=hS(e,t);if(!i.length)return(0,$.jsx)(mS,{});const c=[],u=[];for(const t of i)"reusable"!==t.category&&(e&&t.rootClientId===e?c.push(t):u.push(t));return(0,$.jsx)(gS,{children:(0,$.jsxs)("div",{ref:r,children:[!!c.length&&(0,$.jsx)($.Fragment,{children:(0,$.jsx)(vS,{items:c,categories:s,collections:l,onSelectItem:a,onHover:n,showMostUsedBlocks:o,className:"block-editor-inserter__insertable-blocks-at-selection"})}),(0,$.jsx)(vS,{items:u,categories:s,collections:l,onSelectItem:a,onHover:n,showMostUsedBlocks:o,className:"block-editor-inserter__all-blocks"})]})})}));function xS({selectedCategory:e,patternCategories:t,onClickCategory:n}){const o="block-editor-block-patterns-explorer__sidebar";return(0,$.jsx)("div",{className:`${o}__categories-list`,children:t.map((({name:t,label:r})=>(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,label:r,className:`${o}__categories-list__item`,isPressed:e===t,onClick:()=>{n(t)},children:r},t)))})}function yS({searchValue:e,setSearchValue:t}){return(0,$.jsx)("div",{className:"block-editor-block-patterns-explorer__search",children:(0,$.jsx)(Ji.SearchControl,{__nextHasNoMarginBottom:!0,onChange:t,value:e,label:(0,C.__)("Search for patterns"),placeholder:(0,C.__)("Search")})})}const SS=function({selectedCategory:e,patternCategories:t,onClickCategory:n,searchValue:o,setSearchValue:r}){return(0,$.jsxs)("div",{className:"block-editor-block-patterns-explorer__sidebar",children:[(0,$.jsx)(yS,{searchValue:o,setSearchValue:r}),!o&&(0,$.jsx)(xS,{selectedCategory:e,patternCategories:t,onClickCategory:n})]})};function wS({currentPage:e,numPages:t,changePage:n,totalItems:o}){return(0,$.jsxs)(Ji.__experimentalVStack,{className:"block-editor-patterns__grid-pagination-wrapper",children:[(0,$.jsx)(Ji.__experimentalText,{variant:"muted",children:(0,C.sprintf)((0,C._n)("%s item","%s items",o),o)}),t>1&&(0,$.jsxs)(Ji.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination",children:[(0,$.jsxs)(Ji.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous",children:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,variant:"tertiary",onClick:()=>n(1),disabled:1===e,"aria-label":(0,C.__)("First page"),accessibleWhenDisabled:!0,children:(0,$.jsx)("span",{children:"«"})}),(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,variant:"tertiary",onClick:()=>n(e-1),disabled:1===e,"aria-label":(0,C.__)("Previous page"),accessibleWhenDisabled:!0,children:(0,$.jsx)("span",{children:""})})]}),(0,$.jsx)(Ji.__experimentalText,{variant:"muted",children:(0,C.sprintf)((0,C._x)("%1$s of %2$s","paging"),e,t)}),(0,$.jsxs)(Ji.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next",children:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,variant:"tertiary",onClick:()=>n(e+1),disabled:e===t,"aria-label":(0,C.__)("Next page"),accessibleWhenDisabled:!0,children:(0,$.jsx)("span",{children:""})}),(0,$.jsx)(Ji.Button,{variant:"tertiary",onClick:()=>n(t),disabled:e===t,"aria-label":(0,C.__)("Last page"),size:"default",accessibleWhenDisabled:!0,children:(0,$.jsx)("span",{children:"»"})})]})]})]})}const CS=({showTooltip:e,title:t,children:n})=>e?(0,$.jsx)(Ji.Tooltip,{text:t,children:n}):(0,$.jsx)($.Fragment,{children:n});function BS({id:e,isDraggable:t,pattern:n,onClick:o,onHover:r,showTitle:i=!0,showTooltip:s,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)(BS)}`,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,$.jsx)(sS,{isEnabled:t,blocks:f,pattern:n,children:({draggable:t,onDragStart:l,onDragEnd:a})=>(0,$.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,$.jsx)(CS,{showTooltip:s&&!n.type!==ge.user,title:n.title,children:(0,$.jsxs)(Ji.Composite.Item,{render:(0,$.jsx)("div",{role:"option","aria-label":n.title,"aria-describedby":n.description?m:void 0,className:$i("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":n.type===ge.user&&!n.syncStatus})}),id:e,onClick:()=>{o(n,h),r?.(null)},onMouseEnter:()=>{d||r?.(n)},onMouseLeave:()=>r?.(null),children:[(0,$.jsx)(eS,{blocks:h,viewportWidth:g}),i&&(0,$.jsxs)(Ji.__experimentalHStack,{className:"block-editor-patterns__pattern-details",spacing:2,children:[n.type===ge.user&&!n.syncStatus&&(0,$.jsx)("div",{className:"block-editor-patterns__pattern-icon-wrapper",children:(0,$.jsx)(cl,{className:"block-editor-patterns__pattern-icon",icon:U})}),(!s||n.type===ge.user)&&(0,$.jsx)("div",{className:"block-editor-block-patterns-list__item-title",children:n.title})]}),!!n.description&&(0,$.jsx)(Ji.VisuallyHidden,{id:m,children:n.description})]})})})})}function IS(){return(0,$.jsx)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const jS=(0,a.forwardRef)((function({isDraggable:e,blockPatterns:t,shownPatterns:n,onHover:o,onClickPattern:r,orientation:i,label:s=(0,C.__)("Block patterns"),category:l,showTitle:c=!0,showTitlesAsTooltip:u,pagingProps:d},p){const[h,g]=(0,a.useState)(void 0);return(0,a.useEffect)((()=>{const e=t.find((e=>n.includes(e)))?.name;g(e)}),[n,t]),(0,$.jsxs)(Ji.Composite,{orientation:i,activeId:h,setActiveId:g,role:"listbox",className:"block-editor-block-patterns-list","aria-label":s,ref:p,children:[t.map((t=>n.includes(t)?(0,$.jsx)(BS,{id:t.name,pattern:t,onClick:r,onHover:o,isDraggable:e,showTitle:c,showTooltip:u,category:l},t.name):(0,$.jsx)(IS,{},t.name))),d&&(0,$.jsx)(wS,{...d})]})}));function ES({destinationRootClientId:e,destinationIndex:t,rootClientId:n,registry:o}){if(n===e)return t;const r=["",...o.select(oi).getBlockParents(e),e],i=r.indexOf(n);return-1!==i?o.select(oi).getBlockIndex(r[i+1])+1:o.select(oi).getBlockOrder(n).length}const TS=function({rootClientId:e="",insertionIndex:t,clientId:n,isAppender:o,onSelect:r,shouldFocusBlock:i=!0,selectBlockOnInsert:s=!0}){const u=(0,c.useRegistry)(),{getSelectedBlock:d}=(0,c.useSelect)(oi),{destinationRootClientId:p,destinationIndex:h}=(0,c.useSelect)((r=>{const{getSelectedBlockClientId:i,getBlockRootClientId:s,getBlockIndex:l,getBlockOrder:a}=r(oi),c=i();let u,d=e;return void 0!==t?u=t:n?u=l(n):!o&&c?(d=s(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:k}=te((0,c.useDispatch)(oi)),v=(0,a.useCallback)(((e,t,n=!1,a)=>{(n||i||s)&&k(null);const c=d();!o&&c&&(0,l.isUnmodifiedDefaultBlock)(c)?g(c.clientId,e,null,i||n?0:null,t):m(e,o||void 0===a?h:ES({destinationRootClientId:p,destinationIndex:h,rootClientId:a,registry:u}),o||void 0===a?p:a,s,i||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,Vo.speak)(b),r&&r(e)}),[o,d,g,m,p,h,r,i,s]),_=(0,a.useCallback)((e=>{e?.hasOwnProperty("rootClientId")?f(e.rootClientId,ES({destinationRootClientId:p,destinationIndex:h,rootClientId:e.rootClientId,registry:u})):b()}),[f,b,p,h]);return[p,v,_]},MS=(e,t,n)=>{const{patternCategories:o,patterns:r,userPatternCategories:i}=(0,c.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(oi),{__experimentalUserPatternCategories:r,__experimentalBlockPatternCategories:i}=o();return{patterns:n(t),userPatternCategories:r,patternCategories:i}}),[t]),s=(0,a.useMemo)((()=>{const e=[...o];return i?.forEach((t=>{e.find((e=>e.name===t.name))||e.push(t)})),e}),[o,i]),{createSuccessNotice:u}=(0,c.useDispatch)(Fo.store),d=(0,a.useCallback)(((t,o)=>{const r=t.type===ge.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,s,d]};var PS=n(9681),RS=n.n(PS);function NS(e){return e.toLowerCase()}var LS=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],AS=/[^A-Z0-9]+/gi;function DS(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}const OS=e=>e.name||"",zS=e=>e.title,VS=e=>e.description||"",FS=e=>e.keywords||[],HS=e=>e.category,GS=()=>null,$S=[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],US=/(\p{C}|\p{P}|\p{S})+/giu,WS=new Map,KS=new Map;function ZS(e=""){if(WS.has(e))return WS.get(e);const t=function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?LS:n,r=t.stripRegexp,i=void 0===r?AS:r,s=t.transform,l=void 0===s?NS:s,a=t.delimiter,c=void 0===a?" ":a,u=DS(DS(e,o,"$1\0$2"),i,"\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:$S,stripRegexp:US}).split(" ").filter(Boolean);return WS.set(e,t),t}function qS(e=""){if(KS.has(e))return KS.get(e);let t=RS()(e);return t=t.replace(/^\//,""),t=t.toLowerCase(),KS.set(e,t),t}const YS=(e="")=>ZS(qS(e)),XS=(e,t,n,o)=>{if(0===YS(o).length)return e;return QS(e,o,{getCategory:e=>t.find((({slug:t})=>t===e.category))?.title,getCollection:e=>n[e.name.split("/")[0]]?.title})},QS=(e=[],t="",n={})=>{if(0===YS(t).length)return e;const o=e.map((e=>[e,JS(e,t,n)])).filter((([,e])=>e>0));return o.sort((([,e],[,t])=>t-e)),o.map((([e])=>e))};function JS(e,t,n={}){const{getName:o=OS,getTitle:r=zS,getDescription:i=VS,getKeywords:s=FS,getCategory:l=HS,getCollection:a=GS}=n,c=o(e),u=r(e),d=i(e),p=s(e),h=l(e),g=a(e),m=qS(t),f=qS(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=>!YS(t).some((t=>t.includes(e))))))(ZS(m),e).length&&(b+=10)}if(0!==b&&c.startsWith("core/")){b+=c!==e.id?1:2}return b}const ew=20,tw=5;function nw(e,t,n,o=""){const[r,i]=(0,a.useState)(1),s=(0,u.usePrevious)(t),l=(0,u.usePrevious)(o);s===t&&l===o||1===r||i(1);const c=e.length,d=r-1,p=(0,a.useMemo)((()=>e.slice(d*ew,d*ew+ew)),[d,e]),h=(0,u.useAsyncList)(p,{step:tw}),g=Math.ceil(e.length/ew);return(0,a.useEffect)((function(){const e=(0,ha.getScrollContainer)(n?.current);e?.scrollTo(0,0)}),[t,n]),{totalItems:c,categoryPatterns:p,categoryPatternsAsyncList:h,numPages:g,changePage:e=>{const t=(0,ha.getScrollContainer)(n?.current);t?.scrollTo(0,0),i(e)},currentPage:r}}function ow({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,$.jsx)(Ji.__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 rw=function({searchValue:e,selectedCategory:t,patternCategories:n,rootClientId:o}){const r=(0,a.useRef)(),i=(0,u.useDebounce)(Vo.speak,500),[s,l]=TS({rootClientId:o,shouldFocusBlock:!0}),[c,,d]=MS(l,s,t),p=(0,a.useMemo)((()=>n.map((e=>e.name))),[n]),h=(0,a.useMemo)((()=>{const n=c.filter((e=>{if(t===fe.name)return!0;if(t===be.name&&e.type===ge.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?QS(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);i(n)}),[e,i,h.length]);const g=nw(h,t,r),[m,f]=(0,a.useState)(e);e!==m&&(f(e),g.changePage(1));const b=!!h?.length;return(0,$.jsxs)("div",{className:"block-editor-block-patterns-explorer__list",ref:r,children:[(0,$.jsx)(ow,{filterValue:e,filteredBlockPatternsLength:h.length}),(0,$.jsx)(gS,{children:b&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(jS,{shownPatterns:g.categoryPatternsAsyncList,blockPatterns:g.categoryPatterns,onClickPattern:d,isDraggable:!1}),(0,$.jsx)(wS,{...g})]})})]})};function iw(e,t="all"){const[n,o]=MS(void 0,e),r=(0,a.useMemo)((()=>"all"===t?n:n.filter((e=>!ke(e,t)))),[t,n]),i=(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===ge.user))&&e.unshift(be),r.length>0&&e.unshift({name:fe.name,label:fe.label}),(0,Vo.speak)((0,C.sprintf)((0,C._n)("%d category button displayed.","%d category buttons displayed.",e.length),e.length)),e}),[o,r]);return i}function sw({initialCategory:e,rootClientId:t}){const[n,o]=(0,a.useState)(""),[r,i]=(0,a.useState)(e?.name),s=iw(t);return(0,$.jsxs)("div",{className:"block-editor-block-patterns-explorer",children:[(0,$.jsx)(SS,{selectedCategory:r,patternCategories:s,onClickCategory:i,searchValue:n,setSearchValue:o}),(0,$.jsx)(rw,{searchValue:n,selectedCategory:r,patternCategories:s,rootClientId:t})]})}const lw=function({onModalClose:e,...t}){return(0,$.jsx)(Ji.Modal,{title:(0,C.__)("Patterns"),onRequestClose:e,isFullScreen:!0,children:(0,$.jsx)(sw,{...t})})};function aw({title:e}){return(0,$.jsx)(Ji.__experimentalVStack,{spacing:0,children:(0,$.jsx)(Ji.__experimentalView,{children:(0,$.jsx)(Ji.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,$.jsxs)(Ji.__experimentalHStack,{spacing:2,children:[(0,$.jsx)(Ji.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,C.isRTL)()?Af:Df,size:"small",label:(0,C.__)("Back")}),(0,$.jsx)(Ji.__experimentalSpacer,{children:(0,$.jsx)(Ji.__experimentalHeading,{level:5,children:e})})]})})})})}function cw({categories:e,children:t}){return(0,$.jsxs)(Ji.__experimentalNavigatorProvider,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation",children:[(0,$.jsx)(Ji.__experimentalNavigatorScreen,{path:"/",children:(0,$.jsx)(Ji.__experimentalItemGroup,{children:e.map((e=>(0,$.jsx)(Ji.__experimentalNavigatorButton,{path:`/category/${e.name}`,as:Ji.__experimentalItem,isAction:!0,children:(0,$.jsxs)(Ji.__experimentalHStack,{children:[(0,$.jsx)(Ji.FlexBlock,{children:e.label}),(0,$.jsx)(cl,{icon:(0,C.isRTL)()?Df:Af})]})},e.name)))})}),e.map((e=>(0,$.jsxs)(Ji.__experimentalNavigatorScreen,{path:`/category/${e.name}`,children:[(0,$.jsx)(aw,{title:(0,C.__)("Back")}),t(e)]},e.name)))]})}const uw=e=>"all"!==e&&"user"!==e,dw=e=>e.name===be.name,pw=[{value:"all",label:(0,C._x)("All","patterns")},{value:ge.directory,label:(0,C.__)("Pattern Directory")},{value:ge.theme,label:(0,C.__)("Theme & Plugins")},{value:ge.user,label:(0,C.__)("User")}];function hw({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:n,patternSourceFilter:o,scrollContainerRef:r,category:i}){const s=i.name===be.name?ge.user:o,l=uw(s),c=dw(i),u=(0,a.useMemo)((()=>[{value:"all",label:(0,C._x)("All","patterns")},{value:me.full,label:(0,C._x)("Synced","patterns"),disabled:l},{value:me.unsynced,label:(0,C._x)("Not synced","patterns"),disabled:l}]),[l]);return(0,$.jsx)($.Fragment,{children:(0,$.jsx)(Ji.DropdownMenu,{popoverProps:{placement:"right-end"},label:(0,C.__)("Filter patterns"),toggleProps:{size:"compact"},icon:(0,$.jsx)(cl,{icon:(0,$.jsx)(Ji.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,$.jsx)(Ji.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"currentColor"})})}),children:()=>(0,$.jsxs)($.Fragment,{children:[!c&&(0,$.jsx)(Ji.MenuGroup,{label:(0,C.__)("Source"),children:(0,$.jsx)(Ji.MenuItemsChoice,{choices:pw,onSelect:n=>{var o;t(o=n),uw(o)&&e("all"),r.current?.scrollTo(0,0)},value:s})}),(0,$.jsx)(Ji.MenuGroup,{label:(0,C.__)("Type"),children:(0,$.jsx)(Ji.MenuItemsChoice,{choices:u,onSelect:t=>{e(t),r.current?.scrollTo(0,0)},value:n})}),(0,$.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,$.jsx)(Ji.ExternalLink,{href:(0,C.__)("https://wordpress.org/patterns/")})})})]})})})}const gw=()=>{};function mw({rootClientId:e,onInsert:t,onHover:n=gw,category:o,showTitlesAsTooltip:r}){const i=(0,c.useSelect)((e=>"zoom-out"===e(oi).__unstableGetEditorMode()),[]),[s,,l]=MS(t,e,o?.name),[u,d]=(0,a.useState)("all"),[p,h]=(0,a.useState)("all"),g=iw(e,p),m=(0,a.useRef)(),f=(0,a.useMemo)((()=>s.filter((e=>!ke(e,p,u)&&(o.name===fe.name||(o.name===be.name&&e.type===ge.user||("uncategorized"===o.name?!e.categories||!e.categories.some((e=>g.some((t=>t.name===e)))):e.categories?.includes(o.name))))))),[s,g,o.name,p,u]),b=nw(f,o,m),{changePage:k}=b;(0,a.useEffect)((()=>()=>n(null)),[]);const v=(0,a.useCallback)((e=>{d(e),k(1)}),[d,k]),_=(0,a.useCallback)((e=>{h(e),k(1)}),[h,k]);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Ji.__experimentalVStack,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header",children:[(0,$.jsxs)(Ji.__experimentalHStack,{children:[(0,$.jsx)(Ji.FlexBlock,{children:(0,$.jsx)(Ji.__experimentalHeading,{className:"block-editor-inserter__patterns-category-panel-title",size:13,level:4,as:"div",children:o.label})}),(0,$.jsx)(hw,{patternSyncFilter:u,patternSourceFilter:p,setPatternSyncFilter:v,setPatternSourceFilter:_,scrollContainerRef:m,category:o})]}),!f.length&&(0,$.jsx)(Ji.__experimentalText,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results",children:(0,C.__)("No results found")})]}),f.length>0&&(0,$.jsxs)($.Fragment,{children:[i&&(0,$.jsx)(Ji.__experimentalText,{size:"12",as:"p",className:"block-editor-inserter__help-text",children:(0,C.__)("Drag and drop patterns into the canvas.")}),(0,$.jsx)(jS,{ref:m,shownPatterns:b.categoryPatternsAsyncList,blockPatterns:b.categoryPatterns,onClickPattern:l,onHover:n,label:o.label,orientation:"vertical",category:o.name,isDraggable:!0,showTitlesAsTooltip:r,patternFilter:p,pagingProps:b})]})]})}const{Tabs:fw}=te(Ji.privateApis);const bw=function({categories:e,selectedCategory:t,onSelectCategory:n,children:o}){const r={type:"tween",duration:(0,u.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]},i=(0,u.usePrevious)(t);return(0,$.jsxs)(fw,{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,$.jsx)(fw.TabList,{className:"block-editor-inserter__category-tablist",children:e.map((e=>(0,$.jsx)(fw.Tab,{tabId:e.name,className:"block-editor-inserter__category-tab","aria-label":e.label,"aria-current":e===t?"true":void 0,children:(0,$.jsxs)(Ji.__experimentalHStack,{children:[(0,$.jsx)(Ji.FlexBlock,{children:e.label}),(0,$.jsx)(cl,{icon:(0,C.isRTL)()?Df:Af})]})},e.name)))}),e.map((e=>(0,$.jsx)(fw.TabPanel,{tabId:e.name,focusable:!1,children:(0,$.jsx)(Ji.__unstableMotion.div,{className:"block-editor-inserter__category-panel",initial:i?"open":"closed",animate:"open",variants:{open:{transform:"translateX( 0 )",transitionEnd:{zIndex:"1"}},closed:{transform:"translateX( -100% )",zIndex:"-1"}},transition:r,children:o})},e.name)))]})};const kw=function({onSelectCategory:e,selectedCategory:t,onInsert:n,rootClientId:o,children:r}){const[i,s]=(0,a.useState)(!1),l=iw(o),d=(0,u.useViewportMatch)("medium","<");return(0,c.useSelect)((e=>te(e(oi)).isResolvingPatterns()),[])?(0,$.jsx)("div",{className:"block-editor-inserter__patterns-loading",children:(0,$.jsx)(Ji.Spinner,{})}):l.length?(0,$.jsxs)($.Fragment,{children:[!d&&(0,$.jsxs)("div",{className:"block-editor-inserter__block-patterns-tabs-container",children:[(0,$.jsx)(bw,{categories:l,selectedCategory:t,onSelectCategory:e,children:r}),(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__patterns-explore-button",onClick:()=>s(!0),variant:"secondary",children:(0,C.__)("Explore all patterns")})]}),d&&(0,$.jsx)(cw,{categories:l,children:e=>(0,$.jsx)("div",{className:"block-editor-inserter__category-panel",children:(0,$.jsx)(mw,{onInsert:n,rootClientId:o,category:e,showTitlesAsTooltip:!1},e.name)})}),i&&(0,$.jsx)(lw,{initialCategory:t||l[0],patternCategories:l,onModalClose:()=>s(!1),rootClientId:o})]}):(0,$.jsx)(mS,{})},vw=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),_w={image:"img",video:"video",audio:"audio"};function xw(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 i=_w[t],s=(0,$.jsx)(i,{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),s]}const yw=["image"],Sw=25,ww={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function Cw({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return(0,$.jsx)(Ji.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,C.__)("Options"),popoverProps:ww,icon:tb,children:()=>(0,$.jsx)(Ji.MenuGroup,{children:(0,$.jsx)(Ji.MenuItem,{onClick:()=>window.open(n,"_blank").focus(),icon:vw,children:(0,C.sprintf)((0,C.__)("Report %s"),e.mediaType)})})})}function Bw({onClose:e,onSubmit:t}){return(0,$.jsxs)(Ji.Modal,{title:(0,C.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",children:[(0,$.jsxs)(Ji.__experimentalVStack,{spacing:3,children:[(0,$.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,$.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,$.jsxs)(Ji.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,$.jsx)(Ji.FlexItem,{children:(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:(0,C.__)("Cancel")})}),(0,$.jsx)(Ji.FlexItem,{children:(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:t,children:(0,C.__)("Insert")})})]})]})}function Iw({media:e,onClick:t,category:n}){const[o,r]=(0,a.useState)(!1),[i,s]=(0,a.useState)(!1),[u,d]=(0,a.useState)(!1),[p,h]=(0,a.useMemo)((()=>xw(e,n.mediaType)),[e,n.mediaType]),{createErrorNotice:g,createSuccessNotice:m}=(0,c.useDispatch)(Fo.store),{getSettings:f}=(0,c.useSelect)(oi),b=(0,a.useCallback)((e=>{if(u)return;const n=f(),o=(0,l.cloneBlock)(e),{id:i,url:s,caption:a}=o.attributes;i||n.mediaUpload?i?t(o):(d(!0),window.fetch(s).then((e=>e.blob())).then((e=>{n.mediaUpload({filesList:[e],additionalData:{caption:a},onFileChange([e]){(0,ga.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:yw,onError(e){g(e,{type:"snackbar"}),d(!1)}})})).catch((()=>{r(!0),d(!1)}))):r(!0)}),[u,f,t,m,g]),k="string"==typeof e.title?e.title:e.title?.rendered||(0,C.__)("no title");let v;if(k.length>Sw){const e="...";v=k.slice(0,Sw-e.length)+e}const _=(0,a.useCallback)((()=>s(!0)),[]),x=(0,a.useCallback)((()=>s(!1)),[]);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(sS,{isEnabled:!0,blocks:[p],children:({draggable:t,onDragStart:o,onDragEnd:r})=>(0,$.jsx)("div",{className:$i("block-editor-inserter__media-list__list-item",{"is-hovered":i}),draggable:t,onDragStart:o,onDragEnd:r,children:(0,$.jsxs)("div",{onMouseEnter:_,onMouseLeave:x,children:[(0,$.jsx)(Ji.Tooltip,{text:v||k,children:(0,$.jsx)(Ji.Composite.Item,{render:(0,$.jsx)("div",{"aria-label":k,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>b(p),children:(0,$.jsxs)("div",{className:"block-editor-inserter__media-list__item-preview",children:[h,u&&(0,$.jsx)("div",{className:"block-editor-inserter__media-list__item-preview-spinner",children:(0,$.jsx)(Ji.Spinner,{})})]})})}),!u&&(0,$.jsx)(Cw,{category:n,media:e})]})})}),o&&(0,$.jsx)(Bw,{onClose:()=>r(!1),onSubmit:()=>{t((0,l.cloneBlock)(p)),m((0,C.__)("Image inserted."),{type:"snackbar"}),r(!1)}})]})}const jw=function({mediaList:e,category:t,onClick:n,label:o=(0,C.__)("Media List")}){return(0,$.jsx)(Ji.Composite,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":o,children:e.map(((e,o)=>(0,$.jsx)(Iw,{media:e,category:t,onClick:n},e.id||e.sourceId||o)))})};const Ew=10;function Tw({rootClientId:e,onInsert:t,category:n}){const[o,r,i]=(0,u.useDebouncedInput)(),{mediaList:s,isLoading:l}=function(e,t={}){const[n,o]=(0,a.useState)(),[r,i]=(0,a.useState)(!1),s=(0,a.useRef)();return(0,a.useEffect)((()=>{(async()=>{const n=JSON.stringify({category:e.name,...t});s.current=n,i(!0),o([]);const r=await(e.fetch?.(t));n===s.current&&(o(r),i(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}(n,{per_page:i?20:Ew,search:i}),c="block-editor-inserter__media-panel",d=n.labels.search_items||(0,C.__)("Search");return(0,$.jsxs)("div",{className:c,children:[(0,$.jsx)(Ji.SearchControl,{__nextHasNoMarginBottom:!0,className:`${c}-search`,onChange:r,value:o,label:d,placeholder:d}),l&&(0,$.jsx)("div",{className:`${c}-spinner`,children:(0,$.jsx)(Ji.Spinner,{})}),!l&&!s?.length&&(0,$.jsx)(mS,{}),!l&&!!s?.length&&(0,$.jsx)(jw,{rootClientId:e,onClick:t,mediaList:s,category:n})]})}const Mw=["image","video","audio"];const Pw=function({rootClientId:e,selectedCategory:t,onSelectCategory:n,onInsert:o,children:r}){const i=function(e){const[t,n]=(0,a.useState)([]),o=(0,c.useSelect)((e=>te(e(oi)).getInserterMediaCategories()),[]),{canInsertImage:r,canInsertVideo:i,canInsertAudio:s}=(0,c.useSelect)((t=>{const{canInsertBlockType:n}=t(oi);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:i,audio:s};o.forEach((n=>{l[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[r,i,s,o]),t}(e),s=(0,u.useViewportMatch)("medium","<"),l=(0,a.useCallback)((e=>{if(!e?.url)return;const[t]=xw(e,e.type);o(t)}),[o]),d=(0,a.useMemo)((()=>i.map((e=>({...e,label:e.labels.name})))),[i]);return d.length?(0,$.jsxs)($.Fragment,{children:[!s&&(0,$.jsxs)("div",{className:"block-editor-inserter__media-tabs-container",children:[(0,$.jsx)(bw,{categories:d,selectedCategory:t,onSelectCategory:n,children:r}),(0,$.jsx)(_a,{children:(0,$.jsx)(va,{multiple:!1,onSelect:l,allowedTypes:Mw,render:({open:e})=>(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,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")})})})]}),s&&(0,$.jsx)(cw,{categories:d,children:t=>(0,$.jsx)(Tw,{onInsert:o,rootClientId:e,category:t})})]}):(0,$.jsx)(mS,{})},{Fill:Rw,Slot:Nw}=(0,Ji.createSlotFill)("__unstableInserterMenuExtension");Rw.Slot=Nw;const Lw=Rw,Aw=(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,Dw=[];const Ow=function({filterValue:e,onSelect:t,onHover:n,onHoverPattern:o,rootClientId:r,clientId:i,isAppender:s,__experimentalInsertionIndex:l,maxBlockPatterns:d,maxBlockTypes:p,showBlockDirectory:h=!1,isDraggable:g=!0,shouldFocusBlock:m=!0,prioritizePatterns:f,selectBlockOnInsert:b,isQuick:k}){const v=(0,u.useDebounce)(Vo.speak,500),{prioritizedBlocks:_}=(0,c.useSelect)((e=>{const t=e(oi).getBlockListSettings(r);return{prioritizedBlocks:t?.prioritizedInserterBlocks||Dw}}),[r]),[x,y]=TS({onSelect:t,rootClientId:r,clientId:i,isAppender:s,insertionIndex:l,shouldFocusBlock:m,selectBlockOnInsert:b}),[S,w,B,I]=hS(x,y,k),[j,,E]=MS(y,x),T=(0,a.useMemo)((()=>{if(0===d)return[];const t=QS(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=he(S.filter((e=>"core/block"!==e.name)),"frecency","desc");!e&&_.length&&(t=Aw(t,_));const n=XS(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);v(n)}),[e,v,P,T]);const R=(0,u.useAsyncList)(P,{step:9}),N=(0,u.useAsyncList)(R.length===P.length?T:Dw),L=P.length>0||T.length>0,A=!!P.length&&(0,$.jsx)(pS,{title:(0,$.jsx)(Ji.VisuallyHidden,{children:(0,C.__)("Blocks")}),children:(0,$.jsx)(dS,{items:R,onSelect:I,onHover:n,label:(0,C.__)("Blocks"),isDraggable:g})}),D=!!T.length&&(0,$.jsx)(pS,{title:(0,$.jsx)(Ji.VisuallyHidden,{children:(0,C.__)("Block patterns")}),children:(0,$.jsx)("div",{className:"block-editor-inserter__quick-inserter-patterns",children:(0,$.jsx)(jS,{shownPatterns:N,blockPatterns:T,onClickPattern:E,onHover:o,isDraggable:g})})});return(0,$.jsxs)(gS,{children:[!h&&!L&&(0,$.jsx)(mS,{}),f?D:A,!!P.length&&!!T.length&&(0,$.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),f?A:D,h&&(0,$.jsx)(Lw.Slot,{fillProps:{onSelect:I,onHover:n,filterValue:e,hasItems:L,rootClientId:x},children:e=>e.length?e:L?null:(0,$.jsx)(mS,{})})]})},zw=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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:Vw}=te(Ji.privateApis);const Fw=(0,a.forwardRef)((function({defaultTabId:e,onClose:t,onSelect:n,selectedTab:o,tabs:r,closeButtonLabel:i},s){return(0,$.jsx)("div",{className:"block-editor-tabbed-sidebar",children:(0,$.jsxs)(Vw,{selectOnMove:!1,defaultTabId:e,onSelect:n,selectedTabId:o,children:[(0,$.jsxs)("div",{className:"block-editor-tabbed-sidebar__tablist-and-close-button",children:[(0,$.jsx)(Ji.Button,{className:"block-editor-tabbed-sidebar__close-button",icon:zw,label:i,onClick:()=>t(),size:"small"}),(0,$.jsx)(Vw.TabList,{className:"block-editor-tabbed-sidebar__tablist",ref:s,children:r.map((e=>(0,$.jsx)(Vw.Tab,{tabId:e.name,className:"block-editor-tabbed-sidebar__tab",children:e.title},e.name)))})]}),r.map((e=>(0,$.jsx)(Vw.TabPanel,{tabId:e.name,focusable:!1,className:"block-editor-tabbed-sidebar__tabpanel",ref:e.panelRef,children:e.panel},e.name)))]})})})),Hw=()=>{};const Gw=(0,a.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,onSelect:r,showInserterHelpPanel:i,showMostUsedBlocks:s,__experimentalFilterValue:l="",shouldFocusBlock:d=!0,onPatternCategorySelection:p,onClose:h,__experimentalInitialTab:g,__experimentalInitialCategory:m},f){const b=(0,c.useSelect)((e=>"zoom-out"===e(oi).__unstableGetEditorMode()),[]),[k,v,_]=(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||(b?"patterns":void 0)),[P,R,N]=TS({rootClientId:e,clientId:t,isAppender:n,insertionIndex:o,shouldFocusBlock:d}),L=(0,a.useRef)(),A=(0,a.useCallback)(((e,t,n,o)=>{R(e,t,n,o),r(e),window.requestAnimationFrame((()=>{d||L.current?.contains(f.current.ownerDocument.activeElement)||L.current?.querySelector("button").focus()}))}),[R,r,d]),D=(0,a.useCallback)(((e,t)=>{N(!1),R(e,{patternName:t}),r()}),[R,r]),O=(0,a.useCallback)((e=>{N(e),y(e)}),[N,y]),z=(0,a.useCallback)(((e,t)=>{w(e),I(t),p?.()}),[w,p]),V="patterns"===T&&!_&&!!S,F="media"===T&&!!j,H=(0,a.useMemo)((()=>"media"===T?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{x&&y(null),v(e)},value:k,label:(0,C.__)("Search for blocks and patterns"),placeholder:(0,C.__)("Search")}),!!_&&(0,$.jsx)(Ow,{filterValue:_,onSelect:r,onHover:O,rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,showBlockDirectory:!0,shouldFocusBlock:d,prioritizePatterns:"patterns"===T})]})),[T,x,y,v,k,_,r,O,d,t,e,o,n]),G=(0,a.useMemo)((()=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("div",{className:"block-editor-inserter__block-list",children:(0,$.jsx)(_S,{ref:L,rootClientId:P,onInsert:A,onHover:O,showMostUsedBlocks:s})}),i&&(0,$.jsxs)("div",{className:"block-editor-inserter__tips",children:[(0,$.jsx)(Ji.VisuallyHidden,{as:"h2",children:(0,C.__)("A tip for using the block editor")}),(0,$.jsx)(Lf,{})]})]})),[P,A,O,s,i]),U=(0,a.useMemo)((()=>(0,$.jsx)(kw,{rootClientId:P,onInsert:D,onSelectCategory:z,selectedCategory:S,children:V&&(0,$.jsx)(mw,{rootClientId:P,onInsert:D,category:S,patternFilter:B,showTitlesAsTooltip:!0})})),[P,D,z,B,S,V]),W=(0,a.useMemo)((()=>(0,$.jsx)(Pw,{rootClientId:P,selectedCategory:j,onSelectCategory:E,onInsert:A,children:F&&(0,$.jsx)(Tw,{rootClientId:P,onInsert:A,category:j})})),[P,A,j,E,F]),K=(0,a.useRef)();return(0,a.useLayoutEffect)((()=>{K.current&&window.requestAnimationFrame((()=>{K.current.querySelector('[role="tab"][aria-selected="true"]')?.focus()}))}),[]),(0,$.jsxs)("div",{className:$i("block-editor-inserter__menu",{"show-panel":V||F,"is-zoom-out":b}),ref:f,children:[(0,$.jsx)("div",{className:"block-editor-inserter__main-area",children:(0,$.jsx)(Fw,{ref:K,onSelect:e=>{"patterns"!==e&&w(null),M(e)},onClose:h,selectedTab:T,closeButtonLabel:(0,C.__)("Close block inserter"),tabs:[{name:"blocks",title:(0,C.__)("Blocks"),panel:(0,$.jsxs)($.Fragment,{children:[H,"blocks"===T&&!_&&G]})},{name:"patterns",title:(0,C.__)("Patterns"),panel:(0,$.jsxs)($.Fragment,{children:[H,"patterns"===T&&!_&&U]})},{name:"media",title:(0,C.__)("Media"),panel:(0,$.jsxs)($.Fragment,{children:[H,W]})}]})}),i&&x&&(0,$.jsx)(Ji.Popover,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1,children:(0,$.jsx)(nS,{item:x})})]})}));const $w=(0,a.forwardRef)((function(e,t){return(0,$.jsx)(Gw,{...e,onPatternCategorySelection:Hw,ref:t})}));function Uw({onSelect:e,rootClientId:t,clientId:n,isAppender:o,prioritizePatterns:r,selectBlockOnInsert:i,hasSearch:s=!0}){const[l,u]=(0,a.useState)(""),[d,p]=TS({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:i}),[h]=hS(d,p,!0),[g]=MS(p,d),{setInserterIsOpened:m,insertionIndex:f}=(0,c.useSelect)((e=>{const{getSettings:t,getBlockIndex:o,getBlockCount:r}=e(oi),i=t(),s=o(n),l=r();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,insertionIndex:-1===s?l:s}}),[n]),b=g.length&&(!!l||r),k=s&&(b&&g.length>6||h.length>6);(0,a.useEffect)((()=>{m&&m(!1)}),[m]);let v=0;return b&&(v=r?4:2),(0,$.jsxs)("div",{className:$i("block-editor-inserter__quick-inserter",{"has-search":k,"has-expand":m}),children:[k&&(0,$.jsx)(Ji.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,$.jsx)("div",{className:"block-editor-inserter__quick-inserter-results",children:(0,$.jsx)(Ow,{filterValue:l,onSelect:e,rootClientId:t,clientId:n,isAppender:o,maxBlockPatterns:v,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:r,selectBlockOnInsert:i,isQuick:!0})}),m&&(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{m({rootClientId:t,insertionIndex:f,filterValue:l,onSelect:e})},"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:i={},prioritizePatterns:s})=>{const{as:l=Ji.Button,label:a,onClick:c,...u}=i;let d=a;return!d&&r?d=(0,C.sprintf)((0,C._x)("Add %s","directly add the only allowed block"),o):!d&&s?d=(0,C.__)("Add pattern"):d||(d=(0,C._x)("Add block","Generic label for block inserter button")),(0,$.jsx)(l,{icon:Pa,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:i,toggleProps:s,hasItems:l,renderToggle:a=Ww,prioritizePatterns:c}=this.props;return a({onToggle:e,isOpen:t,disabled:n||!l,blockTitle:o,hasSingleBlockType:r,directInsertBlock:i,toggleProps:s,prioritizePatterns:c})}renderContent({onClose:e}){const{rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r,__experimentalIsQuick:i,prioritizePatterns:s,onSelectOrClose:l,selectBlockOnInsert:a}=this.props;return i?(0,$.jsx)(Uw,{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:s,selectBlockOnInsert:a}):(0,$.jsx)($w,{onSelect:()=>{e()},rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:i}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,$.jsx)(Ji.Dropdown,{className:"block-editor-inserter",contentClassName:$i("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:i})}}const Zw=(0,u.compose)([(0,c.withSelect)(((e,{clientId:t,rootClientId:n,shouldDirectInsert:o=!0})=>{const{getBlockRootClientId:r,hasInserterItems:i,getAllowedBlocks:s,getDirectInsertBlock:a,getSettings:c}=e(oi),{getBlockVariations:u}=e(l.store),d=s(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:i(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:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!s&&!c)return;const{insertBlock:p}=e(oi);let h;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:i}=n(oi);if(!e||!r&&!o)return{};const s={};let l={};if(r){const e=t(r),n=t(i(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)&&(s[e]=l[e])})),s}(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:s,getBlockRootClientId:l}=n(oi);if(r)return e(r);const a=t();return!i&&a&&l(a)===o?e(a)+1:s(o).length}(),o,d),u&&u({clientId:h?.clientId});const g=(0,C.sprintf)((0,C.__)("%s block added"),a.title);(0,Vo.speak)(g)}}))),(0,u.ifCondition)((({hasItems:e,isAppender:t,rootClientId:n,clientId:o})=>e||!t&&!n&&!o))])(Kw);function qw({rootClientId:e,className:t,onFocus:n,tabIndex:o,onSelect:r},i){const s=(0,a.useRef)(),l=(0,u.useMergeRefs)([s,i]);return(0,$.jsx)(Zw,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,onSelectOrClose:(...e)=>{r&&"function"==typeof r&&r(...e),s.current?.focus()},renderToggle:({onToggle:e,disabled:r,isOpen:i,blockTitle:s,hasSingleBlockType:a})=>{const c=!a,u=a?(0,C.sprintf)((0,C._x)("Add %s","directly add the only allowed block"),s):(0,C._x)("Add block","Generic label for block inserter button");return(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,ref:l,onFocus:n,tabIndex:o,className:$i(t,"block-editor-button-block-appender"),onClick:e,"aria-haspopup":c?"true":void 0,"aria-expanded":c?i:void 0,disabled:r,label:u,showTooltip:!0,children:(0,$.jsx)(cl,{icon:Pa})})},isAppender:!0})}const Yw=(0,a.forwardRef)(((e,t)=>(y()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),qw(e,t)))),Xw=(0,a.forwardRef)(qw);function Qw({clientId:e,contentRef:t,parentLayout:n}){const o=(0,c.useSelect)((e=>e(oi).getSettings().isDistractionFree),[]),r=mp(e);if(o||!r)return null;const i=n?.isManualPlacement&&window.__experimentalEnableGridInteractivity;return(0,$.jsx)(Jw,{gridClientId:e,gridElement:r,isManualGrid:i,ref:t})}const Jw=(0,a.forwardRef)((({gridClientId:e,gridElement:t,isManualGrid:n},o)=>{const[r,i]=(0,a.useState)((()=>Rf(t))),[s,l]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{const e=[];for(const n of[t,...t.children]){const o=new window.ResizeObserver((()=>{i(Rf(t))}));o.observe(n),e.push(o)}return()=>{for(const t of e)t.disconnect()}}),[t]),(0,a.useEffect)((()=>{function e(){l(!0)}function t(){l(!1)}return document.addEventListener("drag",e),document.addEventListener("dragend",t),()=>{document.removeEventListener("drag",e),document.removeEventListener("dragend",t)}}),[]),(0,$.jsx)(qg,{className:$i("block-editor-grid-visualizer",{"is-dropping-allowed":s}),clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",children:(0,$.jsx)("div",{ref:o,className:"block-editor-grid-visualizer__grid",style:r.style,children:n?(0,$.jsx)(eC,{gridClientId:e,gridInfo:r}):Array.from({length:r.numItems},((e,t)=>(0,$.jsx)(tC,{color:r.currentColor},t)))})})}));function eC({gridClientId:e,gridInfo:t}){const[n,o]=(0,a.useState)(null),r=(0,c.useSelect)((t=>{const{getBlockOrder:n,getBlockStyles:o}=te(t(oi));return o(n(e))}),[e]),i=(0,a.useMemo)((()=>{const e=[];for(const n of Object.values(r)){var t;const{columnStart:o,rowStart:r,columnSpan:i=1,rowSpan:s=1}=null!==(t=n?.layout)&&void 0!==t?t:{};o&&r&&e.push(new Ef({columnStart:o,rowStart:r,columnSpan:i,rowSpan:s}))}return e}),[r]);return jf(1,t.numRows).map((r=>jf(1,t.numColumns).map((s=>{var l;const a=i.some((e=>e.contains(s,r))),c=null!==(l=n?.contains(s,r))&&void 0!==l&&l;return(0,$.jsx)(tC,{color:t.currentColor,className:c&&"is-highlighted",children:a?(0,$.jsx)(oC,{column:s,row:r,gridClientId:e,gridInfo:t,setHighlightedRect:o}):(0,$.jsx)(rC,{column:s,row:r,gridClientId:e,gridInfo:t,setHighlightedRect:o})},`${r}-${s}`)}))))}function tC({color:e,children:t,className:n}){return(0,$.jsx)("div",{className:$i("block-editor-grid-visualizer__cell",n),style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${e} 20%, #0000)`,color:e},children:t})}function nC(e,t,n,o,r){const{getBlockAttributes:i,getBlockRootClientId:s,canInsertBlockType:l,getBlockName:a}=(0,c.useSelect)(oi),{updateBlockAttributes:d,moveBlocksToPosition:p,__unstableMarkNextChangeAsNotPersistent:h}=(0,c.useDispatch)(oi),g=hg(n,o.numColumns);return function({validateDrag:e,onDragEnter:t,onDragLeave:n,onDrop:o}){const{getDraggedBlockClientIds:r}=(0,c.useSelect)(oi);return(0,u.__experimentalUseDropZone)({onDragEnter(){const[n]=r();n&&e(n)&&t(n)},onDragLeave(){n()},onDrop(){const[t]=r();t&&e(t)&&o(t)}})}({validateDrag(r){const s=a(r);if(!l(s,n))return!1;const c=i(r),u=new Ef({columnStart:e,rowStart:t,columnSpan:c.style?.layout?.columnSpan,rowSpan:c.style?.layout?.rowSpan});return new Ef({columnSpan:o.numColumns,rowSpan:o.numRows}).containsRect(u)},onDragEnter(n){const o=i(n);r(new Ef({columnStart:e,rowStart:t,columnSpan:o.style?.layout?.columnSpan,rowSpan:o.style?.layout?.rowSpan}))},onDragLeave(){r((n=>n?.columnStart===e&&n?.rowStart===t?null:n))},onDrop(o){r(null);const l=i(o);d(o,{style:{...l.style,layout:{...l.style?.layout,columnStart:e,rowStart:t}}}),h(),p([o],s(o),n,g(e,t))}})}function oC({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:r}){return(0,$.jsx)("div",{className:"block-editor-grid-visualizer__drop-zone",ref:nC(e,t,n,o,r)})}function rC({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:r}){const{updateBlockAttributes:i,moveBlocksToPosition:s,__unstableMarkNextChangeAsNotPersistent:l}=(0,c.useDispatch)(oi),a=hg(n,o.numColumns);return(0,$.jsx)(Xw,{rootClientId:n,className:"block-editor-grid-visualizer__appender",ref:nC(e,t,n,o,r),style:{color:o.currentColor},onSelect:o=>{o&&(i(o.clientId,{style:{layout:{columnStart:e,rowStart:t}}}),l(),s([o.clientId],n,n,a(e,t)))}})}function iC({clientId:e,bounds:t,onChange:n,parentLayout:o}){const r=mp(e),i=r?.parentElement,{isManualPlacement:s}=o;return r&&i?(0,$.jsx)(sC,{clientId:e,bounds:t,blockElement:r,rootBlockElement:i,onChange:n,isManualGrid:s&&window.__experimentalEnableGridInteractivity}):null}function sC({clientId:e,bounds:t,blockElement:n,rootBlockElement:o,onChange:r,isManualGrid:i}){const[s,l]=(0,a.useState)(null),[c,u]=(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();u({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 d={right:"left",left:"right"},p={top:"flex-end",bottom:"flex-start"},h={display:"flex",justifyContent:"center",alignItems:"center",...d[s]&&{justifyContent:d[s]},...p[s]&&{alignItems:p[s]}};return(0,$.jsx)(qg,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",additionalStyles:h,children:(0,$.jsx)(Ji.ResizableBox,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:c.bottom,bottomLeft:!1,bottomRight:!1,left:c.left,right:c.right,top:c.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onPointerDown:({target:e,pointerId:t})=>{e.setPointerCapture(t)},onResizeStart:(e,t)=>{l(t)},onResizeStop:(e,t,s)=>{const l=parseFloat(Tf(o,"column-gap")),a=parseFloat(Tf(o,"row-gap")),c=Mf(Tf(o,"grid-template-columns"),l),u=Mf(Tf(o,"grid-template-rows"),a),d=new window.DOMRect(n.offsetLeft+s.offsetLeft,n.offsetTop+s.offsetTop,s.offsetWidth,s.offsetHeight),p=Pf(c,d.left)+1,h=Pf(u,d.top)+1,g=Pf(c,d.right,"end")+1,m=Pf(u,d.bottom,"end")+1;r({columnSpan:g-p+1,rowSpan:m-h+1,columnStart:i?p:void 0,rowStart:i?h:void 0})}})})}const lC=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.jsx)(G.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),aC=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.jsx)(G.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})});function cC({layout:e,parentLayout:t,onChange:n,gridClientId:o,blockClientId:r}){var i,s,l,a;const{moveBlocksToPosition:u,__unstableMarkNextChangeAsNotPersistent:d}=(0,c.useDispatch)(oi),p=null!==(i=e?.columnStart)&&void 0!==i?i:1,h=null!==(s=e?.rowStart)&&void 0!==s?s:1,g=null!==(l=e?.columnSpan)&&void 0!==l?l:1,m=null!==(a=e?.rowSpan)&&void 0!==a?a:1,f=p+g-1,b=h+m-1,k=t?.columnCount,v=t?.rowCount,_=hg(o,k);return(0,$.jsx)(ss,{group:"parent",children:(0,$.jsxs)(Ji.ToolbarGroup,{className:"block-editor-grid-item-mover__move-button-container",children:[(0,$.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-left",children:(0,$.jsx)(uC,{icon:(0,C.isRTL)()?Af:Df,label:(0,C.__)("Move left"),description:(0,C.__)("Move left"),isDisabled:p<=1,onClick:()=>{n({columnStart:p-1}),d(),u([r],o,o,_(p-1,h))}})}),(0,$.jsxs)("div",{className:"block-editor-grid-item-mover__move-vertical-button-container",children:[(0,$.jsx)(uC,{className:"is-up-button",icon:lC,label:(0,C.__)("Move up"),description:(0,C.__)("Move up"),isDisabled:h<=1,onClick:()=>{n({rowStart:h-1}),d(),u([r],o,o,_(p,h-1))}}),(0,$.jsx)(uC,{className:"is-down-button",icon:aC,label:(0,C.__)("Move down"),description:(0,C.__)("Move down"),isDisabled:v&&b>=v,onClick:()=>{n({rowStart:h+1}),d(),u([r],o,o,_(p,h+1))}})]}),(0,$.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-right",children:(0,$.jsx)(uC,{icon:(0,C.isRTL)()?Df:Af,label:(0,C.__)("Move right"),description:(0,C.__)("Move right"),isDisabled:k&&f>=k,onClick:()=>{n({columnStart:p+1}),d(),u([r],o,o,_(p+1,h))}})})]})})}function uC({className:e,icon:t,label:n,isDisabled:o,onClick:r,description:i}){const s=`block-editor-grid-item-mover-button__description-${(0,u.useInstanceId)(uC)}`;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.ToolbarButton,{className:$i("block-editor-grid-item-mover-button",e),icon:t,label:n,"aria-describedby":s,onClick:o?null:r,disabled:o,accessibleWhenDisabled:!0}),(0,$.jsx)(Ji.VisuallyHidden,{id:s,children:i})]})}const dC={useBlockProps:function e({style:t}){var n;const o=(0,c.useSelect)((e=>!e(oi).getSettings().disableLayoutStyles)),r=null!==(n=t?.layout)&&void 0!==n?n:{},{selfStretch:i,flexSize:s,columnStart:l,rowStart:a,columnSpan:d,rowSpan:p}=r,h=Bl()||{},{columnCount:g,minimumColumnWidth:m}=h,f=(0,u.useInstanceId)(e),b=`.wp-container-content-${f}`;let k="";if(o&&("fixed"===i&&s?k=`${b} {\n\t\t\t\tflex-basis: ${s};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===i?k=`${b} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`:l&&d?k=`${b} {\n\t\t\t\tgrid-column: ${l} / span ${d};\n\t\t\t}`:l?k=`${b} {\n\t\t\t\tgrid-column: ${l};\n\t\t\t}`:d&&(k=`${b} {\n\t\t\t\tgrid-column: span ${d};\n\t\t\t}`),a&&p?k+=`${b} {\n\t\t\t\tgrid-row: ${a} / span ${p};\n\t\t\t}`:a?k+=`${b} {\n\t\t\t\tgrid-row: ${a};\n\t\t\t}`:p&&(k+=`${b} {\n\t\t\t\tgrid-row: span ${p};\n\t\t\t}`),(d||l)&&(m||!g))){let e=parseFloat(m);isNaN(e)&&(e=12);let t=m?.replace(e,"");["px","rem","em"].includes(t)||(t="rem");let n=2;n=d&&l?d+l-1:d||l;const o="px"===t?24:1.5,r=n*e+(n-1)*o,i=2*e+o-1,s=d&&d>1?"1/-1":"auto";k+=`@container (max-width: ${Math.max(r,i)}${t}) {\n\t\t\t\t${b} {\n\t\t\t\t\tgrid-column: ${s};\n\t\t\t\t\tgrid-row: auto;\n\t\t\t\t}\n\t\t\t}`}if(qi({css:k}),k)return{className:`wp-container-content-${f}`}},edit:function({clientId:e,style:t,setAttributes:n}){const o=Bl()||{},{type:r="default",allowSizingOnChildren:i=!1,isManualPlacement:s}=o,l=(0,c.useSelect)((t=>t(oi).getBlockRootClientId(e)),[e]),[u,d]=(0,a.useState)();if("grid"!==r)return null;function p(e){n({style:{...t,layout:{...t?.layout,...e}}})}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Qw,{clientId:l,contentRef:d,parentLayout:o}),i&&(0,$.jsx)(iC,{clientId:e,bounds:u,onChange:p,parentLayout:o}),s&&window.__experimentalEnableGridInteractivity&&(0,$.jsx)(cC,{layout:t?.layout,parentLayout:o,onChange:p,gridClientId:l,blockClientId:e})]})},attributeKeys:["style"],hasSupport:()=>!0};const pC={edit:function({clientId:e}){const{templateLock:t,isLockedByParent:n,isEditingAsBlocks:o}=(0,c.useSelect)((t=>{const{getContentLockingParent:n,getTemplateLock:o,getTemporarilyEditingAsBlocks:r}=te(t(oi));return{templateLock:o(e),isLockedByParent:!!n(e),isEditingAsBlocks:r()===e}}),[e]),{stopEditingAsBlocks:r}=te((0,c.useDispatch)(oi)),i=!n&&"contentOnly"===t,s=(0,a.useCallback)((()=>{r(e)}),[e,r]);return i||o?o&&!i&&(0,$.jsx)(ss,{group:"other",children:(0,$.jsx)(Ji.ToolbarButton,{onClick:s,children:(0,C.__)("Done")})}):null},hasSupport:()=>!0},hC="metadata";(0,d.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){return e?.attributes?.[hC]?.type||(e.attributes={...e.attributes,[hC]:{type:"object"}}),e}));const gC={};const mC={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]),i=(0,c.useSelect)((n=>{const{getBlocks:o,getBlockRootClientId:i,getGlobalBlockCount:s}=n(oi),l=i(t),a=r.reduce(((n,r)=>{if(0===s(r.name))return n;const i=r?.blockHooks?.[e];let a;switch(i){case"before":case"after":a=o(l);break;case"first_child":case"last_child":a=o(t);break;case void 0:a=[...o(l),...o(t)]}const c=a?.find((e=>e.name===r.name));return c?{...n,[r.name]:c.clientId}:n}),{});return Object.values(a).length>0?a:gC}),[r,e,t]),{getBlockIndex:s,getBlockCount:u,getBlockRootClientId:d}=(0,c.useSelect)(oi),{insertBlock:p,removeBlock:h}=(0,c.useDispatch)(oi);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,$.jsx)(da,{children:(0,$.jsxs)(Ji.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,C.__)("Plugins"),initialOpen:!0,children:[(0,$.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,$.jsxs)(a.Fragment,{children:[(0,$.jsx)("h3",{children:n}),g[n].map((n=>{const o=n.name in i;return(0,$.jsx)(Ji.ToggleControl,{__nextHasNoMarginBottom:!0,checked:o,label:n.title,onChange:()=>{if(o)h(i[n.name],!1);else{const o=n.blockHooks[e];((e,n)=>{const o=s(t),r=u(t),i=d(t);switch(n){case"before":case"after":p(e,"after"===n?o+1:o,i,!1);break;case"first_child":case"last_child":p(e,"first_child"===n?0:r,t,!1);break;case void 0:p(e,o+1,i,!1)}})((0,l.createBlock)(n.name),o)}}},n.title)}))]},n)))]})})},attributeKeys:["metadata"],hasSupport:()=>!0};function fC(e){return!e||0===Object.keys(e).length}function bC(){const{clientId:e}=_(),{updateBlockAttributes:t}=(0,c.useDispatch)(oi),{getBlockAttributes:n}=(0,c.useRegistry)().select(oi);return{updateBlockBindings:o=>{const{metadata:{bindings:r,...i}={}}=n(e),s={...r};Object.entries(o).forEach((([e,t])=>{t||!s[e]?s[e]=t:delete s[e]}));const l={...i,bindings:s};fC(l.bindings)&&delete l.bindings,t(e,{metadata:fC(l)?void 0:l})},removeAllBlockBindings:()=>{const{metadata:{bindings:o,...r}={}}=n(e);t(e,{metadata:fC(r)?void 0:r})}}}const{DropdownMenuV2:kC}=te(Ji.privateApis),vC={};function _C({fieldsList:e,attribute:t,binding:n}){const o=(0,l.getBlockBindingsSources)(),{updateBlockBindings:r}=bC(),i=n?.args?.key;return(0,$.jsx)($.Fragment,{children:Object.entries(e).map((([n,s],l)=>(0,$.jsxs)(a.Fragment,{children:[(0,$.jsxs)(kC.Group,{children:[Object.keys(e).length>1&&(0,$.jsx)(kC.GroupLabel,{children:o[n].label}),Object.entries(s).map((([e,o])=>(0,$.jsxs)(kC.RadioItem,{onChange:()=>r({[t]:{source:n,args:{key:e}}}),name:t+"-binding",value:e,checked:e===i,children:[(0,$.jsx)(kC.ItemLabel,{children:o?.label}),(0,$.jsx)(kC.ItemHelpText,{children:o?.value})]},e)))]}),l!==Object.keys(e).length-1&&(0,$.jsx)(kC.Separator,{})]},n)))})}function xC({attribute:e,binding:t,fieldsList:n}){const{source:o,args:r}=t||{},i=(0,l.getBlockBindingsSource)(o),s=!i;return(0,$.jsxs)(Ji.__experimentalVStack,{className:"block-editor-bindings__item",spacing:0,children:[(0,$.jsx)(Ji.__experimentalText,{truncate:!0,children:e}),!!t&&(0,$.jsx)(Ji.__experimentalText,{truncate:!0,variant:!s&&"muted",isDestructive:s,children:s?(0,C.__)("Invalid source"):n?.[o]?.[r?.key]?.label||i?.label||o})]})}function yC({bindings:e,fieldsList:t}){return(0,$.jsx)($.Fragment,{children:Object.entries(e).map((([e,n])=>(0,$.jsx)(Ji.__experimentalItem,{children:(0,$.jsx)(xC,{attribute:e,binding:n,fieldsList:t})},e)))})}function SC({attributes:e,bindings:t,fieldsList:n}){const{updateBlockBindings:o}=bC(),r=(0,u.useViewportMatch)("medium","<");return(0,$.jsx)($.Fragment,{children:e.map((e=>{const i=t[e];return(0,$.jsx)(Ji.__experimentalToolsPanelItem,{hasValue:()=>!!i,label:e,onDeselect:()=>{o({[e]:void 0})},children:(0,$.jsx)(kC,{placement:r?"bottom-start":"left-start",gutter:r?8:36,trigger:(0,$.jsx)(Ji.__experimentalItem,{children:(0,$.jsx)(xC,{attribute:e,binding:i,fieldsList:n})}),children:(0,$.jsx)(_C,{fieldsList:n,attribute:e,binding:i})})},e)}))})}const wC={edit:({name:e,metadata:t})=>{const n=(0,a.useContext)(Xf),{removeAllBlockBindings:o}=bC(),r=function(e){return X_[e]}(e),i=(0,u.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}},s={},{fieldsList:d,canUpdateBlockBindings:p}=(0,c.useSelect)((e=>{if(!r||0===r.length)return vC;const t=(0,l.getBlockBindingsSources)();return Object.entries(t).forEach((([t,{getFieldsList:o,usesContext:r}])=>{if(o){const i={};if(r?.length)for(const e of r)i[e]=n[e];const l=o({select:e,context:i});Object.keys(l||{}).length&&(s[t]={...l})}})),{fieldsList:Object.values(s).length>0?s:vC,canUpdateBlockBindings:e(oi).getSettings().canUpdateBlockBindings}}),[n,r]);if(!r||0===r.length)return null;const{bindings:h}=t||{},g={...h};Object.keys(g).forEach((t=>{ex(e,t)&&"core/pattern-overrides"!==g[t].source||delete g[t]}));const m=!p||!Object.keys(d).length;return m&&0===Object.keys(g).length?null:(0,$.jsx)(da,{group:"bindings",children:(0,$.jsxs)(Ji.__experimentalToolsPanel,{label:(0,C.__)("Attributes"),resetAll:()=>{o()},dropdownMenuProps:i,className:"block-editor-bindings__panel",children:[(0,$.jsx)(Ji.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:m?(0,$.jsx)(yC,{bindings:g,fieldsList:d}):(0,$.jsx)(SC,{attributes:r,bindings:g,fieldsList:d})}),(0,$.jsx)(Ji.__experimentalItemGroup,{children:(0,$.jsx)(Ji.__experimentalText,{variant:"muted",children:(0,C.__)("Attributes connected to custom fields or other dynamic data.")})})]})})},attributeKeys:["metadata"],hasSupport:()=>!0};function CC(e,t,n,o,r=1,i=1){for(let s=i;;s++)for(let l=s===i?r:1;l<=t;l++){const t=new Ef({columnStart:l,rowStart:s,columnSpan:n,rowSpan:o});if(!e.some((e=>e.intersectsRect(t))))return[l,s]}}function BC(e){!function({clientId:e}){const{gridLayout:t,blockOrder:n,selectedBlockLayout:o}=(0,c.useSelect)((t=>{var n;const{getBlockAttributes:o,getBlockOrder:r}=t(oi),i=t(oi).getSelectedBlock();return{gridLayout:null!==(n=o(e).layout)&&void 0!==n?n:{},blockOrder:r(e),selectedBlockLayout:i?.attributes.style?.layout}}),[e]),{getBlockAttributes:r,getBlockRootClientId:i}=(0,c.useSelect)(oi),{updateBlockAttributes:s,__unstableMarkNextChangeAsNotPersistent:l}=(0,c.useDispatch)(oi),d=(0,a.useMemo)((()=>o?new Ef(o):null),[o]),p=(0,u.usePrevious)(d),h=(0,u.usePrevious)(t.isManualPlacement),g=(0,u.usePrevious)(n);(0,a.useEffect)((()=>{const o={};if(t.isManualPlacement){const s=[];for(const e of n){var a;const{columnStart:t,rowStart:n,columnSpan:o=1,rowSpan:i=1}=null!==(a=r(e).style?.layout)&&void 0!==a?a:{};t&&n&&s.push(new Ef({columnStart:t,rowStart:n,columnSpan:o,rowSpan:i}))}for(const e of n){var c;const n=r(e),{columnStart:i,rowStart:l,columnSpan:a=1,rowSpan:u=1}=null!==(c=n.style?.layout)&&void 0!==c?c:{};if(i&&l)continue;const[d,h]=CC(s,t.columnCount,a,u,p?.columnEnd,p?.rowEnd);s.push(new Ef({columnStart:d,rowStart:h,columnSpan:a,rowSpan:u})),o[e]={style:{...n.style,layout:{...n.style?.layout,columnStart:d,rowStart:h}}}}const l=Math.max(...s.map((e=>e.rowEnd)));(!t.rowCount||t.rowCount<l)&&(o[e]={layout:{...t,rowCount:l}});for(const e of null!=g?g:[])if(!n.includes(e)){var u;const t=i(e);if(null===t)continue;const n=r(t);if("grid"===n?.layout?.type)continue;const s=r(e),{columnStart:l,rowStart:a,columnSpan:c,rowSpan:d,...p}=null!==(u=s.style?.layout)&&void 0!==u?u:{};if(l||a||c||d){const t=0===Object.keys(p).length;o[e]=ve(s,["style","layout"],t?void 0:p)}}}else{if(!0===h)for(const e of n){var d;const t=r(e),{columnStart:n,rowStart:i,...s}=null!==(d=t.style?.layout)&&void 0!==d?d:{};if(n||i){const n=0===Object.keys(s).length;o[e]=ve(t,["style","layout"],n?void 0:s)}}t.rowCount&&(o[e]={layout:{...t,rowCount:void 0}})}Object.keys(o).length&&(l(),s(Object.keys(o),o,!0))}),[e,t,g,n,p,h,l,r,i,s])}(e)}function IC({clientId:e,layout:t}){const{isSelected:n,isDragging:o}=(0,c.useSelect)((t=>{const{isBlockSelected:n,isDraggingBlocks:o}=t(oi);return{isSelected:n(e),isDragging:o()}}));return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(BC,{clientId:e}),(n||o)&&(0,$.jsx)(Qw,{clientId:e,parentLayout:t})]})}(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 jC=(0,u.createHigherOrderComponent)((e=>t=>"grid"!==t.attributes.layout?.type?(0,$.jsx)(e,{...t},"edit"):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(IC,{clientId:t.clientId,layout:t.attributes.layout}),(0,$.jsx)(e,{...t},"edit")]})),"addGridVisualizerToBlockEdit");function EC(e){const t=e.style?.border||{};return{className:Ld(e)||void 0,style:cm({border:t})}}function TC(e){const{colors:t}=$u(),n=EC(e),{borderColor:o}=e;if(o){const e=Bd({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function MC(e){return{style:cm({shadow:e.style?.shadow||""})}}function PC(e){const{backgroundColor:t,textColor:n,gradient:o,style:r}=e,i=Gu("background-color",t),s=Gu("color",n),l=Dd(o);return{className:$i(s,l,{[i]:!(l||r?.color?.gradient)&&!!i,"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:cm({color:r?.color||{}})}}function RC(e){const{backgroundColor:t,textColor:n,gradient:o}=e,[r,i,s,l,c,u]=ii("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),d=(0,a.useMemo)((()=>[...r||[],...i||[],...s||[]]),[r,i,s]),p=(0,a.useMemo)((()=>[...l||[],...c||[],...u||[]]),[l,c,u]),h=PC(e);if(t){const e=Fu(d,t);h.style.backgroundColor=e.color}if(o&&(h.style.background=Od(p,o)),n){const e=Fu(d,n);h.style.color=e.color}return h}function NC(e){const{style:t}=e;return{style:cm({spacing:t?.spacing||{}})}}(0,d.addFilter)("editor.BlockEdit","core/editor/grid-visualizer",jC);const{kebabCase:LC}=te(Ji.privateApis);function AC(e,t){let n=e?.style?.typography||{};n={...n,fontSize:xi({size:e?.style?.typography?.fontSize},t)};const o=cm({typography:n}),r=e?.fontFamily?`has-${LC(e.fontFamily)}-font-family`:"";return{className:$i(r,e?.style?.typography?.textAlign?`has-text-align-${e?.style?.typography?.textAlign}`:"",Th(e?.fontSize)),style:o}}function DC(e){const[t,n]=(0,a.useState)(e);return(0,a.useEffect)((()=>{e&&n(e)}),[e]),t}function OC(e=!0){const{setZoomLevel:t}=te((0,c.useDispatch)(oi)),{isZoomOut:n}=te((0,c.useSelect)(oi)),o=(0,a.useRef)(null);(0,a.useEffect)((()=>(o.current||(o.current=n()),e&&!1===n()?t(50):!e&&n()&&o.current!==n()&&t(o.current?50:100),()=>{n()&&n()!==o.current&&t(o.current?50:100)})),[n,t,e])}var zC;!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:i,attributeKeys:s=[],shareWithChildBlocks:l}=e;if(!(o[p]||o[h]&&l)||!i(n.name))return null;const a={};for(const e of s)n.attributes[e]&&(a[e]=n.attributes[e]);return(0,$.jsx)(r,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...a},t)})),(0,$.jsx)(t,{...n},"edit")]}),"withBlockEditHooks");(0,d.addFilter)("editor.BlockEdit","core/editor/hooks",t)}([Gl,Uh,ou,su,fm,Dm,qm,wf,pC,mC,wC,dC].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:i=[],useBlockProps:s,isMatch:l}=e,a={};for(const e of i)n.attributes[e]&&(a[e]=n.attributes[e]);return!Object.keys(a).length||!o(n.name)||l&&!l(a)?null:(0,$.jsx)(Qi,{index:t,useBlockProps:s,setAllWrapperProps:r,name:n.name,clientId:n.clientId,...a},t)})),(0,$.jsx)(t,{...n,wrapperProps:o.filter(Boolean).reduce(((e,t)=>({...e,...t,className:$i(e.className,t.className),style:{...e.style,...t.style}})),n.wrapperProps||{})},"edit")]}),"withBlockListBlockHooks");(0,d.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}([Gl,Uh,eu,fm,Ep,im,Dm,Bh,Rh,Ad,qm,vf,dC]),zC=[Gl,Uh,ou,iu,su,Ad,Ep,fm,Bh,Rh],(0,d.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(function(e,t,n){return zC.reduce(((e,o)=>{const{hasSupport:r,attributeKeys:i=[],addSaveProps:s}=o,l={};for(const e of i)n[e]&&(l[e]=n[e]);return Object.keys(l).length&&r(t)?s(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:VC}=te(Ji.privateApis),FC=([e,...t])=>e.toUpperCase()+t.join(""),HC=e=>(0,u.createHigherOrderComponent)((t=>n=>(0,$.jsx)(t,{...n,colors:e})),"withCustomColorPalette"),GC=()=>(0,u.createHigherOrderComponent)((e=>t=>{const[n,o,r]=ii("color.palette.custom","color.palette.theme","color.palette.default"),i=(0,a.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,$.jsx)(e,{...t,colors:i})}),"withEditorColorPalette");function $C(e,t){const n=e.reduce(((e,t)=>({...e,..."string"==typeof t?{[t]:VC(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=Ru(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=FC(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=Hu(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,i])=>{const s=Fu(t,e[r],e[`custom${FC(r)}`]),l=o[r],a=l?.color;return a===s.color&&l?n[r]=l:n[r]={...s,class:Gu(i,s.slug)},n}),{})}render(){return(0,$.jsx)(e,{...this.props,colors:void 0,...this.state,...this.setters,colorUtils:this.colorUtils})}}])}function UC(e){return(...t)=>{const n=HC(e);return(0,u.createHigherOrderComponent)($C(t,n),"withCustomColors")}}function WC(...e){const t=GC();return(0,u.createHigherOrderComponent)($C(e,t),"withColors")}const KC=function(e){const[t,n]=ii("typography.fontSizes","typography.customFontSize");return(0,$.jsx)(Ji.FontSizePicker,{...e,fontSizes:t,disableCustomFontSizes:!n})},ZC=[],qC=([e,...t])=>e.toUpperCase()+t.join(""),YC=(...e)=>{const t=e.reduce(((e,t)=>(e[t]=`custom${qC(t)}`,e)),{});return(0,u.createHigherOrderComponent)((0,u.compose)([(0,u.createHigherOrderComponent)((e=>t=>{const[n]=ii("typography.fontSizes");return(0,$.jsx)(e,{...t,fontSizes:n||ZC})}),"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${qC(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 i=Object.entries(t).filter((([e,t])=>r(t,e))).reduce(((t,[o,r])=>{const i=e[o],s=jh(n,i,e[r]);return t[o]={...s,class:Th(i)},t}),{});return{...o,...i}}render(){return(0,$.jsx)(e,{...this.props,fontSizes:void 0,...this.state,...this.setters})}}]),"withFontSizes")},XC=()=>{};const QC={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(oi),i=t(),s=r(i);return{selectedBlockName:i?n(i):null,rootClientId:s,prioritizedBlocks:o(s)?.prioritizedInserterBlocks}}),[]),[r,i,s]=hS(t,XC,!0),l=(0,a.useMemo)((()=>(e.trim()?XS(r,i,s,e):Aw(he(r,"frecency","desc"),o)).filter((e=>e.name!==n)).slice(0,9)),[e,n,r,i,s,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,$.jsxs)($.Fragment,{children:[(0,$.jsx)(zf,{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:i}=e;return{action:"replace",value:"unsynced"===r?(0,l.parse)(i,{__unstableSkipMigrationLogs:!0}):(0,l.createBlock)(t,n,(0,l.createBlocksFromInnerBlocksTemplate)(o))}}},JC=window.wp.apiFetch;var eB=n.n(JC);const tB=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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 nB={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await eB()({path:(0,pa.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,$.jsxs)($.Fragment,{children:[(0,$.jsx)(cl,{icon:"page"===e.subtype?La:tB},"icon"),e.title]}),getOptionCompletion:e=>(0,$.jsx)("a",{href:e.url,children:e.title})},oB=[];function rB({completers:e=oB}){const{name:t}=_();return(0,a.useMemo)((()=>{let n=[...e,nB];return(t===(0,l.getDefaultBlockName)()||(0,l.getBlockSupport)(t,"__experimentalSlashInserter",!1))&&(n=[...n,QC]),(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 iB=function(e){return(0,$.jsx)(Ji.Autocomplete,{...e,completers:rB(e)})},sB=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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 lB=function({isActive:e,label:t=(0,C.__)("Toggle full height"),onToggle:n,isDisabled:o}){return(0,$.jsx)(Ji.ToolbarButton,{isActive:e,icon:sB,label:t,onClick:()=>n(!e),disabled:o})},aB=()=>{};const cB=function(e){const{label:t=(0,C.__)("Change matrix alignment"),onChange:n=aB,value:o="center",isDisabled:r}=e,i=(0,$.jsx)(Ji.AlignmentMatrixControl.Icon,{value:o});return(0,$.jsx)(Ji.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e,isOpen:n})=>(0,$.jsx)(Ji.ToolbarButton,{onClick:e,"aria-haspopup":"true","aria-expanded":n,onKeyDown:t=>{n||t.keyCode!==ma.DOWN||(t.preventDefault(),e())},label:t,icon:i,showTooltip:!0,disabled:r}),renderContent:()=>(0,$.jsx)(Ji.AlignmentMatrixControl,{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(oi),{getBlockType:i,getActiveBlockVariation:s}=t(l.store),a=o(e),c=i(a);if(!c)return null;const u=r(e),d=(0,l.__experimentalGetBlockLabel)(c,u,n);if(d!==c.title)return d;const p=s(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 dB({clientId:e,maximumLength:t,context:n}){return uB({clientId:e,maximumLength:t,context:n})}function pB(e){var t,n;if(!e)return null;const o=null!==(t=Array.from(document.querySelectorAll('iframe[name="editor-canvas"]').values()).find((t=>(t.contentDocument||t.contentWindow.document)===e.ownerDocument)))&&void 0!==t?t:e;return null!==(n=o?.closest('[role="region"]'))&&void 0!==n?n:o}const hB=function({rootLabelText:e}){const{selectBlock:t,clearSelectedBlock:n}=(0,c.useDispatch)(oi),{clientId:o,parents:r,hasSelection:i}=(0,c.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getEnabledBlockParents:o}=te(e(oi)),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),s=e||(0,C.__)("Document"),l=(0,a.useRef)();return gp(o,l),(0,$.jsxs)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,C.__)("Block breadcrumb"),children:[(0,$.jsxs)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true",children:[i&&(0,$.jsx)(Ji.Button,{size:"small",className:"block-editor-block-breadcrumb__button",onClick:()=>{const e=l.current?.closest(".editor-styles-wrapper");n(),pB(e)?.focus()},children:s}),!i&&s,!!o&&(0,$.jsx)(cl,{icon:Ba,className:"block-editor-block-breadcrumb__separator"})]}),r.map((e=>(0,$.jsxs)("li",{children:[(0,$.jsx)(Ji.Button,{size:"small",className:"block-editor-block-breadcrumb__button",onClick:()=>t(e),children:(0,$.jsx)(dB,{clientId:e,maximumLength:35})}),(0,$.jsx)(cl,{icon:Ba,className:"block-editor-block-breadcrumb__separator"})]},e))),!!o&&(0,$.jsx)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true",children:(0,$.jsx)(dB,{clientId:o,maximumLength:35})})]})};function gB(e){return(0,c.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(oi);return n(e)}),[e])}const mB={placement:"top-start"},fB={...mB,flip:!1,shift:!0},bB={...mB,flip:!0,shift:!1};function kB(e,t,n,o,r){if(!e||!t)return fB;const i=n?.scrollTop||0,s=$g(t),l=i+e.getBoundingClientRect().top,a=e.ownerDocument.documentElement.clientHeight,c=l+o,u=s.top>c,d=s.height>a-o;return r||!u&&!d?bB:fB}function vB({contentElement:e,clientId:t}){const n=mp(t),[o,r]=(0,a.useState)(0),{blockIndex:i,isSticky:s}=(0,c.useSelect)((e=>{const{getBlockIndex:n,getBlockAttributes:o}=e(oi);return{blockIndex:n(t),isSticky:Wm(o(t))}}),[t]),l=(0,a.useMemo)((()=>{if(e)return(0,ha.getScrollContainer)(e)}),[e]),[d,p]=(0,a.useState)((()=>kB(e,n,l,o,s))),h=(0,u.useRefEffect)((e=>{r(e.offsetHeight)}),[]),g=(0,a.useCallback)((()=>p(kB(e,n,l,o,s))),[e,n,l,o]);return(0,a.useLayoutEffect)(g,[i,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 _B(e){const t=(0,c.useSelect)((t=>{const{getBlockRootClientId:n,getBlockParents:o,__experimentalGetBlockListSettingsForBlocks:r,isBlockInsertionPointVisible:i,getBlockInsertionPoint:s,getBlockOrder:l,hasMultiSelection:a,getLastMultiSelectedBlockClientId:c}=t(oi),u=o(e),d=r(u),p=u.find((e=>d[e]?.__experimentalCaptureToolbars));let h=!1;if(i()){const t=s();h=l(t.rootClientId)[t.index]===e}return{capturingClientId:p,isInsertionPointVisible:h,lastClientId:a()?c():null,rootClientId:n(e)}}),[e]);return t}function xB({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:r,rootClientId:i}=_B(e),s=vB({contentElement:t?.current,clientId:e});return(0,$.jsx)(qg,{clientId:n||e,bottomClientId:r,className:$i("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":o}),__unstableContentRef:t,...s,children:(0,$.jsx)("div",{className:"block-editor-block-list__empty-block-inserter",children:(0,$.jsx)(Zw,{position:"bottom right",rootClientId:i,clientId:e,__experimentalIsQuick:!0})})})}const yB=({appendToOwnerDocument:e,children:t,clientIds:n,cloneClassname:o,elementId:r,onDragStart:i,onDragEnd:s,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:i,isBlockInsertionPointVisible:s}=e(oi),{getBlockType:a,getActiveBlockVariation:c}=e(l.store),u=o(n[0]),d=r(n[0]),p=c(d,i(n[0]));return{srcRootClientId:u,isDraggable:t(n),icon:p?.icon||a(d)?.icon,visibleInserter:s(),getBlockType:a}}),[n]),k=(0,a.useRef)(!1),[v,_,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,ha.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,i=e.current-n.current.offsetTop,s=o.clientY-n.current.offsetTop;if(o.clientY>i){const e=Math.max(r-i-50,0),n=Math.max(s-i-50,0),o=0===e||0===n?0:n/e;t.current=25*o}else if(o.clientY<i){const e=Math.max(i-50,0),n=Math.max(i-s-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)(oi),{startDraggingBlocks:C,stopDraggingBlocks:B}=(0,c.useDispatch)(oi);(0,a.useEffect)((()=>()=>{k.current&&B()}),[]);const I=mp(n[0]),j=I?.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),i=S([o])[0];let s;if(0===r?.length){const e=w(o),n=S([e])[0],r=y(e);s=Px(b,r,t,n)}else s=Px(b,r,t,i);s||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,$.jsx)(Ji.Draggable,{appendToOwnerDocument:e,cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:E,onDragStart:e=>{window.requestAnimationFrame((()=>{C(n),k.current=!0,v(e),i&&i()}))},onDragOver:_,onDragEnd:()=>{B(),k.current=!1,x(),s&&s()},__experimentalDragComponent:void 0!==p?p:(0,$.jsx)(iS,{count:n.length,icon:m,fadeWhenDisabled:!0}),elementId:r,children:({onDraggableStart:e,onDraggableEnd:n})=>t({draggable:!0,onDragStart:e,onDragEnd:n})})},SB=(e,t)=>"up"===e?"horizontal"===t?(0,C.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,C.isRTL)()?"left":"right":"down":null;function wB(e,t,n,o,r,i,s){const l=n+1;if(e>1)return function(e,t,n,o,r,i){const s=t+1;if(n&&o)return(0,C.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=SB("down",i);if("down"===t)return(0,C.sprintf)((0,C.__)("Move %1$d blocks from position %2$d down by one place"),e,s);if("left"===t)return(0,C.sprintf)((0,C.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if("right"===t)return(0,C.sprintf)((0,C.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(r>0&&o){const e=SB("down",i);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=SB("up",i);if("up"===t)return(0,C.sprintf)((0,C.__)("Move %1$d blocks from position %2$d up by one place"),e,s);if("left"===t)return(0,C.sprintf)((0,C.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if("right"===t)return(0,C.sprintf)((0,C.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(r<0&&n){const e=SB("up",i);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,i,s);if(o&&r)return(0,C.sprintf)((0,C.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!r){const e=SB("down",s);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(i>0&&r){const e=SB("down",s);if("down"===e)return(0,C.sprintf)((0,C.__)("Block %1$s is at the end of the content and cant be moved down"),t);if("left"===e)return(0,C.sprintf)((0,C.__)("Block %1$s is at the end of the content and cant be moved left"),t);if("right"===e)return(0,C.sprintf)((0,C.__)("Block %1$s is at the end of the content and cant be moved right"),t)}if(i<0&&!o){const e=SB("up",s);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(i<0&&o){const e=SB("up",s);if("up"===e)return(0,C.sprintf)((0,C.__)("Block %1$s is at the beginning of the content and cant be moved up"),t);if("left"===e)return(0,C.sprintf)((0,C.__)("Block %1$s is at the beginning of the content and cant be moved left"),t);if("right"===e)return(0,C.sprintf)((0,C.__)("Block %1$s is at the beginning of the content and cant be moved right"),t)}}const CB=(e,t)=>"up"===e?"horizontal"===t?(0,C.isRTL)()?Af:Df:lC:"down"===e?"horizontal"===t?(0,C.isRTL)()?Df:Af:aC:null,BB=(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 i=(0,u.useInstanceId)(IB),s=Array.isArray(e)?e:[e],a=s.length,{disabled:d}=o,{blockType:p,isDisabled:h,rootClientId:g,isFirst:m,isLast:f,firstIndex:b,orientation:k="vertical"}=(0,c.useSelect)((e=>{const{getBlockIndex:o,getBlockRootClientId:r,getBlockOrder:i,getBlock:a,getBlockListSettings:c}=e(oi),u=s[0],p=r(u),h=o(u),g=o(s[s.length-1]),m=i(p),f=a(u),b=0===h,k=g===m.length-1,{orientation:v}=c(p)||{};return{blockType:f?(0,l.getBlockType)(f.name):null,isDisabled:d||("up"===t?b:k),rootClientId:p,firstIndex:h,isFirst:b,isLast:k,orientation:n||v}}),[e,t]),{moveBlocksDown:v,moveBlocksUp:_}=(0,c.useDispatch)(oi),x="up"===t?_:v,y=`block-editor-block-mover-button__description-${i}`;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,ref:r,className:$i("block-editor-block-mover-button",`is-${t}-button`),icon:CB(t,k),label:BB(t,k),"aria-describedby":y,...o,onClick:h?null:t=>{x(e,g),o.onClick&&o.onClick(t)},disabled:h,accessibleWhenDisabled:!0}),(0,$.jsx)(Ji.VisuallyHidden,{id:y,children:wB(a,p&&p.title,b,m,f,"up"===t?-1:1,k)})]})})),jB=(0,a.forwardRef)(((e,t)=>(0,$.jsx)(IB,{direction:"up",ref:t,...e}))),EB=(0,a.forwardRef)(((e,t)=>(0,$.jsx)(IB,{direction:"down",ref:t,...e})));const TB=function({clientIds:e,hideDragHandle:t,isBlockMoverUpButtonDisabled:n,isBlockMoverDownButtonDisabled:o}){const{canMove:r,rootClientId:i,isFirst:s,isLast:l,orientation:a,isManualGrid:u}=(0,c.useSelect)((t=>{var n;const{getBlockIndex:o,getBlockListSettings:r,canMoveBlocks:i,getBlockOrder:s,getBlockRootClientId:l,getBlockAttributes:a}=t(oi),c=Array.isArray(e)?e:[e],u=c[0],d=l(u),p=o(u),h=o(c[c.length-1]),g=s(d),{layout:m={}}=null!==(n=a(d))&&void 0!==n?n:{};return{canMove:i(e),rootClientId:d,isFirst:0===p,isLast:h===g.length-1,orientation:r(d)?.orientation,isManualGrid:"grid"===m.type&&m.isManualPlacement&&window.__experimentalEnableGridInteractivity}}),[e]);return!r||s&&l&&!i||t&&u?null:(0,$.jsxs)(Ji.ToolbarGroup,{className:$i("block-editor-block-mover",{"is-horizontal":"horizontal"===a}),children:[!t&&(0,$.jsx)(yB,{clientIds:e,fadeWhenDisabled:!0,children:e=>(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,icon:rS,className:"block-editor-block-mover__drag-handle",label:(0,C.__)("Drag"),tabIndex:"-1",...e})}),!u&&(0,$.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,$.jsx)(Ji.ToolbarItem,{children:t=>(0,$.jsx)(jB,{disabled:n,clientIds:e,...t})}),(0,$.jsx)(Ji.ToolbarItem,{children:t=>(0,$.jsx)(EB,{disabled:o,clientIds:e,...t})})]})]})},{clearTimeout:MB,setTimeout:PB}=window,RB=200;function NB({ref:e,isFocused:t,highlightParent:n,debounceTimeout:o=RB}){const{getSelectedBlockClientId:r,getBlockRootClientId:i}=(0,c.useSelect)(oi),{toggleBlockHighlight:s}=(0,c.useDispatch)(oi),l=(0,a.useRef)(),u=(0,c.useSelect)((e=>e(oi).getSettings().isDistractionFree),[]),d=e=>{if(e&&u)return;const t=r(),o=n?i(t):t;s(o,e)},p=()=>{const n=e?.current&&e.current.matches(":hover");return!t&&!n},h=()=>{const e=l.current;e&&MB&&MB(e)};return(0,a.useEffect)((()=>()=>{d(!1),h()}),[]),{debouncedShowGestures:e=>{e&&e.stopPropagation(),h(),d(!0)},debouncedHideGestures:e=>{e&&e.stopPropagation(),h(),l.current=PB((()=>{p()&&d(!1)}),o)}}}function LB({ref:e,highlightParent:t=!1,debounceTimeout:n=RB}){const[o,r]=(0,a.useState)(!1),{debouncedShowGestures:i,debouncedHideGestures:s}=NB({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),i())},o=()=>{c()||(r(!1),s())};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,i,s]),{onMouseMove:i,onMouseLeave:s}}function AB(){const{selectBlock:e}=(0,c.useDispatch)(oi),{firstParentClientId:t,isVisible:n}=(0,c.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getBlockEditingMode:r}=e(oi),{hasBlockSupport:i}=e(l.store),s=n(o()),a=s[s.length-1],c=t(a),u=(0,l.getBlockType)(c);return{firstParentClientId:a,isVisible:a&&"default"===r(a)&&i(u,"__experimentalParentSelector",!0)}}),[]),o=zm(t),r=(0,a.useRef)(),i=LB({ref:r,highlightParent:!0});return n?(0,$.jsx)("div",{className:"block-editor-block-parent-selector",ref:r,...i,children:(0,$.jsx)(Ji.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,$.jsx)(zf,{icon:o?.icon})})},t):null}const DB=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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 OB({blocks:e}){return(0,u.useViewportMatch)("medium","<")?null:(0,$.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,$.jsx)(Ji.Popover,{className:"block-editor-block-switcher__popover-preview",placement:"right-start",focusOnMount:!1,offset:16,children:(0,$.jsxs)("div",{className:"block-editor-block-switcher__preview",children:[(0,$.jsx)("div",{className:"block-editor-block-switcher__preview-title",children:(0,C.__)("Preview")}),(0,$.jsx)(eS,{viewportWidth:500,blocks:e})]})})})}const zB={};function VB({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:i}=e;return(0,$.jsxs)(Ji.MenuItem,{className:(0,l.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[(0,$.jsx)(zf,{icon:r,showColors:!0}),i]})}const FB=({transformations:e,onSelect:t,blocks:n})=>{const[o,r]=(0,a.useState)();return(0,$.jsxs)($.Fragment,{children:[o&&(0,$.jsx)(OB,{blocks:(0,l.cloneBlock)(n[0],e.find((({name:e})=>e===o)).attributes)}),e?.map((e=>(0,$.jsx)(VB,{item:e,onSelect:t,setHoveredTransformItemName:r},e.name)))]})};function HB({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map((e=>(0,$.jsx)(GB,{item:e,onSelect:t,setHoveredTransformItemName:n},e.name)))}function GB({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:i,isDisabled:s}=e;return(0,$.jsxs)(Ji.MenuItem,{className:(0,l.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},disabled:s,onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[(0,$.jsx)(zf,{icon:r,showColors:!0}),i]})}const $B=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:n,onSelect:o,onSelectVariation:r,blocks:i})=>{const[s,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,$.jsx)(HB,{restTransformations:d,onSelect:o,setHoveredTransformItemName:c});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Ji.MenuGroup,{label:(0,C.__)("Transform to"),className:e,children:[s&&(0,$.jsx)(OB,{blocks:(0,l.switchToBlockType)(i,s)}),!!n?.length&&(0,$.jsx)(FB,{transformations:n,blocks:i,onSelect:r}),u.map((e=>(0,$.jsx)(GB,{item:e,onSelect:o,setHoveredTransformItemName:c},e.name))),!p&&h]}),!!p&&(0,$.jsx)(Ji.MenuGroup,{className:e,children:h})]})};function UB(e,t,n){const o=new(yh())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function WB(e){return e?.find((e=>e.isDefault))}function KB({clientId:e,onSwitch:t}){const{styles:n,block:o,blockType:r,className:i}=(0,c.useSelect)((t=>{const{getBlock:n}=t(oi),o=n(e);if(!o)return{};const r=(0,l.getBlockType)(o.name),{getBlockStyles:i}=t(l.store);return{block:o,blockType:r,styles:i(o.name),className:o.attributes.className||""}}),[e]),{updateBlockAttributes:s}=(0,c.useDispatch)(oi),u=function(e){return e&&0!==e.length?WB(e)?e:[{name:"default",label:(0,C._x)("Default","block style"),isDefault:!0},...e]:[]}(n),d=function(e,t){for(const n of new(yh())(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 WB(e)}(u,i),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=UB(i,d,n);s(e,{className:o}),t()},stylesToRender:u,activeStyle:d,genericPreviewBlock:p,className:i}}const ZB=()=>{};function qB({clientId:e,onSwitch:t=ZB}){const{onSelect:n,stylesToRender:o,activeStyle:r}=KB({clientId:e,onSwitch:t});return o&&0!==o.length?(0,$.jsx)($.Fragment,{children:o.map((e=>{const t=e.label||e.name;return(0,$.jsx)(Ji.MenuItem,{icon:r.name===e.name?id:null,onClick:()=>n(e),children:(0,$.jsx)(Ji.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:t})},e.name)}))}):null}function YB({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return(0,$.jsx)(Ji.MenuGroup,{label:(0,C.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:(0,$.jsx)(qB,{clientId:n,onSwitch:t})})}const XB=(e,t,n=new Set)=>{const{clientId:o,name:r,innerBlocks:i=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of i){const o=XB(e,t,n);if(o)return o}}},QB=(e,t)=>{const n=((e,t)=>{const n=(0,l.getBlockAttributesNamesByRole)(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}},JB=(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=XB(r,t.name,o);if(n){e=!0,o.add(n.clientId),QB(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function eI({patterns:e,onSelect:t}){const n=(0,u.useViewportMatch)("medium","<");return(0,$.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,$.jsx)(Ji.Popover,{className:"block-editor-block-switcher__popover-preview",placement:n?"bottom":"right-start",offset:16,children:(0,$.jsx)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:(0,$.jsx)(tI,{patterns:e,onSelect:t})})})})}function tI({patterns:e,onSelect:t}){return(0,$.jsx)(Ji.Composite,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,C.__)("Patterns list"),children:e.map((e=>(0,$.jsx)(nI,{pattern:e,onSelect:t},e.name)))})}function nI({pattern:e,onSelect:t}){const n="block-editor-block-switcher__preview-patterns-container",o=(0,u.useInstanceId)(nI,`${n}-list__item-description`);return(0,$.jsxs)("div",{className:`${n}-list__list-item`,children:[(0,$.jsxs)(Ji.Composite.Item,{render:(0,$.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,$.jsx)(eS,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,$.jsx)("div",{className:`${n}-list__item-title`,children:e.title})]}),!!e.description&&(0,$.jsx)(Ji.VisuallyHidden,{id:o,children:e.description})]})}const oI=function({blocks:e,patterns:t,onSelect:n}){const[o,r]=(0,a.useState)(!1),i=JB(t,e);return i.length?(0,$.jsxs)(Ji.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[o&&(0,$.jsx)(eI,{patterns:i,onSelect:n}),(0,$.jsx)(Ji.MenuItem,{onClick:e=>{e.preventDefault(),r(!o)},icon:Af,children:(0,C.__)("Patterns")})]}):null};function rI({onClose:e,clientIds:t,hasBlockStyles:n,canRemove:o,isUsingBindings:r}){const{replaceBlocks:i,multiSelect:s,updateBlockAttributes:u}=(0,c.useDispatch)(oi),{possibleBlockTransformations:d,patterns:p,blocks:h}=(0,c.useSelect)((e=>{const{getBlocksByClientId:n,getBlockRootClientId:o,getBlockTransformItems:r,__experimentalGetPatternTransformItems:i}=e(oi),s=o(Array.isArray(t)?t[0]:t),l=n(t);return{blocks:l,possibleBlockTransformations:r(l,s),patterns:i(l,s)}}),[t]),g=function({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:o}=(0,c.useSelect)((n=>{const{getBlockAttributes:o,canRemoveBlocks:r}=n(oi),{getActiveBlockVariation:i,getBlockVariations:s}=n(l.store),a=r(e);if(1!==t.length||!a)return zB;const[c]=t;return{blockVariationTransformations:s(c.name,"transform"),activeBlockVariation:i(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&&s(e[0].clientId,e[e.length-1].clientId)}const f=1===h.length,b=f&&(0,l.isTemplatePart)(h[0]),k=!!d.length&&o&&!b,v=!!g?.length,_=!!p?.length&&o,x=k||v;if(!(n||x||_))return(0,$.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,$.jsxs)("div",{className:"block-editor-block-switcher__container",children:[_&&(0,$.jsx)(oI,{blocks:h,patterns:p,onSelect:n=>{!function(e){i(t,e),m(e)}(n),e()}}),x&&(0,$.jsx)($B,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:d,possibleBlockVariationTransformations:g,blocks:h,onSelect:n=>{!function(e){const n=(0,l.switchToBlockType)(h,e);i(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,$.jsx)(YB,{hoveredBlock:h[0],onSwitch:e}),r&&(0,$.jsx)(Ji.MenuGroup,{children:(0,$.jsx)(Ji.__experimentalText,{className:"block-editor-block-switcher__binding-indicator",children:y})})]})}const iI=({icon:e,showTitle:t,blockTitle:n})=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(zf,{className:"block-editor-block-switcher__toggle",icon:e,showColors:!0}),t&&n&&(0,$.jsx)("span",{className:"block-editor-block-switcher__toggle-text",children:n})]}),sI=({clientIds:e,disabled:t,isUsingBindings:n})=>{const{hasContentOnlyLocking:o,canRemove:r,hasBlockStyles:i,icon:s,invalidBlocks:a,isReusable:u,isTemplate:d}=(0,c.useSelect)((t=>{const{getTemplateLock:n,getBlocksByClientId:o,getBlockAttributes:r,canRemoveBlocks:i}=t(oi),{getBlockStyles:s,getBlockType:a,getActiveBlockVariation:c}=t(l.store),u=o(e);if(!u.length||u.some((e=>!e)))return{invalidBlocks:!0};const[{name:d}]=u,p=1===u.length,h=a(d);let g,m;if(p){const t=c(d,r(e[0]));g=t?.icon||h.icon,m="contentOnly"===n(e[0])}else{const t=1===new Set(u.map((({name:e})=>e))).size;m=e.some((e=>"contentOnly"===n(e))),g=t?h.icon:DB}return{canRemove:i(e),hasBlockStyles:p&&!!s(d)?.length,icon:g,isReusable:p&&(0,l.isReusableBlock)(u[0]),isTemplate:p&&(0,l.isTemplatePart)(u[0]),hasContentOnlyLocking:m}}),[e]),p=uB({clientId:e?.[0],maximumLength:35});if(a)return null;const h=1===e.length,g=h?p:(0,C.__)("Multiple blocks selected");if(t||!i&&!r||o)return(0,$.jsx)(Ji.ToolbarGroup,{children:(0,$.jsx)(Ji.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:g,icon:(0,$.jsx)(iI,{icon:s,showTitle:u||d,blockTitle:p})})});const m=h?(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,$.jsx)(Ji.ToolbarGroup,{children:(0,$.jsx)(Ji.ToolbarItem,{children:t=>(0,$.jsx)(Ji.DropdownMenu,{className:"block-editor-block-switcher",label:g,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:(0,$.jsx)(iI,{icon:s,showTitle:u||d,blockTitle:p}),toggleProps:{description:m,...t},menuProps:{orientation:"both"},children:({onClose:t})=>(0,$.jsx)(rI,{onClose:t,clientIds:e,hasBlockStyles:i,canRemove:r,isUsingBindings:n})})})})},{Fill:lI,Slot:aI}=(0,Ji.createSlotFill)("__unstableBlockToolbarLastItem");lI.Slot=aI;const cI=lI,uI="align",dI="__experimentalBorder",pI="color",hI="customClassName",gI="typography.__experimentalFontFamily",mI="typography.fontSize",fI="typography.textAlign",bI="layout",kI=["shadow",...["typography.lineHeight",mI,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",gI,fI,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalWritingMode","typography.__experimentalLetterSpacing"],dI,pI,"spacing"];const vI={align:e=>(0,l.hasBlockSupport)(e,uI),borderColor:e=>function(e,t="any"){if("web"!==a.Platform.OS)return!1;const n=(0,l.getBlockSupport)(e,dI);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,pI);return t&&!1!==t.background},textAlign:e=>(0,l.hasBlockSupport)(e,fI),textColor:e=>{const t=(0,l.getBlockSupport)(e,pI);return t&&!1!==t.text},gradient:e=>{const t=(0,l.getBlockSupport)(e,pI);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,l.hasBlockSupport)(e,hI,!0),fontFamily:e=>(0,l.hasBlockSupport)(e,gI),fontSize:e=>(0,l.hasBlockSupport)(e,mI),layout:e=>(0,l.hasBlockSupport)(e,bI),style:e=>kI.some((t=>(0,l.hasBlockSupport)(e,t)))};function _I(e,t){return Object.entries(vI).reduce(((n,[o,r])=>(r(e.name)&&r(t.name)&&(n[o]=e.attributes[o]),n)),{})}function xI(e,t,n){for(let o=0;o<Math.min(t.length,e.length);o+=1)n(e[o].clientId,_I(t[o],e[o])),xI(e[o].innerBlocks,t[o].innerBlocks,n)}function yI(){const e=(0,c.useRegistry)(),{updateBlockAttributes:t}=(0,c.useDispatch)(oi),{createSuccessNotice:n,createWarningNotice:o,createErrorNotice:r}=(0,c.useDispatch)(Fo.store);return(0,a.useCallback)((async i=>{let s="";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"});s=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(!s||!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}}(s))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)(s);if(1===a.length?e.batch((()=>{xI(i,i.map((()=>a[0])),t)})):e.batch((()=>{xI(i,a,t)})),1===i.length){const e=(0,l.getBlockType)(i[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."),i.length),{type:"snackbar"})}),[e.batch,t,n,o,r])}function SI({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{getDefaultBlockName:o,getGroupingBlockName:r}=(0,c.useSelect)(l.store),i=(0,c.useSelect)((t=>{const{canInsertBlockType:n,getBlockRootClientId:r,getBlocksByClientId:i,getDirectInsertBlock:s,canMoveBlocks:a,canRemoveBlocks:c}=t(oi),u=i(e),d=r(e[0]),p=n(o(),d),h=d?s(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:s,getBlocks:a}=(0,c.useSelect)(oi),{canMove:u,canRemove:d,canInsertBlock:p,canCopyStyles:h,canDuplicate:g}=i,{removeBlocks:m,replaceBlocks:f,duplicateBlocks:b,insertAfterBlock:k,insertBeforeBlock:v,flashBlock:_,setBlockMovingClientId:x,setNavigationMode:y,selectBlock:S}=(0,c.useDispatch)(oi),w=my(),C=yI();return t({canCopyStyles:h,canDuplicate:g,canInsertBlock:p,canMove:u,canRemove:d,onDuplicate:()=>b(e,n),onRemove:()=>m(e,n),onInsertBefore(){v(e[0])},onInsertAfter(){k(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)(s(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(s(e))}})}const wI=function({clientId:e}){const t=(0,c.useSelect)((t=>t(oi).getBlock(e)),[e]),{replaceBlocks:n}=(0,c.useDispatch)(oi);return t&&"core/html"===t.name?(0,$.jsx)(Ji.MenuItem,{onClick:()=>n(e,(0,l.rawHandler)({HTML:(0,l.getBlockContent)(t)})),children:(0,C.__)("Convert to Blocks")}):null},{Fill:CI,Slot:BI}=(0,Ji.createSlotFill)("__unstableBlockSettingsMenuFirstItem");CI.Slot=BI;const II=CI;function jI(e){return(0,c.useSelect)((t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:o,isUngroupable:r,isGroupable:i}=t(oi),{getGroupingBlockName:s,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:i(c),isUngroupable:p,blocksSelection:u,groupingBlockName:s(),onUngroup:p&&a(d.name)?.transforms?.ungroup}}),[e])}function EI({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:o,blocksSelection:r,groupingBlockName:i,onClose:s=(()=>{})}){const{getSelectedBlockClientIds:a}=(0,c.useSelect)(oi),{replaceBlocks:u}=(0,c.useDispatch)(oi);if(!t&&!n)return null;const d=a();return(0,$.jsxs)($.Fragment,{children:[t&&(0,$.jsx)(Ji.MenuItem,{shortcut:d.length>1?ma.displayShortcut.primary("g"):void 0,onClick:()=>{(()=>{const t=(0,l.switchToBlockType)(r,i);t&&u(e,t)})(),s()},children:(0,C._x)("Group","verb")}),n&&(0,$.jsx)(Ji.MenuItem,{onClick:()=>{(()=>{let t=r[0].innerBlocks;t.length&&(o&&(t=o(r[0].attributes,r[0].innerBlocks)),u(e,t))})(),s()},children:(0,C._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor")})]})}function TI(e){return(0,c.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:i,getBlockName:s,getTemplateLock:l}=t(oi),a=n(e),c=o(e),u=r(e);return{canEdit:a,canMove:c,canRemove:u,canLock:i(s(e)),isContentLocked:"contentOnly"===l(e),isLocked:!a||!c||!u}}),[e])}const MI=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.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"})}),PI=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.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"})}),RI=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.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"})}),NI=["core/block","core/navigation"];function LI(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function AI({clientId:e,onClose:t}){const[n,o]=(0,a.useState)({move:!1,remove:!1}),{canEdit:r,canMove:i,canRemove:s}=TI(e),{allowsEditLocking:u,templateLock:d,hasTemplateLock:p}=(0,c.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(oi),r=n(e),i=(0,l.getBlockType)(r);return{allowsEditLocking:NI.includes(r),templateLock:o(e)?.templateLock,hasTemplateLock:!!i?.attributes?.templateLock}}),[e]),[h,g]=(0,a.useState)(!!d),{updateBlockAttributes:m}=(0,c.useDispatch)(oi),f=zm(e);(0,a.useEffect)((()=>{o({move:!i,remove:!s,...u?{edit:!r}:{}})}),[r,i,s,u]);const b=Object.values(n).every(Boolean),k=Object.values(n).some(Boolean)&&!b;return(0,$.jsx)(Ji.Modal,{title:(0,C.sprintf)((0,C.__)("Lock %s"),f.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,children:(0,$.jsxs)("form",{onSubmit:o=>{o.preventDefault(),m([e],{lock:n,templateLock:h?LI(n):void 0}),t()},children:[(0,$.jsxs)("fieldset",{className:"block-editor-block-lock-modal__options",children:[(0,$.jsx)("legend",{children:(0,C.__)("Choose specific attributes to restrict or lock all available options.")}),(0,$.jsx)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:(0,$.jsxs)("li",{children:[(0,$.jsx)(Ji.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-all",label:(0,C.__)("Lock all"),checked:b,indeterminate:k,onChange:e=>o({move:e,remove:e,...u?{edit:e}:{}})}),(0,$.jsxs)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:[u&&(0,$.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,$.jsx)(Ji.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Restrict editing"),checked:!!n.edit,onChange:e=>o((t=>({...t,edit:e})))}),(0,$.jsx)(Ji.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?RI:MI})]}),(0,$.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,$.jsx)(Ji.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Disable movement"),checked:n.move,onChange:e=>o((t=>({...t,move:e})))}),(0,$.jsx)(Ji.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?RI:MI})]}),(0,$.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,$.jsx)(Ji.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Prevent removal"),checked:n.remove,onChange:e=>o((t=>({...t,remove:e})))}),(0,$.jsx)(Ji.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?RI:MI})]})]})]})}),p&&(0,$.jsx)(Ji.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,C.__)("Apply to all blocks inside"),checked:h,disabled:n.move&&!n.remove,onChange:()=>g(!h)})]}),(0,$.jsxs)(Ji.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,$.jsx)(Ji.FlexItem,{children:(0,$.jsx)(Ji.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,C.__)("Cancel")})}),(0,$.jsx)(Ji.FlexItem,{children:(0,$.jsx)(Ji.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,C.__)("Apply")})})]})]})})}function DI({clientId:e}){const{canLock:t,isLocked:n}=TI(e),[o,r]=(0,a.useReducer)((e=>!e),!1);if(!t)return null;const i=n?(0,C.__)("Unlock"):(0,C.__)("Lock");return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.MenuItem,{icon:n?MI:PI,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog",children:i}),o&&(0,$.jsx)(AI,{clientId:e,onClose:r})]})}const OI=()=>{};function zI({clientId:e,onToggle:t=OI}){const{blockType:n,mode:o,isCodeEditingEnabled:r}=(0,c.useSelect)((t=>{const{getBlock:n,getBlockMode:o,getSettings:r}=t(oi),i=n(e);return{mode:o(e),blockType:i?(0,l.getBlockType)(i.name):null,isCodeEditingEnabled:r().codeEditingEnabled}}),[e]),{toggleBlockMode:i}=(0,c.useDispatch)(oi);if(!n||!(0,l.hasBlockSupport)(n,"html",!0)||!r)return null;const s="visual"===o?(0,C.__)("Edit as HTML"):(0,C.__)("Edit visually");return(0,$.jsx)(Ji.MenuItem,{onClick:()=>{i(e),t()},children:s})}function VI({clientId:e,onClose:t}){const{templateLock:n,isLockedByParent:o,isEditingAsBlocks:r}=(0,c.useSelect)((t=>{const{getContentLockingParent:n,getTemplateLock:o,getTemporarilyEditingAsBlocks:r}=te(t(oi));return{templateLock:o(e),isLockedByParent:!!n(e),isEditingAsBlocks:r()===e}}),[e]),i=(0,c.useDispatch)(oi),s=!o&&"contentOnly"===n;if(!s&&!r)return null;const{modifyContentLockBlock:l}=te(i);return!r&&s&&(0,$.jsx)(Ji.MenuItem,{onClick:()=>{l(e),t()},children:(0,C._x)("Modify","Unlock content locked blocks")})}function FI(e){return 0===e?.trim()?.length}function HI({blockName:e,originalBlockName:t,onClose:n,onSave:o,hasOverridesWarning:r}){const[i,s]=(0,a.useState)(e),l=i!==e,c=i===t,u=FI(i),d=l||c;return(0,$.jsx)(Ji.Modal,{title:(0,C.__)("Rename"),onRequestClose:n,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",size:"small",children:(0,$.jsx)("form",{onSubmit:e=>{e.preventDefault(),d&&(()=>{const e=c||u?(0,C.sprintf)((0,C.__)('Block name reset to: "%s".'),i):(0,C.sprintf)((0,C.__)('Block name changed to: "%s".'),i);(0,Vo.speak)(e,"assertive"),o(i),n()})()},children:(0,$.jsxs)(Ji.__experimentalVStack,{spacing:"3",children:[(0,$.jsx)(Ji.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:i,label:(0,C.__)("Name"),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:s,onFocus:e=>e.target.select()}),(0,$.jsxs)(Ji.__experimentalHStack,{justify:"right",children:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n,children:(0,C.__)("Cancel")}),(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,"aria-disabled":!d,variant:"primary",type:"submit",children:(0,C.__)("Save")})]})]})})})}function GI({clientId:e}){const[t,n]=(0,a.useState)(!1),{metadata:o}=(0,c.useSelect)((t=>{const{getBlockAttributes:n}=t(oi),o=n(e)?.metadata;return{metadata:o}}),[e]),{updateBlockAttributes:r}=(0,c.useDispatch)(oi),i=o?.name,s=!!i&&!!o?.bindings&&Object.values(o.bindings).some((e=>"core/pattern-overrides"===e.source));const l=zm(e);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.MenuItem,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog",children:(0,C.__)("Rename")}),t&&(0,$.jsx)(HI,{blockName:i||"",originalBlockName:l?.title,hasOverridesWarning:s,onClose:()=>n(!1),onSave:t=>{(t===l?.title||FI(t))&&(t=void 0),function(t){r([e],{metadata:{...o,name:t}})}(t)}})]})}const{Fill:$I,Slot:UI}=(0,Ji.createSlotFill)("BlockSettingsMenuControls");function WI({...e}){return(0,$.jsx)(Ji.__experimentalStyleProvider,{document,children:(0,$.jsx)($I,{...e})})}WI.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(oi),i=null!==t?t:o();return{selectedBlocks:n(i),selectedClientIds:i,isContentOnly:"contentOnly"===r(i[0])}}),[t]),{canLock:i}=TI(o[0]),{canRename:s}=(a=n[0],{canRename:(0,l.getBlockSupport)(a,"renaming",!0)});var a;const d=1===o.length&&i&&!r,p=1===o.length&&s&&!r,h=jI(o),{isGroupable:g,isUngroupable:m}=h,f=g||m;return(0,$.jsx)(UI,{fillProps:{...e,selectedBlocks:n,selectedClientIds:o},children:t=>!t?.length>0&&!f&&!d?null:(0,$.jsxs)(Ji.MenuGroup,{children:[f&&(0,$.jsx)(EI,{...h,onClose:e?.onClose}),d&&(0,$.jsx)(DI,{clientId:o[0]}),p&&(0,$.jsx)(GI,{clientId:o[0]}),t,e?.canMove&&!e?.onlyBlock&&!r&&(0,$.jsx)(Ji.MenuItem,{onClick:(0,u.pipe)(e?.onClose,e?.onMoveTo),children:(0,C.__)("Move to")}),1===o.length&&(0,$.jsx)(VI,{clientId:o[0],onClose:e?.onClose}),1===e?.count&&!r&&(0,$.jsx)(zI,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};const KI=WI;function ZI({parentClientId:e,parentBlockType:t}){const n=(0,u.useViewportMatch)("medium","<"),{selectBlock:o}=(0,c.useDispatch)(oi),r=(0,a.useRef)(),i=LB({ref:r,highlightParent:!0});return n?(0,$.jsx)(Ji.MenuItem,{...i,ref:r,icon:(0,$.jsx)(zf,{icon:t.icon}),onClick:()=>o(e),children:(0,C.sprintf)((0,C.__)("Select parent block (%s)"),t.title)}):null}const qI={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function YI({clientIds:e,onCopy:t,label:n,shortcut:o}){const{getBlocksByClientId:r}=(0,c.useSelect)(oi),i=(0,u.useCopyToClipboard)((()=>(0,l.serialize)(r(e))),t),s=n||(0,C.__)("Copy");return(0,$.jsx)(Ji.MenuItem,{ref:i,shortcut:o,children:s})}function XI({block:e,clientIds:t,children:n,__experimentalSelectBlock:o,...r}){const i=e?.clientId,s=t.length,d=t[0],{firstParentClientId:p,onlyBlock:h,parentBlockType:g,previousBlockClientId:m,selectedBlockClientIds:f,openedBlockSettingsMenu:b,isContentOnly:k}=(0,c.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:r,getSelectedBlockClientIds:i,getBlockAttributes:s,getOpenedBlockSettingsMenu:a,getBlockEditingMode:c}=te(e(oi)),{getActiveBlockVariation:u}=e(l.store),p=o(d),h=p&&n(p);return{firstParentClientId:p,onlyBlock:1===t(p),parentBlockType:p&&(u(h,s(p))||(0,l.getBlockType)(h)),previousBlockClientId:r(d),selectedBlockClientIds:i(),openedBlockSettingsMenu:a(),isContentOnly:"contentOnly"===c(d)}}),[d]),{getBlockOrder:v,getSelectedBlockClientIds:_}=(0,c.useSelect)(oi),{setOpenedBlockSettingsMenu:x}=te((0,c.useDispatch)(oi)),y=(0,c.useSelect)((e=>{const{getShortcutRepresentation:t}=e($f.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=v()[0]);const t=S&&0===_().length;o(e,t)}const I=f?.includes(p),j=i?b===i||!1:void 0;function E(e){e&&b!==i?x(i):!e&&b&&b===i&&x(void 0)}return(0,$.jsx)(SI,{clientIds:t,__experimentalUpdateSelection:!o,children:({canCopyStyles:e,canDuplicate:o,canInsertBlock:i,canMove:l,canRemove:c,onDuplicate:m,onInsertAfter:f,onInsertBefore:b,onRemove:v,onCopy:_,onPasteStyles:x,onMoveTo:S})=>(0,$.jsx)(Ji.DropdownMenu,{icon:tb,label:(0,C.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:qI,open:j,onToggle:E,noIcons:!0,...r,children:({onClose:r})=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Ji.MenuGroup,{children:[(0,$.jsx)(II.Slot,{fillProps:{onClose:r}}),!I&&!!p&&(0,$.jsx)(ZI,{parentClientId:p,parentBlockType:g}),1===s&&(0,$.jsx)(wI,{clientId:d}),!k&&(0,$.jsx)(YI,{clientIds:t,onCopy:_,shortcut:ma.displayShortcut.primary("c")}),o&&(0,$.jsx)(Ji.MenuItem,{onClick:(0,u.pipe)(r,m,w),shortcut:y.duplicate,children:(0,C.__)("Duplicate")}),i&&!k&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.MenuItem,{onClick:(0,u.pipe)(r,b),shortcut:y.insertBefore,children:(0,C.__)("Add before")}),(0,$.jsx)(Ji.MenuItem,{onClick:(0,u.pipe)(r,f),shortcut:y.insertAfter,children:(0,C.__)("Add after")})]})]}),e&&!k&&(0,$.jsxs)(Ji.MenuGroup,{children:[(0,$.jsx)(YI,{clientIds:t,onCopy:_,label:(0,C.__)("Copy styles")}),(0,$.jsx)(Ji.MenuItem,{onClick:x,children:(0,C.__)("Paste styles")})]}),(0,$.jsx)(KI.Slot,{fillProps:{onClose:r,canMove:l,onMoveTo:S,onlyBlock:h,count:s,firstBlockClientId:d},clientIds:t}),"function"==typeof n?n({onClose:r}):a.Children.map((e=>(0,a.cloneElement)(e,{onClose:r}))),c&&(0,$.jsx)(Ji.MenuGroup,{children:(0,$.jsx)(Ji.MenuItem,{onClick:(0,u.pipe)(r,v,B),shortcut:y.remove,children:(0,C.__)("Delete")})})]})})})}const QI=XI;const JI=function({clientIds:e,...t}){return(0,$.jsx)(Ji.ToolbarGroup,{children:(0,$.jsx)(Ji.ToolbarItem,{children:n=>(0,$.jsx)(QI,{clientIds:e,toggleProps:n,...t})})})};function ej({clientId:e}){const{canLock:t,isLocked:n}=TI(e),[o,r]=(0,a.useReducer)((e=>!e),!1),i=(0,a.useRef)(!1);if((0,a.useEffect)((()=>{n&&(i.current=!0)}),[n]),!n&&!i.current)return null;let s=n?(0,C.__)("Unlock"):(0,C.__)("Lock");return!t&&n&&(s=(0,C.__)("Locked")),(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.ToolbarGroup,{className:"block-editor-block-lock-toolbar",children:(0,$.jsx)(Ji.ToolbarButton,{disabled:!t,icon:n?RI:MI,label:s,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog"})}),o&&(0,$.jsx)(AI,{clientId:e,onClose:r})]})}const tj=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.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"})}),nj=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),oj=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),rj=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),ij={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}};const sj=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=jI(),{replaceBlocks:r}=(0,c.useDispatch)(oi),{canRemove:i,variations:s}=(0,c.useSelect)((e=>{const{canRemoveBlocks:o}=e(oi),{getBlockVariations:r}=e(l.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),a=o=>{const i=(0,l.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),i&&i.length>0&&(i[0].attributes.layout=ij[o],r(t,i))};if(!o||!i)return null;const u=!!s.find((({name:e})=>"group-row"===e)),d=!!s.find((({name:e})=>"group-stack"===e)),p=!!s.find((({name:e})=>"group-grid"===e));return(0,$.jsxs)(Ji.ToolbarGroup,{children:[(0,$.jsx)(Ji.ToolbarButton,{icon:tj,label:(0,C._x)("Group","verb"),onClick:a}),u&&(0,$.jsx)(Ji.ToolbarButton,{icon:nj,label:(0,C._x)("Row","single horizontal line"),onClick:()=>a("row")}),d&&(0,$.jsx)(Ji.ToolbarButton,{icon:oj,label:(0,C._x)("Stack","verb"),onClick:()=>a("stack")}),p&&(0,$.jsx)(Ji.ToolbarButton,{icon:rj,label:(0,C._x)("Grid","verb"),onClick:()=>a("grid")})]})};function lj({clientIds:e}){const t=1===e.length?e[0]:void 0,n=(0,c.useSelect)((e=>!!t&&"html"===e(oi).getBlockMode(t)),[t]),{toggleBlockMode:o}=(0,c.useDispatch)(oi);return n?(0,$.jsx)(Ji.ToolbarGroup,{children:(0,$.jsx)(Ji.ToolbarButton,{onClick:()=>{o(t)},children:(0,C.__)("Edit visually")})}):null}const aj=(0,a.createContext)("");function cj(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function uj(e){return e.contains(e.ownerDocument.activeElement)}function dj({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:n,defaultIndex:o,onIndexChange:r,shouldUseKeyboardFocusShortcut:i,focusEditorOnEscape:s}){const[l]=(0,a.useState)(t),[u]=(0,a.useState)(o),d=(0,a.useCallback)((()=>{!function(e){const[t]=ha.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[e]);(0,$f.useShortcut)("core/block-editor/focus-toolbar",(()=>{i&&d()})),(0,a.useEffect)((()=>{l&&d()}),[n,l,d]),(0,a.useEffect)((()=>{const t=e.current;let n=0;return l||uj(t)||(n=window.requestAnimationFrame((()=>{const e=cj(t),n=u||0;e[n]&&uj(t)&&e[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(n),!r||!t)return;const e=cj(t).findIndex((e=>0===e.tabIndex));r(e)}}),[u,l,r,e]);const{getLastFocus:p}=te((0,c.useSelect)(oi));(0,a.useEffect)((()=>{const t=e.current;if(s){const e=e=>{const t=p();e.keyCode===ma.ESCAPE&&t?.current&&(e.preventDefault(),t.current.focus())};return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}}),[s,p,e])}function pj({children:e,focusOnMount:t,focusEditorOnEscape:n=!1,shouldUseKeyboardFocusShortcut:o=!0,__experimentalInitialIndex:r,__experimentalOnIndexChange:i,orientation:s="horizontal",...l}){const c=(0,a.useRef)(),u=function(e){const[t,n]=(0,a.useState)(!0),o=(0,a.useCallback)((()=>{const t=!ha.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}(c);return dj({toolbarRef:c,focusOnMount:t,defaultIndex:r,onIndexChange:i,isAccessibleToolbar:u,shouldUseKeyboardFocusShortcut:o,focusEditorOnEscape:n}),u?(0,$.jsx)(Ji.Toolbar,{label:l["aria-label"],ref:c,orientation:s,...l,children:e}):(0,$.jsx)(Ji.NavigableMenu,{orientation:s,role:"toolbar",ref:c,...l,children:e})}function hj(e="default"){const t=es[e]?.Slot,n=(0,Ji.__experimentalUseSlotFills)(t?.__unstableName);return t?!!n?.length:null}function gj(){const{isToolbarEnabled:e,isDefaultEditingMode:t}=(0,c.useSelect)((e=>{const{getBlockEditingMode:t,getBlockName:n,getBlockSelectionStart:o}=e(oi),r=o(),i=r&&(0,l.getBlockType)(n(r));return{isToolbarEnabled:i&&(0,l.hasBlockSupport)(i,"__experimentalToolbar",!0),isDefaultEditingMode:"default"===t(r)}}),[]),n=function(){let e=!1;for(const t in es)hj(t)&&(e=!0);return e}();return!(!e||!t&&!n)}function mj({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,variant:r="unstyled"}){const{blockClientId:i,blockClientIds:s,isContentOnlyEditingMode:d,isDefaultEditingMode:p,blockType:h,toolbarKey:g,shouldShowVisualToolbar:m,showParentSelector:f,isUsingBindings:b,hasParentPattern:k,hasContentOnlyLocking:v}=(0,c.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getBlockParents:o,getSelectedBlockClientIds:r,isBlockValid:i,getBlockEditingMode:s,getBlockAttributes:a,getBlockParentsByBlockName:c,getTemplateLock:u}=e(oi),d=r(),p=d[0],h=o(p),g=h[h.length-1],m=t(g),f=(0,l.getBlockType)(m),b=s(p),k="default"===b,v=t(p),_=d.every((e=>i(e))),x=d.every((e=>"visual"===n(e))),y=d.every((e=>!!a(e)?.metadata?.bindings)),S=d.every((e=>c(e,"core/block",!0).length>0)),w=d.some((e=>"contentOnly"===u(e)));return{blockClientId:p,blockClientIds:d,isContentOnlyEditingMode:"contentOnly"===b,isDefaultEditingMode:k,blockType:p&&(0,l.getBlockType)(v),shouldShowVisualToolbar:_&&x,toolbarKey:`${p}${g}`,showParentSelector:f&&"default"===s(g)&&(0,l.hasBlockSupport)(f,"__experimentalParentSelector",!0)&&1===d.length&&k,isUsingBindings:y,hasParentPattern:S,hasContentOnlyLocking:w}}),[]),_=(0,a.useRef)(null),x=(0,a.useRef)(),y=LB({ref:x}),S=!(0,u.useViewportMatch)("medium","<");if(!gj())return null;const w=s.length>1,B=(0,l.isReusableBlock)(h)||(0,l.isTemplatePart)(h),I=$i("block-editor-block-contextual-toolbar",{"has-parent":f}),j=$i("block-editor-block-toolbar",{"is-synced":B,"is-connected":b});return(0,$.jsx)(pj,{focusEditorOnEscape:!0,className:I,"aria-label":(0,C.__)("Block tools"),variant:"toolbar"===r?void 0:r,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,children:(0,$.jsxs)("div",{ref:_,className:j,children:[!w&&S&&p&&(0,$.jsx)(AB,{}),(m||w)&&(p||d&&!k||B)&&(0,$.jsx)("div",{ref:x,...y,children:(0,$.jsxs)(Ji.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls",children:[(0,$.jsx)(sI,{clientIds:s,disabled:!p,isUsingBindings:b}),p&&(0,$.jsxs)($.Fragment,{children:[!w&&(0,$.jsx)(ej,{clientId:i}),(0,$.jsx)(TB,{clientIds:s,hideDragHandle:e})]})]})}),!v&&m&&w&&(0,$.jsx)(sj,{}),m&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ss.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,$.jsx)(ss.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,$.jsx)(ss.Slot,{className:"block-editor-block-toolbar__slot"}),(0,$.jsx)(ss.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,$.jsx)(ss.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,$.jsx)(aj.Provider,{value:h?.name,children:(0,$.jsx)(cI.Slot,{})})]}),(0,$.jsx)(lj,{clientIds:s}),p&&(0,$.jsx)(JI,{clientIds:s})]})},g)}function fj({hideDragHandle:e,variant:t}){return(0,$.jsx)(mj,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0})}function bj({clientId:e,isTyping:t,__unstableContentRef:n}){const{capturingClientId:o,isInsertionPointVisible:r,lastClientId:i}=_B(e),s=(0,a.useRef)();(0,a.useEffect)((()=>{s.current=void 0}),[e]);const{stopTyping:l}=(0,c.useDispatch)(oi),u=(0,a.useRef)(!1);(0,$f.useShortcut)("core/block-editor/focus-toolbar",(()=>{u.current=!0,l(!0)})),(0,a.useEffect)((()=>{u.current=!1}));const d=o||e,p=vB({contentElement:n?.current,clientId:d});return!t&&(0,$.jsx)(Kg,{clientId:d,bottomClientId:i,className:$i("block-editor-block-list__block-popover",{"is-insertion-point-visible":r}),resize:!1,...p,children:(0,$.jsx)(mj,{focusOnMount:u.current,__experimentalInitialIndex:s.current,__experimentalOnIndexChange:e=>{s.current=e},variant:"toolbar"})})}const kj=(0,a.forwardRef)((function({clientId:e,rootClientId:t},n){const o=(0,c.useSelect)((n=>{const{getBlock:o,getBlockIndex:r,hasBlockMovingClientId:i,getBlockListSettings:s,__unstableGetEditorMode:a,getNextBlockClientId:c,getPreviousBlockClientId:u,canMoveBlock:d}=n(oi),{getActiveBlockVariation:p,getBlockType:h}=n(l.store),g=r(e),{name:m,attributes:f}=o(e),b=h(m),k=s(t)?.orientation,v=p(m,f);return{blockMovingMode:i(),editorMode:a(),icon:v?.icon||b.icon,label:(0,l.__experimentalGetAccessibleBlockLabel)(b,f,g+1,k),canMove:d(e,t),getNextBlockClientId:c,getPreviousBlockClientId:u}}),[e,t]),{label:r,icon:i,blockMovingMode:s,editorMode:u,canMove:d}=o,{setNavigationMode:p,removeBlock:h}=(0,c.useDispatch)(oi);(0,a.useEffect)((()=>{"navigation"===u&&(n.current.focus(),(0,Vo.speak)(r))}),[r,u]);const g=mp(e),{hasBlockMovingClientId:m,getBlockIndex:f,getBlockRootClientId:b,getClientIdsOfDescendants:k,getSelectedBlockClientId:v,getMultiSelectedBlocksEndClientId:_,getPreviousBlockClientId:x,getNextBlockClientId:y}=(0,c.useSelect)(oi),{selectBlock:S,clearSelectedBlock:w,setBlockMovingClientId:B,moveBlockToPosition:I}=(0,c.useDispatch)(oi),j=$i("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!s}),E=(0,C.__)("Drag"),T=d&&"navigation"===u;return(0,$.jsx)("div",{className:j,children:(0,$.jsxs)(Ji.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content",children:[(0,$.jsx)(Ji.FlexItem,{children:(0,$.jsx)(zf,{icon:i,showColors:!0})}),T&&(0,$.jsx)(Ji.FlexItem,{children:(0,$.jsx)(yB,{clientIds:[e],children:e=>(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,icon:rS,className:"block-selection-button_drag-handle",label:E,tabIndex:"-1",...e})})}),"navigation"===u&&(0,$.jsx)(Ji.FlexItem,{children:(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,ref:n,onClick:"navigation"===u?()=>p(!1):void 0,onKeyDown:function(t){const{keyCode:n}=t,o=n===ma.UP,r=n===ma.DOWN,i=n===ma.LEFT,s=n===ma.RIGHT,l=n===ma.TAB,a=n===ma.ESCAPE,c=n===ma.ENTER,u=n===ma.SPACE,d=t.shiftKey;if(n===ma.BACKSPACE||n===ma.DELETE)return h(e),void t.preventDefault();const p=v(),C=_(),j=x(C||p),E=y(C||p),T=l&&d||o,M=l&&!d||r,P=i,R=s;let N;if(T)N=j;else if(M)N=E;else if(P){var L;N=null!==(L=b(p))&&void 0!==L?L:p}else if(R){var A;N=null!==(A=k(p)[0])&&void 0!==A?A:p}const D=m();if(a&&D&&!t.defaultPrevented&&(B(null),t.preventDefault()),(c||u)&&D){const e=b(D),t=b(p),n=f(D);let o=f(p);n<o&&e===t&&(o-=1),I(D,e,t,o),S(D),B(null)}if((!D||p!==D||!R)&&(M||T||P||R))if(N)t.preventDefault(),S(N);else if(l&&p){let e;if(M){e=g;do{e=ha.focus.tabbable.findNext(e)}while(e&&g.contains(e));e||(e=g.ownerDocument.defaultView.frameElement,e=ha.focus.tabbable.findNext(e))}else e=ha.focus.tabbable.findPrevious(g);e&&(t.preventDefault(),e.focus(),w())}},label:r,showTooltip:!1,className:"block-selection-button_select-button",children:(0,$.jsx)(dB,{clientId:e,maximumLength:35})})})]})})}));const vj=(0,a.forwardRef)((function({clientId:e,__unstableContentRef:t},n){const{capturingClientId:o,isInsertionPointVisible:r,lastClientId:i,rootClientId:s}=_B(e),l=vB({contentElement:t?.current,clientId:e});return(0,$.jsx)(Wg,{clientId:o||e,bottomClientId:i,className:$i("block-editor-block-list__block-popover",{"is-insertion-point-visible":r}),resize:!1,...l,children:(0,$.jsx)(kj,{ref:n,clientId:e,rootClientId:s})})})),_j=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),xj=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/SVG",children:(0,$.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"})}),yj=[];function Sj(e){return(0,$.jsx)(Ji.ToolbarGroup,{children:(0,$.jsx)(Ji.ToolbarButton,{...e})})}function wj({clientId:e,as:t=Sj}){const{categories:n,patterns:o,patternName:r}=(0,c.useSelect)((t=>{const{getBlockAttributes:n,getBlockRootClientId:o,__experimentalGetAllowedPatterns:r}=t(oi),i=n(e),s=i?.metadata?.categories||yj,l=i?.metadata?.patternName,a=o(e);return{categories:s,patterns:s.length>0?r(a):yj,patternName:l}}),[e]),{replaceBlocks:i}=(0,c.useDispatch)(oi),s=(0,a.useMemo)((()=>0!==n.length&&o&&0!==o.length?o.filter((e=>{const t="core"===e.source||e.source?.startsWith("pattern-directory")&&"pattern-directory/theme"!==e.source;return 1===e.blocks.length&&!t&&e.categories?.some((e=>n.includes(e)))&&("unsynced"===e.syncStatus||!e.id)})):yj),[n,o]);if(s.length<2)return null;const l=t;return(0,$.jsx)(l,{label:(0,C.__)("Shuffle"),icon:xj,className:"block-editor-block-toolbar-shuffle",onClick:()=>{const t=function(){const e=s.length,t=s.findIndex((({name:e})=>e===r));return s[t+1<e?t+1:0]}();t.blocks[0].attributes={...t.blocks[0].attributes,metadata:{...t.blocks[0].attributes.metadata,categories:n}},i(e,t.blocks)}})}function Cj({clientId:e,__unstableContentRef:t}){const n=(0,c.useSelect)((t=>{const{getBlock:n,hasBlockMovingClientId:o,getNextBlockClientId:r,getPreviousBlockClientId:i,canRemoveBlock:s,canMoveBlock:a,getSettings:c}=t(oi),{__experimentalSetIsInserterOpened:u}=c(),{getBlockType:d}=t(l.store),{name:p}=n(e),h=d(p),g="core/template-part"===h?.name;let m=!1;const f=r();if(f){const{name:e}=n(f),t=d(e);m="core/template-part"===t?.name}let b=!1;const k=i();if(k){const{name:e}=n(k),t=d(e);b="core/template-part"===t?.name}return{blockMovingMode:o(),isBlockTemplatePart:g,isNextBlockTemplatePart:m,isPrevBlockTemplatePart:b,canRemove:s(e),canMove:a(e),setIsInserterOpened:u}}),[e]),{blockMovingMode:o,isBlockTemplatePart:r,isNextBlockTemplatePart:i,isPrevBlockTemplatePart:s,canRemove:a,canMove:u,setIsInserterOpened:d}=n,{removeBlock:p,__unstableSetEditorMode:h,resetZoomLevel:g}=te((0,c.useDispatch)(oi)),m=$i("zoom-out-toolbar",{"is-block-moving-mode":!!o}),f=u&&!r;return(0,$.jsxs)(pj,{className:m,"aria-label":(0,C.__)("Block tools"),variant:"unstyled",orientation:"vertical",children:[f&&(0,$.jsx)(yB,{clientIds:[e],children:e=>(0,$.jsx)(Ji.Button,{icon:rS,className:"block-selection-button_drag-handle zoom-out-toolbar-button",label:(0,C.__)("Drag"),iconSize:24,size:"compact",tabIndex:"-1",...e})}),!r&&(0,$.jsx)(TB,{clientIds:[e],hideDragHandle:!0,isBlockMoverUpButtonDisabled:s,isBlockMoverDownButtonDisabled:i,iconSize:24,size:"compact"}),u&&a&&(0,$.jsx)(wj,{clientId:e,as:Ji.ToolbarButton}),!r&&(0,$.jsx)(Ji.ToolbarButton,{className:"zoom-out-toolbar-button",icon:uc,label:(0,C.__)("Edit"),onClick:()=>{"function"==typeof d&&d(!1),h("edit"),g(),t.current?.focus()}}),a&&!r&&(0,$.jsx)(Ji.ToolbarButton,{className:"zoom-out-toolbar-button",icon:_j,label:(0,C.__)("Delete"),onClick:()=>{p(e)}})]})}function Bj({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:r}=_B(e),i={...vB({contentElement:t?.current,clientId:e}),placement:"left-start",flip:!1,shift:!0};return(0,$.jsx)(Kg,{clientId:n||e,bottomClientId:r,className:$i("zoom-out-toolbar-popover",{"is-insertion-point-visible":o}),resize:!1,...i,children:(0,$.jsx)(Cj,{__unstableContentRef:t,clientId:e})})}const Ij=function({isVisible:e,onClick:t}){const[n,o]=(0,a.useState)(!1);return(0,$.jsx)(Ji.Button,{variant:"primary",icon:Pa,size:"compact",className:$i("block-editor-button-pattern-inserter__button","block-editor-block-tools__zoom-out-mode-inserter-button",{"is-visible":e||n}),onClick:t,onMouseOver:()=>{o(!0)},onMouseOut:()=>{o(!1)},label:(0,C._x)("Add pattern","Generic label for pattern inserter button")})};const jj=function(){const[e,t]=(0,a.useState)(!1),{hasSelection:n,blockInsertionPoint:o,blockOrder:r,blockInsertionPointVisible:i,setInserterIsOpened:s,sectionRootClientId:l,selectedBlockClientId:u,hoveredBlockClientId:d}=(0,c.useSelect)((e=>{const{getSettings:t,getBlockInsertionPoint:n,getBlockOrder:o,getSelectionStart:r,getSelectedBlockClientId:i,getHoveredBlockClientId:s,isBlockInsertionPointVisible:l,getSectionRootClientId:a}=te(e(oi)),c=a();return{hasSelection:!!r().clientId,blockInsertionPoint:n(),blockOrder:o(c),blockInsertionPointVisible:l(),sectionRootClientId:c,setInserterIsOpened:t().__experimentalSetIsInserterOpened,selectedBlockClientId:i(),hoveredBlockClientId:s()}}),[]),{showInsertionPoint:p}=(0,c.useDispatch)(oi);return(0,a.useEffect)((()=>{const e=setTimeout((()=>{t(!0)}),500);return()=>{clearTimeout(e)}}),[]),e?[void 0,...r].map(((e,t)=>{const a=i&&o.index===t,c=e,h=r[t],g=n&&(u===c||u===h),m=d===c||d===h;return(0,$.jsx)(gx,{previousClientId:c,nextClientId:h,children:!a&&(0,$.jsx)(Ij,{isVisible:g||m,onClick:()=>{s({rootClientId:l,insertionIndex:t,tab:"patterns",category:"all"}),p(l,t,{operation:"insert"})}})},t)})):null};function Ej(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getSettings:o,__unstableGetEditorMode:r,isTyping:i}=e(oi),s=t()||n(),l=r();return{clientId:s,hasFixedToolbar:o().hasFixedToolbar,isTyping:i(),isZoomOutMode:"zoom-out"===l}}function Tj({children:e,__unstableContentRef:t,...n}){const{clientId:o,hasFixedToolbar:r,isTyping:i,isZoomOutMode:s}=(0,c.useSelect)(Ej,[]),u=(0,$f.__unstableUseShortcutEventMatch)(),{getBlocksByClientId:d,getSelectedBlockClientIds:p,getBlockRootClientId:h,isGroupable:g}=(0,c.useSelect)(oi),{getGroupingBlockName:m}=(0,c.useSelect)(l.store),{showEmptyBlockSideInserter:f,showBreadcrumb:b,showBlockToolbarPopover:k,showZoomOutToolbar:v}=(0,c.useSelect)((e=>{const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlock:o,getBlockMode:r,getSettings:i,hasMultiSelection:s,__unstableGetEditorMode:a,isTyping:c}=e(oi),u=t()||n(),d=o(u),p=a(),h=!!u&&!!d,g=h&&(0,l.isUnmodifiedDefaultBlock)(d)&&"html"!==r(u),m=u&&!c()&&"edit"===p&&g,f=h&&!s()&&"navigation"===p,b="zoom-out"===p&&"full"===d?.attributes?.align&&!m&&!f;return{showEmptyBlockSideInserter:m,showBreadcrumb:!m&&f,showBlockToolbarPopover:!b&&!i().hasFixedToolbar&&!m&&h&&!g&&!f,showZoomOutToolbar:b}}),[]),{clearSelectedBlock:_,duplicateBlocks:x,removeBlocks:y,replaceBlocks:S,insertAfterBlock:w,insertBeforeBlock:B,selectBlock:I,moveBlocksUp:j,moveBlocksDown:E,expandBlock:T}=te((0,c.useDispatch)(oi)),M=(0,a.useRef)();const P=Lg(t),R=Lg(t);return(0,$.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]);j(t,n)}}else if(u("core/block-editor/move-down",e)){const t=p();if(t.length){e.preventDefault();const n=h(t[0]);E(t,n)}}else if(u("core/block-editor/duplicate",e)){const t=p();t.length&&(e.preventDefault(),x(t))}else if(u("core/block-editor/remove",e)){const t=p();t.length&&(e.preventDefault(),y(t))}else if(u("core/block-editor/insert-after",e)){const t=p();t.length&&(e.preventDefault(),w(t[t.length-1]))}else if(u("core/block-editor/insert-before",e)){const t=p();t.length&&(e.preventDefault(),B(t[0]))}else if(u("core/block-editor/unselect",e)){if(e.target.closest("[role=toolbar]"))return;const n=p();n.length>1?(e.preventDefault(),I(n[0])):1===n.length&&e.target===M?.current&&(e.preventDefault(),_(),pB(t.current)?.focus())}else if(u("core/block-editor/collapse-list-view",e)){if((0,ha.isTextField)(e.target)||(0,ha.isTextField)(e.target?.contentWindow?.document?.activeElement))return;e.preventDefault(),T(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);S(t,r),(0,Vo.speak)((0,C.__)("Selected blocks are grouped."))}}},children:(0,$.jsxs)(bx.Provider,{value:(0,a.useRef)(!1),children:[!i&&!s&&(0,$.jsx)(vx,{__unstableContentRef:t}),f&&(0,$.jsx)(xB,{__unstableContentRef:t,clientId:o}),k&&(0,$.jsx)(bj,{__unstableContentRef:t,clientId:o,isTyping:i}),b&&(0,$.jsx)(vj,{ref:M,__unstableContentRef:t,clientId:o}),v&&(0,$.jsx)(Bj,{__unstableContentRef:t,clientId:o}),!s&&!r&&(0,$.jsx)(Ji.Popover.Slot,{name:"block-toolbar",ref:P}),e,(0,$.jsx)(Ji.Popover.Slot,{name:"__unstable-block-tools-after",ref:R}),s&&(0,$.jsx)(jj,{__unstableContentRef:t})]})})}const Mj=window.wp.commands,Pj=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),Rj=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),Nj=()=>{const{replaceBlocks:e,multiSelect:t}=(0,c.useDispatch)(oi),{blocks:n,clientIds:o,canRemove:r,possibleBlockTransformations:i,invalidSelection:s}=(0,c.useSelect)((e=>{const{getBlockRootClientId:t,getBlockTransformItems:n,getSelectedBlockClientIds:o,getBlocksByClientId:r,canRemoveBlocks:i}=e(oi),s=o(),l=r(s);if(l.filter((e=>!e)).length>0)return{invalidSelection:!0};return{blocks:l,clientIds:s,possibleBlockTransformations:n(l,t(s[0])),canRemove:i(s),invalidSelection:!1}}),[]);if(s)return{isLoading:!1,commands:[]};const a=1===n.length&&(0,l.isTemplatePart)(n[0]);function u(r){const i=(0,l.switchToBlockType)(n,r);var s;e(o,i),(s=i).length>1&&t(s[0].clientId,s[s.length-1].clientId)}const d=!!i.length&&r&&!a;if(!o||o.length<1||!d)return{isLoading:!1,commands:[]};return{isLoading:!1,commands:i.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,$.jsx)(zf,{icon:o}),callback:({close:e})=>{u(t),e()}}}))}},Lj=()=>{const{clientIds:e}=(0,c.useSelect)((e=>{const{getSelectedBlockClientIds:t}=e(oi);return{clientIds:t()}}),[]),{getBlockRootClientId:t,canMoveBlocks:n,getBlockCount:o}=(0,c.useSelect)(oi),{setBlockMovingClientId:r,setNavigationMode:i,selectBlock:s}=(0,c.useDispatch)(oi);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:()=>{i(!0),s(e[0]),r(e[0])},icon:Pj}),{isLoading:!1,commands:a.map((e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}})))}},Aj=()=>{const{clientIds:e,isUngroupable:t,isGroupable:n}=(0,c.useSelect)((e=>{const{getSelectedBlockClientIds:t,isUngroupable:n,isGroupable:o}=e(oi);return{clientIds:t(),isUngroupable:n(),isGroupable:o()}}),[]),{canInsertBlockType:o,getBlockRootClientId:r,getBlocksByClientId:i,canRemoveBlocks:s}=(0,c.useSelect)(oi),{getDefaultBlockName:a,getGroupingBlockName:u}=(0,c.useSelect)(l.store),d=i(e),{removeBlocks:p,replaceBlocks:h,duplicateBlocks:g,insertAfterBlock:m,insertBeforeBlock:f}=(0,c.useDispatch)(oi),b=()=>{if(!d.length)return;const t=u(),n=(0,l.switchToBlockType)(d,t);n&&h(e,n)},k=()=>{if(!d.length)return;const t=d[0].innerBlocks;t.length&&h(e,t)};if(!e||e.length<1)return{isLoading:!1,commands:[]};const v=r(e[0]),_=o(a(),v),x=d.every((e=>!!e&&(0,l.hasBlockSupport)(e.name,"multiple",!0)&&o(e.name,v))),y=s(e),S=[];return x&&S.push({name:"duplicate",label:(0,C.__)("Duplicate"),callback:()=>g(e,!0),icon:DB}),_&&S.push({name:"add-before",label:(0,C.__)("Add before"),callback:()=>{const t=Array.isArray(e)?e[0]:t;f(t)},icon:Pa},{name:"add-after",label:(0,C.__)("Add after"),callback:()=>{const t=Array.isArray(e)?e[e.length-1]:t;m(t)},icon:Pa}),n&&S.push({name:"Group",label:(0,C.__)("Group"),callback:b,icon:tj}),t&&S.push({name:"ungroup",label:(0,C.__)("Ungroup"),callback:k,icon:Rj}),y&&S.push({name:"remove",label:(0,C.__)("Delete"),callback:()=>p(e,!0),icon:_j}),{isLoading:!1,commands:S.map((e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}})))}},Dj=()=>{(0,Mj.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:Nj}),(0,Mj.useCommandLoader)({name:"core/block-editor/blockActions",hook:Lj}),(0,Mj.useCommandLoader)({name:"core/block-editor/blockQuickActions",hook:Aj,context:"block-selection-edit"})},Oj={ignoredSelectors:[/\.editor-styles-wrapper/gi]};function zj({shouldIframe:e=!0,height:t="300px",children:n=(0,$.jsx)(Qx,{}),styles:o,contentRef:r,iframeProps:i}){Dj();const s=$x(),l=xx(),c=(0,a.useRef)(),d=(0,u.useMergeRefs)([r,l,c]);return e?(0,$.jsx)(Tj,{__unstableContentRef:c,style:{height:t,display:"flex"},children:(0,$.jsxs)(By,{...i,ref:s,contentRef:d,style:{...i?.style},name:"editor-canvas",children:[(0,$.jsx)(Ky,{styles:o}),n]})}):(0,$.jsxs)(Tj,{__unstableContentRef:c,style:{height:t,display:"flex"},children:[(0,$.jsx)(Ky,{styles:o,scope:":where(.editor-styles-wrapper)",transformOptions:Oj}),(0,$.jsx)(xy,{ref:d,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%"},children:n})]})}const Vj=function({children:e,height:t,styles:n}){return(0,$.jsx)(zj,{height:t,styles:n,children:e})},Fj=()=>(0,$.jsx)(Ji.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:(0,$.jsx)(Ji.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"})}),Hj=({style:e,className:t})=>(0,$.jsx)("div",{className:"block-library-colors-selector__icon-container",children:(0,$.jsx)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e,children:(0,$.jsx)(Fj,{})})}),Gj=({TextColor:e,BackgroundColor:t})=>({onToggle:n,isOpen:o})=>(0,$.jsx)(Ji.ToolbarGroup,{children:(0,$.jsx)(Ji.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,C.__)("Open Colors Selector"),onClick:n,onKeyDown:e=>{o||e.keyCode!==ma.DOWN||(e.preventDefault(),n())},icon:(0,$.jsx)(t,{children:(0,$.jsx)(e,{children:(0,$.jsx)(Hj,{})})})})}),$j=({children:e,...t})=>(y()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,$.jsx)(Ji.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Gj(t),renderContent:()=>e})),Uj=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.jsx)(G.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),Wj=(0,a.createContext)({}),Kj=()=>(0,a.useContext)(Wj);function Zj({children:e,...t}){const n=(0,a.useRef)();return(0,a.useEffect)((()=>{n.current&&(n.current.textContent=n.current.textContent)}),[e]),(0,$.jsx)("div",{hidden:!0,...t,ref:n,children:e})}const qj=(0,a.forwardRef)((({nestingLevel:e,blockCount:t,clientId:n,...o},r)=>{const{insertedBlock:i,setInsertedBlock:s}=Kj(),l=(0,u.useInstanceId)(qj),d=(0,c.useSelect)((e=>{const{getTemplateLock:t,__unstableGetEditorMode:o}=e(oi);return!!t(n)||"zoom-out"===o()}),[n]),p=uB({clientId:n,context:"list-view"}),h=uB({clientId:i?.clientId,context:"list-view"});if((0,a.useEffect)((()=>{h?.length&&(0,Vo.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,$.jsxs)("div",{className:"list-view-appender",children:[(0,$.jsx)(Zw,{ref:r,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0,...o,toggleProps:{"aria-describedby":g},onSelectOrClose:e=>{e?.clientId&&s(e)}}),(0,$.jsx)(Zj,{id:g,children:m})]})})),Yj=z_(Ji.__experimentalTreeGridRow),Xj=(0,a.forwardRef)((({isDragged:e,isSelected:t,position:n,level:o,rowCount:r,children:i,className:s,path:l,...a},c)=>{const d=F_({clientId:a["data-block"],enableAnimation:!0,triggerAnimationOnChange:l}),p=(0,u.useMergeRefs)([c,d]);return(0,$.jsx)(Yj,{ref:p,className:$i("block-editor-list-view-leaf",s),level:o,positionInSet:n,setSize:r,isExpanded:void 0,...a,children:i})})),Qj=Xj;const Jj=(0,$.jsx)(G.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.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"})}),eE=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.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 tE({onClick:e}){return(0,$.jsx)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander",children:(0,$.jsx)(cl,{icon:(0,C.isRTL)()?Ca:Ba})})}const nE=3;function oE(e){if("core/image"===e.name)return e.attributes?.url?{url:e.attributes.url,alt:e.attributes.alt,clientId:e.clientId}:void 0}function rE(e,t){const n=oE(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=oE(n);if(e&&t.push(e),t.length>=nE)return t}return t}(e)}const iE=(0,a.forwardRef)((function({className:e,block:{clientId:t},onClick:n,onContextMenu:o,onMouseDown:r,onToggleExpanded:i,tabIndex:s,onFocus:l,onDragStart:u,onDragEnd:d,draggable:p,isExpanded:h,ariaDescribedBy:g},m){const f=zm(t),b=uB({clientId:t,context:"list-view"}),{isLocked:k}=TI(t),{isContentOnly:v}=(0,c.useSelect)((e=>({isContentOnly:"contentOnly"===e(oi).getBlockEditingMode(t)})),[t]),_=k&&!v,x="sticky"===f?.positionType,y=function({clientId:e,isExpanded:t}){const{block:n}=(0,c.useSelect)((t=>({block:t(oi).getBlock(e)})),[e]);return(0,a.useMemo)((()=>rE(n,t)),[n,t])}({clientId:t,isExpanded:h});return(0,$.jsxs)(Ji.Button,{__next40pxDefaultSize:!1,className:$i("block-editor-list-view-block-select-button",e),onClick:n,onContextMenu:o,onKeyDown:function(e){e.keyCode!==ma.ENTER&&e.keyCode!==ma.SPACE||n(e)},onMouseDown:r,ref:m,tabIndex:s,onFocus:l,onDragStart:e=>{e.dataTransfer.clearData(),u?.(e)},onDragEnd:d,draggable:p,href:`#block-${t}`,"aria-describedby":g,"aria-expanded":h,children:[(0,$.jsx)(tE,{onClick:i}),(0,$.jsx)(zf,{icon:f?.icon,showColors:!0,context:"list-view"}),(0,$.jsxs)(Ji.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[(0,$.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,$.jsx)(Ji.__experimentalTruncate,{ellipsizeMode:"auto",children:b})}),f?.anchor&&(0,$.jsx)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:(0,$.jsx)(Ji.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto",children:f.anchor})}),x&&(0,$.jsx)("span",{className:"block-editor-list-view-block-select-button__sticky",children:(0,$.jsx)(cl,{icon:Jj})}),y.length?(0,$.jsx)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:y.map(((e,t)=>(0,$.jsx)("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${e.url})`,zIndex:y.length-t}},e.clientId)))}):null,_&&(0,$.jsx)("span",{className:"block-editor-list-view-block-select-button__lock",children:(0,$.jsx)(cl,{icon:eE})})]})]})})),sE=(0,a.forwardRef)((({onClick:e,onToggleExpanded:t,block:n,isSelected:o,position:r,siblingBlockCount:i,level:s,isExpanded:l,selectedClientIds:a,...u},d)=>{const{clientId:p}=n,{blockMovingClientId:h,selectedBlockInBlockEditor:g}=(0,c.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(oi);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[]),{AdditionalBlockContent:m,insertedBlock:f,setInsertedBlock:b}=Kj(),k=$i("block-editor-list-view-block-contents",{"is-dropping-before":h&&g===p}),v=a.includes(p)?a:[p];return(0,$.jsxs)($.Fragment,{children:[m&&(0,$.jsx)(m,{block:n,insertedBlock:f,setInsertedBlock:b}),(0,$.jsx)(yB,{appendToOwnerDocument:!0,clientIds:v,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:a,onDragStart:c,onDragEnd:p})=>(0,$.jsx)(iE,{ref:d,className:k,block:n,onClick:e,onToggleExpanded:t,isSelected:o,position:r,siblingBlockCount:i,level:s,draggable:a,onDragStart:c,onDragEnd:p,isExpanded:l,...u})})]})})),lE=sE;function aE(e,t){const n=()=>{const n=t?.querySelector(`[role=row][data-block="${e}"]`);return n?ha.focus.focusable.find(n)[0]:null};let o=n();o?o.focus():window.requestAnimationFrame((()=>{o=n(),o&&o.focus()}))}const cE=(0,a.memo)((function e({block:{clientId:t},displacement:n,isAfterDraggedBlocks:o,isDragged:r,isNesting:i,isSelected:s,isBranchSelected:d,selectBlock:p,position:h,level:g,rowCount:m,siblingBlockCount:f,showBlockMovers:b,path:k,isExpanded:v,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}=TI(t),R=s&&_[0]===t,N=s&&_[_.length-1]===t,{toggleBlockHighlight:L,duplicateBlocks:A,multiSelect:D,replaceBlocks:O,removeBlocks:z,insertAfterBlock:V,insertBeforeBlock:F,setOpenedBlockSettingsMenu:H}=te((0,c.useDispatch)(oi)),{canInsertBlockType:G,getSelectedBlockClientIds:U,getPreviousBlockClientId:W,getBlockRootClientId:K,getBlockOrder:Z,getBlockParents:q,getBlocksByClientId:Y,canRemoveBlocks:X,isGroupable:Q}=(0,c.useSelect)(oi),{getGroupingBlockName:J}=(0,c.useSelect)(l.store),ee=zm(t),{block:ne,blockName:oe,allowRightClickOverrides:re}=(0,c.useSelect)((e=>{const{getBlock:n,getBlockName:o,getSettings:r}=e(oi);return{block:n(t),blockName:o(t),allowRightClickOverrides:r().allowRightClickOverrides}}),[t]),ie=(0,l.hasBlockSupport)(oe,"__experimentalToolbar",!0),se=`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}=Kj(),fe=(0,$f.__unstableUseShortcutEventMatch)();function be(){const e=U(),n=e.includes(t),o=n?e[0]:t,r=K(o);return{blocksToUpdate:n?e:[t],firstBlockClientId:o,firstBlockRootClientId:r,selectedBlockClientIds:e}}const ke=(0,a.useCallback)((()=>{I(!0),L(t,!0)}),[t,I,L]),ve=(0,a.useCallback)((()=>{I(!1),L(t,!1)}),[t,I,L]),_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),aE(e,ge?.current)}),[p,ge]),ye=(0,a.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===v?ae(t):!1===v&&le(t)}),[t,le,ae,v]),Se=(0,a.useCallback)((e=>{ie&&re&&(w.current?.click(),E(new window.DOMRect(e.clientX,e.clientY,0,0)),e.preventDefault())}),[re,w,ie]),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,ha.getScrollContainer)(n.current),{ownerDocument:r}=n.current;if(t===r.body||t===r.documentElement||!t)return;const i=n.current.getBoundingClientRect(),s=t.getBoundingClientRect();(i.top<s.top||i.bottom>s.bottom)&&n.current.scrollIntoView()}),[e,o,n])}({isSelected:s,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,t)=>[e?.positionLabel?`${(0,C.sprintf)((0,C.__)("Position: %s"),e.positionLabel)}.`:void 0,t?(0,C.__)("This block is locked."):void 0].filter(Boolean).join(" "))(ee,T),Ee=b&&f>0,Te=$i("block-editor-list-view-block__mover-cell",{"is-visible":B||s}),Me=$i("block-editor-list-view-block__menu-cell",{"is-visible":B||R});let Pe;Ee?Pe=2:ie||(Pe=3);const Re=$i({"is-selected":s,"is-first-selected":R,"is-last-selected":N,"is-branch-selected":d,"is-synced-branch":x,"is-dragging":r,"has-single-cell":!ie,"is-synced":ee?.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":i}),Ne=_.includes(t)?_:[t],Le=s&&1===_.length;return(0,$.jsxs)(Qj,{className:Re,isDragged:r,onKeyDown:async function(e){if(e.defaultPrevented)return;if(e.target.closest("[role=dialog]"))return;const t=[ma.BACKSPACE,ma.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 i=null!==(n=W(t))&&void 0!==n?n:o;z(e,!1);const s=r.length>0&&0===U().length;i||(i=Z()[0]),xe(i,s)}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 A(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=U();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=U();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(ya()(n,o)&&t&&t!==me)return void xe(t,!0);D(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&&Q(t)){e.preventDefault();const n=Y(t),o=J(),r=(0,l.switchToBlockType)(n,o);O(t,r),(0,Vo.speak)((0,C.__)("Selected blocks are grouped."));const i=U();H(void 0),xe(i[0],!1)}}},onMouseEnter:ke,onMouseLeave:ve,onFocus:ke,onBlur:ve,level:g,position:h,rowCount:m,path:k,id:`list-view-${de}-block-${t}`,"data-block":t,"data-expanded":M?v:void 0,ref:S,children:[(0,$.jsx)(Ji.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Pe,ref:y,"aria-selected":!!s,children:({ref:e,tabIndex:t,onFocus:n})=>(0,$.jsxs)("div",{className:"block-editor-list-view-block__contents-container",children:[(0,$.jsx)(lE,{block:ne,onClick:_e,onContextMenu:Se,onMouseDown:we,onToggleExpanded:ye,isSelected:s,position:h,siblingBlockCount:f,level:g,ref:e,tabIndex:Le?0:t,onFocus:n,isExpanded:M?v:void 0,selectedClientIds:_,ariaDescribedBy:se}),(0,$.jsx)(Zj,{id:se,children:[Ie,je].filter(Boolean).join(" ")})]})}),Ee&&(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(Ji.__experimentalTreeGridCell,{className:Te,withoutGridItem:!0,children:[(0,$.jsx)(Ji.__experimentalTreeGridItem,{children:({ref:e,tabIndex:n,onFocus:o})=>(0,$.jsx)(jB,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o})}),(0,$.jsx)(Ji.__experimentalTreeGridItem,{children:({ref:e,tabIndex:n,onFocus:o})=>(0,$.jsx)(EB,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o})})]})}),ie&&ue&&(0,$.jsx)(Ji.__experimentalTreeGridCell,{className:Me,"aria-selected":!!s,ref:w,children:({ref:e,tabIndex:t,onFocus:n})=>(0,$.jsx)(ue,{clientIds:Ne,block:ne,icon:tb,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 uE(e,t,n,o){var r;const i=n?.includes(e.clientId);if(i)return 0;return(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(dE(t,n,o),0):1}const dE=(e,t,n)=>(o,r)=>{var i;const s=t?.includes(r.clientId);if(s)return o;return(null!==(i=e[r.clientId])&&void 0!==i?i:n)&&r.innerBlocks.length>0?o+uE(r,e,t,n):o+1},pE=()=>{};const hE=(0,a.memo)((function e(t){const{blocks:n,selectBlock:o=pE,showBlockMovers:r,selectedClientIds:i,level:s=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=zm(h),k=m||!!b?.isSynced,v=(0,c.useSelect)((e=>!h||e(oi).canEditBlock(h)),[h]),{blockDropPosition:_,blockDropTargetIndex:x,firstDraggedBlockIndex:y,blockIndexes:S,expandedState:w,draggedClientIds:C}=Kj();if(!v)return null;const B=f&&1===s,I=n.filter(Boolean),j=I.length,E=B?j+1:j;let T=u;return(0,$.jsxs)($.Fragment,{children:[I.map(((t,n)=>{var u;const{clientId:h,innerBlocks:m}=t;n>0&&(T+=uE(I[n-1],w,C,p));const f=!!C?.includes(h),{displacement:b,isAfterDraggedBlocks:v,isNesting:B}=function({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:n,clientId:o,firstDraggedBlockIndex:r,isDragged:i}){let s,l,a;if(!i){l=!1;const i=e[o];a=i>r,null!=t&&void 0!==r?void 0!==i&&(s=i>=r&&i<t?"up":i<r&&i>=t?"down":"normal",l="number"==typeof t&&t-1===i&&"inside"===n):null===t&&void 0!==r?s=void 0!==i&&i>=r?"up":"normal":null!=t&&void 0===r?void 0!==i&&(s=i<t?"normal":"down"):null===t&&(s="normal")}return{displacement:s,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}`,L=!!m?.length,A=L&&g?null!==(u=w[h])&&void 0!==u?u:p:void 0,D=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(h,i),O=a||D&&L,z=f||P||D&&h===i[0]||0===n||n===j-1;return(0,$.jsxs)(c.AsyncModeProvider,{value:!D,children:[z&&(0,$.jsx)(cE,{block:t,selectBlock:o,isSelected:D,isBranchSelected:O,isDragged:f,level:s,position:R,rowCount:E,siblingBlockCount:j,showBlockMovers:r,path:N,isExpanded:!f&&A,listPosition:T,selectedClientIds:i,isSyncedBranch:k,displacement:b,isAfterDraggedBlocks:v,isNesting:B}),!z&&(0,$.jsx)("tr",{children:(0,$.jsx)("td",{className:"block-editor-list-view-placeholder"})}),L&&A&&!f&&(0,$.jsx)(e,{parentId:h,blocks:m,selectBlock:o,showBlockMovers:r,level:s+1,path:N,listPosition:T+1,fixedListWindow:d,isBranchSelected:O,selectedClientIds:i,isExpanded:p,isSyncedBranch:k})]},h)})),B&&(0,$.jsx)(Ji.__experimentalTreeGridRow,{level:s,setSize:E,positionInSet:E,isExpanded:!0,children:(0,$.jsx)(Ji.__experimentalTreeGridCell,{children:e=>(0,$.jsx)(qj,{clientId:h,nestingLevel:s,blockCount:j,...e})})})]})}));function gE({draggedBlockClientId:e,listViewRef:t,blockDropTarget:n}){const o=zm(e),r=uB({clientId:e,context:"list-view"}),{rootClientId:i,clientId:s,dropPosition:l}=n||{},[c,u]=(0,a.useMemo)((()=>{if(!t.current)return[];return[i?t.current.querySelector(`[data-block="${i}"]`):void 0,s?t.current.querySelector(`[data-block="${s}"]`):void 0]}),[t,i,s]),d=u||c,p=(0,C.isRTL)(),h=(0,a.useCallback)(((e,t)=>{if(!d)return 0;let n=d.offsetWidth;const o=(0,ha.getScrollContainer)(d,"horizontal"),r=d.ownerDocument,i=o===r.body||o===r.documentElement;if(o&&!i){const r=o.getBoundingClientRect(),i=(0,C.isRTL)()?r.right-e.right:e.left-r.left,s=o.clientWidth;if(s<n+i&&(n=s-i),!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,ha.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]),k=(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,ha.getScrollContainer)(d,"horizontal"),r=d.ownerDocument,i=o===r.body||o===r.documentElement;if(o&&!i){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 s=h(e,0),a=e.height;return new window.DOMRect(t,n,s,a)}}}),[d,l,h,p]);return d?(0,$.jsx)(Ji.Popover,{animate:!1,anchor:k,focusOnMount:!1,className:"block-editor-list-view-drop-indicator--preview",variant:"unstyled",flip:!1,resize:!0,children:(0,$.jsx)("div",{style:g,className:$i("block-editor-list-view-drop-indicator__line",{"block-editor-list-view-drop-indicator__line--darker":b}),children:(0,$.jsxs)("div",{className:"block-editor-list-view-leaf","aria-level":f,children:[(0,$.jsxs)("div",{className:$i("block-editor-list-view-block-select-button","block-editor-list-view-block-contents"),style:m,children:[(0,$.jsx)(tE,{onClick:()=>{}}),(0,$.jsx)(zf,{icon:o?.icon,showColors:!0,context:"list-view"}),(0,$.jsx)(Ji.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:(0,$.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,$.jsx)(Ji.__experimentalTruncate,{ellipsizeMode:"auto",children:r})})})]}),(0,$.jsx)("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}function mE(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,c.useDispatch)(oi),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:i,getSelectedBlockClientIds:s,hasMultiSelection:u,hasSelectedBlock:d}=(0,c.useSelect)(oi),{getBlockType:p}=(0,c.useSelect)(l.store);return{updateBlockSelection:(0,a.useCallback)((async(l,a,c,h)=>{if(!l?.shiftKey&&l?.keyCode!==ma.ESCAPE)return void n(a,h);l.preventDefault();const g="keydown"===l.type&&l.keyCode===ma.ESCAPE,m="keydown"===l.type&&(l.keyCode===ma.UP||l.keyCode===ma.DOWN||l.keyCode===ma.HOME||l.keyCode===ma.END);if(!m&&!d()&&!u())return void n(a,null);const f=s(),b=[...r(a),a];if((g||m&&!f.some((e=>b.includes(e))))&&await e(),!g){let e=i(),n=a;m&&(d()||u()||(e=a),c&&(n=c));const o=r(e),s=r(n),{start:l,end:p}=function(e,t,n,o){const r=[...n,e],i=[...o,t],s=Math.min(r.length,i.length)-1;return{start:r[s],end:i[s]}}(e,n,o,s);await t(l,p,null)}const k=s();if((l.keyCode===ma.HOME||l.keyCode===ma.END)&&k.length>1)return;const v=f.filter((e=>!k.includes(e)));let _;if(1===v.length){const e=p(o(v[0]))?.title;e&&(_=(0,C.sprintf)((0,C.__)("%s deselected."),e))}else v.length>1&&(_=(0,C.sprintf)((0,C.__)("%s blocks deselected."),v.length));_&&(0,Vo.speak)(_,"assertive")}),[e,o,p,r,i,s,u,d,t,n])}}const fE=24;function bE(e,t){const n=e[t+1];return n&&n.isDraggedBlock?bE(e,t+1):n}const kE=["top","bottom"];function vE(e,t,n=!1){let o,r,i,s,l;for(let n=0;n<e.length;n++){const a=e[n];if(a.isDraggedBlock)continue;const c=a.element.getBoundingClientRect(),[u,d]=Ix(t,c,kE),p=jx(t,c);if(void 0===i||u<i||p){i=u;const t=e.indexOf(a),n=e[t-1];if("top"===d&&n&&n.rootClientId===a.rootClientId&&!n.isDraggedBlock?(r=n,o="bottom",s=n.element.getBoundingClientRect(),l=t-1):(r=a,o=d,s=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*fE:t.left+n*fE;return(o?e.x<r-fE:e.x>r+fE)&&e.y<t.bottom}(t,s,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*fE:t.left+n*fE;return o?e.x>r:e.x<r}(t,s,a.length,n)){const i=bE(e,l),c=r.nestingLevel,u=i?i.nestingLevel:1;if(c&&u){const d=function(e,t,n=1,o=!1){const r=o?t.right-n*fE:t.left+n*fE,i=o?r-e.x:e.x-r,s=Math.round(i/fE);return Math.abs(s)}(t,s,a.length,n),p=Math.max(Math.min(d,c-u),0);if(a[p]){let t=r.blockIndex;if(a[p].nestingLevel===i?.nestingLevel)t=i?.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 _E={leading:!1,trailing:!0};function xE({selectBlock:e}){const t=(0,c.useRegistry)(),{getBlockOrder:n,getBlockRootClientId:o,getBlocksByClientId:r,getPreviousBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a,canInsertBlockType:d,canRemoveBlocks:p}=(0,c.useSelect)(oi),{flashBlock:h,removeBlocks:g,replaceBlocks:m,insertBlocks:f}=(0,c.useDispatch)(oi),b=my();return(0,u.useRefEffect)((c=>{function u(t,n){n&&e(void 0,t,null,null),aE(t,c)}function k(e){if(e.defaultPrevented)return;if(!c.contains(e.target.ownerDocument.activeElement))return;const k=e.target.ownerDocument.activeElement?.closest("[role=row]"),v=k?.dataset?.block;if(!v)return;const{blocksToUpdate:_,firstBlockClientId:x,firstBlockRootClientId:y,originallySelectedBlockClientIds:S}=function(e){const t=s(),n=t.includes(e),r=n?t[0]:e;return{blocksToUpdate:n?t:[e],firstBlockClientId:r,firstBlockRootClientId:o(r),originallySelectedBlockClientIds:t}}(v);if(0!==_.length){if(e.preventDefault(),"copy"===e.type||"cut"===e.type){1===_.length&&h(_[0]),b(e.type,_);ky(e,r(_),t)}if("cut"===e.type){var w;if(!p(_))return;let e=null!==(w=i(x))&&void 0!==w?w:y;g(_,!1);const t=S.length>0&&0===s().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}=fy(e);let i=[];if(r.length){const e=(0,l.getBlockTransforms)("from");i=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 i=(0,l.pasteHandler)({HTML:o,plainText:n,mode:"BLOCKS",canUserUseUnfilteredHTML:t});return i}(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",k),c.ownerDocument.addEventListener("cut",k),c.ownerDocument.addEventListener("paste",k),()=>{c.ownerDocument.removeEventListener("copy",k),c.ownerDocument.removeEventListener("cut",k),c.ownerDocument.removeEventListener("paste",k)}}),[])}const yE=(e,t)=>"clear"===t.type?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;const SE=(0,a.forwardRef)((function e({id:t,blocks:n,dropZoneElement:o,showBlockMovers:r=!1,isExpanded:i=!1,showAppender:s=!1,blockSettingsMenu:l=XI,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:k,selectedClientIds:v}=function({blocks:e,rootClientId:t}){return(0,c.useSelect)((n=>{const{getDraggedBlockClientIds:o,getSelectedBlockClientIds:r,getEnabledClientIdsTree:i}=te(n(oi));return{selectedClientIds:r(),draggedClientIds:o(),clientIdsTree:null!=e?e:i(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)(oi),{visibleBlockCount:S}=(0,c.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(oi),o=k?.length>0?n(k).length+1:0;return{visibleBlockCount:t()-o}}),[k]),{updateBlockSelection:w}=mE(),[B,I]=(0,a.useReducer)(yE,{}),[j,E]=(0,a.useState)(null),{setSelectedTreeId:T}=function({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,o]=(0,a.useState)(null),{selectedBlockParentClientIds:r}=(0,c.useSelect)((t=>{const{getBlockParents:n}=t(oi);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:v[0],setExpandedState:I}),M=(0,a.useCallback)(((e,t,n)=>{w(e,t,null,n),T(t),h&&h(x(t))}),[T,w,h,x]),{ref:P,target:R}=function({dropZoneElement:e,expandedState:t,setExpandedState:n}){const{getBlockRootClientId:o,getBlockIndex:r,getBlockCount:i,getDraggedBlockClientIds:s,canInsertBlocks:l}=(0,c.useSelect)(oi),[d,p]=(0,a.useState)(),{rootClientId:h,blockIndex:g}=d||{},m=Bx(h,g),f=(0,C.isRTL)(),b=(0,u.usePrevious)(h),k=(0,a.useCallback)(((e,t)=>{const{rootClientId:o}=t||{};o&&("inside"!==t?.dropPosition||e[o]||n({type:"expand",clientIds:[o]}))}),[n]),v=(0,u.useThrottle)(k,500,_E);(0,a.useEffect)((()=>{"inside"===d?.dropPosition&&b===d?.rootClientId?v(t,d):v.cancel()}),[t,b,d,v]);const _=s(),x=(0,u.useThrottle)((0,a.useCallback)(((e,t)=>{const n={x:e.clientX,y:e.clientY},s=!!_?.length,a=vE(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:!!s&&a,innerBlockCount:i(t),canInsertDraggedBlocksAsSibling:!s||l(_,u),canInsertDraggedBlocksAsChild:!s||l(_,t)}})),n,f);a&&p(a)}),[l,_,i,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:B,setExpandedState:I}),N=(0,a.useRef)(),L=xE({selectBlock:M}),A=(0,u.useMergeRefs)([L,N,P,m]);(0,a.useEffect)((()=>{v?.length&&aE(v[0],N?.current)}),[]);const D=(0,a.useCallback)((e=>{if(!e)return;const t=Array.isArray(e)?e:[e];I({type:"expand",clientIds:t})}),[I]),O=(0,a.useCallback)((e=>{e&&I({type:"collapse",clientIds:[e]})}),[I]),z=(0,a.useCallback)((()=>{I({type:"clear"})}),[I]),V=(0,a.useCallback)((e=>{D(e?.dataset?.block)}),[D]),F=(0,a.useCallback)((e=>{O(e?.dataset?.block)}),[O]),H=(0,a.useCallback)(((e,t,n)=>{e.shiftKey&&w(e,t?.dataset?.block,n?.dataset?.block)}),[w]);!function({collapseAll:e,expand:t}){const{expandedBlock:n,getBlockParents:o}=(0,c.useSelect)((e=>{const{getBlockParents:t,getExpandedBlock:n}=te(e(oi));return{expandedBlock:n(),getBlockParents:t}}),[]);(0,a.useEffect)((()=>{if(n){const r=o(n,!1);e(),t(r)}}),[e,t,n,o])}({collapseAll:z,expand:D});const G=k?.[0],{blockDropTargetIndex:U,blockDropPosition:W,firstDraggedBlockIndex:K}=(0,a.useMemo)((()=>{let e,t;if(R?.clientId){const t=_[R.clientId];e=void 0===t||"top"===R?.dropPosition?t:t+1}else null===R&&(e=null);if(G){const e=_[G];t=void 0===e||"top"===R?.dropPosition?e:e+1}return{blockDropTargetIndex:e,blockDropPosition:R?.dropPosition,firstDraggedBlockIndex:t}}),[R,_,G]),Z=(0,a.useMemo)((()=>({blockDropPosition:W,blockDropTargetIndex:U,blockIndexes:_,draggedClientIds:k,expandedState:B,expand:D,firstDraggedBlockIndex:K,collapse:O,collapseAll:z,BlockSettingsMenu:l,listViewInstanceId:f,AdditionalBlockContent:g,insertedBlock:j,setInsertedBlock:E,treeGridElementRef:N,rootClientId:d})),[W,U,_,k,B,D,K,O,z,l,f,g,j,E,d]),[q]=(0,u.__experimentalUseFixedWindowList)(N,32,S,{expandedState:B,useWindowing:!0,windowOverscan:40});if(!b.length&&!s)return null;const Y=p&&`block-editor-list-view-description-${f}`;return(0,$.jsxs)(c.AsyncModeProvider,{value:!0,children:[(0,$.jsx)(gE,{draggedBlockClientId:G,listViewRef:N,blockDropTarget:R}),p&&(0,$.jsx)(Ji.VisuallyHidden,{id:Y,children:p}),(0,$.jsx)(Ji.__experimentalTreeGrid,{id:t,className:$i("block-editor-list-view-tree",{"is-dragging":k?.length>0&&void 0!==U}),"aria-label":(0,C.__)("Block navigation structure"),ref:A,onCollapseRow:F,onExpandRow:V,onFocusRow:H,applicationAriaLabel:(0,C.__)("Block navigation structure"),"aria-describedby":Y,style:{"--wp-admin--list-view-dragged-items-height":k?.length?32*(k.length-1)+"px":null},children:(0,$.jsx)(Wj.Provider,{value:Z,children:(0,$.jsx)(hE,{blocks:b,parentId:d,selectBlock:M,showBlockMovers:r,fixedListWindow:q,selectedClientIds:v,isExpanded:i,showAppender:s})})})]})})),wE=(0,a.forwardRef)(((e,t)=>(0,$.jsx)(SE,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0})));function CE({isEnabled:e,onToggle:t,isOpen:n,innerRef:o,...r}){return(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,...r,ref:o,icon:Uj,"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 BE=(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(oi).getBlockCount()),[])&&!e;return(0,$.jsx)(Ji.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:e,onToggle:r})=>(0,$.jsx)(CE,{...t,innerRef:n,isOpen:e,onToggle:r,isEnabled:o}),renderContent:()=>(0,$.jsxs)("div",{className:"block-editor-block-navigation__container",children:[(0,$.jsx)("p",{className:"block-editor-block-navigation__label",children:(0,C.__)("List view")}),(0,$.jsx)(wE,{})]})})}));function IE({genericPreviewBlock:e,style:t,className:n,activeStyle:o}){const r=(0,l.getBlockType)(e.name)?.example,i=UB(n,o,t),s=(0,a.useMemo)((()=>({...e,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:i+" block-editor-block-styles__block-preview-container"},example:r})),[e,i]);return(0,$.jsx)(nS,{item:s})}const jE=()=>{};const EE=function({clientId:e,onSwitch:t=jE,onHoverClassName:n=jE}){const{onSelect:o,stylesToRender:r,activeStyle:i,genericPreviewBlock:s,className:l}=KB({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,$.jsxs)("div",{className:"block-editor-block-styles",children:[(0,$.jsx)("div",{className:"block-editor-block-styles__variants",children:r.map((e=>{const t=e.label||e.name;return(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!0,className:$i("block-editor-block-styles__item",{"is-active":i.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":i.name===e.name,children:(0,$.jsx)(Ji.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:t})},e.name)}))}),c&&!p&&(0,$.jsx)(Ji.Popover,{placement:"left-start",offset:34,focusOnMount:!1,children:(0,$.jsx)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>g(null),children:(0,$.jsx)(IE,{activeStyle:i,className:l,genericPreviewBlock:s,style:c})})})]})},TE={0:(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})}),2:(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(G.Path,{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})}),5:(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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 ME({level:e}){return TE[e]?(0,$.jsx)(Ji.Icon,{icon:TE[e]}):null}const PE=[1,2,3,4,5,6],RE={className:"block-library-heading-level-dropdown"};function NE({options:e=PE,value:t,onChange:n}){const o=e.filter((e=>0===e||PE.includes(e))).sort(((e,t)=>e-t));return(0,$.jsx)(Ji.ToolbarDropdownMenu,{popoverProps:RE,icon:(0,$.jsx)(ME,{level:t}),label:(0,C.__)("Change level"),controls:o.map((e=>{const o=e===t;return{icon:(0,$.jsx)(ME,{level:e}),title:0===e?(0,C.__)("Paragraph"):(0,C.sprintf)((0,C.__)("Heading %d"),e),isActive:o,onClick(){n(e)},role:"menuitemradio"}}))})}const LE=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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 AE=function({icon:e=LE,label:t=(0,C.__)("Choose variation"),instructions:n=(0,C.__)("Select a variation to start with:"),variations:o,onSelect:r,allowSkip:i}){const s=$i("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,$.jsxs)(Ji.Placeholder,{icon:e,label:t,instructions:n,className:s,children:[(0,$.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,C.__)("Block variations"),children:o.map((e=>(0,$.jsxs)("li",{children:[(0,$.jsx)(Ji.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,$.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:e.title})]},e.name)))}),i&&(0,$.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,variant:"link",onClick:()=>r(),children:(0,C.__)("Skip")})})]})},DE="carousel",OE="grid",zE=({onBlockPatternSelect:e})=>(0,$.jsx)("div",{className:"block-editor-block-pattern-setup__actions",children:(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,variant:"primary",onClick:e,children:(0,C.__)("Choose")})}),VE=({handlePrevious:e,handleNext:t,activeSlide:n,totalSlides:o})=>(0,$.jsxs)("div",{className:"block-editor-block-pattern-setup__navigation",children:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,icon:(0,C.isRTL)()?Af:Df,label:(0,C.__)("Previous pattern"),onClick:e,disabled:0===n,accessibleWhenDisabled:!0}),(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,icon:(0,C.isRTL)()?Df:Af,label:(0,C.__)("Next pattern"),onClick:t,disabled:n===o-1,accessibleWhenDisabled:!0})]}),FE=({viewMode:e,setViewMode:t,handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:i,onBlockPatternSelect:s})=>{const l=e===DE,a=(0,$.jsxs)("div",{className:"block-editor-block-pattern-setup__display-controls",children:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,icon:Nl,label:(0,C.__)("Carousel view"),onClick:()=>t(DE),isPressed:l}),(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,icon:rj,label:(0,C.__)("Grid view"),onClick:()=>t(OE),isPressed:e===OE})]});return(0,$.jsxs)("div",{className:"block-editor-block-pattern-setup__toolbar",children:[l&&(0,$.jsx)(VE,{handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:i}),a,l&&(0,$.jsx)(zE,{onBlockPatternSelect:s})]})};const HE=function(e,t,n){return(0,c.useSelect)((o=>{const{getBlockRootClientId:r,getPatternsByBlockTypes:i,__experimentalGetAllowedPatterns:s}=o(oi),l=r(e);return n?s(l).filter(n):i(t,l)}),[e,t,n])},GE=({viewMode:e,activeSlide:t,patterns:n,onBlockPatternSelect:o,showTitles:r})=>{const i="block-editor-block-pattern-setup__container";if(e===DE){const e=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,$.jsx)("div",{className:"block-editor-block-pattern-setup__carousel",children:(0,$.jsx)("div",{className:i,children:(0,$.jsx)("div",{className:"carousel-container",children:n.map(((n,o)=>(0,$.jsx)(UE,{active:o===t,className:e.get(o)||"",pattern:n},n.name)))})})})}return(0,$.jsx)("div",{className:"block-editor-block-pattern-setup__grid",children:(0,$.jsx)(Ji.Composite,{role:"listbox",className:i,"aria-label":(0,C.__)("Patterns list"),children:n.map((e=>(0,$.jsx)($E,{pattern:e,onSelect:o,showTitles:r},e.name)))})})};function $E({pattern:e,onSelect:t,showTitles:n}){const o="block-editor-block-pattern-setup-list",{blocks:r,description:i,viewportWidth:s=700}=e,l=(0,u.useInstanceId)($E,`${o}__item-description`);return(0,$.jsx)("div",{className:`${o}__list-item`,children:(0,$.jsxs)(Ji.Composite.Item,{render:(0,$.jsx)("div",{"aria-describedby":i?l:void 0,"aria-label":e.title,className:`${o}__item`}),id:`${o}__pattern__${e.name}`,role:"option",onClick:()=>t(r),children:[(0,$.jsx)(eS,{blocks:r,viewportWidth:s}),n&&(0,$.jsx)("div",{className:`${o}__item-title`,children:e.title}),!!i&&(0,$.jsx)(Ji.VisuallyHidden,{id:l,children:i})]})})}function UE({active:e,className:t,pattern:n,minHeight:o}){const{blocks:r,title:i,description:s}=n,l=(0,u.useInstanceId)(UE,"block-editor-block-pattern-setup-list__item-description");return(0,$.jsxs)("div",{"aria-hidden":!e,role:"img",className:`pattern-slide ${t}`,"aria-label":i,"aria-describedby":s?l:void 0,children:[(0,$.jsx)(eS,{blocks:r,minHeight:o}),!!s&&(0,$.jsx)(Ji.VisuallyHidden,{id:l,children:s})]})}const WE=({clientId:e,blockName:t,filterPatternsFn:n,onBlockPatternSelect:o,initialViewMode:r=DE,showTitles:i=!1})=>{const[s,u]=(0,a.useState)(r),[d,p]=(0,a.useState)(0),{replaceBlock:h}=(0,c.useDispatch)(oi),g=HE(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,$.jsx)($.Fragment,{children:(0,$.jsxs)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`,children:[(0,$.jsx)(GE,{viewMode:s,activeSlide:d,patterns:g,onBlockPatternSelect:m,showTitles:i}),(0,$.jsx)(FE,{viewMode:s,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 KE({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,$.jsxs)("fieldset",{className:e,children:[(0,$.jsx)(Ji.VisuallyHidden,{as:"legend",children:(0,C.__)("Transform to variation")}),o.map((e=>(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,icon:(0,$.jsx)(zf,{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 ZE({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,$.jsx)(Ji.DropdownMenu,{className:e,label:(0,C.__)("Transform to variation"),text:(0,C.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:aC,toggleProps:{iconPosition:"right"},children:()=>(0,$.jsx)("div",{className:`${e}__container`,children:(0,$.jsx)(Ji.MenuGroup,{children:(0,$.jsx)(Ji.MenuItemsChoice,{choices:r,value:n,onSelect:t})})})})}function qE({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,$.jsx)("div",{className:e,children:(0,$.jsx)(Ji.__experimentalToggleGroupControl,{label:(0,C.__)("Transform to variation"),value:n,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:o.map((e=>(0,$.jsx)(Ji.__experimentalToggleGroupControlOptionIcon,{icon:(0,$.jsx)(zf,{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 YE=function({blockClientId:e}){const{updateBlockAttributes:t}=(0,c.useDispatch)(oi),{activeBlockVariation:n,variations:o,isContentOnly:r}=(0,c.useSelect)((t=>{const{getActiveBlockVariation:n,getBlockVariations:o}=t(l.store),{getBlockName:r,getBlockAttributes:i,getBlockEditingMode:s}=t(oi),a=e&&r(e),{hasContentRoleAttribute:c}=te(t(l.store)),u=c(a);return{activeBlockVariation:n(a,i(e)),variations:a&&o(a,"transform"),isContentOnly:"contentOnly"===s(e)&&!u}}),[e]),i=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||r)return null;const u=o.length>5,d=s?u?KE:qE:ZE;return(0,$.jsx)(d,{className:"block-editor-block-variation-transforms",onSelectVariation:n=>{t(e,{...o.find((({name:e})=>e===n)).attributes})},selectedValue:i,variations:o})},XE=(0,u.createHigherOrderComponent)((e=>t=>{const[n,o]=ii("color.palette","color.custom"),{colors:r=n,disableCustomColors:i=!o}=t,s=r&&r.length>0||!i;return(0,$.jsx)(e,{...t,colors:r,disableCustomColors:i,hasColorsToChoose:s})}),"withColorContext"),QE=XE(Ji.ColorPalette);function JE({onChange:e,value:t,...n}){return(0,$.jsx)(Kd,{...n,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}const eT=window.wp.date,tT=new Date;function nT({format:e,defaultFormat:t,onChange:n}){return(0,$.jsxs)("fieldset",{className:"block-editor-date-format-picker",children:[(0,$.jsx)(Ji.VisuallyHidden,{as:"legend",children:(0,C.__)("Date format")}),(0,$.jsx)(Ji.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Default format"),help:`${(0,C.__)("Example:")} ${(0,eT.dateI18n)(t,tT)}`,checked:!e,onChange:e=>n(e?null:t)}),e&&(0,$.jsx)(oT,{format:e,onChange:n})]})}function oT({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")])].map(((e,t)=>({key:`suggested-${t}`,name:(0,eT.dateI18n)(e,tT),format:e}))),{key:"human-diff",name:(0,eT.humanTimeDiff)(tT),format:"human-diff"}],r={key:"custom",name:(0,C.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",hint:(0,C.__)("Enter your own date format")},[i,s]=(0,a.useState)((()=>!!e&&!o.some((t=>t.format===e))));return(0,$.jsxs)(Ji.__experimentalVStack,{children:[(0,$.jsx)(Ji.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,C.__)("Choose a format"),options:[...o,r],value:i?r:null!==(n=o.find((t=>t.format===e)))&&void 0!==n?n:r,onChange:({selectedItem:e})=>{e===r?s(!0):(s(!1),t(e.format))}}),i&&(0,$.jsx)(Ji.TextControl,{__next40pxDefaultSize:!0,__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,$.jsx)(Ji.ExternalLink,{href:(0,C.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:e=>t(e)})]})}tT.setDate(20),tT.setMonth(tT.getMonth()-3),4===tT.getMonth()&&tT.setMonth(3);const rT=({setting:e,children:t,panelId:n,...o})=>(0,$.jsx)(Ji.__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}),iT=({colorValue:e,label:t})=>(0,$.jsxs)(Ji.__experimentalHStack,{justify:"flex-start",children:[(0,$.jsx)(Ji.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,$.jsx)(Ji.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),sT=e=>({onToggle:t,isOpen:n})=>{const{colorValue:o,label:r}=e,i={onClick:t,className:$i("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n};return(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,...i,children:(0,$.jsx)(iT,{colorValue:o,label:r})})};function lT({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradients:r,settings:i,__experimentalIsRenderedInSidebar:s,...l}){let a;return s&&(a={placement:"left-start",offset:36,shift:!0}),(0,$.jsx)($.Fragment,{children:i.map(((i,c)=>{var u;const d={clearable:!1,colorValue:i.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradientValue:i.gradientValue,gradients:r,label:i.label,onColorChange:i.onColorChange,onGradientChange:i.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...i},p={colorValue:null!==(u=i.gradientValue)&&void 0!==u?u:i.colorValue,label:i.label};return i&&(0,$.jsx)(rT,{setting:i,...l,children:(0,$.jsx)(Ji.Dropdown,{popoverProps:a,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:sT(p),renderContent:()=>(0,$.jsx)(Ji.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,$.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,$.jsx)(Kd,{...d})})})})},c)}))})}const aT=["colors","disableCustomColors","gradients","disableCustomGradients"],cT=({className:e,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,children:i,settings:s,title:l,showTitle:a=!0,__experimentalIsRenderedInSidebar:d,enableAlpha:p})=>{const h=(0,u.useInstanceId)(cT),{batch:g}=(0,c.useRegistry)();return t&&0!==t.length||n&&0!==n.length||!o||!r||!s?.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,$.jsxs)(Ji.__experimentalToolsPanel,{className:$i("block-editor-panel-color-gradient-settings",e),label:a?l:void 0,resetAll:()=>{g((()=>{s.forEach((({colorValue:e,gradientValue:t,onColorChange:n,onGradientChange:o})=>{e?n():t&&o()}))}))},panelId:h,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,$.jsx)(lT,{settings:s,panelId:h,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:d,enableAlpha:p}),!!i&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.__experimentalSpacer,{marginY:4})," ",i]})]}):null},uT=e=>{const t=$u();return(0,$.jsx)(cT,{...t,...e})},dT=e=>aT.every((t=>e.hasOwnProperty(t)))?(0,$.jsx)(cT,{...e}):(0,$.jsx)(uT,{...e}),pT=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),hT=100,gT=300,mT={placement:"bottom-start"};const fT=(0,a.createContext)({}),bT=()=>(0,a.useContext)(fT);function kT({id:e,url:t,naturalWidth:n,naturalHeight:o,onFinishEditing:r,onSaveImage:i,children:s}){const l=function({url:e,naturalWidth:t,naturalHeight:n}){const[o,r]=(0,a.useState)(),[i,s]=(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),k=(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 i=0,s=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||(i=o.width),270!==t&&180!==t||(s=o.height);const l=o.getContext("2d");l.translate(i,s),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 i=(0,d.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof i&&(o.crossOrigin=i)}),[h,m,e]);return(0,a.useMemo)((()=>({editedUrl:o,setEditedUrl:r,crop:i,setCrop:s,position:l,setPosition:c,zoom:u,setZoom:p,rotation:h,setRotation:g,rotateClockwise:k,aspect:f,setAspect:b,defaultAspect:m})),[o,i,l,u,h,k,f,m])}({url:t,naturalWidth:n,naturalHeight:o}),u=function({crop:e,rotation:t,url:n,id:o,onSaveImage:r,onFinishEditing:i}){const{createErrorNotice:s}=(0,c.useDispatch)(Fo.store),[l,u]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>{u(!1),i()}),[i]),p=(0,a.useCallback)((()=>{u(!0);const l=[];if(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}}),0===l.length)return u(!1),void i();eB()({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=>{s((0,C.sprintf)((0,C.__)("Could not edit image. %s"),(0,ha.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{u(!1),i()}))}),[e,t,o,n,r,s,i]);return(0,a.useMemo)((()=>({isInProgress:l,apply:p,cancel:d})),[l,p,d])}({id:e,url:t,onSaveImage:i,onFinishEditing:r,...l}),p=(0,a.useMemo)((()=>({...l,...u})),[l,u]);return(0,$.jsx)(fT.Provider,{value:p,children:s})}function vT({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:r}){return(0,$.jsx)(Ji.MenuGroup,{label:n,children:e.map((({name:e,slug:n,ratio:i})=>(0,$.jsx)(Ji.MenuItem,{disabled:t,onClick:()=>{o(i)},role:"menuitemradio",isSelected:i===r,icon:i===r?id:void 0,children:e},n)))})}function _T(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 xT({ratio:e,...t}){return{ratio:_T(e),...t}}function yT({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:r}=bT(),[i,s,l]=ii("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return(0,$.jsx)(Ji.DropdownMenu,{icon:pT,label:(0,C.__)("Aspect Ratio"),popoverProps:mT,toggleProps:e,children:({onClose:e})=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(vT,{isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{slug:"original",name:(0,C.__)("Original"),aspect:r},...l?i.map(xT).filter((({ratio:e})=>1===e)):[]]}),s?.length>0&&(0,$.jsx)(vT,{label:(0,C.__)("Theme"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:s}),l&&(0,$.jsx)(vT,{label:(0,C.__)("Landscape"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:i.map(xT).filter((({ratio:e})=>e>1))}),l&&(0,$.jsx)(vT,{label:(0,C.__)("Portrait"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:i.map(xT).filter((({ratio:e})=>e<1))})]})})}var ST=function(e,t){return ST=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])},ST(e,t)};function wT(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}ST(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var CT=function(){return CT=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},CT.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var BT=n(7520),IT=n.n(BT);function jT(e,t,n,o,r){void 0===r&&(r=0);var i=LT(t.width,t.height,r),s=i.width,l=i.height;return{x:ET(e.x,s,n.width,o),y:ET(e.y,l,n.height,o)}}function ET(e,t,n,o){var r=t*o/2-n/2;return AT(e,-r,r)}function TT(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function MT(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function PT(e,t){return Math.min(e,Math.max(0,t))}function RT(e,t){return t}function NT(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function LT(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 AT(e,t,n){return Math.min(Math.max(e,t),n)}function DT(){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 OT=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=ja.createRef(),n.videoRef=ja.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,i){var s=LT(t.width,t.height,n),l=AT(o.width/s.width*(100/e.width),r,i);return{crop:{x:l*s.width/2-o.width/2-s.width*l*(e.x/100),y:l*s.height/2-o.height/2-s.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 i=function(e,t,n,o,r,i){void 0===n&&(n=0);var s=LT(t.naturalWidth,t.naturalHeight,n),l=AT(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,i),a=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((s.width-e.width)/2-e.x)*a,y:((s.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=i.crop,r=i.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}},n.computeSizes=function(){var e,t,o,r,i,s,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=CT(CT({},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,i){void 0===i&&(i=0);var s=LT(e,t,i),l=s.width,a=s.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===(i=n.state.cropSize)||void 0===i?void 0:i.height)===h.height&&(null===(s=n.state.cropSize)||void 0===s?void 0:s.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 i=n.gestureRotationStart+e.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,o,r=e.x,i=e.y;n.dragStartPosition={x:r,y:i},n.dragStartCrop=CT({},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,i={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},s=n.props.restrictPosition?jT(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(s)}})))},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=IT()(e).pixelY,i=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(i,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,i=r.crop,s=r.zoom;return{x:(t+i.x)/s,y:(o+i.y)/s}},n.setNewZoom=function(e,t,o){var r=(void 0===o?{}:o).shouldUpdatePosition,i=void 0===r||r;if(n.state.cropSize&&n.props.onZoomChange){var s=AT(e,n.props.minZoom,n.props.maxZoom);if(i){var l=n.getPointOnContainer(t,n.containerPosition),a=n.getPointOnMedia(l),c={x:a.x*s-l.x,y:a.y*s-l.y},u=n.props.restrictPosition?jT(c,n.mediaSize,n.state.cropSize,s,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(s)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,o,r,i,s){void 0===i&&(i=0),void 0===s&&(s=!0);var l=s?PT:RT,a=LT(t.width,t.height,i),c=LT(t.naturalWidth,t.naturalHeight,i),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:CT(CT({},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?jT(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?jT(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 wT(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,i,s,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===(i=e.crop)||void 0===i?void 0:i.x)===(null===(s=this.props.crop)||void 0===s?void 0:s.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=TT(n,o),this.lastPinchRotation=MT(n,o),this.onDragStart(NT(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]),i=NT(o,r);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=TT(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,i,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var s=MT(o,r),l=n.props.rotation+(s-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(l),n.lastPinchRotation=s}))}},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,i=t.transform,s=t.crop,l=s.x,a=s.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,k=b.containerClassName,v=b.cropAreaClassName,_=b.mediaClassName,x=this.state.mediaObjectFit;return ja.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:DT("reactEasyCrop_Container",k)},n?ja.createElement("img",CT({alt:"",className:DT("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:CT(CT({},f),{transform:i||"translate(".concat(l,"px, ").concat(a,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),onLoad:this.onMediaLoad})):o&&ja.createElement("video",CT({autoPlay:!0,loop:!0,muted:!0,className:DT("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:CT(CT({},f),{transform:i||"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 ja.createElement("source",CT({key:e.src},e))}))),this.state.cropSize&&ja.createElement("div",{style:CT(CT({},m),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:DT("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",v)}))},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}(ja.Component);function zT({url:e,width:t,height:n,naturalHeight:o,naturalWidth:r,borderProps:i}){const{isInProgress:s,editedUrl:l,position:a,zoom:c,aspect:d,setPosition:p,setCrop:h,setZoom:g,rotation:m}=bT(),[f,{width:b}]=(0,u.useResizeObserver)();let k=n||b*o/r;m%180==90&&(k=b*r/o);const v=(0,$.jsxs)("div",{className:$i("wp-block-image__crop-area",i?.className,{"is-applying":s}),style:{...i?.style,width:t||b,height:k},children:[(0,$.jsx)(OT,{image:l||e,disabled:s,minZoom:hT/100,maxZoom:gT/100,crop:a,zoom:c/100,aspect:d,onCropChange:e=>{p(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{g(100*e)}}),s&&(0,$.jsx)(Ji.Spinner,{})]});return(0,$.jsxs)($.Fragment,{children:[f,v]})}const VT=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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 FT(){const{isInProgress:e,zoom:t,setZoom:n}=bT();return(0,$.jsx)(Ji.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:mT,renderToggle:({isOpen:t,onToggle:n})=>(0,$.jsx)(Ji.ToolbarButton,{icon:VT,label:(0,C.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,$.jsx)(Ji.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,$.jsx)(Ji.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,C.__)("Zoom"),min:hT,max:gT,value:Math.round(t),onChange:n})})})}const HT=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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 GT(){const{isInProgress:e,rotateClockwise:t}=bT();return(0,$.jsx)(Ji.ToolbarButton,{icon:HT,label:(0,C.__)("Rotate"),onClick:t,disabled:e})}function $T(){const{isInProgress:e,apply:t,cancel:n}=bT();return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.ToolbarButton,{onClick:t,disabled:e,children:(0,C.__)("Apply")}),(0,$.jsx)(Ji.ToolbarButton,{onClick:n,children:(0,C.__)("Cancel")})]})}function UT({id:e,url:t,width:n,height:o,naturalHeight:r,naturalWidth:i,onSaveImage:s,onFinishEditing:l,borderProps:a}){return(0,$.jsxs)(kT,{id:e,url:t,naturalWidth:i,naturalHeight:r,onSaveImage:s,onFinishEditing:l,children:[(0,$.jsx)(zT,{borderProps:a,url:t,width:n,height:o,naturalHeight:r,naturalWidth:i}),(0,$.jsxs)(ss,{children:[(0,$.jsxs)(Ji.ToolbarGroup,{children:[(0,$.jsx)(FT,{}),(0,$.jsx)(Ji.ToolbarItem,{children:e=>(0,$.jsx)(yT,{toggleProps:e})}),(0,$.jsx)(GT,{})]}),(0,$.jsx)(Ji.ToolbarGroup,{children:(0,$.jsx)($T,{})})]})]})}const WT=[25,50,75,100],KT=()=>{};function ZT({imageSizeHelp:e,imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:i,width:s,height:l,onChange:c,onChangeImage:u=KT}){const{currentHeight:d,currentWidth:p,updateDimension:h,updateDimensions:g}=function(e,t,n,o,r){var i,s;const[l,c]=(0,a.useState)(null!==(i=null!=t?t:o)&&void 0!==i?i:""),[u,d]=(0,a.useState)(null!==(s=null!=e?e:n)&&void 0!==s?s:"");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,s,n,t,c);return(0,$.jsxs)($.Fragment,{children:[o&&o.length>0&&(0,$.jsx)(Ji.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Resolution"),value:i,options:o,onChange:u,help:e,size:"__unstable-large"}),r&&(0,$.jsxs)("div",{className:"block-editor-image-size-control",children:[(0,$.jsxs)(Ji.__experimentalHStack,{align:"baseline",spacing:"3",children:[(0,$.jsx)(Ji.__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,$.jsx)(Ji.__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,$.jsxs)(Ji.__experimentalHStack,{children:[(0,$.jsx)(Ji.ButtonGroup,{"aria-label":(0,C.__)("Image size presets"),children:WT.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),i=p===o&&d===r;return(0,$.jsxs)(Ji.Button,{size:"small",variant:i?"primary":void 0,isPressed:i,onClick:()=>g(r,o),children:[e,"%"]},e)}))}),(0,$.jsx)(Ji.Button,{size:"small",onClick:()=>g(),children:(0,C.__)("Reset")})]})]})]})}function qT({url:e,urlLabel:t,className:n}){const o=$i(n,"block-editor-url-popover__link-viewer-url");return e?(0,$.jsx)(Ji.ExternalLink,{className:o,href:e,children:t||(0,pa.filterURLForDisplay)((0,pa.safeDecodeURI)(e))}):(0,$.jsx)("span",{className:o})}const{__experimentalPopoverLegacyPositionToPlacement:YT}=te(Ji.privateApis),XT=(0,a.forwardRef)((({additionalControls:e,children:t,renderSettings:n,placement:o,focusOnMount:r="firstElement",position:i,...s},l)=>{let c;void 0!==i&&y()("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==o?c=o:void 0!==i&&(c=YT(i)),c=c||"bottom";const[u,d]=(0,a.useState)(!1),p=!!n&&u;return(0,$.jsxs)(Ji.Popover,{ref:l,role:"dialog","aria-modal":"true","aria-label":(0,C.__)("Edit URL"),className:"block-editor-url-popover",focusOnMount:r,placement:c,shift:!0,variant:"toolbar",...s,children:[(0,$.jsx)("div",{className:"block-editor-url-popover__input-container",children:(0,$.jsxs)("div",{className:"block-editor-url-popover__row",children:[t,!!n&&(0,$.jsx)(Ji.Button,{className:"block-editor-url-popover__settings-toggle",icon:aC,label:(0,C.__)("Link settings"),onClick:()=>{d(!u)},"aria-expanded":u,size:"compact"})]})}),p&&(0,$.jsx)("div",{className:"block-editor-url-popover__settings",children:n()}),e&&!p&&(0,$.jsx)("div",{className:"block-editor-url-popover__additional-controls",children:e})]})}));XT.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...r}){return(0,$.jsxs)("form",{className:$i("block-editor-url-popover__link-editor",t),...r,children:[(0,$.jsx)(Ma,{value:o,onChange:n,autocompleteRef:e}),(0,$.jsx)(Ji.Button,{icon:wa,label:(0,C.__)("Apply"),type:"submit",size:"compact"})]})},XT.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:r,...i}){return(0,$.jsxs)("div",{className:$i("block-editor-url-popover__link-viewer",e),...i,children:[(0,$.jsx)(qT,{url:o,urlLabel:r,className:t}),n&&(0,$.jsx)(Ji.Button,{icon:uc,label:(0,C.__)("Edit"),onClick:n,size:"compact"})]})};const QT=XT,JT=()=>{},eM=({src:e,onChange:t,onSubmit:n,onClose:o,popoverAnchor:r})=>(0,$.jsx)(QT,{anchor:r,onClose:o,children:(0,$.jsx)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n,children:(0,$.jsx)(Ji.__experimentalInputControl,{__next40pxDefaultSize:!0,label:(0,C.__)("URL"),hideLabelFromVision:!0,placeholder:(0,C.__)("Paste or type URL"),onChange:t,value:e,suffix:(0,$.jsx)(Ji.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,$.jsx)(Ji.Button,{size:"small",icon:wa,label:(0,C.__)("Apply"),type:"submit"})})})})}),tM=({src:e,onChangeSrc:t,onSelectURL:n})=>{const[o,r]=(0,a.useState)(null),[i,s]=(0,a.useState)(!1),l=()=>{s(!1),o?.focus()};return(0,$.jsxs)("div",{className:"block-editor-media-placeholder__url-input-container",children:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,className:"block-editor-media-placeholder__button",onClick:()=>{s(!0)},isPressed:i,variant:"secondary","aria-haspopup":"dialog",ref:r,children:(0,C.__)("Insert from URL")}),i&&(0,$.jsx)(eM,{src:e,onChange:t,onSubmit:t=>{t.preventDefault(),e&&n&&(n(e),l())},onClose:l,popoverAnchor:o})]})};const nM=(0,Ji.withFilters)("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:o,labels:r={},mediaPreview:i,notices:s,isAppender:u,accept:d,addToGallery:p,multiple:h=!1,handleUpload:g=!0,disableDropZone:m,disableMediaButtons:f,onError:b,onSelect:k,onCancel:v,onSelectURL:_,onToggleFeaturedImage:x,onDoubleClick:S,onFilesPreUpload:w=JT,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(oi);return t().mediaUpload}),[]),[P,R]=(0,a.useState)("");(0,a.useEffect)((()=>{var t;R(null!==(t=e?.src)&&void 0!==t?t:"")}),[e?.src]);const N=n=>{if(!g||"function"==typeof g&&!g(n))return k(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)))));k(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=k;else o=([e])=>k(e);M({allowedTypes:t,filesList:n,onFileChange:o,onError:b})};async function L(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)));k(h?o:o[0])}(n)}const A=e=>{N(e.target.files)},D=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,i=o&&"image"===n,s=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 or drag an audio file here, or pick one from your library."):i?l=(0,C.__)("Upload or drag an image file here, or pick one from your library."):s&&(l=(0,C.__)("Upload or drag a video file here, or pick one from your library."))),void 0===a&&(a=(0,C.__)("Media"),r?a=(0,C.__)("Audio"):i?a=(0,C.__)("Image"):s&&(a=(0,C.__)("Video")))}const c=$i("block-editor-media-placeholder",n,{"is-appender":u});return(0,$.jsxs)(Ji.Placeholder,{icon:o,label:a,instructions:l,className:c,notices:s,onDoubleClick:S,preview:i,style:T,children:[e,I]})},O=()=>m?null:(0,$.jsx)(Ji.DropZone,{onFilesDrop:N,onHTMLDrop:L}),z=()=>v&&(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,className:"block-editor-media-placeholder__cancel-button",title:(0,C.__)("Cancel"),variant:"link",onClick:v,children:(0,C.__)("Cancel")}),V=()=>_&&(0,$.jsx)(tM,{src:P,onChangeSrc:R,onSelectURL:_}),F=()=>x&&(0,$.jsx)("div",{className:"block-editor-media-placeholder__url-input-container",children:(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,className:"block-editor-media-placeholder__button",onClick:x,variant:"secondary",children:(0,C.__)("Use featured image")})});return f?(0,$.jsx)(_a,{children:O()}):(0,$.jsx)(_a,{fallback:D(V()),children:(()=>{const n=null!=j?j:({open:e})=>(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,variant:"secondary",onClick:()=>{e()},children:(0,C.__)("Media Library")}),o=(0,$.jsx)(va,{addToGallery:p,gallery:h&&!(!t||0===t.length)&&t.every((e=>"image"===e||e.startsWith("image/"))),multiple:h,onSelect:k,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map((({id:e})=>e)):e.id,render:n});if(M&&u)return(0,$.jsxs)($.Fragment,{children:[O(),(0,$.jsx)(Ji.FormFileUpload,{onChange:A,accept:d,multiple:!!h,render:({openFileDialog:e})=>{const t=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,variant:"primary",className:$i("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e,children:(0,C.__)("Upload")}),o,V(),F(),z()]});return D(t)}})]});if(M){const e=(0,$.jsxs)($.Fragment,{children:[O(),(0,$.jsx)(Ji.FormFileUpload,{render:({openFileDialog:e})=>(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,onClick:e,variant:"primary",className:$i("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),children:(0,C.__)("Upload")}),onChange:A,accept:d,multiple:!!h}),o,V(),F(),z()]});return D(e)}return D(o)})()})})),oM=({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,$.jsx)(dT,{settings:n,gradients:[],disableCustomGradients:!0,...t})},rM={placement:"bottom-start"},iM=()=>(0,$.jsxs)($.Fragment,{children:[["bold","italic","link","unknown"].map((e=>(0,$.jsx)(Ji.Slot,{name:`RichText.ToolbarControls.${e}`},e))),(0,$.jsx)(Ji.Slot,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;const t=e.map((([{props:e}])=>e)).some((({isActive:e})=>e));return(0,$.jsx)(Ji.ToolbarItem,{children:n=>(0,$.jsx)(Ji.DropdownMenu,{icon:aC,label:(0,C.__)("More"),toggleProps:{...n,className:$i(n.className,{"is-pressed":t}),description:(0,C.__)("Displays more block tools")},controls:he(e.map((([{props:e}])=>e)),"title"),popoverProps:rM})})}})]});function sM({popoverAnchor:e}){return(0,$.jsx)(Ji.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,$.jsx)(pj,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,C.__)("Format tools"),children:(0,$.jsx)(Ji.ToolbarGroup,{children:(0,$.jsx)(iM,{})})})})}const lM=({inline:e,editableContentElement:t})=>e?(0,$.jsx)(sM,{popoverAnchor:t}):(0,$.jsx)(ss,{group:"inline",children:(0,$.jsx)(iM,{})});function aM(e){return e(W.store).getFormatTypes()}const cM=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function uM(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((([e,n])=>[`${t}.${e}`,n])))}function dM(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 pM=["`",'"',"'","“”",""];function hM(e){let t=e.length;for(;t--;){const n=Go(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].toString().replace(Ho,""),[e[t].clientId,n,0,0];const o=hM(e[t].innerBlocks);if(o)return o}return[]}function gM(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function mM({allowedFormats:e,disableFormats:t}){return t?mM.EMPTY_ARRAY:e}mM.EMPTY_ARRAY=[];const fM=[e=>t=>{function n(n){const{inputType:o,data:r}=n,{value:i,onChange:s,registry:l}=e.current;if("insertText"!==o)return;if((0,W.isCollapsed)(i))return;const a=(0,d.applyFilters)("blockEditor.wrapSelectionSettings",pM).find((([e,t])=>e===r||t===r));if(!a)return;const[c,u=c]=a,p=i.start,h=i.end+c.length;let g=(0,W.insert)(i,c,p,p);g=(0,W.insert)(g,u,h,h);const{__unstableMarkLastChangeAsPersistent:m,__unstableMarkAutomaticChange:f}=l.dispatch(oi);m(),s(g),f();const b={};for(const e in n)b[e]=n[e];b.data=u;const{ownerDocument:k}=t,{defaultView:v}=k,_=new v.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 i=t(),{start:s,text:a}=i;if(" "!==a.slice(s-1,s))return;const c=a.slice(0,s).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)(i,Ho,0,s)}),h=d.transform(p);return o(...hM([h])),n([h]),r.dispatch(oi).__unstableMarkAutomaticChange(),!0}function o(t){const{inputType:o,type:r}=t,{getValue:i,onChange:s,__unstableAllowPrefixTransformations:l,formatTypes:a,registry:c}=e.current;if("insertText"!==o&&"compositionend"!==r)return;if(l&&n())return;const u=i(),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(oi);d!==u&&(p(),s({...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(oi).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},()=>e=>{function t(e){(ma.isKeyboardEvent.primary(e,"z")||ma.isKeyboardEvent.primary(e,"y")||ma.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!==ma.BACKSPACE&&n!==ma.ESCAPE)return;const{registry:o}=e.current,{didAutomaticChange:r,getSettings:i}=o.select(oi),{__experimentalUndo:s}=i();s&&r()&&(t.preventDefault(),s())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(n){const{disableFormats:o,onChange:r,value:i,formatTypes:s,tagName:a,onReplace:c,__unstableEmbedURLOnPaste:u,preserveWhiteSpace:d,pastePlainText:p}=e.current;if(!t.contains(n.target))return;if(n.defaultPrevented)return;const{plainText:h,html:g}=fy(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)(i,h));function m(e){const t=s.reduce(((e,{__unstablePasteRule:t})=>(t&&e===i&&(e=t(i,{html:g,plainText:h})),e)),i);if(t!==i)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,i.activeFormats),r((0,W.insert)(i,t))}}if("true"===n.clipboardData.getData("rich-text"))return void m(g);if(p)return void r((0,W.insert)(i,(0,W.create)({text:h})));let f="INLINE";const b=h.trim();u&&(0,W.isEmpty)(i)&&(0,pa.isURL)(b)&&/^https?:/.test(b)&&(f="BLOCKS");const k=(0,l.pasteHandler)({HTML:g,plainText:h,mode:f,tagName:a,preserveWhiteSpace:d});"string"==typeof k?m(k):k.length>0&&c&&(0,W.isEmpty)(i)&&c(k,k.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:i}=e.current;if(n===ma.DELETE||n===ma.BACKSPACE){const{start:e,end:s,text:l}=o,a=n===ma.BACKSPACE,c=o.activeFormats&&!!o.activeFormats.length;if(!(0,W.isCollapsed)(o)||c||a&&0!==e||!a&&s!==l.length)return;r?r(!a):i&&(0,W.isEmpty)(o)&&a&&i(!a),t.preventDefault()}}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){if(t.keyCode!==ma.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!==ma.ENTER)return;const{value:o,onChange:r,disableLineBreaks:i,onSplitAtEnd:s,onSplitAtDoubleLineEnd:l,registry:a}=e.current;n.preventDefault();const{text:c,start:u,end:d}=o;n.shiftKey?i||r((0,W.insert)(o,"\n")):s&&u===d&&d===c.length?s():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()})):i||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(oi).isMultiSelecting())return;const o=t.parentElement.closest('[contenteditable="true"]');o&&o.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}];function bM(e){const t=(0,a.useRef)(e);t.current=e;const n=(0,a.useMemo)((()=>fM.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 kM={},vM=Symbol("usesContext");function _M({onChange:e,onFocus:t,value:n,forwardedRef:o,settings:r}){const{name:i,edit:s,[vM]:l}=r,c=(0,a.useContext)(Xf),u=(0,a.useMemo)((()=>l?Object.fromEntries(Object.entries(c).filter((([e])=>l.includes(e)))):kM),[l,c]);if(!s)return null;const d=(0,W.getActiveFormat)(n,i),p=void 0!==d,h=(0,W.getActiveObject)(n),g=void 0!==h&&h.type===i;return(0,$.jsx)(s,{isActive:p,activeAttributes:p&&d.attributes||{},isObjectActive:g,activeObjectAttributes:g&&h.attributes||{},value:n,onChange:e,onFocus:t,contentRef:o,context:u},i)}function xM({formatTypes:e,...t}){return e.map((e=>(0,ja.createElement)(_M,{settings:e,...t,key:e.name})))}function yM(e,t){if(RM.isEmpty(e)){const e=gM(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 SM({value:e,tagName:t,multiline:n,format:o,...r}){return e=(0,$.jsx)(a.RawHTML,{children:yM(e,n)}),t?(0,$.jsx)(t,{...r,children:e}):e}const wM=(0,a.forwardRef)((function({children:e,identifier:t,tagName:n="div",value:o="",onChange:r,multiline:i,...s},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)(oi),{selectionChange:p}=(0,c.useDispatch)(oi),h=gM(i),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,$.jsx)(n,{ref:l,children:g.map(((e,n)=>(0,$.jsx)(EM,{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!==ma.ENTER)return;o.preventDefault();const{offset:r}=u(),{offset:i}=d();if("number"!=typeof r||"number"!=typeof i)return;const s=(0,W.create)({html:e});s.start=r,s.end=i;const l=(0,W.split)(s).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)},...s},n)))})}));const CM=(0,a.createContext)(),BM=(0,a.createContext)(),IM=Symbol("instanceId");function jM(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:r,selectionColor:i,tagsToEliminate:s,disableEditingMenu:l,fontSize:a,fontFamily:c,fontWeight:u,fontStyle:d,minWidth:p,maxWidth:h,disableSuggestions:g,disableAutocorrection:m,...f}=e;return f}function EM({children:e,tagName:t="div",value:n="",onChange:o,isSelected:r,multiline:i,inlineToolbar:s,wrapperClassName:d,autocompleters:p,onReplace:h,placeholder:g,allowedFormats:f,withoutInteractiveFormatting:b,onRemove:k,onMerge:v,onSplit:x,__unstableOnSplitAtEnd:S,__unstableOnSplitAtDoubleLineEnd:w,identifier:B,preserveWhiteSpace:I,__unstablePastePlainText:j,__unstableEmbedURLOnPaste:E,__unstableDisableFormats:T,disableLineBreaks:M,__unstableAllowPrefixTransformations:P,readOnly:R,...N},L){N=jM(N),x&&y()("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});const A=(0,u.useInstanceId)(EM),D=(0,a.useRef)(),O=_(),{clientId:z,isSelected:V,name:F}=O,H=O[m],G=(0,a.useContext)(Xf),U=(0,c.useRegistry)(),{selectionStart:K,selectionEnd:Z,isSelected:q}=(0,c.useSelect)((e=>{if(!V)return{isSelected:!1};const{getSelectionStart:t,getSelectionEnd:n}=e(oi),o=t(),i=n();let s;return void 0===r?s=o.clientId===z&&i.clientId===z&&(B?o.attributeKey===B:o[IM]===A):r&&(s=o.clientId===z),{selectionStart:s?o.offset:void 0,selectionEnd:s?i.offset:void 0,isSelected:s}}),[z,B,A,r,V]),{disableBoundBlock:Y,bindingsPlaceholder:X,bindingsLabel:Q}=(0,c.useSelect)((e=>{var t;if(!H?.[B]||!J_(F))return{};const o=H[B],r=(0,l.getBlockBindingsSource)(o.source),i={};if(r?.usesContext?.length)for(const e of r.usesContext)i[e]=G[e];const s=!r?.canUserEditValue?.({select:e,context:i,args:o.args});if(n.length>0)return{disableBoundBlock:s,bindingsPlaceholder:null,bindingsLabel:null};const{getBlockAttributes:a}=e(oi),c=a(z),u=r?.getFieldsList?.({select:e,context:i}),d=null!==(t=u?.[o?.args?.key]?.label)&&void 0!==t?t:r?.label,p=s?d:(0,C.sprintf)((0,C.__)("Add %s"),d),h=s?o?.args?.key||r?.label:(0,C.sprintf)((0,C.__)("Empty %s; start writing to edit its value"),o?.args?.key||r?.label);return{disableBoundBlock:s,bindingsPlaceholder:c?.placeholder||p,bindingsLabel:h}}),[H,B,F,G,n]),J=R||Y,{getSelectionStart:ee,getSelectionEnd:te,getBlockRootClientId:ne}=(0,c.useSelect)(oi),{selectionChange:oe}=(0,c.useDispatch)(oi),re=mM({allowedFormats:f,disableFormats:T}),ie=!re||re.length>0,se=(0,a.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t,r={clientId:z,[B?"attributeKey":IM]:B||A};if("number"==typeof e||o){if(void 0===t&&ne(z)!==ne(te().clientId))return;n.start={...r,offset:e}}if("number"==typeof t||o){if(void 0===e&&ne(z)!==ne(ee().clientId))return;n.end={...r,offset:t}}oe(n)}),[z,ne,te,ee,B,A,oe]),{formatTypes:le,prepareHandlers:ae,valueHandlers:ce,changeHandlers:ue,dependencies:de}=function({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:o}){const r=(0,c.useSelect)(aM,[]),i=(0,a.useMemo)((()=>r.filter((({name:e,interactive:t,tagName:r})=>!(o&&!o.includes(e)||n&&(t||cM.has(r)))))),[r,o,n]),s=(0,c.useSelect)((n=>i.reduce(((o,r)=>r.__experimentalGetPropsForEditableTreePreparation?{...o,...uM(r.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e}),r.name)}:o),{})),[i,e,t]),l=(0,c.useDispatch)(),u=[],d=[],p=[],h=[];for(const e in s)h.push(s[e]);return i.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const o=n.__experimentalCreatePrepareEditableTree(dM(s,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=dM(s,n.name);p.push(n.__experimentalCreateOnChangeEditableValue({..."object"==typeof r?r:{},...o},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:h}}({clientId:z,identifier:B,withoutInteractiveFormatting:b,allowedFormats:re});function pe(e){return le.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,W.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:he,getValue:ge,onChange:me,ref:fe}=(0,W.__unstableUseRichText)({value:n,onChange(e,{__unstableFormats:t,__unstableText:n}){o(e),Object.values(ue).forEach((e=>{e(t,n)}))},selectionStart:K,selectionEnd:Z,onSelectionChange:se,placeholder:X||g,__unstableIsSelected:q,__unstableDisableFormats:T,preserveWhiteSpace:I,__unstableDependencies:[...de,t],__unstableAfterParse:function(e){return ce.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:pe,__unstableAddInvisibleFormats:function(e){return ae.reduce(((t,n)=>n(t,e.text)),e.formats)}}),be=function(e){return(0,Ji.__unstableUseAutocompleteProps)({...e,completers:rB(e)})}({onReplace:h,completers:p,record:he,onChange:me});!function({html:e,value:t}){const n=(0,a.useRef)(),o=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:r}=(0,c.useDispatch)(oi);(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:he});const ke=(0,a.useRef)(new Set),ve=(0,a.useRef)(new Set);function _e(){D.current?.focus()}const xe=t;return(0,$.jsxs)($.Fragment,{children:[q&&(0,$.jsx)(CM.Provider,{value:ke,children:(0,$.jsx)(BM.Provider,{value:ve,children:(0,$.jsxs)(Ji.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:he,onChange:me,onFocus:_e}),(0,$.jsx)(xM,{value:he,onChange:me,onFocus:_e,formatTypes:le,forwardedRef:D})]})})}),q&&ie&&(0,$.jsx)(lM,{inline:s,editableContentElement:D.current}),(0,$.jsx)(xe,{role:"textbox","aria-multiline":!M,"aria-readonly":J,...N,"aria-label":Q||N["aria-label"]||g,...be,ref:(0,u.useMergeRefs)([fe,L,be.ref,N.ref,bM({registry:U,getValue:ge,onChange:me,__unstableAllowPrefixTransformations:P,formatTypes:le,onReplace:h,selectionChange:oe,isSelected:q,disableFormats:T,value:he,tagName:t,onSplit:x,__unstableEmbedURLOnPaste:E,pastePlainText:j,onMerge:v,onRemove:k,removeEditorOnlyFormats:pe,disableLineBreaks:M,onSplitAtEnd:S,onSplitAtDoubleLineEnd:w,keyboardShortcuts:ke,inputEvents:ve}),D]),contentEditable:!J,suppressContentEditableWarning:!0,className:$i("block-editor-rich-text__editable",N.className,"rich-text"),tabIndex:0!==N.tabIndex||J?N.tabIndex:null,"data-wp-block-attribute-key":B})]})}const TM=(MM=(0,a.forwardRef)(EM),(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?wM:MM;return(0,$.jsx)(r,{...e,value:n,onChange:o,ref:t})})));var MM;TM.Content=SM,TM.isEmpty=e=>!e||0===e.length;const PM=(0,a.forwardRef)(((e,t)=>{if(_()[f]){const{children:t,tagName:n="div",value:o,onChange:r,isSelected:i,multiline:s,inlineToolbar:l,wrapperClassName:a,autocompleters:c,onReplace:u,placeholder:d,allowedFormats:p,withoutInteractiveFormatting:h,onRemove:g,onMerge:m,onSplit:f,__unstableOnSplitAtEnd:b,__unstableOnSplitAtDoubleLineEnd:k,identifier:v,preserveWhiteSpace:_,__unstablePastePlainText:x,__unstableEmbedURLOnPaste:y,__unstableDisableFormats:S,disableLineBreaks:w,__unstableAllowPrefixTransformations:C,readOnly:B,...I}=jM(e);return(0,$.jsx)(n,{...I,dangerouslySetInnerHTML:{__html:yM(o,s)}})}return(0,$.jsx)(TM,{ref:t,...e,readOnly:!1})}));PM.Content=SM,PM.isEmpty=e=>!e||0===e.length;const RM=PM,NM=(0,a.forwardRef)(((e,t)=>(0,$.jsx)(RM,{ref:t,...e,__unstableDisableFormats:!0})));NM.Content=({value:e="",tagName:t="div",...n})=>(0,$.jsx)(t,{...n,children:e});const LM=NM,AM=(0,a.forwardRef)((({__experimentalVersion:e,...t},n)=>{if(2===e)return(0,$.jsx)(LM,{ref:n,...t});const{className:o,onChange:r,...i}=t;return(0,$.jsx)(mb.A,{ref:n,className:$i("block-editor-plain-text",o),onChange:e=>r(e.target.value),...i})}));function DM({property:e,viewport:t,desc:n}){const o=(0,u.useInstanceId)(DM),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,$.jsxs)($.Fragment,{children:[(0,$.jsx)("span",{"aria-describedby":`rbc-desc-${o}`,children:t.label}),(0,$.jsx)(Ji.VisuallyHidden,{as:"span",id:`rbc-desc-${o}`,children:r})]})}const OM=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:i,renderResponsiveControls:s,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||!i)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=i((0,$.jsx)(DM,{property:n,viewport:c}),c);return(0,$.jsxs)("fieldset",{className:"block-editor-responsive-block-control",children:[(0,$.jsx)("legend",{className:"block-editor-responsive-block-control__title",children:t}),(0,$.jsxs)("div",{className:"block-editor-responsive-block-control__inner",children:[(0,$.jsx)(Ji.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-responsive-block-control__toggle",label:d,checked:!l,onChange:r,help:p}),(0,$.jsxs)("div",{className:$i("block-editor-responsive-block-control__group",{"is-responsive":l}),children:[!l&&h,l&&(s?s(u):u.map((e=>(0,$.jsx)(a.Fragment,{children:i((0,$.jsx)(DM,{property:n,viewport:e}),e)},e.id))))]})]})]})};function zM({character:e,type:t,onUse:n}){const o=(0,a.useContext)(CM),r=(0,a.useRef)();return r.current=n,(0,a.useEffect)((()=>{function n(n){ma.isKeyboardEvent[t](n,e)&&(r.current(),n.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}}),[e,t]),null}function VM({name:e,shortcutType:t,shortcutCharacter:n,...o}){let r,i="RichText.ToolbarControls";return e&&(i+=`.${e}`),t&&n&&(r=ma.displayShortcut[t](n)),(0,$.jsx)(Ji.Fill,{name:i,children:(0,$.jsx)(Ji.ToolbarButton,{...o,shortcut:r})})}function FM({inputType:e,onInput:t}){const n=(0,a.useContext)(BM),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 HM=(0,$.jsx)(Ji.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,$.jsx)(Ji.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 GM=(0,a.forwardRef)((function(e,t){const n=(0,c.useSelect)((e=>e(oi).__unstableGetEditorMode()),[]),{__unstableSetEditorMode:o}=te((0,c.useDispatch)(oi));return(0,$.jsx)(Ji.Dropdown,{renderToggle:({isOpen:o,onToggle:r})=>(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,...e,ref:t,icon:"navigation"===n?HM:uc,"aria-expanded":o,"aria-haspopup":"true",onClick:r,label:(0,C.__)("Tools")}),popoverProps:{placement:"bottom-start"},renderContent:()=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.NavigableMenu,{role:"menu","aria-label":(0,C.__)("Tools"),children:(0,$.jsx)(Ji.MenuItemsChoice,{value:"navigation"===n?"navigation":"edit",onSelect:o,choices:[{value:"edit",label:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(cl,{icon:uc}),(0,C.__)("Edit")]})},{value:"navigation",label:(0,$.jsxs)($.Fragment,{children:[HM,(0,C.__)("Select")]})}]})}),(0,$.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 $M({units:e,...t}){const[n]=ii("spacing.units"),o=(0,Ji.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vw"],units:e});return(0,$.jsx)(Ji.__experimentalUnitControl,{units:o,...t})}const UM=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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 WM 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,$.jsxs)("div",{className:"block-editor-url-input__button",children:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,icon:Ju,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,$.jsx)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink,children:(0,$.jsxs)("div",{className:"block-editor-url-input__button-modal-line",children:[(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,className:"block-editor-url-input__back",icon:UM,label:(0,C.__)("Close"),onClick:this.toggle}),(0,$.jsx)(Ma,{value:e||"",onChange:t}),(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,icon:wa,label:(0,C.__)("Submit"),type:"submit"})]})})]})}}const KM=WM,ZM=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.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"})}),qM="none",YM="custom",XM="media",QM="attachment",JM=["noreferrer","noopener"],eP=({linkDestination:e,onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:r,mediaLink:i,linkTarget:s,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),[k,v]=(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;(ha.focus.focusable.find(S.current)[0]||S.current).focus()}),[k,n,d]);const w=()=>{e!==XM&&e!==QM||x(""),v(!0)},B=()=>{v(!1)},I=()=>{const e=[{linkDestination:XM,title:(0,C.__)("Link to image file"),url:"image"===o?r:void 0,icon:ZM}];return"image"===o&&i&&e.push({linkDestination:QM,title:(0,C.__)("Link to attachment page"),url:"image"===o?i:void 0,icon:La}),e},j=(0,$.jsxs)(Ji.__experimentalVStack,{spacing:"3",children:[(0,$.jsx)(Ji.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(" ");JM.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=c?c:"").split(" ").filter((e=>!1===JM.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===s}),(0,$.jsx)(Ji.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,C.__)("Link rel"),value:null!=c?c:"",onChange:e=>{t({rel:e})}}),(0,$.jsx)(Ji.TextControl,{__next40pxDefaultSize:!0,__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,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ji.ToolbarButton,{icon:Ju,className:"components-toolbar__control",label:(0,C.__)("Link"),"aria-expanded":g,onClick:()=>{m(!0)},ref:b,isActive:!!n||d&&u}),g&&(0,$.jsx)(QT,{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,$.jsxs)(Ji.NavigableMenu,{children:[I().map((e=>(0,$.jsx)(Ji.MenuItem,{icon:e.icon,iconPosition:"left",onClick:()=>{x(null),(e=>{const n=I();let o;o=e?(n.find((t=>t.url===e))||{linkDestination:YM}).linkDestination:qM,t({linkDestination:o,href:e})})(e.url),B()},children:e.title},e.linkDestination))),u&&(0,$.jsx)(Ji.MenuItem,{className:"block-editor-url-popover__expand-on-click",icon:sB,info:(0,C.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{x(null),t({linkDestination:qM,href:""}),p?.(!0),B()},children:(0,C.__)("Expand on click")},"expand-on-click")]}),offset:13,children:d&&u&&!n&&!k?(0,$.jsxs)("div",{className:"block-editor-url-popover__expand-on-click",children:[(0,$.jsx)(cl,{icon:sB}),(0,$.jsxs)("div",{className:"text",children:[(0,$.jsx)("p",{children:(0,C.__)("Expand on click")}),(0,$.jsx)("p",{className:"description",children:(0,C.__)("Scales the image with a lightbox effect")})]}),(0,$.jsx)(Ji.Button,{icon:dc,label:(0,C.__)("Disable expand on click"),onClick:()=>{p?.(!1)},size:"compact"})]}):!n||k?(0,$.jsx)(QT.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:E,onChangeInputValue:x,onSubmit:e=>{if(_){const e=I().find((e=>e.url===_))?.linkDestination||YM;t({href:_,linkDestination:e,lightbox:{enabled:!1}})}B(),x(null),e.preventDefault()},autocompleteRef:y}):n&&!k?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(QT.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:w,urlLabel:P}),(0,$.jsx)(Ji.Button,{icon:dc,label:(0,C.__)("Remove link"),onClick:()=>{t({linkDestination:qM,href:""}),h?.()},size:"compact"})]}):void 0})]})};function tP(){return y()("wp.blockEditor.PreviewOptions",{version:"6.5"}),null}function nP(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:64)+"px",r="auto";switch(e){case"Tablet":case"Mobile":return{width:o(e),marginTop:n,marginBottom:n,marginLeft:r,marginRight:r,height:t,overflowY:"auto"};default:return{marginLeft:r,marginRight:r}}})(e)}function oP(){const e=(0,c.useSelect)((e=>e(oi).getBlockSelectionStart()),[]),t=(0,a.useRef)();gp(e,t);return e?(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current?.focus()},children:(0,C.__)("Skip to the selected block")}):null}const rP=window.wp.wordcount;function iP(){const{blocks:e}=(0,c.useSelect)((e=>{const{getMultiSelectedBlocks:t}=e(oi);return{blocks:t()}}),[]),t=(0,rP.count)((0,l.serialize)(e),"words");return(0,$.jsxs)("div",{className:"block-editor-multi-selection-inspector__card",children:[(0,$.jsx)(zf,{icon:DB,showColors:!0}),(0,$.jsxs)("div",{className:"block-editor-multi-selection-inspector__card-content",children:[(0,$.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,$.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)})]})]})}const sP=(0,$.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.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"})}),lP=(0,$.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,$.jsx)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"})}),aP={name:"settings",title:(0,C.__)("Settings"),value:"settings",icon:sP,className:"block-editor-block-inspector__tab-item"},cP={name:"styles",title:(0,C.__)("Styles"),value:"styles",icon:lP,className:"block-editor-block-inspector__tab-item"},uP={name:"list",title:(0,C.__)("List View"),value:"list-view",icon:Uj,className:"block-editor-block-inspector__tab-item"},dP=()=>{const e=(0,Ji.__experimentalUseSlotFills)(ua.slotName);return Boolean(e&&e.length)?(0,$.jsx)(Ji.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,C.__)("Advanced"),initialOpen:!1,children:(0,$.jsx)(da.Slot,{group:"advanced"})}):null},pP=()=>{const[e,t]=(0,a.useState)(),{multiSelectedBlocks:n}=(0,c.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:n}=e(oi);return{multiSelectedBlocks:t(n())}}),[]);return(0,a.useLayoutEffect)((()=>{void 0===e&&t(n.some((({attributes:e})=>!!e?.style?.position?.type)))}),[e,n,t]),(0,$.jsx)(Ji.PanelBody,{className:"block-editor-block-inspector__position",title:(0,C.__)("Position"),initialOpen:null!=e&&e,children:(0,$.jsx)(da.Slot,{group:"position"})})},hP=()=>{const e=(0,Ji.__experimentalUseSlotFills)(na.position.Slot.__unstableName);return Boolean(e&&e.length)?(0,$.jsx)(pP,{}):null},gP=({showAdvancedControls:e=!1})=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(da.Slot,{}),(0,$.jsx)(hP,{}),(0,$.jsx)(da.Slot,{group:"bindings"}),e&&(0,$.jsx)("div",{children:(0,$.jsx)(dP,{})})]}),mP=({blockName:e,clientId:t,hasBlockStyles:n})=>{const o=Rd({blockName:e});return(0,$.jsxs)($.Fragment,{children:[n&&(0,$.jsx)("div",{children:(0,$.jsx)(Ji.PanelBody,{title:(0,C.__)("Styles"),children:(0,$.jsx)(EE,{clientId:t})})}),(0,$.jsx)(da.Slot,{group:"color",label:(0,C.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,$.jsx)(da.Slot,{group:"background",label:(0,C.__)("Background image")}),(0,$.jsx)(da.Slot,{group:"filter"}),(0,$.jsx)(da.Slot,{group:"typography",label:(0,C.__)("Typography")}),(0,$.jsx)(da.Slot,{group:"dimensions",label:(0,C.__)("Dimensions")}),(0,$.jsx)(da.Slot,{group:"border",label:o}),(0,$.jsx)(da.Slot,{group:"styles"})]})},fP=["core/navigation"],bP=e=>!fP.includes(e),{Tabs:kP}=te(Ji.privateApis);function vP({blockName:e,clientId:t,hasBlockStyles:n,tabs:o}){const r=(0,c.useSelect)((e=>e(Sa.store).get("core","showIconLabels")),[]),i=bP(e)?void 0:uP.name;return(0,$.jsx)("div",{className:"block-editor-block-inspector__tabs",children:(0,$.jsxs)(kP,{defaultTabId:i,children:[(0,$.jsx)(kP.TabList,{children:o.map((e=>(0,$.jsx)(kP.Tab,{tabId:e.name,render:(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,icon:r?void 0:e.icon,label:r?void 0:e.title,className:e.className,children:r&&e.title})},e.name)))}),(0,$.jsx)(kP.TabPanel,{tabId:aP.name,focusable:!1,children:(0,$.jsx)(gP,{showAdvancedControls:!!e})}),(0,$.jsx)(kP.TabPanel,{tabId:cP.name,focusable:!1,children:(0,$.jsx)(mP,{blockName:e,clientId:t,hasBlockStyles:n})}),(0,$.jsx)(kP.TabPanel,{tabId:uP.name,focusable:!1,children:(0,$.jsx)(da.Slot,{group:"list"})})]},t)})}const _P=[];function xP(e){const t=[],{bindings:n,border:o,color:r,default:i,dimensions:s,list:l,position:a,styles:u,typography:d,effects:p}=na,h=bP(e),g=(0,Ji.__experimentalUseSlotFills)(l.Slot.__unstableName),m=!h&&!!g&&g.length,f=[...(0,Ji.__experimentalUseSlotFills)(o.Slot.__unstableName)||[],...(0,Ji.__experimentalUseSlotFills)(r.Slot.__unstableName)||[],...(0,Ji.__experimentalUseSlotFills)(s.Slot.__unstableName)||[],...(0,Ji.__experimentalUseSlotFills)(u.Slot.__unstableName)||[],...(0,Ji.__experimentalUseSlotFills)(d.Slot.__unstableName)||[],...(0,Ji.__experimentalUseSlotFills)(p.Slot.__unstableName)||[]].length,b=[...(0,Ji.__experimentalUseSlotFills)(ua.slotName)||[],...(0,Ji.__experimentalUseSlotFills)(n.Slot.__unstableName)||[]],k=[...(0,Ji.__experimentalUseSlotFills)(i.Slot.__unstableName)||[],...(0,Ji.__experimentalUseSlotFills)(a.Slot.__unstableName)||[],...m&&f>1?b:[]];m&&t.push(uP),k.length&&t.push(aP),f&&t.push(cP);const v=function(e,t={}){return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,c.useSelect)((e=>e(oi).getSettings().blockInspectorTabs),[]));return v?t:_P}const{createPrivateSlotFill:yP}=te(Ji.privateApis),{Fill:SP,Slot:wP}=yP("BlockInformation"),CP=e=>_()[p]?(0,$.jsx)(SP,{...e}):null;CP.Slot=e=>(0,$.jsx)(wP,{...e});const BP=CP;function IP({clientIds:e,onSelect:t}){return e.length?(0,$.jsx)(Ji.__experimentalVStack,{spacing:1,children:e.map((e=>(0,$.jsx)(jP,{onSelect:t,clientId:e},e)))}):null}function jP({clientId:e,onSelect:t}){const n=zm(e),o=uB({clientId:e,context:"list-view"}),{isSelected:r}=(0,c.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t(oi);return{isSelected:n(e)||o(e,!0)}}),[e]),{selectBlock:i}=(0,c.useDispatch)(oi);return(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,isPressed:r,onClick:async()=>{await i(e),t&&t(e)},children:(0,$.jsxs)(Ji.Flex,{children:[(0,$.jsx)(Ji.FlexItem,{children:(0,$.jsx)(zf,{icon:n?.icon})}),(0,$.jsx)(Ji.FlexBlock,{style:{textAlign:"left"},children:(0,$.jsx)(Ji.__experimentalTruncate,{children:o})})]})})}function EP({clientId:e}){return(0,$.jsx)(Ji.PanelBody,{title:(0,C.__)("Styles"),children:(0,$.jsx)(EE,{clientId:e})})}function TP({topLevelLockedBlock:e}){const t=(0,c.useSelect)((t=>{const{getClientIdsOfDescendants:n,getBlockName:o,getBlockEditingMode:r}=t(oi);return n(e).filter((e=>"core/list-item"!==o(e)&&"contentOnly"===r(e)))}),[e]),n=(0,c.useSelect)((t=>{const{getBlockName:n}=t(oi),{getBlockStyles:o}=t(l.store);return!!o(n(e))?.length}),[e]),o=zm(e);return(0,$.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,$.jsx)(Vf,{...o,className:o.isSynced&&"is-synced"}),(0,$.jsx)(BP.Slot,{}),n&&(0,$.jsx)(EP,{clientId:e}),t.length>0&&(0,$.jsx)(Ji.PanelBody,{title:(0,C.__)("Content"),children:(0,$.jsx)(IP,{clientIds:t})})]})}const MP=({animate:e,wrapper:t,children:n})=>e?t(n):n,PP=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const o=e&&"leftToRight"===e.enterDirection?-50:50;return(0,$.jsx)(Ji.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},children:n},t)},RP=({clientId:e,blockName:t})=>{const n=xP(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]),i=zm(e),s=Rd({blockName:t});return(0,$.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,$.jsx)(Vf,{...i,className:i.isSynced&&"is-synced"}),(0,$.jsx)(YE,{blockClientId:e}),(0,$.jsx)(BP.Slot,{}),o&&(0,$.jsx)(vP,{hasBlockStyles:r,clientId:e,blockName:t,tabs:n}),!o&&(0,$.jsxs)($.Fragment,{children:[r&&(0,$.jsx)(EP,{clientId:e}),(0,$.jsx)(da.Slot,{}),(0,$.jsx)(da.Slot,{group:"list"}),(0,$.jsx)(da.Slot,{group:"color",label:(0,C.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,$.jsx)(da.Slot,{group:"background",label:(0,C.__)("Background image")}),(0,$.jsx)(da.Slot,{group:"typography",label:(0,C.__)("Typography")}),(0,$.jsx)(da.Slot,{group:"dimensions",label:(0,C.__)("Dimensions")}),(0,$.jsx)(da.Slot,{group:"border",label:s}),(0,$.jsx)(da.Slot,{group:"styles"}),(0,$.jsx)(hP,{}),(0,$.jsx)(da.Slot,{group:"bindings"}),(0,$.jsx)("div",{children:(0,$.jsx)(dP,{})})]}),(0,$.jsx)(oP,{},"back")]})},NP=({showNoBlockSelectedMessage:e=!0})=>{const{count:t,selectedBlockName:n,selectedBlockClientId:o,blockType:r,topLevelLockedBlock:i}=(0,c.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o,getContentLockingParent:r,getTemplateLock:i}=te(e(oi)),s=t(),a=s&&o(s),c=a&&(0,l.getBlockType)(a);return{count:n(),selectedBlockClientId:s,selectedBlockName:a,blockType:c,topLevelLockedBlock:r(s)||("contentOnly"===i(s)||"core/block"===a?s:void 0)}}),[]),s=xP(r?.name),a=s?.length>1,u=function(e){return(0,c.useSelect)((t=>{if(e){const n=t(oi).getSettings().blockInspectorAnimation,o=n?.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:i}=t(oi);return i(r(),o,!0)[0]||e.name===o?n?.[e.name]:null}return null}),[e])}(r),d=Rd({blockName:n});if(t>1)return(0,$.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,$.jsx)(iP,{}),a?(0,$.jsx)(vP,{tabs:s}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(da.Slot,{}),(0,$.jsx)(da.Slot,{group:"color",label:(0,C.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,$.jsx)(da.Slot,{group:"background",label:(0,C.__)("Background image")}),(0,$.jsx)(da.Slot,{group:"typography",label:(0,C.__)("Typography")}),(0,$.jsx)(da.Slot,{group:"dimensions",label:(0,C.__)("Dimensions")}),(0,$.jsx)(da.Slot,{group:"border",label:d}),(0,$.jsx)(da.Slot,{group:"styles"})]})]});const p=n===(0,l.getUnregisteredTypeHandlerName)();return r&&o&&!p?i?(0,$.jsx)(TP,{topLevelLockedBlock:i}):(0,$.jsx)(MP,{animate:u,wrapper:e=>(0,$.jsx)(PP,{blockInspectorAnimationSettings:u,selectedBlockClientId:o,children:e}),children:(0,$.jsx)(RP,{clientId:o,blockName:r.name})}):e?(0,$.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,C.__)("No block selected.")}):null},LP=()=>(y()("__unstableUseClipboardHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),vy());function AP(e){return y()("CopyHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),(0,$.jsx)("div",{...e,ref:vy()})}const DP=()=>{};const OP=(0,a.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r=!1,__experimentalInsertionIndex:i,__experimentalInitialTab:s,__experimentalInitialCategory:l,__experimentalFilterValue:a,onPatternCategorySelection:u,onSelect:d=DP,shouldFocusBlock:p=!1,onClose:h},g){const{destinationRootClientId:m}=(0,c.useSelect)((n=>{const{getBlockRootClientId:o}=n(oi);return{destinationRootClientId:e||o(t)||void 0}}),[t,e]);return(0,$.jsx)(Gw,{onSelect:d,rootClientId:m,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r,__experimentalInsertionIndex:i,__experimentalFilterValue:a,onPatternCategorySelection:u,__experimentalInitialTab:s,__experimentalInitialCategory:l,shouldFocusBlock:p,ref:g,onClose:h})}));const zP=(0,a.forwardRef)((function(e,t){return(0,$.jsx)(OP,{...e,onPatternCategorySelection:void 0,ref:t})}));function VP(){return y()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const FP=-1!==window.navigator.userAgent.indexOf("Trident"),HP=new Set([ma.UP,ma.DOWN,ma.LEFT,ma.RIGHT]),GP=.75;function $P(){const e=(0,c.useSelect)((e=>e(oi).hasSelectedBlock()),[]);return(0,u.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,i,s;function l(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){i&&o.cancelAnimationFrame(i),i=o.requestAnimationFrame((()=>{c(e),i=null}))}function c({keyCode:e}){if(!h())return;const r=(0,ha.computeCaretRect)(o);if(!r)return;if(!s)return void(s=r);if(HP.has(e))return void(s=r);const i=r.top-s.top;if(0===i)return;const l=(0,ha.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?s.top/o.innerHeight:(s.top-u)/(o.innerHeight-u);if(0===c&&d<GP&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(s=r);const p=a?o.innerHeight:l.clientHeight;s.top+s.height>u+p||s.top<u?s=r:a?o.scrollBy(0,i):l.scrollTop+=i}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){h()&&(s=(0,ha.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(i)}}),[e])}const UP=FP?e=>e.children:function({children:e}){return(0,$.jsx)("div",{ref:$P(),className:"block-editor__typewriter",children:e})},WP=(0,a.createContext)({});function KP({children:e,uniqueId:t,blockName:n=""}){const o=(0,a.useContext)(WP),{name:r}=_();n=n||r;const i=(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,$.jsx)(WP.Provider,{value:i,children:e})}function ZP(e,t=""){const n=(0,a.useContext)(WP),{name:o}=_();return t=t||o,Boolean(n[t]?.has(e))}const qP=e=>(y()("wp.blockEditor.__experimentalRecursionProvider",{since:"6.5",alternative:"wp.blockEditor.RecursionProvider"}),(0,$.jsx)(KP,{...e})),YP=(...e)=>(y()("wp.blockEditor.__experimentalUseHasRecursion",{since:"6.5",alternative:"wp.blockEditor.useHasRecursion"}),ZP(...e));function XP({title:e,help:t,actions:n=[],onClose:o}){return(0,$.jsxs)(Ji.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4,children:[(0,$.jsxs)(Ji.__experimentalHStack,{alignment:"center",children:[(0,$.jsx)(Ji.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),(0,$.jsx)(Ji.__experimentalSpacer,{}),n.map((({label:e,icon:t,onClick:n})=>(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,className:"block-editor-inspector-popover-header__action",label:e,icon:t,variant:!t&&"tertiary",onClick:n,children:!t&&e},e))),o&&(0,$.jsx)(Ji.Button,{__next40pxDefaultSize:!1,className:"block-editor-inspector-popover-header__action",label:(0,C.__)("Close"),icon:zw,onClick:o})]}),t&&(0,$.jsx)(Ji.__experimentalText,{children:t})]})}const QP=(0,a.forwardRef)((function({onClose:e,onChange:t,showPopoverHeaderActions:n,isCompact:o,currentDate:r,...i},s){const l={startOfWeek:(0,eT.getSettings)().l10n.startOfWeek,onChange:t,currentDate:o?void 0:r,currentTime:o?r:void 0,...i},a=o?Ji.TimePicker:Ji.DateTimePicker;return(0,$.jsxs)("div",{ref:s,className:"block-editor-publish-date-time-picker",children:[(0,$.jsx)(XP,{title:(0,C.__)("Publish"),actions:n?[{label:(0,C.__)("Now"),onClick:()=>t?.(null)}]:void 0,onClose:e}),(0,$.jsx)(a,{...l})]})}));const JP=(0,a.forwardRef)((function(e,t){return(0,$.jsx)(QP,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})})),eR={button:"wp-element-button",caption:"wp-element-caption"},tR=e=>eR[e]?eR[e]:"",nR=()=>"";function oR(e,t,n){return"core/image"===e&&n?.lightbox?.allowEditing||!!t?.lightbox}function rR({onChange:e,value:t,inheritedValue:n,panelId:o}){const r=ji(),i=()=>{e(void 0)};let s=!1;return n?.lightbox?.enabled&&(s=n.lightbox.enabled),(0,$.jsx)($.Fragment,{children:(0,$.jsx)(Ji.__experimentalToolsPanel,{label:(0,C._x)("Settings","Image settings"),resetAll:i,panelId:o,dropdownMenuProps:r,children:(0,$.jsx)(Ji.__experimentalToolsPanelItem,{hasValue:()=>!!t?.lightbox,label:(0,C.__)("Expand on click"),onDeselect:i,isShownByDefault:!0,panelId:o,children:(0,$.jsx)(Ji.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Expand on click"),checked:s,onChange:t=>{e({enabled:t})}})})})})}function iR({value:e,onChange:t,inheritedValue:n=e}){const[o,r]=(0,a.useState)(null),i=n?.css;return(0,$.jsxs)(Ji.__experimentalVStack,{spacing:3,children:[o&&(0,$.jsx)(Ji.Notice,{status:"error",onRemove:()=>r(null),children:o}),(0,$.jsx)(Ji.TextareaControl,{label:(0,C.__)("Additional CSS"),__nextHasNoMarginBottom:!0,value:i,onChange:n=>function(n){if(t({...e,css:n}),o){const[e]=Uy([{css:n}],".for-validation-only");e&&r(null)}}(n),onBlur:function(e){if(!e?.target?.value)return void r(null);const[t]=Uy([{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 sR=new Map,lR=[],aR={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")},cR=function(e,t){var n,o,r=0;function i(){var i,s,l=n,a=arguments.length;e:for(;l;){if(l.args.length===arguments.length){for(s=0;s<a;s++)if(l.args[s]!==arguments[s]){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(i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return l={args:i,val:e.apply(null,i)},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||{},i.clear=function(){n=null,o=null,r=0},i}((()=>(0,l.getBlockTypes)().reduce(((e,{name:t,title:n})=>(e[t]=n,e)),{}))),uR=e=>null!==e&&"object"==typeof e;function dR(e,t,n=""){if(!uR(e)&&!uR(t))return e!==t?n.split(".").slice(0,2).join("."):void 0;e=uR(e)?e:{},t=uR(t)?t:{};const o=new Set([...Object.keys(e),...Object.keys(t)]);let r=[];for(const i of o){const o=n?n+"."+i:i,s=dR(e[i],t[i],o);s&&(r=r.concat(s))}return r}function pR(e,t){const n=JSON.stringify({next:e,previous:t});if(sR.has(n))return sR.get(n);const o=dR({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 sR.set(n,lR),lR;const r=[...new Set(o)].reduce(((e,t)=>{const n=function(e){if(aR[e])return aR[e];const t=e.split(".");if("blocks"===t?.[0]){const e=cR()?.[t[1]];return e||t[1]}return"elements"===t?.[0]?aR[t[1]]||t[1]:void 0}(t);return n&&e.push([t.split(".")[0],n]),e}),[]);return sR.set(n,r),r}function hR(e,t,n={}){let o=pR(e,t);const r=o.length,{maxResults:i}=n;return r?(i&&r>i&&(o=o.slice(0,i)),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)}}))):lR}function gR(e,t,n){if(null==e||!1===e)return;if(Array.isArray(e))return mR(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 mR(r.children,t,n);case a.RawHTML:return;case Hx.Content:return fR(t,n);case SM:return void t.push(r.value)}switch(typeof o){case"string":return void 0!==r.children?mR(r.children,t,n):void 0;case"function":return gR(o.prototype&&"function"==typeof o.prototype.render?new o(r).render():o(r),t,n)}}function mR(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;n<e.length;n++)gR(e[n],...t)}function fR(e,t){for(let n=0;n<t.length;n++){const{name:o,attributes:r,innerBlocks:i}=t[n];gR((0,l.getSaveElement)(o,r,(0,$.jsx)(Hx.Content,{})),e,i)}}const bR=[{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 kR({panelId:e,value:t,onChange:n,options:o=bR,defaultValue:r=bR[0].value,isShownByDefault:i=!0}){const s=null!=t?t:"fill",l=(0,a.useMemo)((()=>o.reduce(((e,t)=>(e[t.value]=t.help,e)),{})),[o]);return(0,$.jsx)(Ji.__experimentalToolsPanelItem,{label:(0,C.__)("Scale"),isShownByDefault:i,hasValue:()=>s!==r,onDeselect:()=>n(r),panelId:e,children:(0,$.jsx)(Ji.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Scale"),isBlock:!0,help:l[s],value:s,onChange:n,size:"__unstable-large",children:o.map((e=>(0,$.jsx)(Ji.__experimentalToggleGroupControlOption,{...e},e.value)))})})}function vR(){return vR=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},vR.apply(this,arguments)}function _R(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var xR=/^((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)-.*))$/,yR=_R((function(e){return xR.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));var SR=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}(),wR=Math.abs,CR=String.fromCharCode,BR=Object.assign;function IR(e){return e.trim()}function jR(e,t,n){return e.replace(t,n)}function ER(e,t){return e.indexOf(t)}function TR(e,t){return 0|e.charCodeAt(t)}function MR(e,t,n){return e.slice(t,n)}function PR(e){return e.length}function RR(e){return e.length}function NR(e,t){return t.push(e),e}var LR=1,AR=1,DR=0,OR=0,zR=0,VR="";function FR(e,t,n,o,r,i,s){return{value:e,root:t,parent:n,type:o,props:r,children:i,line:LR,column:AR,length:s,return:""}}function HR(e,t){return BR(FR("",null,null,"",null,null,0),e,{length:-e.length},t)}function GR(){return zR=OR>0?TR(VR,--OR):0,AR--,10===zR&&(AR=1,LR--),zR}function $R(){return zR=OR<DR?TR(VR,OR++):0,AR++,10===zR&&(AR=1,LR++),zR}function UR(){return TR(VR,OR)}function WR(){return OR}function KR(e,t){return MR(VR,e,t)}function ZR(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 qR(e){return LR=AR=1,DR=PR(VR=e),OR=0,[]}function YR(e){return VR="",e}function XR(e){return IR(KR(OR-1,eN(91===e?e+2:40===e?e+1:e)))}function QR(e){for(;(zR=UR())&&zR<33;)$R();return ZR(e)>2||ZR(zR)>3?"":" "}function JR(e,t){for(;--t&&$R()&&!(zR<48||zR>102||zR>57&&zR<65||zR>70&&zR<97););return KR(e,WR()+(t<6&&32==UR()&&32==$R()))}function eN(e){for(;$R();)switch(zR){case e:return OR;case 34:case 39:34!==e&&39!==e&&eN(zR);break;case 40:41===e&&eN(e);break;case 92:$R()}return OR}function tN(e,t){for(;$R()&&e+zR!==57&&(e+zR!==84||47!==UR()););return"/*"+KR(t,OR-1)+"*"+CR(47===e?e:$R())}function nN(e){for(;!ZR(UR());)$R();return KR(e,OR)}var oN="-ms-",rN="-moz-",iN="-webkit-",sN="comm",lN="rule",aN="decl",cN="@keyframes";function uN(e,t){for(var n="",o=RR(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function dN(e,t,n,o){switch(e.type){case"@import":case aN:return e.return=e.return||e.value;case sN:return"";case cN:return e.return=e.value+"{"+uN(e.children,o)+"}";case lN:e.value=e.props.join(",")}return PR(n=uN(e.children,o))?e.return=e.value+"{"+n+"}":""}function pN(e){return YR(hN("",null,null,null,[""],e=qR(e),0,[0],e))}function hN(e,t,n,o,r,i,s,l,a){for(var c=0,u=0,d=s,p=0,h=0,g=0,m=1,f=1,b=1,k=0,v="",_=r,x=i,y=o,S=v;f;)switch(g=k,k=$R()){case 40:if(108!=g&&58==TR(S,d-1)){-1!=ER(S+=jR(XR(k),"&","&\f"),"&\f")&&(b=-1);break}case 34:case 39:case 91:S+=XR(k);break;case 9:case 10:case 13:case 32:S+=QR(g);break;case 92:S+=JR(WR()-1,7);continue;case 47:switch(UR()){case 42:case 47:NR(mN(tN($R(),WR()),t,n),a);break;default:S+="/"}break;case 123*m:l[c++]=PR(S)*b;case 125*m:case 59:case 0:switch(k){case 0:case 125:f=0;case 59+u:h>0&&PR(S)-d&&NR(h>32?fN(S+";",o,n,d-1):fN(jR(S," ","")+";",o,n,d-2),a);break;case 59:S+=";";default:if(NR(y=gN(S,t,n,c,u,r,l,v,_=[],x=[],d),i),123===k)if(0===u)hN(S,t,y,y,_,i,d,l,x);else switch(99===p&&110===TR(S,3)?100:p){case 100:case 109:case 115:hN(e,y,y,o&&NR(gN(e,y,y,0,0,r,l,v,r,_=[],d),x),r,x,d,l,o?_:x);break;default:hN(S,y,y,y,[""],x,0,l,x)}}c=u=h=0,m=b=1,v=S="",d=s;break;case 58:d=1+PR(S),h=g;default:if(m<1)if(123==k)--m;else if(125==k&&0==m++&&125==GR())continue;switch(S+=CR(k),k*m){case 38:b=u>0?1:(S+="\f",-1);break;case 44:l[c++]=(PR(S)-1)*b,b=1;break;case 64:45===UR()&&(S+=XR($R())),p=UR(),u=d=PR(v=S+=nN(WR())),k++;break;case 45:45===g&&2==PR(S)&&(m=0)}}return i}function gN(e,t,n,o,r,i,s,l,a,c,u){for(var d=r-1,p=0===r?i:[""],h=RR(p),g=0,m=0,f=0;g<o;++g)for(var b=0,k=MR(e,d+1,d=wR(m=s[g])),v=e;b<h;++b)(v=IR(m>0?p[b]+" "+k:jR(k,/&\f/g,p[b])))&&(a[f++]=v);return FR(e,t,n,0===r?lN:l,a,c,u)}function mN(e,t,n){return FR(e,t,n,sN,CR(zR),MR(e,2,-2),0)}function fN(e,t,n,o){return FR(e,t,n,aN,MR(e,0,o),MR(e,o+1,-1),o)}var bN=function(e,t,n){for(var o=0,r=0;o=r,r=UR(),38===o&&12===r&&(t[n]=1),!ZR(r);)$R();return KR(e,OR)},kN=function(e,t){return YR(function(e,t){var n=-1,o=44;do{switch(ZR(o)){case 0:38===o&&12===UR()&&(t[n]=1),e[n]+=bN(OR-1,t,n);break;case 2:e[n]+=XR(o);break;case 4:if(44===o){e[++n]=58===UR()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=CR(o)}}while(o=$R());return e}(qR(e),t))},vN=new WeakMap,_N=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)||vN.get(n))&&!o){vN.set(e,!0);for(var r=[],i=kN(t,r),s=n.props,l=0,a=0;l<i.length;l++)for(var c=0;c<s.length;c++,a++)e.props[a]=r[l]?i[l].replace(/&\f/g,s[c]):s[c]+" "+i[l]}}},xN=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function yN(e,t){switch(function(e,t){return 45^TR(e,0)?(((t<<2^TR(e,0))<<2^TR(e,1))<<2^TR(e,2))<<2^TR(e,3):0}(e,t)){case 5103:return iN+"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 iN+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return iN+e+rN+e+oN+e+e;case 6828:case 4268:return iN+e+oN+e+e;case 6165:return iN+e+oN+"flex-"+e+e;case 5187:return iN+e+jR(e,/(\w+).+(:[^]+)/,iN+"box-$1$2"+oN+"flex-$1$2")+e;case 5443:return iN+e+oN+"flex-item-"+jR(e,/flex-|-self/,"")+e;case 4675:return iN+e+oN+"flex-line-pack"+jR(e,/align-content|flex-|-self/,"")+e;case 5548:return iN+e+oN+jR(e,"shrink","negative")+e;case 5292:return iN+e+oN+jR(e,"basis","preferred-size")+e;case 6060:return iN+"box-"+jR(e,"-grow","")+iN+e+oN+jR(e,"grow","positive")+e;case 4554:return iN+jR(e,/([^-])(transform)/g,"$1"+iN+"$2")+e;case 6187:return jR(jR(jR(e,/(zoom-|grab)/,iN+"$1"),/(image-set)/,iN+"$1"),e,"")+e;case 5495:case 3959:return jR(e,/(image-set\([^]*)/,iN+"$1$`$1");case 4968:return jR(jR(e,/(.+:)(flex-)?(.*)/,iN+"box-pack:$3"+oN+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+iN+e+e;case 4095:case 3583:case 4068:case 2532:return jR(e,/(.+)-inline(.+)/,iN+"$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(PR(e)-1-t>6)switch(TR(e,t+1)){case 109:if(45!==TR(e,t+4))break;case 102:return jR(e,/(.+:)(.+)-([^]+)/,"$1"+iN+"$2-$3$1"+rN+(108==TR(e,t+3)?"$3":"$2-$3"))+e;case 115:return~ER(e,"stretch")?yN(jR(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==TR(e,t+1))break;case 6444:switch(TR(e,PR(e)-3-(~ER(e,"!important")&&10))){case 107:return jR(e,":",":"+iN)+e;case 101:return jR(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+iN+(45===TR(e,14)?"inline-":"")+"box$3$1"+iN+"$2$3$1"+oN+"$2box$3")+e}break;case 5936:switch(TR(e,t+11)){case 114:return iN+e+oN+jR(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return iN+e+oN+jR(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return iN+e+oN+jR(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return iN+e+oN+e+e}return e}var SN=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case aN:e.return=yN(e.value,e.length);break;case cN:return uN([HR(e,{value:jR(e.value,"@","@"+iN)})],o);case lN: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 uN([HR(e,{props:[jR(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return uN([HR(e,{props:[jR(t,/:(plac\w+)/,":"+iN+"input-$1")]}),HR(e,{props:[jR(t,/:(plac\w+)/,":-moz-$1")]}),HR(e,{props:[jR(t,/:(plac\w+)/,oN+"input-$1")]})],o)}return""}))}}];const wN=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||SN;var r,i,s={},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++)s[t[n]]=!0;l.push(e)}));var a,c,u,d,p=[dN,(d=function(e){a.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],h=(c=[_N,xN].concat(o,p),u=RR(c),function(e,t,n,o){for(var r="",i=0;i<u;i++)r+=c[i](e,t,n,o)||"";return r});i=function(e,t,n,o){a=n,function(e){uN(pN(e),h)}(e?e+"{"+t.styles+"}":t.styles),o&&(g.inserted[t.name]=!0)};var g={key:t,sheet:new SR({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:i};return g.sheet.hydrate(l),g};const CN=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 BN={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 IN(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var jN=/[A-Z]|^ms/g,EN=/_EMO_([^_]+?)_([^]*?)_EMO_/g,TN=function(e){return 45===e.charCodeAt(1)},MN=function(e){return null!=e&&"boolean"!=typeof e},PN=IN((function(e){return TN(e)?e:e.replace(jN,"-$&").toLowerCase()})),RN=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(EN,(function(e,t,n){return LN={name:t,styles:n,next:LN},t}))}return 1===BN[e]||TN(e)||"number"!=typeof t||0===t?t:t+"px"};function NN(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 LN={name:n.name,styles:n.styles,next:LN},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)LN={name:o.name,styles:o.styles,next:LN},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+=NN(e,t,n[r])+";";else for(var i in n){var s=n[i];if("object"!=typeof s)null!=t&&void 0!==t[s]?o+=i+"{"+t[s]+"}":MN(s)&&(o+=PN(i)+":"+RN(i,s)+";");else if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var l=NN(e,t,s);switch(i){case"animation":case"animationName":o+=PN(i)+":"+l+";";break;default:o+=i+"{"+l+"}"}}else for(var a=0;a<s.length;a++)MN(s[a])&&(o+=PN(i)+":"+RN(i,s[a])+";")}return o}(e,t,n);case"function":if(void 0!==e){var r=LN,i=n(e);return LN=r,NN(e,t,i)}}if(null==t)return n;var s=t[n];return void 0!==s?s:n}var LN,AN=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var DN=!!ja.useInsertionEffect&&ja.useInsertionEffect,ON=DN||function(e){return e()},zN=(0,ja.createContext)("undefined"!=typeof HTMLElement?wN({key:"css"}):null);zN.Provider;var VN=function(e){return(0,ja.forwardRef)((function(t,n){var o=(0,ja.useContext)(zN);return e(t,o,n)}))},FN=(0,ja.createContext)({});var HN=function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)},GN=yR,$N=function(e){return"theme"!==e},UN=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?GN:$N},WN=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},KN=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;HN(t,n,o);ON((function(){return function(e,t,n){HN(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 ZN=function e(t,n){var o,r,i=t.__emotion_real===t,s=i&&t.__emotion_base||t;void 0!==n&&(o=n.label,r=n.target);var l=WN(t,n,i),a=l||UN(s),c=!a("as");return function(){var u=arguments,d=i&&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=VN((function(e,t,n){var o=c&&e.as||s,i="",u=[],p=e;if(null==e.theme){for(var h in p={},e)p[h]=e[h];p.theme=(0,ja.useContext)(FN)}"string"==typeof e.className?i=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&&(i=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="";LN=void 0;var i=e[0];null==i||void 0===i.raw?(o=!1,r+=NN(n,t,i)):r+=i[0];for(var s=1;s<e.length;s++)r+=NN(n,t,e[s]),o&&(r+=i[s]);AN.lastIndex=0;for(var l,a="";null!==(l=AN.exec(r));)a+="-"+l[1];return{name:CN(r)+a,styles:r,next:LN}}(d.concat(u),t.registered,p);i+=t.key+"-"+g.name,void 0!==r&&(i+=" "+r);var m=c&&void 0===l?UN(o):a,f={};for(var b in e)c&&"as"===b||m(b)&&(f[b]=e[b]);return f.className=i,f.ref=n,(0,ja.createElement)(ja.Fragment,null,(0,ja.createElement)(KN,{cache:t,serialized:g,isStringTag:"string"==typeof o}),(0,ja.createElement)(o,f))}));return g.displayName=void 0!==o?o:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",g.defaultProps=t.defaultProps,g.__emotion_real=g,g.__emotion_base=s,g.__emotion_styles=d,g.__emotion_forwardProp=l,Object.defineProperty(g,"toString",{value:function(){return"."+r}}),g.withComponent=function(t,o){return e(t,vR({},n,o,{shouldForwardProp:WN(g,o,!0)})).apply(void 0,d)},g}};const qN=ZN(Ji.__experimentalToolsPanelItem,{target:"ef8pe3d0"})({name:"957xgf",styles:"grid-column:span 1"});function YN({panelId:e,value:t={},onChange:n=(()=>{}),units:o,isShownByDefault:r=!0}){var i,s;const l="auto"===t.width?"":null!==(i=t.width)&&void 0!==i?i:"",a="auto"===t.height?"":null!==(s=t.height)&&void 0!==s?s:"",c=e=>o=>{const r={...t};o?r[e]=o:delete r[e],n(r)};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(qN,{label:(0,C.__)("Width"),isShownByDefault:r,hasValue:()=>""!==l,onDeselect:c("width"),panelId:e,children:(0,$.jsx)(Ji.__experimentalUnitControl,{label:(0,C.__)("Width"),placeholder:(0,C.__)("Auto"),labelPosition:"top",units:o,min:0,value:l,onChange:c("width"),size:"__unstable-large"})}),(0,$.jsx)(qN,{label:(0,C.__)("Height"),isShownByDefault:r,hasValue:()=>""!==a,onDeselect:c("height"),panelId:e,children:(0,$.jsx)(Ji.__experimentalUnitControl,{label:(0,C.__)("Height"),placeholder:(0,C.__)("Auto"),labelPosition:"top",units:o,min:0,value:a,onChange:c("height"),size:"__unstable-large"})})]})}const XN=function({panelId:e,value:t={},onChange:n=(()=>{}),aspectRatioOptions:o,defaultAspectRatio:r="auto",scaleOptions:i,defaultScale:s="fill",unitsOptions:l,tools:c=["aspectRatio","widthHeight","scale"]}){const u=void 0===t.width||"auto"===t.width?null:t.width,d=void 0===t.height||"auto"===t.height?null:t.height,p=void 0===t.aspectRatio||"auto"===t.aspectRatio?null:t.aspectRatio,h=void 0===t.scale||"fill"===t.scale?null:t.scale,[g,m]=(0,a.useState)(h),[f,b]=(0,a.useState)(p),k=u&&d?"custom":f,v=p||u&&d;return(0,$.jsxs)($.Fragment,{children:[c.includes("aspectRatio")&&(0,$.jsx)(vg,{panelId:e,options:o,defaultValue:r,value:k,onChange:e=>{const o={...t};b(e="auto"===e?null:e),e?o.aspectRatio=e:delete o.aspectRatio,e?g?o.scale=g:(o.scale=s,m(s)):delete o.scale,"custom"!==e&&u&&d&&delete o.height,n(o)}}),c.includes("widthHeight")&&(0,$.jsx)(YN,{panelId:e,units:l,value:{width:u,height:d},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:f&&(r.aspectRatio=f),f||!!e==!!o?g?r.scale=g:(r.scale=s,m(s)):delete r.scale,n(r)}}),c.includes("scale")&&v&&(0,$.jsx)(kR,{panelId:e,options:i,defaultValue:s,value:g,onChange:e=>{const o={...t};m(e="fill"===e?null:e),e?o.scale=e:delete o.scale,n(o)}})]})},QN=[{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 JN={};ee(JN,{...s,ExperimentalBlockCanvas:zj,ExperimentalBlockEditorProvider:Kf,getDuotoneFilter:ym,getRichTextValues:function(e=[]){l.__unstableGetBlockProps.skipFilters=!0;const t=[];return fR(t,e),l.__unstableGetBlockProps.skipFilters=!1,t.map((e=>e instanceof W.RichTextData?e:W.RichTextData.fromHTMLString(e)))},PrivateQuickInserter:Uw,extractWords:ZS,getNormalizedSearchTerms:YS,normalizeString:qS,PrivateListView:SE,ResizableBoxPopover:function({clientId:e,resizableBoxProps:t,...n}){return(0,$.jsx)(qg,{clientId:e,__unstablePopoverSlot:"block-toolbar",...n,children:(0,$.jsx)(Ji.ResizableBox,{...t})})},BlockInfo:BP,useHasBlockToolbar:gj,cleanEmptyObject:Ui,BlockQuickNavigation:IP,LayoutStyle:function({layout:e={},css:t,...n}){const o=yl(e.type),[r]=ii("spacing.blockGap"),i=null!==r;if(o){if(t)return(0,$.jsx)("style",{children:t});const r=o.getLayoutStyle?.({hasBlockGapSupport:i,layout:e,...n});if(r)return(0,$.jsx)("style",{children:r})}return null},BlockRemovalWarningModal:function({rules:e}){const{clientIds:t,selectPrevious:n,message:o}=(0,c.useSelect)((e=>te(e(oi)).getRemovalPromptData())),{clearBlockRemovalPrompt:r,setBlockRemovalRules:i,privateRemoveBlocks:s}=te((0,c.useDispatch)(oi));if((0,a.useEffect)((()=>(i(e),()=>{i()})),[e,i]),!o)return;return(0,$.jsxs)(Ji.Modal,{title:(0,C.__)("Be careful!"),onRequestClose:r,size:"medium",children:[(0,$.jsx)("p",{children:o}),(0,$.jsxs)(Ji.__experimentalHStack,{justify:"right",children:[(0,$.jsx)(Ji.Button,{variant:"tertiary",onClick:r,__next40pxDefaultSize:!0,children:(0,C.__)("Cancel")}),(0,$.jsx)(Ji.Button,{variant:"primary",onClick:()=>{s(t,n,!0),r()},__next40pxDefaultSize:!0,children:(0,C.__)("Delete")})]})]})},useLayoutClasses:Sf,useLayoutStyles:function(e={},t,n){const{layout:o={},style:r={}}=e,i=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||{},s=yl(i?.type||"default"),[l]=ii("spacing.blockGap"),a=null!==l;return s?.getLayoutStyle?.({blockName:t,selector:n,layout:o,style:r,hasBlockGapSupport:a})},DimensionsTool:XN,ResolutionTool:function({panelId:e,value:t,onChange:n,options:o=QN,defaultValue:r=QN[0].value,isShownByDefault:i=!0}){const s=null!=t?t:r;return(0,$.jsx)(Ji.__experimentalToolsPanelItem,{hasValue:()=>s!==r,label:(0,C.__)("Resolution"),onDeselect:()=>n(r),isShownByDefault:i,panelId:e,children:(0,$.jsx)(Ji.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,C.__)("Resolution"),value:s,options:o,onChange:n,help:(0,C.__)("Select the size of the source image."),size:"__unstable-large"})})},TabbedSidebar:Fw,TextAlignmentControl:Gp,usesContextKey:vM,useFlashEditableBlocks:Y_,globalStylesDataKey:Z,globalStylesLinksDataKey:q,selectBlockPatternsKey:Y,requiresWrapperOnCopy:by,PrivateRichText:TM,PrivateInserterLibrary:OP,reusableBlocksSelectKey:X,PrivateBlockPopover:Wg,PrivatePublishDateTimePicker:QP,useSpacingSizes:cg,useBlockDisplayTitle:uB,__unstableBlockStyleVariationOverridesWithConfig:function({config:e}){const{getBlockStyles:t,overrides:n}=(0,c.useSelect)((e=>({getBlockStyles:e(l.store).getBlockStyles,overrides:te(e(oi)).getStyleOverrides()})),[]),{getBlockName:o}=(0,c.useSelect)(oi),r=(0,a.useMemo)((()=>{if(!n?.length)return;const r=[],i=[];for(const[,s]of n)if(s?.variation&&s?.clientId&&!i.includes(s.clientId)){const n=o(s.clientId),a=e?.styles?.blocks?.[n]?.variations?.[s.variation];if(a){const o={settings:e?.settings,styles:{blocks:{[n]:{variations:{[`${s.variation}-${s.clientId}`]:a}}}}},c=df((0,l.getBlockTypes)(),t,s.clientId),u=cf(o,c,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0});r.push({id:`${s.variation}-${s.clientId}`,css:u,__unstableType:"variation",variation:s.variation,clientId:s.clientId}),i.push(s.clientId)}}return r}),[e,n,t,o]);if(r&&r.length)return(0,$.jsx)($.Fragment,{children:r.map((e=>(0,$.jsx)(bf,{override:e},e.id)))})},setBackgroundStyleDefaults:Yc,sectionRootClientIdKey:Q})})(),(window.wp=window.wp||{}).blockEditor=o})();