vendor: 4,511 bytes, lines 1-2
1/*! For license information please see index.js.LICENSE.txt */ 2(()=>{var e={6587(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(5556),c=n(9692),u=n(5467),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}))})},5323(e,t,n){"use strict";var o=n(6587);t.A=o.TextareaAutosize},9692(e,t){var n,o;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&&d()},l=function(t){window.removeEventListener("resize",s,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",l,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach(function(n){e.style[n]=t[n]}),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",l,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",s,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:l,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;
2)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach(function(e){e.node.scrollTop=e.scrollTop}),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var 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)}),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===(o=n.apply(t,[e,t]))||(e.exports=o)},8283(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()})]}},5255(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}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.callback;"function"==typeof n&&(i=n,n={}),this.options=n;var s=this;function l(e){return i?(setTimeout(function(){i(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],h=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&h+1>=c)return l([{value:this.join(t),count:t.length}]);function g(){for(var n=-1*u;n<=u;n+=2){var i=void 0,d=p[n-1],h=p[n+1],g=(h?h.newPos:0)-n;d&&(p[n-1]=void 0);var m=d&&d.newPos+1<a,f=h&&0<=g&&g<c;if(m||f){if(!m||f&&d.newPos<h.newPos?(i=r(h),s.pushComponent(i.components,void 0,!0)):((i=d).newPos++,s.pushComponent(i.components,!0,void 0)),g=s.extractCommon(i,t,e,n),i.newPos+1>=a&&g+1>=c)return l(o(s,i.components,t,e,s.useLongestToken));p[n]=i}else p[n]=void 0}u++}if(i)!function e(){setTimeout(function(){if(u>d)return i();g()||e()},0)}();else for(;u<=d;){var m=g();if(m)return m}},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("")}}},6687(e,t,n){"use strict";var o;t.JJ=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(5255))&&o.__esModule?o:{default:o}).default)},9252(e){"use strict";e.exports=function e(t,n){if(t===n)return!0;
vendor: 1,808 bytes, line 2
2if(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}},2017(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}}
2,5467(e,t,n){var o=n(8283);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=" ","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}},4030(e,t,n){e.exports=n(777)},7700(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},8751(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|Ice
vendor: 2,907 bytes, line 2
2weasel).(\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},8125(e,t,n){"use strict";var o,r=n(7700);r.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),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}},777(e,t,n){"use strict";var o=n(8751),r=n(8125);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},8633(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,bgGreen
2Bright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};e.exports=n(),e.exports.createColors=n},9193(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))})}}},9370(e,t,n){const o=n(5482);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},5482(e,t,n){var o=n(8809),r=n(8449),i=n(9063);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(2882),s.walk=r,s.stringify=i,e.exports=s},8809(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,_,y,x,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&&(!x||x&&"function"===x.type&&"calc"!==x.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||!x||"function"!==x.type||"calc"!==x.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(y=C,b={type:"function",sourceIndex:C-T.length,value:T,before:w.slice(y+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);y<_?(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=[],x=b;T=""}else if(n===B&&E)C+=1,B=w.charCodeAt(C),x.after=P,x.sourceEndIndex+=P.length,P="",E-=1,j[j.length-1].sourceEndIndex=C,j.pop(),S=(x=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&&x&&"function"===x.type&&"calc"===x.value||B===s&&"function"===x.type&&"calc"===x.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)||
vendor: 4,406 bytes, line 2
2!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}},9063(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},2882(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)}}},8449(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)}},396(e,t,n){"use strict";let o=n(7793);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)},9371(e,t,n){"use strict";let o=n(3152);class r extends o{constructor(e){super(e),this.type="comment"}}e.exports=r,r.default=r},7793(e,t,n){"use strict";let o,r,i,s,l=n(9371),a=n(5238),c=n(3152),{isClean:u,my:d}=n(4151);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{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]}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}
vendor: 10,944 bytes, line 2
2normalize(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)}))}}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)})}},3614(e,t,n){"use strict";let o=n(8633),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},5238(e,t,n){"use strict";let o=n(3152);class r extends o{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}e.exports=r,r.default=r},145(e,t,n){"use strict";let o,r,i=n(7793);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},1106(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(3614),d=n(3878),p=n(9746),h=Symbol("lineToIndexCache"),g=Boolean(s&&l),m=Boolean(i&&r);function f(e){if(e[h])return e[h];let t=e.css.split("\n"),n=new Array(t.length),o=0;for(let e=0,r=t.length;e<r;e++)n[e]=o,o+=t[e].length+1;return e[h]=n,n}class b{get from(){return this.file||this.id}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,this.document=this.css,t.document&&(this.document=t.document.toString()),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,l,a;if(t&&"object"==typeof t){let e=t,o=n;if("number"==typeof e.offset){l=e.offset;let o=this.fromOffset(l);t=o.line,n=o.col}else t=e.line,n=e.column,l=this.fromLineAndColumn(t,n);if("number"==typeof o.offset){s=o.offset;let e=this.fromOffset(s);i=e.line,r=e.col}else i=o.line,r=o.column,s=this.fromLineAndColumn(o.line,o.column)}else if(n)l=this.fromLineAndColumn(t,n);else{l=t;let e=this.fromOffset(l);t=e.line,n=e.col}let d=this.origin(t,n,i,r);return a=d?new u(e,void 0===d.endLine?d.line:{column:d.column,line:d.line},void 0===d.endLine?d.column:{column:d.endColumn,line:d.endLine},d.source,d.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),a.input={column:n,endColumn:r,endLine:i,endOffset:s,line:t,offset:l,source:this.css},this.file&&(c&&(a.input.url=c(this.file).toString()),a.input.file=this.file),a}fromLineAndColumn(e,t){return f(this)[e-1]+t-1}fromOffset(e){let t=f(this),n=0;if(e>=t[t.length-1])n=t.length-1;else{let o,r=t.length-2;for(;n<r;)if(o=n+(r-n>>1),e<t[o])r=o-1;else{if(!(e>=t[o+1])){n=o;break}n=o+1}}return{col:e-t[n]+1,line:n+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}}e.exports=b,b.default=b,p&&p.registerInput&&p.registerInput(b)},6966(e,t,n){"use strict";let o=n(7793),r=n(145),i=n(3604),s=n(9577),l=n(3717),a=n(5644),c=n(3303),{isClean:u,my:d}=n(4151);n(6156);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};function m(e){return"object"==typeof e&&"function"==typeof e.then}function f(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,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function b(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function k(e){return e[u]=!1,e.nodes&&e.nodes.forEach(e=>k(e)),e}let v={};class _{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"}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 _||t instanceof l)r=k(t.root),t.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let e=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=k(t);this.result=new l(e,r,n),this.helpers={...v,postcss:v,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={};
vendor: 10,540 bytes, line 2
2let 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(m(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=[b(e)];for(;t.length>0;){let e=this.visitTick(t);if(m(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 m(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(m(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(m(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(b(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,0===e)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=f(e);for(let n of t)if(0===n)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()}}_.registerPostcss=e=>{v=e},e.exports=_,_.default=_,a.registerLazyResult(_),r.registerLazyResult(_)},1752(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},3604(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(1106),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}}},4211(e,t,n){"use strict";let o=n(3604),r=n(9577);const i=n(3717);let s=n(3303);n(6156);class l{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"}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);
vendor: 2,364 bytes, line 2
2if(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[]}}e.exports=l,l.default=l},3152(e,t,n){"use strict";let o=n(3614),r=n(7668),i=n(3303),{isClean:s,my:l}=n(4151);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}function c(e,t){if(t&&void 0!==t.offset)return t.offset;let n=1,o=1,r=0;for(let i=0;i<e.length;i++){if(o===t.line&&n===t.column){r=i;break}"\n"===e[i]?(n=1,o+=1):n+=1}return r}class u{get proxyOf(){return this}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}
vendor: 5,055 bytes, line 2
2markDirty(){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={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let n="document"in this.source.input?this.source.input.document:this.source.input.css,o=n.slice(c(n,this.source.start),c(n,this.source.end)).indexOf(e.word);-1!==o&&(t=this.positionInside(o))}return t}positionInside(e){let t=this.source.start.column,n=this.source.start.line,o="document"in this.source.input?this.source.input.document:this.source.input.css,r=c(o,this.source.start),i=r+e;for(let e=r;e<i;e++)"\n"===o[e]?(t=1,n+=1):t+=1;return{column:t,line:n,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,n={column:this.source.start.column,line:this.source.start.line,offset:c(t,this.source.start)},o=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:c(t,this.source.end)+1}:{column:n.column+1,line:n.line,offset:n.offset+1};if(e.word){let r=t.slice(c(t,this.source.start),c(t,this.source.end)).indexOf(e.word);-1!==r&&(n=this.positionInside(r),o=this.positionInside(r+e.word.length))}else e.start?n={column:e.start.column,line:e.start.line,offset:c(t,e.start)}:e.index&&(n=this.positionInside(e.index)),e.end?o={column:e.end.column,line:e.end.line,offset:c(t,e.end)}:"number"==typeof e.endIndex?o=this.positionInside(e.endIndex):e.index&&(o=this.positionInside(e.index+1));return(o.line<n.line||o.line===n.line&&o.column<=n.column)&&(o={column:n.column+1,line:n.line,offset:n.offset+1}),{end:o,start:n}}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){if(null==o)continue;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)}}e.exports=u,u.default=u},9577(e,t,n){"use strict";let o=n(7793),r=n(1106),i=n(8339);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)},8339(e,t,n){"use strict";let o=n(396),r=n(9371),i=n(5238),s=n(5644),l=n(1534),a=n(5781);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);
vendor: 4,332 bytes, line 2
2if(/^\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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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)=>
vendor: 4,541 bytes, line 2
2e+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 "+e[0][1],{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})}}},3878(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},6846(e,t,n){"use strict";let o=n(145),r=n(6966),i=n(4211),s=n(5644);class l{constructor(e=[]){this.version="8.5.6",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)},3717(e,t,n){"use strict";let o=n(38);class r{get content(){return this.css}constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css="",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)}}
vendor: 5,103 bytes, line 2
2e.exports=r,r.default=r},5644(e,t,n){"use strict";let o,r,i=n(7793);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)},1534(e,t,n){"use strict";let o=n(7793),r=n(1752);class i extends o{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}e.exports=i,i.default=i,o.registerRule(i)},7668(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)}}
vendor: 6,249 bytes, line 2
2e.exports=n,n.default=n},3303(e,t,n){"use strict";let o=n(7668);function r(e,t){new o(t).stringify(e)}e.exports=r,r.default=r},4151(e){"use strict";e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},5781(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,y=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,x=/.[\r\n"'(/\\]/,S=/[\da-f]/i;e.exports=function(e,w={}){let C,B,I,j,E,T,M,P,R,A,N=e.css.valueOf(),L=w.ignoreErrors,D=N.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=N.charCodeAt(O),C){case i:case s:case a:case c:case l:j=O;do{j+=1,C=N.charCodeAt(j)}while(C===s||C===i||C===a||C===c||C===l);T=["space",N.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(A=z.length?z.pop()[1]:"",R=N.charCodeAt(O+1),"url"===A&&R!==t&&R!==n&&R!==s&&R!==i&&R!==a&&R!==l&&R!==c){j=O;do{if(M=!1,j=N.indexOf(")",j+1),-1===j){if(L||w){j=O;break}F("bracket")}for(P=j;N.charCodeAt(P-1)===o;)P-=1,M=!M}while(M);T=["brackets",N.slice(O,j+1),O,j],O=j}else j=N.indexOf(")",O+1),B=N.slice(O,j+1),-1===j||x.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=N.indexOf(E,j+1),-1===j){if(L||w){j=O+1;break}F("string")}for(P=j;N.charCodeAt(P-1)===o;)P-=1,M=!M}while(M);T=["string",N.slice(O,j+1),O,j],O=j;break;case v:_.lastIndex=O+1,_.test(N),j=0===_.lastIndex?N.length-1:_.lastIndex-2,T=["at-word",N.slice(O,j+1),O,j],O=j;break;case o:for(j=O,I=!0;N.charCodeAt(j+1)===o;)j+=1,I=!I;if(C=N.charCodeAt(j+1),I&&C!==r&&C!==s&&C!==i&&C!==a&&C!==c&&C!==l&&(j+=1,S.test(N.charAt(j)))){for(;S.test(N.charAt(j+1));)j+=1;N.charCodeAt(j+1)===s&&(j+=1)}T=["word",N.slice(O,j+1),O,j],O=j;break;default:C===r&&N.charCodeAt(O+1)===b?(j=N.indexOf("*/",O+2)+1,0===j&&(L||w?j=N.length:F("comment")),T=["comment",N.slice(O,j+1),O,j],O=j):(y.lastIndex=O+1,y.test(N),j=0===y.lastIndex?N.length-1:y.lastIndex-2,T=["word",N.slice(O,j+1),O,j],z.push(T),O=j)}return O++,T},position:function(){return O}}}},6156(e){"use strict";let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},38(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},2694(e,t,n){"use strict";var o=n(6925);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}},5556(e,t,n){e.exports=n(2694)()},6925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},731(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",Å:"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",
2yÌ:"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=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let o="",r=0|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:()=>Tg,AlignmentToolbar:()=>Mg,Autocomplete:()=>YI,BlockAlignmentControl:()=>ca,BlockAlignmentToolbar:()=>ua,BlockBreadcrumb:()=>oj,BlockCanvas:()=>wT,BlockColorsStyleSelector:()=>jT,BlockContextProvider:()=>Uk,BlockControls:()=>Ps,BlockEdit:()=>ov,BlockEditorKeyboardShortcuts:()=>Dk,BlockEditorProvider:()=>Fk,BlockFormatControls:()=>Ms,BlockIcon:()=>Au,BlockInspector:()=>lA,BlockList:()=>$S,BlockMover:()=>_j,BlockNavigationDropdown:()=>lM,BlockPopover:()=>Gm,BlockPreview:()=>Yw,BlockSelectionClearer:()=>gS,BlockSettingsMenu:()=>HE,BlockSettingsMenuControls:()=>NE,BlockStyles:()=>uM,BlockTitle:()=>nj,BlockToolbar:()=>dT,BlockTools:()=>fT,BlockVerticalAlignmentControl:()=>kl,BlockVerticalAlignmentToolbar:()=>vl,ButtonBlockAppender:()=>HB,ButtonBlockerAppender:()=>FB,ColorPalette:()=>PM,ColorPaletteControl:()=>RM,ContrastChecker:()=>oh,CopyHandler:()=>cA,DefaultBlockAppender:()=>nS,FontSizePicker:()=>OI,HeadingLevelDropdown:()=>mM,HeightControl:()=>sm,InnerBlocks:()=>AS,Inserter:()=>zB,InspectorAdvancedControls:()=>Da,InspectorControls:()=>Oa,JustifyContentControl:()=>xl,JustifyToolbar:()=>Sl,LineHeightControl:()=>Eh,LinkControl:()=>ru,MediaPlaceholder:()=>LP,MediaReplaceFlow:()=>lu,MediaUpload:()=>Ka,MediaUploadCheck:()=>Za,MultiSelectScrollIntoView:()=>hA,NavigableToolbar:()=>nT,ObserveTyping:()=>OS,PanelColorSettings:()=>DP,PlainText:()=>fR,RecursionProvider:()=>_A,RichText:()=>hR,RichTextShortcut:()=>vR,RichTextToolbarButton:()=>_R,SETTINGS_DEFAULTS:()=>P,SkipToSelectedBlock:()=>NR,ToolSelector:()=>IA,Typewriter:()=>kA,URLInput:()=>ic,URLInputButton:()=>wR,URLPopover:()=>PP,Warning:()=>tv,WritingFlow:()=>gw,__experimentalBlockAlignmentMatrixControl:()=>ej,__experimentalBlockFullHeightAligmentControl:()=>QI,__experimentalBlockPatternSetup:()=>BM,__experimentalBlockPatternsList:()=>SC,__experimentalBlockVariationPicker:()=>bM,__experimentalBlockVariationTransforms:()=>TM,__experimentalBorderRadiusControl:()=>Yd,__experimentalColorGradientControl:()=>Fp,__experimentalColorGradientSettingsDropdown:()=>FM,__experimentalDateFormatPicker:()=>LM,__experimentalDuotoneControl:()=>kf,__experimentalFontAppearanceControl:()=>jh,__experimentalFontFamilyControl:()=>Bh,__experimentalGetBorderClassesAndStyles:()=>yI,__experimentalGetColorClassesAndStyles:()=>wI,__experimentalGetElementClassName:()=>EA,__experimentalGetGapCSSValue:()=>cl,__experimentalGetGradientClass:()=>Tp,__experimentalGetGradientObjectByGradientValue:()=>Pp,__experimentalGetShadowClassesAndStyles:()=>SI,__experimentalGetSpacingClassesAndStyles:()=>BI,__experimentalImageEditor:()=>wP,__experimentalImageSizeControl:()=>jP,__experimentalImageURLInputUI:()=>MR,__experimentalInspectorPopoverHeader:()=>wA,__experimentalLetterSpacingControl:()=>Th,__experimentalLibrary:()=>pA,__experimentalLinkControl:()=>ou,__experimentalLinkControlSearchInput:()=>Vc,__experimentalLinkControlSearchItem:()=>Sc,__experimentalLinkControlSearchResults:()=>Pc,__experimentalListView:()=>iM,__experimentalPanelColorGradientSettings:()=>$M,__experimentalPreviewOptions:()=>PR,__experimentalPublishDateTimePicker:()=>BA,__experimentalRecursionProvider:()=>xA,__experimentalResponsiveBlockControl:()=>kR,__experimentalSpacingSizesControl:()=>rm,__experimentalTextDecorationControl:()=>Wh,__experimentalTextTransformControl:()=>Hh,__experimentalUnitControl:()=>xR,__experimentalUseBlockOverlayActive:()=>rj,__experimentalUseBlockPreview:()=>Xw,__experimentalUseBorderProps:()=>xI,__experimentalUseColorProps:()=>CI,__experimentalUseCustomSides:()=>of,__experimentalUseGradient:()=>Ap,__experimentalUseHasRecursion:()=>SA,__experimentalUseMultipleOriginColorsAndGradients:()=>jd,__experimentalUseResizeCanvas:()=>RR,__experimentalWritingModeControl:()=>Yh,__unstableBlockNameContext:()=>JE,__unstableBlockSettingsMenuFirstItem:()=>hE,__unstableBlockToolbarLastItem:()=>Xj,__unstableEditorStyles:()=>Fw,__unstableIframe:()=>_w,__unstableInserterMenuExtension:()=>CB,__unstableRichTextInputEvent:()=>yR,__unstableUseBlockSelectionClearer:()=>hS,__unstableUseClipboardHandler:()=>aA,__unstableUseMouseMoveTypingReset:()=>LS,__unstableUseTypewriter:()=>bA,__unstableUseTypingObserver:()=>DS,createCustomColorsHOC:()=>LI,getColorClassName:()=>Id,getColorObjectByAttributeValues:()=>Cd,getColorObjectByColorValue:()=>Bd,getComputedFluidTypographyValue:()=>Oi,getCustomValueFromPreset:()=>rl,getFontSize:()=>_g,getFontSizeClass:()=>xg,getFontSizeObjectByValue:()=>yg,getGradientSlugByValue:()=>Rp,getGradientValueBySlug:()=>Mp,getPxFromCssUnit:()=>TA,getSpacingPresetCssVar:()=>sl,getTypographyClassesAndStyles:()=>jI,isValueSpacingPreset:()=>ol,privateApis:()=>SL,store:()=>Ii,storeConfig:()=>Bi,transformStyles:()=>zw,useBlockBindingsUtils:()=>qk,useBlockCommands:()=>yT,useBlockDisplayInformation:()=>zf,useBlockEditContext:()=>C,useBlockEditingMode:()=>da,useBlockProps:()=>qx,useCachedTruthy:()=>EI,useHasRecursion:()=>yA,useInnerBlocksProps:()=>RS,useSetting:()=>
2Ti,useSettings:()=>Ei,useStyleOverride:()=>vs,withColorContext:()=>MM,withColors:()=>DI,withFontSizes:()=>FI});var e={};n.r(e),n.d(e,{getAllPatterns:()=>Oe,getBlockRemovalRules:()=>Me,getBlockSettings:()=>_e,getBlockStyles:()=>qe,getBlockWithoutAttributes:()=>we,getClosestAllowedInsertionPoint:()=>Je,getClosestAllowedInsertionPointForPattern:()=>et,getContentLockingParent:()=>Ge,getEnabledBlockParents:()=>Ee,getEnabledClientIdsTree:()=>je,getExpandedBlock:()=>Ue,getInserterMediaCategories:()=>Ne,getInsertionPoint:()=>tt,getLastFocus:()=>Fe,getLastInsertedBlocksClientIds:()=>Se,getOpenedBlockSettingsMenu:()=>Pe,getParentSectionBlock:()=>$e,getPatternBySlug:()=>De,getRegisteredInserterMediaCategories:()=>Ae,getRemovalPromptData:()=>Te,getReusableBlocks:()=>Ve,getSectionRootClientId:()=>Ye,getStyleOverrides:()=>Re,getTemporarilyEditingAsBlocks:()=>Ke,getTemporarilyEditingFocusModeToRevert:()=>Ze,getZoomLevel:()=>Qe,hasAllowedPatterns:()=>Le,hasBlockSpotlight:()=>ot,isBlockHidden:()=>nt,isBlockInterfaceHidden:()=>xe,isBlockSubtreeDisabled:()=>Ce,isContainerInsertableToInContentOnlyMode:()=>Be,isDragging:()=>He,isSectionBlock:()=>We,isZoomOut:()=>Xe});var t={};n.r(t),n.d(t,{__experimentalGetActiveBlockIdByBlockNames:()=>Eo,__experimentalGetAllowedBlocks:()=>so,__experimentalGetAllowedPatterns:()=>go,__experimentalGetBlockListSettingsForBlocks:()=>yo,__experimentalGetDirectInsertBlock:()=>ao,__experimentalGetGlobalBlocksByName:()=>Ot,__experimentalGetLastBlockAttributeChanges:()=>wo,__experimentalGetParsedPattern:()=>co,__experimentalGetPatternTransformItems:()=>bo,__experimentalGetPatternsByBlockTypes:()=>fo,__experimentalGetReusableBlockTitle:()=>xo,__unstableGetBlockWithoutInnerBlocks:()=>Tt,__unstableGetClientIdWithClientIdsTree:()=>Pt,__unstableGetClientIdsTree:()=>Rt,__unstableGetContentLockingParent:()=>zo,__unstableGetSelectedBlocksWithPartialSelection:()=>_n,__unstableGetTemporarilyEditingAsBlocks:()=>Vo,__unstableGetTemporarilyEditingFocusModeToRevert:()=>Fo,__unstableGetVisibleBlocks:()=>Ro,__unstableHasActiveBlockOverlayActive:()=>Ao,__unstableIsFullySelected:()=>fn,__unstableIsLastBlockChangeIgnored:()=>So,__unstableIsSelectionCollapsed:()=>bn,__unstableIsSelectionMergeable:()=>vn,__unstableIsWithinBlockOverlay:()=>No,__unstableSelectionHasUnmergeableBlock:()=>kn,areInnerBlocksControlled:()=>jo,canEditBlock:()=>Yn,canInsertBlockType:()=>Gn,canInsertBlocks:()=>$n,canLockBlockType:()=>Xn,canMoveBlock:()=>Zn,canMoveBlocks:()=>qn,canRemoveBlock:()=>Wn,canRemoveBlocks:()=>Kn,didAutomaticChange:()=>Bo,getAdjacentBlockClientId:()=>tn,getAllowedBlocks:()=>io,getBlock:()=>Et,getBlockAttributes:()=>jt,getBlockCount:()=>Ft,getBlockEditingMode:()=>Lo,getBlockHierarchyRootClientId:()=>Jt,getBlockIndex:()=>xn,getBlockInsertionPoint:()=>Dn,getBlockListSettings:()=>ko,getBlockMode:()=>Tn,getBlockName:()=>Bt,getBlockNamesByClientId:()=>Vt,getBlockOrder:()=>yn,getBlockParents:()=>Xt,getBlockParentsByBlockName:()=>Qt,getBlockRootClientId:()=>Yt,getBlockSelectionEnd:()=>$t,getBlockSelectionStart:()=>Gt,getBlockTransformItems:()=>oo,getBlocks:()=>Mt,getBlocksByClientId:()=>zt,getBlocksByName:()=>Dt,getClientIdsOfDescendants:()=>At,getClientIdsWithDescendants:()=>Nt,getDirectInsertBlock:()=>lo,getDraggedBlockClientIds:()=>Rn,getFirstMultiSelectedBlockClientId:()=>cn,getGlobalBlockCount:()=>Lt,getHoveredBlockClientId:()=>Po,getInserterItems:()=>no,getLastMultiSelectedBlockClientId:()=>un,getLowestCommonAncestorWithSelectedBlock:()=>en,getMultiSelectedBlockClientIds:()=>ln,getMultiSelectedBlocks:()=>an,getMultiSelectedBlocksEndClientId:()=>mn,getMultiSelectedBlocksStartClientId:()=>gn,getNextBlockClientId:()=>on,getPatternsByBlockTypes:()=>mo,getPreviousBlockClientId:()=>nn,getSelectedBlock:()=>qt,getSelectedBlockClientId:()=>Zt,getSelectedBlockClientIds:()=>sn,getSelectedBlockCount:()=>Wt,getSelectedBlocksInitialCaretPosition:()=>rn,getSelectionEnd:()=>Ut,getSelectionStart:()=>Ht,getSettings:()=>vo,getTemplate:()=>Vn,getTemplateLock:()=>Fn,hasBlockMovingClientId:()=>Co,hasDraggedInnerBlock:()=>Cn,hasInserterItems:()=>ro,hasMultiSelection:()=>In,hasSelectedBlock:()=>Kt,hasSelectedInnerBlock:()=>wn,isAncestorBeingDragged:()=>Nn,isAncestorMultiSelected:()=>hn,isBlockBeingDragged:()=>An,isBlockHighlighted:()=>Io,isBlockInsertionPointVisible:()=>On,isBlockMultiSelected:()=>pn,isBlockSelected:()=>Sn,isBlockValid:()=>It,isBlockVisible:()=>Mo,isBlockWithinSelection:()=>Bn,isCaretWithinFormattedText:()=>Ln,isDraggingBlocks:()=>Pn,isFirstMultiSelectedBlock:()=>dn,isGroupable:()=>Oo,isLastBlockChangePersistent:()=>_o,isMultiSelecting:()=>jn,isSelectionEnabled:()=>En,isTyping:()=>Mn,isUngroupable:()=>Do,isValidTemplate:()=>zn,wasBlockJustInserted:()=>To});var r={};n.r(r),n.d(r,{__experimentalUpdateSettings:()=>Go,clearBlockRemovalPrompt:()=>Yo,deleteStyleOverride:()=>er,ensureDefaultBlock:()=>Zo,expandBlock:()=>ir,hideBlockInterface:()=>$o,modifyContentLockBlock:()=>lr,privateRemoveBlocks:()=>Ko,resetZoomLevel:()=>cr,setBlockRemovalRules:()=>Xo,setInsertionPoint:()=>sr,setLastFocus:()=>tr,setOpenedBlockSettingsMenu:()=>Qo,setStyleOverride:()=>Jo,setZoomLevel:()=>ar,showBlockInterface:()=>Wo,startDragging:()=>
2or,stopDragging:()=>rr,stopEditingAsBlocks:()=>nr,toggleBlockSpotlight:()=>ur});var i={};n.r(i),n.d(i,{__unstableDeleteSelection:()=>$r,__unstableExpandSelection:()=>Kr,__unstableMarkAutomaticChange:()=>pi,__unstableMarkLastChangeAsPersistent:()=>ui,__unstableMarkNextChangeAsNotPersistent:()=>di,__unstableSaveReusableBlock:()=>ci,__unstableSetEditorMode:()=>hi,__unstableSetTemporarilyEditingAsBlocks:()=>xi,__unstableSplitSelection:()=>Wr,clearSelectedBlock:()=>Tr,duplicateBlocks:()=>mi,enterFormattedText:()=>oi,exitFormattedText:()=>ri,flashBlock:()=>vi,hideInsertionPoint:()=>Hr,hoverBlock:()=>wr,insertAfterBlock:()=>bi,insertBeforeBlock:()=>fi,insertBlock:()=>zr,insertBlocks:()=>Vr,insertDefaultBlock:()=>si,mergeBlocks:()=>Zr,moveBlockToPosition:()=>Or,moveBlocksDown:()=>Nr,moveBlocksToPosition:()=>Dr,moveBlocksUp:()=>Lr,multiSelect:()=>Er,receiveBlocks:()=>_r,registerInserterMediaCategory:()=>Si,removeBlock:()=>Yr,removeBlocks:()=>qr,replaceBlock:()=>Rr,replaceBlocks:()=>Pr,replaceInnerBlocks:()=>Xr,resetBlocks:()=>br,resetSelection:()=>vr,selectBlock:()=>Sr,selectNextBlock:()=>Br,selectPreviousBlock:()=>Cr,selectionChange:()=>ii,setBlockEditingMode:()=>wi,setBlockMovingClientId:()=>gi,setBlockVisibility:()=>yi,setHasControlledInnerBlocks:()=>_i,setTemplateValidity:()=>Ur,showInsertionPoint:()=>Fr,startDraggingBlocks:()=>ti,startMultiSelect:()=>Ir,startTyping:()=>Jr,stopDraggingBlocks:()=>ni,stopMultiSelect:()=>jr,stopTyping:()=>ei,synchronizeTemplate:()=>Gr,toggleBlockHighlight:()=>ki,toggleBlockMode:()=>Qr,toggleSelection:()=>Mr,unsetBlockEditingMode:()=>Ci,updateBlock:()=>xr,updateBlockAttributes:()=>yr,updateBlockListSettings:()=>li,updateSettings:()=>ai,validateBlocksToTemplate:()=>kr});var s={};n.r(s),n.d(s,{getItems:()=>Ub,getSettings:()=>Kb,isUploading:()=>Gb,isUploadingById:()=>Wb,isUploadingByUrl:()=>$b});var l={};n.r(l),n.d(l,{getAllItems:()=>Zb,getBlobUrls:()=>ek,getItem:()=>qb,getPausedUploadForPost:()=>Qb,isBatchUploaded:()=>Yb,isPaused:()=>Jb,isUploadingToPost:()=>Xb});var a={};n.r(a),n.d(a,{addItems:()=>dk,cancelItem:()=>pk});var c={};n.r(c),n.d(c,{addItem:()=>mk,finishOperation:()=>_k,pauseQueue:()=>bk,prepareItem:()=>yk,processItem:()=>fk,removeItem:()=>vk,resumeQueue:()=>kk,revokeBlobUrls:()=>Sk,updateSettings:()=>wk,uploadItem:()=>xk});var u={};n.r(u),n.d(u,{AdvancedPanel:()=>RA,BackgroundPanel:()=>wu,BorderPanel:()=>mp,ColorPanel:()=>nh,DimensionsPanel:()=>jm,FiltersPanel:()=>Pf,GlobalStylesContext:()=>rs,ImageSettingsPanel:()=>PA,TypographyPanel:()=>pg,areGlobalStyleConfigsEqual:()=>ns,getBlockCSSSelector:()=>xf,getBlockSelectors:()=>cb,getGlobalStylesChanges:()=>FA,getLayoutStyles:()=>ob,toStyles:()=>ab,useGlobalSetting:()=>as,useGlobalStyle:()=>cs,useGlobalStylesOutput:()=>pb,useGlobalStylesOutputWithConfig:()=>db,useGlobalStylesReset:()=>ls,useHasBackgroundPanel:()=>yu,useHasBorderPanel:()=>sp,useHasBorderPanelControls:()=>lp,useHasColorPanel:()=>Hp,useHasDimensionsPanel:()=>mm,useHasFiltersPanel:()=>Cf,useHasImageSettingsPanel:()=>MA,useHasTypographyPanel:()=>Jh,useSettingsForBlockElement:()=>us});const d=window.ReactJSXRuntime,p=window.wp.blocks,h=window.wp.element,g=window.wp.data,m=window.wp.compose,f=window.wp.hooks,b=Symbol("mayDisplayControls"),k=Symbol("mayDisplayParentControls"),v=Symbol("blockEditingMode"),_=Symbol("blockBindings"),y=Symbol("isPreviewMode"),x={name:"",isSelected:!1},S=(0,h.createContext)(x);S.displayName="BlockEditContext";const{Provider:w}=S;function C(){return(0,h.useContext)(S)}const B=window.wp.deprecated;var I=n.n(B),j=n(9252),E=n.n(j);const T=window.wp.i18n,M={insertUsage:{}},P={alignWide:!1,supportsLayout:!0,colors:[{name:(0,T.__)("Black"),slug:"black",color:"#000000"},{name:(0,T.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,T.__)("White"),slug:"white",color:"#ffffff"},{name:(0,T.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,T.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,T.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,T.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,T.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,T.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,T.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,T.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,T.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,T._x)("Small","font size name"),size:13,slug:"small"},{name:(0,T._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,T._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,T._x)("Large","font size name"),size:36,slug:"large"},{name:(0,T._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,T.__)("Thumbnail")},{slug:"medium",name:(0,T.__)("Medium")},{slug:"large",name:(0,T.__)("Large")},{slug:"full",name:(0,T.__)("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:[],isPreviewMode:!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,T.__)("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,T.__)("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,T.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,
20,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,T.__)("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,T.__)("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,T.__)("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,T.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,T.__)("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,T.__)("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,T.__)("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,T.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,T.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function R(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function A(e,t,n,o=1){const r=[...e];return r.splice(t,o),R(r,e.slice(t,t+o),n)}const N=Symbol("globalStylesDataKey"),L=Symbol("globalStylesLinks"),D=Symbol("selectBlockPatternsKey"),O=Symbol("reusableBlocksSelect"),z=Symbol("sectionRootClientIdKey"),V=Symbol("mediaEditKey"),F=window.wp.privateApis,{lock:H,unlock:U}=(0,F.__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"),{isContentBlock:G}=U(p.privateApis),$=e=>e;function W(e,t=""){const n=new Map,o=[];return n.set(t,o),e.forEach(e=>{const{clientId:t,innerBlocks:r}=e;o.push(t),W(r,t).forEach((e,t)=>{n.set(t,e)})}),n}function K(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 Z(e,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 q(e){return Z(e,e=>{const{attributes:t,...n}=e;return n})}function Y(e){return Z(e,e=>e.attributes)}function X(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&E()(e.clientIds,t.clientIds)&&function(e,t){return E()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function Q(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 J(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 ee=(0,m.pipe)(g.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),Q(o,n.blocks),J(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)}),J(o,[n.clientId],!1);break;case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":o.tree=new Map(o.tree),n.clientIds.forEach(e
2=>{o.tree.set(e,{...o.tree.get(e),attributes:o.attributes.get(e)})}),J(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)}),Q(o,n.blocks),J(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)}J(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)}),J(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),J(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),J(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})}),J(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(q(n.blocks)),attributes:new Map(Y(n.blocks)),order:W(n.blocks),parents:new Map(K(n.blocks)),c
2ontrolledInnerBlocks:{}};return e.tree=new Map(t?.tree),Q(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);if("SET_EXPLICIT_PERSISTENT"===i.type&&(n=i.isPersistentChange,s=r.isPersistentChange??!0),void 0!==n)return s=n,s===l.isPersistentChange?l:{...l,isPersistentChange:s};const a="MARK_LAST_CHANGE_AS_PERSISTENT"===i.type||o;return r!==l||a?(l={...l,isPersistentChange:a?!o:!X(i,t)},t=i,o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,l):(o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,s=r?.isPersistentChange??!0,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);
2return q(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)}),q(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 Y(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 n=!1;const o=new Map(e);for(const r of t.clientIds){const i=Object.entries(t.options?.uniqueByBlock?t.attributes[r]:t.attributes??{});if(0===i.length)continue;let s=!1;const l=e.get(r),a={};i.forEach(([e,t])=>{l[e]!==t&&(s=!0,a[e]=t)}),n=n||s,s&&o.set(r,{...l,...a})}return n?o: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)}
2),Y(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":{const n=W(t.blocks),o=new Map(e);return n.forEach((e,t)=>{""!==t&&o.set(t,e)}),o.set("",(e.get("")??[]).concat(n[""])),o}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],r=W(t.blocks,n),{index:i=o.length}=t,s=new Map(e);return r.forEach((e,t)=>{s.set(t,e)}),s.set(n,R(o,r.get(n),i)),s}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:i=e.get(o).length}=t;if(n===o){const t=e.get(o).indexOf(r[0]),n=new Map(e);return n.set(o,A(e.get(o),t,i,r.length)),n}const s=new Map(e);return s.set(n,e.get(n)?.filter(e=>!r.includes(e))??[]),s.set(o,R(e.get(o),r,i)),s}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,A(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,A(s,l,l+1,n.length)),a}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=W(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)=>{const r=e?.filter(e=>!t.removedClientIds.includes(e))??[];r.length!==e.length&&n.set(o,r)}),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);
2return K(t.blocks).forEach(([e,t])=>{n.set(e,t)}),n}case"INSERT_BLOCKS":{const n=new Map(e);return K(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)}),K(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 te(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 ne=(0,g.combineReducers)({blocks:ee,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=te(e.selectionStart,t),o=te(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]?E()(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"SET_INSERTION_POINT":return t.value;case"SELECT_BLOCK":return null}return e},insertionCue: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 E()(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=P,t){if("UPDATE_SETTINGS"===t.type){const n=t.reset?{...P,...t.settings}:{...e,...t.settings};return Object.defineProperty(n,"__unstableIsPreviewMode",{get(){return I()("__unstableIsPreviewMode",{since:"6.8",alternative:"isPreviewMode"}),this.isPreviewMode}}),n}return e},preferences:function(e=M,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,g.select)(p.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.options?.uniqueByBlock?t.attributes[n]:t.attributes}),{})}return e},lastFocus:function(e=!1,t){return"LAST_FOCUS"===t.type?t.lastFocus: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.focu
2sModeToRevert: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 e.get(t.clientId)===t.mode?e:new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{if(!e.has(t.clientId))return e;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){return"SET_OPENED_BLOCK_SETTINGS_MENU"===t.type?t?.clientId??null:e},registeredInserterMediaCategories:function(e=[],t){return"REGISTER_INSERTER_MEDIA_CATEGORY"===t.type?[...e,t.category]:e},zoomLevel:function(e=100,t){switch(t.type){case"SET_ZOOM_LEVEL":return t.zoom;case"RESET_ZOOM_LEVEL":return 100}return e},hasBlockSpotlight:function(e,t){switch(t.type){case"TOGGLE_BLOCK_SPOTLIGHT":const{clientId:n,hasBlockSpotlight:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":return t.clientId!==e?null:e;case"SELECTION_CHANGE":return t.start?.clientId!==e||t.end?.clientId!==e?null:e;case"CLEAR_SELECTED_BLOCK":return null}return e}});function oe(e,t){if(""===t){const n=e.blocks.tree.get(t);if(!n)return;return{clientId:"",...n}}if(!e.blocks.controlledInnerBlocks[t])return e.blocks.tree.get(t);const n=e.blocks.tree.get(`controlled||${t}`);return{...e.blocks.tree.get(t),innerBlocks:n?.innerBlocks}}function re(e,t,n){const o=oe(e,t);if(o&&(n(o),o?.innerBlocks?.length))for(const t of o?.innerBlocks)re(e,t.clientId,n)}function ie(e,t,n){if(!n.length)return;let o=e.blocks.parents.get(t);for(;void 0!==o;){if(n.includes(o))return o;o=e.blocks.parents.get(o)}}function se(e,t=""){const n=e?.zoomLevel<100||"auto-scaled"===e?.zoomLevel,o=new Map,r=e.settings?.[z],i=e.blocks.order.get(r),s=Array.from(e.blockEditingModes).some(([,e])=>"disabled"===e),l=[],a=[];
2Object.keys(e.blocks.controlledInnerBlocks).forEach(t=>{const n=e.blocks.byClientId?.get(t);"core/template-part"===n?.name&&l.push(t),"core/block"===n?.name&&a.push(t)});const c=[...Object.keys(e.blockListSettings).filter(t=>"contentOnly"===e.blockListSettings[t]?.templateLock),...window?.__experimentalContentOnlyPatternInsertion?Array.from(e.blocks.attributes.keys()).filter(t=>e.blocks.attributes.get(t)?.metadata?.patternName):[],...window?.__experimentalContentOnlyPatternInsertion?l:[]];return re(e,t,t=>{const{clientId:l,name:u}=t;if(!e.blockEditingModes.has(l)){if(s){let t,n=e.blocks.parents.get(l);for(;void 0!==n&&(e.blockEditingModes.has(n)&&(t=e.blockEditingModes.get(n)),!t);)n=e.blocks.parents.get(n);if("disabled"===t)return void o.set(l,"disabled")}if(n)return l===r||i?.length&&i.includes(l)?void o.set(l,"contentOnly"):void o.set(l,"disabled");if(a.length){if(a.includes(l))return ie(e,l,a)?void o.set(l,"disabled"):void 0;const n=ie(e,l,a);if(n){if(ie(e,n,a))return void o.set(l,"disabled");if(function(e){return e?.attributes?.metadata?.bindings&&Object.keys(e?.attributes?.metadata?.bindings).length}(t))return void o.set(l,"contentOnly");o.set(l,"disabled")}}c.length&&ie(e,l,c)&&(G(u)?o.set(l,"contentOnly"):o.set(l,"disabled"))}}),o}function le({prevState:e,nextState:t,addedBlocks:n,removedClientIds:o}){const r=e.derivedBlockEditingModes;let i;return o?.forEach(t=>{re(e,t,e=>{r.has(e.clientId)&&(i||(i=new Map(r)),i.delete(e.clientId))})}),n?.forEach(e=>{const n=se(t,e.clientId);n.size&&(i=i?new Map([...i?.size?i:[],...n]):new Map([...r?.size?r:[],...n]))}),i}var ae=(0,m.pipe)(function(e){return(t,n)=>{const o=e(t,n);if("SET_EDITOR_MODE"!==n.type&&o===t)return t;switch(n.type){case"REMOVE_BLOCKS":{const e=le({prevState:t,nextState:o,removedClientIds:n.clientIds});if(e)return{...o,derivedBlockEditingModes:e??t.derivedBlockEditingModes};break}case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=le({prevState:t,nextState:o,addedBlocks:n.blocks});if(e)return{...o,derivedBlockEditingModes:e??t.derivedBlockEditingModes};break}case"UPDATE_BLOCK_ATTRIBUTES":{const e=[],r=[];for(const i of n?.clientIds){const s=n.options?.uniqueByBlock?n.attributes[i]:n.attributes;if(!s)break;s.metadata?.patternName&&!t.blocks.attributes.get(i)?.metadata?.patternName?e.push(o.blocks.tree.get(i)):s.metadata&&!s.metadata?.patternName&&t.blocks.attributes.get(i)?.metadata?.patternName&&r.push(i)}if(!e?.length&&!r?.length)break;const i=le({prevState:t,nextState:o,addedBlocks:e,removedClientIds:r});if(i)return{...o,derivedBlockEditingModes:i??t.derivedBlockEditingModes};break}case"UPDATE_BLOCK_LIST_SETTINGS":{const e=[],r=[],i="string"==typeof n.clientId?{[n.clientId]:n.settings}:n.clientId;for(const n in i){const i="contentOnly"!==t.blockListSettings[n]?.templateLock&&"contentOnly"===o.blockListSettings[n]?.templateLock,s="contentOnly"===t.blockListSettings[n]?.templateLock&&"contentOnly"!==o.blockListSettings[n]?.templateLock;i?e.push(o.blocks.tree.get(n)):s&&r.push(n)}if(!e.length&&!r.length)break;const s=le({prevState:t,nextState:o,addedBlocks:e,removedClientIds:r});if(s)return{...o,derivedBlockEditingModes:s??t.derivedBlockEditingModes};break}case"SET_BLOCK_EDITING_MODE":case"UNSET_BLOCK_EDITING_MODE":case"SET_HAS_CONTROLLED_INNER_BLOCKS":{const e=oe(o,n.clientId);if(!e)break;const r=le({prevState:t,nextState:o,removedClientIds:[n.clientId],addedBlocks:[e]});if(r)return{...o,derivedBlockEditingModes:r??t.derivedBlockEditingModes};break}case"REPLACE_BLOCKS":{const e=le({prevState:t,nextState:o,addedBlocks:n.blocks,removedClientIds:n.clientIds});if(e)return{...o,derivedBlockEditingModes:e??t.derivedBlockEditingModes};break}case"REPLACE_INNER_BLOCKS":{const e=t.blocks.order.get(n.rootClientId),r=le({prevState:t,nextState:o,addedBlocks:n.blocks,removedClientIds:e});if(r)return{...o,derivedBlockEditingModes:r??t.derivedBlockEditingModes};break}case"MOVE_BLOCKS_TO_POSITION":{const e=n.clientIds.map(e=>o.blocks.byClientId.get(e)),r=le({prevState:t,nextState:o,addedBlocks:e,removedClientIds:n.clientIds});if(r)return{...o,derivedBlockEditingModes:r??t.derivedBlockEditingModes};break}case"UPDATE_SETTINGS":if(t?.settings?.[z]!==o?.settings?.[z])return{...o,derivedBlockEditingModes:se(o)};break;case"RESET_BLOCKS":case"SET_EDITOR_MODE":case"RESET_ZOOM_LEVEL":case"SET_ZOOM_LEVEL":return{...o,derivedBlockEditingModes:se(o)}}return o.derivedBlockEditingModes=t?.derivedBlockEditingModes??new Map,o}},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}})(ne);const ce=window.wp.primitives;var ue=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});const de=window.wp.richText,pe=window.wp.blockSerializationDefaultParser,he="core/block-editor";function ge(e,t,n){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const o=t.pop();let r=e;for(const e of t){const t=r[e];r=r[e]=Array.isArray(t)?[...t]:{...t}}return r[o]=n,e}
2const me=(e,t,n)=>{const o=Array.isArray(t)?t:t.split(".");let r=e;return o.forEach(e=>{r=r?.[e]}),r??n},fe=["color","border","dimensions","typography","spacing"],be={"color.palette":e=>e.colors,"color.gradients":e=>e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},ke={"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"},ve=e=>ke[e]||e;function _e(e,t,...n){const o=Bt(e,t),r=[];if(t){let n=t;do{const t=Bt(e,n);(0,p.hasBlockSupport)(t,"__experimentalSettings",!1)&&r.push(n)}while(n=e.blocks.parents.get(n))}return n.map(n=>{if(fe.includes(n))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let i=(0,f.applyFilters)("blockEditor.useSetting.before",void 0,n,t,o);if(void 0!==i)return i;const s=ve(n);for(const t of r){const n=jt(e,t);if(i=me(n.settings?.blocks?.[o],s)??me(n.settings,s),void 0!==i)break}const l=vo(e);if(void 0===i&&o&&(i=me(l.__experimentalFeatures?.blocks?.[o],s)),void 0===i&&(i=me(l.__experimentalFeatures,s)),void 0!==i)return p.__EXPERIMENTAL_PATHS_WITH_OVERRIDE[s]?i.custom??i.theme??i.default:i;const a=be[s]?.(l);return void 0!==a?a:"typography.dropCap"===s||void 0})}const{isContentBlock:ye}=U(p.privateApis);function xe(e){return e.isBlockInterfaceHidden}function Se(e){return e?.lastBlockInserted?.clientIds}function we(e,t){return e.blocks.byClientId.get(t)}const Ce=(e,t)=>{const n=t=>"disabled"===Lo(e,t)&&yn(e,t).every(n);return yn(e,t).every(n)};function Be(e,t,n){const o=ye(t),r=Bt(e,n),i=ye(r);return Ye(e)===n||i&&o}function Ie(e,t){const n=yn(e,t),o=[];for(const t of n){const n=Ie(e,t);"disabled"!==Lo(e,t)?o.push({clientId:t,innerBlocks:n}):o.push(...n)}return o}const je=(0,g.createRegistrySelector)(()=>(0,g.createSelector)(Ie,e=>[e.blocks.order,e.derivedBlockEditingModes,e.blockEditingModes])),Ee=(0,g.createSelector)((e,t,n=!1)=>Xt(e,t,n).filter(t=>"disabled"!==Lo(e,t)),e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]);function Te(e){return e.removalPromptData}function Me(e){return e.blockRemovalRules}function Pe(e){return e.openedBlockSettingsMenu}const Re=(0,g.createSelector)(e=>{const t=Nt(e).reduce((e,t,n)=>(e[t]=n,e),{});return[...e.styleOverrides].sort((e,n)=>{const[,{clientId:o}]=e,[,{clientId:r}]=n;return(t[o]??-1)-(t[r]??-1)})},e=>[e.blocks.order,e.styleOverrides]);function Ae(e){return e.registeredInserterMediaCategories}const Ne=(0,g.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]),Le=(0,g.createRegistrySelector)(e=>(0,g.createSelector)((t,n=null)=>{const{getAllPatterns:o}=U(e(he)),r=o(),{allowedBlockTypes:i}=vo(t);return r.some(e=>{const{inserter:o=!0}=e;if(!o)return!1;const r=ft(e);return kt(r,i)&&r.every(({name:e})=>Gn(t,e,n))})},(t,n)=>[...vt(e)(t),..._t(e)(t,n)])),De=(0,g.createRegistrySelector)(e=>(0,g.createSelector)((t,n)=>{if(n?.startsWith("core/block/")){const o=parseInt(n.slice(11),10),r=U(e(he)).getReusableBlocks().find(({id:e})=>e===o);return r?gt(r,t.settings.__experimentalUserPatternCategories):null}return[...t.settings.__experimentalBlockPatterns??[],...t.settings[D]?.(e)??[]].find(({name:e})=>e===n)},(t,n)=>n?.startsWith("core/block/")?[U(e(he)).getReusableBlocks(),t.settings.__experimentalReusableBlocks]:[t.settings.__experimentalBlockPatterns,t.settings[D]?.(e)])),Oe=(0,g.createRegistrySelector)(e=>(0,g.createSelector)(t=>[...U(e(he)).getReusableBlocks().map(e=>gt(e,t.settings.__experimentalUserPatternCategories)),...t.settings.__experimentalBlockPatterns??[],...t.settings[D]?.(e)??[]].filter((e,t,n
2)=>t===n.findIndex(t=>e.name===t.name)),vt(e))),ze=[],Ve=(0,g.createRegistrySelector)(e=>t=>{const n=t.settings[O];return(n?n(e):t.settings.__experimentalReusableBlocks)??ze});function Fe(e){return e.lastFocus}function He(e){return e.isDragging}function Ue(e){return e.expandedBlock}const Ge=(e,t)=>{let n,o=t;for(;!n&&(o=e.blocks.parents.get(o));)"contentOnly"===Fn(e,o)&&(n=o);return n},$e=(e,t)=>{let n,o=t;for(;!n&&(o=e.blocks.parents.get(o));)We(e,o)&&(n=o);return n};function We(e,t){const n=Bt(e,t);if("core/block"===n||"contentOnly"===Fn(e,t))return!0;const o=jt(e,t),r="core/template-part"===n;return!(!o?.metadata?.patternName&&!r||!window?.__experimentalContentOnlyPatternInsertion)}function Ke(e){return e.temporarilyEditingAsBlocks}function Ze(e){return e.temporarilyEditingFocusModeRevert}const qe=(0,g.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 Ye(e){return e.settings?.[z]}function Xe(e){return"auto-scaled"===e.zoomLevel||e.zoomLevel<100}function Qe(e){return e.zoomLevel}function Je(e,t,n=""){const o=Array.isArray(t)?t:[t],r=t=>o.every(n=>Gn(e,n,t));if(!n){if(r(n))return n;const t=Ye(e);return t&&r(t)?t:null}let i=n;for(;null!==i&&!r(i);)i=Yt(e,i);return i}function et(e,t,n){const{allowedBlockTypes:o}=vo(e);return kt(ft(t),o)?Je(e,ft(t).map(({blockName:e})=>e),n):null}function tt(e){return e.insertionPoint}const nt=(e,t)=>{const n=Bt(e,t);if(!(0,p.hasBlockSupport)(e,n,"visibility",!0))return!1;const o=e.blocks.attributes.get(t);return!1===o?.metadata?.blockVisibility};function ot(e){return!!e.hasBlockSpotlight}const rt={user:"user",theme:"theme",directory:"directory"},it="fully",st="unsynced",lt={name:"allPatterns",label:(0,T._x)("All","patterns")},at={name:"myPatterns",label:(0,T.__)("My patterns")},ct={name:"core/starter-content",label:(0,T.__)("Starter content")};function ut(e,t,n){const o=e.name.startsWith("core/block"),r="core"===e.source||e.source?.startsWith("pattern-directory");return!(t!==rt.theme||!o&&!r)||!(t!==rt.directory||!o&&r)||t===rt.user&&e.type!==rt.user||n===it&&""!==e.syncStatus||!(n!==st||"unsynced"===e.syncStatus||!o)}const dt=Symbol("isFiltered"),pt=new WeakMap,ht=new WeakMap;function gt(e,t=[]){return{name:`core/block/${e.id}`,id:e.id,type:rt.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}}function mt(e){let t=pt.get(e);return t||(t=function(e){const t=(0,p.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}}
2),{...e,blocks:t}}(e),pt.set(e,t)),t}function ft(e){let t=ht.get(e);return t||(t=(0,pe.parse)(e.content),t=t.filter(e=>null!==e.blockName),ht.set(e,t)),t}const bt=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,kt=(e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!bt(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach(e=>{n.push(e)})}return!0},vt=e=>t=>[t.settings.__experimentalBlockPatterns,t.settings.__experimentalUserPatternCategories,t.settings.__experimentalReusableBlocks,t.settings[D]?.(e),t.blockPatterns,U(e(he)).getReusableBlocks()],_t=()=>(e,t)=>[e.blockListSettings[t],e.blocks.byClientId.get(t),e.settings.allowedBlockTypes,e.settings.templateLock,Lo(e,t),Ye(e),We(e,t)];function yt(e,t,n="asc"){return e.concat().sort(((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})(t,e,n))}const{isContentBlock:xt}=U(p.privateApis),St=[],wt=new Set,Ct={[dt]:!0};function Bt(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==h.Platform.OS&&n?.name===o){const n=e.blocks.attributes.get(t),{service:r}=n??{};return r?`${o}-${r}`:o}return n?n.name:null}function It(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function jt(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function Et(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const Tt=(0,g.createSelector)((e,t)=>{const n=e.blocks.byClientId.get(t);return n?{...n,attributes:jt(e,t)}:null},(e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]);function Mt(e,t){const n=t&&jo(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||St}const Pt=(0,g.createSelector)((e,t)=>(I()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:Rt(e,t)}),e=>[e.blocks.order]),Rt=(0,g.createSelector)((e,t="")=>(I()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),yn(e,t).map(t=>Pt(e,t))),e=>[e.blocks.order]),At=(0,g.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]),Nt=e=>At(e,""),Lt=(0,g.createSelector)((e,t)=>{const n=Nt(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]),Dt=(0,g.createSelector)((e,t)=>{if(!t)return St;const n=Array.isArray(t)?t:[t],o=Nt(e).filter(t=>{const o=e.blocks.byClientId.get(t);return n.includes(o.name)});return o.length>0?o:St},e=>[e.blocks.order,e.blocks.byClientId]);function Ot(e,t){return I()("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",{since:"6.5",alternative:"wp.data.select( 'core/block-editor' ).getBlocksByName"}),Dt(e,t)}const zt=(0,g.createSelector)((e,t)=>(Array.isArray(t)?t:[t]).map(t=>Et(e,t)),(e,t)=>(Array.isArray(t)?t:[t]).map(t=>e.blocks.tree.get(t))),Vt=(0,g.createSelector)((e,t)=>zt(e,t).filter(Boolean).map(e=>e.name),(e,t)=>zt(e,t));function Ft(e,t){return yn(e,t).length}function Ht(e){return e.selection.selectionStart}function Ut(e){return e.selection.selectionEnd}function Gt(e){return e.selection.selectionStart.clientId}function $t(e){return e.selection.selectionEnd.clientId}function Wt(e){return ln(e).length||(e.selection.selectionStart.clientId?1:0)}function Kt(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function Zt(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function qt(e){const t=Zt(e);return t?Et(e,t):null}function Yt(e,t){return e.blocks.parents.get(t)??null}const Xt=(0,g.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():St},e=>[e.blocks.parents]),Qt=(0,g.createSelector)((e,t,n,o=!1)=>{const r=Xt(e,t,o),i=Array.isArray(n)?e=>n.includes(e):e=>n===e;return r.filter(t=>i(Bt(e,t)))},e=>[e.blocks.parents]);function Jt(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function en(e,t){const n=Zt(e),o=[...Xt(e,t),t],r=[...Xt(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 tn(e,t,n=1){if(void 0===t&&(t=Zt(e)),void 0===t&&(t=n<0?cn(e):un(e)),!t)return null;const o=Yt(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 nn(e,t){return tn(e,t,-1)}function on(e,t){return tn(e,t,1)}function rn(e){return e.initialPosition}const sn=(0,g.createSelector)(e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return St;if(t.clientId===n.clientId)return[t.clientId];const o=Yt(e,t.clientId);if(null===o)return St;const r=yn(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 ln(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?St:sn(e)}const an=(0,g.createSelector)(e=>{const t=ln(e);return t.length?t.map(t=>Et(e,t)):St},e=>[...sn.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]);function cn(e){return ln(e)[0]||null}function un(e){const t=ln(e);return t[t.length-1]||null}function dn(e,t){return cn(e)===t}function pn(e,t){return-1!==ln(e).indexOf(t)}const hn=(0,g.createSelector)((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=Yt(e,n),o=pn(e,n);return o},e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]);function gn(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function mn(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function fn(e){const t=Ht(e),n=Ut(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function bn(e){const t=Ht(e),n=Ut(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function kn(e){return sn(e).some(t=>
2{const n=Bt(e,t);return!(0,p.getBlockType)(n).merge})}function vn(e,t){const n=Ht(e),o=Ut(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=Yt(e,n.clientId);if(r!==Yt(e,o.clientId))return!1;const i=yn(e,r);let s,l;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,l=n):(s=n,l=o);const a=t?l.clientId:s.clientId,c=t?s.clientId:l.clientId,u=Bt(e,a);if(!(0,p.getBlockType)(u).merge)return!1;const d=Et(e,c);if(d.name===u)return!0;const h=(0,p.switchToBlockType)(d,u);return h&&h.length}const _n=e=>{const t=Ht(e),n=Ut(e);if(t.clientId===n.clientId)return St;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return St;const o=Yt(e,t.clientId);if(o!==Yt(e,n.clientId))return St;const r=yn(e,o),i=r.indexOf(t.clientId),s=r.indexOf(n.clientId),[l,a]=i>s?[n,t]:[t,n],c=Et(e,l.clientId),u=Et(e,a.clientId),d=c.attributes[l.attributeKey],p=u.attributes[a.attributeKey];let h=(0,de.create)({html:d}),g=(0,de.create)({html:p});return h=(0,de.remove)(h,0,l.offset),g=(0,de.remove)(g,a.offset,g.text.length),[{...c,attributes:{...c.attributes,[l.attributeKey]:(0,de.toHTMLString)({value:h})}},{...u,attributes:{...u.attributes,[a.attributeKey]:(0,de.toHTMLString)({value:g})}}]};function yn(e,t){return e.blocks.order.get(t||"")||St}function xn(e,t){return yn(e,Yt(e,t)).indexOf(t)}function Sn(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function wn(e,t,n=!1){const o=sn(e);return!!o.length&&(n?o.some(n=>Xt(e,n,!0).includes(t)):o.some(n=>Yt(e,n)===t))}function Cn(e,t,n=!1){return yn(e,t).some(t=>An(e,t)||n&&Cn(e,t,n))}function Bn(e,t){if(!t)return!1;const n=ln(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function In(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function jn(e){return e.isMultiSelecting}function En(e){return e.isSelectionEnabled}function Tn(e,t){return e.blocksMode[t]||"visual"}function Mn(e){return e.isTyping}function Pn(e){return!!e.draggedBlocks.length}function Rn(e){return e.draggedBlocks}function An(e,t){return e.draggedBlocks.includes(t)}function Nn(e,t){return!!Pn(e)&&Xt(e,t).some(t=>An(e,t))}function Ln(){return I()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const Dn=(0,g.createSelector)(e=>{let t,n;const{insertionCue:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:i}=r;return i?(t=Yt(e,i)||void 0,n=xn(e,r.clientId)+1):n=yn(e).length,{rootClientId:t,index:n}},e=>[e.insertionCue,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]);function On(e){return null!==e.insertionCue}function zn(e){return e.template.isValid}function Vn(e){return e.settings.template}function Fn(e,t){return t?ko(e,t)?.templateLock??!1:e.settings.templateLock??!1}const Hn=(e,t,n=null)=>{let o,r;if(t&&"object"==typeof t?(o=t,r=t.name):(o=(0,p.getBlockType)(t),r=t),!o)return!1;const{allowedBlockTypes:i}=vo(e);if(!bt(i,r,!0))return!1;const s=(Array.isArray(o.parent)?o.parent:[]).concat(Array.isArray(o.ancestor)?o.ancestor:[]);if(s.length>0){if(s.includes("core/post-content"))return!0;let t=n,o=!1;do{if(s.includes(Bt(e,t))){o=!0;break}t=e.blocks.parents.get(t)}while(t);return o}return!0},Un=(e,t,n=null)=>{if(!Hn(e,t,n))return!1;let o;if(t&&"object"==typeof t?(o=t,t=o.name):o=(0,p.getBlockType)(t),Fn(e,n))return!1;const r=Lo(e,n??"");if("disabled"===r)return!1;const i=ko(e,n);if(n&&void 0===i)return!1;const s=xt(t),l=!!We(e,n),a=!!$e(e,n);if((l||a)&&!s)return!1;if((l||"contentOnly"===r)&&!Be(e,t,n))return!1;const c=Bt(e,n),u=(0,p.getBlockType)(c),d=u?.allowedBlocks;let h=bt(d,t);if(!1!==h){const e=i?.allowedBlocks,n=bt(e,t);null!==n&&(h=n)}const g=o.parent,m=bt(g,c);let b=!0;const k=o.ancestor;k&&(b=[n,...Xt(e,n)].some(t=>bt(k,Bt(e,t))));const v=b&&(null===h&&null===m||!0===h||!0===m);return v?(0,f.applyFilters)("blockEditor.__unstableCanInsertBlockType",v,o,n,{getBlock:Et.bind(null,e),getBlockParentsByBlockName:Qt.bind(null,e)}):v},Gn=(0,g.createRegistrySelector)(e=>(0,g.createSelector)(Un,(t,n,o)=>_t(e)(t,o)));function $n(e,t,n=null){return t.every(t=>Gn(e,Bt(e,t),n))}function Wn(e,t){const n=jt(e,t);if(null===n)return!0;
2if(void 0!==n.lock?.remove)return!n.lock.remove;const o=Yt(e,t);if(Fn(e,o))return!1;const r=!!$e(e,t),i=xt(Bt(e,t));if(r&&!i)return!1;const s=!!We(e,o),l=Lo(e,o);return!((s||"contentOnly"===l)&&!Be(e,Bt(e,t),o))&&"disabled"!==l}function Kn(e,t){return t.every(t=>Wn(e,t))}function Zn(e,t){const n=jt(e,t);if(null===n)return!0;if(void 0!==n.lock?.move)return!n.lock.move;const o=Yt(e,t),r=Fn(e,o);if("all"===r||"contentOnly"===r)return!1;const i=!!$e(e,t),s=xt(Bt(e,t));if(i&&!s)return!1;const l=!!We(e,o),a=Lo(e,o);return!((l||"contentOnly"===a)&&!Be(e,Bt(e,t),o))&&"disabled"!==Lo(e,o)}function qn(e,t){return t.every(t=>Zn(e,t))}function Yn(e,t){const n=jt(e,t);if(null===n)return!0;const{lock:o}=n;return!o?.edit}function Xn(e,t){return!!(0,p.hasBlockSupport)(t,"lock",!0)&&!!e.settings?.canLockBlocks}function Qn(e,t){return e.preferences.insertUsage?.[t]??null}const Jn=(e,t,n)=>!!(0,p.hasBlockSupport)(t,"inserter",!0)&&Un(e,t.name,n),eo=(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}},to=(e,{buildScope:t="inserter"})=>n=>{const o=n.name;let r=!1;(0,p.hasBlockSupport)(n.name,"multiple",!0)||(r=zt(e,Nt(e)).some(({name:e})=>e===n.name));const{time:i,count:s=0}=Qn(e,o)||{},l={id:o,name:n.name,title:n.title,icon:n.icon,isDisabled:r,frecency:eo(i,s)};if("transform"===t)return l;const a=(0,p.getBlockVariations)(n.name,"inserter");return{...l,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,parent:n.parent,ancestor:n.ancestor,variations:a,example:n.example,utility:1}},no=(0,g.createRegistrySelector)(e=>(0,g.createSelector)((t,n=null,o=Ct)=>{const r=Un(t,"core/block",n)?U(e(he)).getReusableBlocks().map(e=>{const n=e.wp_pattern_sync_status?ue:{src:ue,foreground:"var(--wp-block-synced-color)"},o=gt(e),{time:r,count:i=0}=Qn(t,o.name)||{},s=eo(r,i);return{id:o.name,name:"core/block",initialAttributes:{ref:e.id},title:o.title,icon:n,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:s,content:o.content,get blocks(){return mt(o).blocks},syncStatus:o.syncStatus}}):[],i=to(t,{buildScope:"inserter"});let s=(0,p.getBlockTypes)().filter(e=>(0,p.hasBlockSupport)(e,"inserter",!0)).map(i);s=!1!==o[dt]?s.filter(e=>Jn(t,e,n)):s.filter(e=>Hn(t,e,n)).map(e=>({...e,isAllowedInCurrentRoot:Jn(t,e,n)}));const l=[],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}=Qn(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:eo(r,i)}})(t,n);o.map(r).forEach(t=>{"core/paragraph/stretchy-paragraph"===t.id||"core/heading/stretchy-heading"===t.id?l.push(t):e.push(t)})}return e},[]);a.push(...l);const{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,p.getBlockTypes)(),U(e(he)).getReusableBlocks(),t.blocks.order,t.preferences.insertUsage,..._t(e)(t,n)])),oo=(0,g.createRegistrySelector)(e=>(0,g.createSelector)((e,t,n=null)=>{const o=Array.isArray(t)?t:[t],r=to(e,{buildScope:"transform"}),i=(0,p.getBlockTypes)().filter(t=>Jn(e,t,n)).map(r),s=Object.fromEntries(Object.entries(i).map(([,e])=>[e.name,e]));return yt((0,p.getPossibleBlockTransformations)(o).reduce((e,t)=>(s[t?.name]&&e.push(s[t.name]),e),[]),e=>s[e.name].frecency,"desc")},(t,n,o)=>[(0,p.getBlockTypes)(),t.preferences.insertUsage,..._t(e)(t,o)])),ro=(e,t=null)=>!!(0,p.getBlockTypes)().some(n=>Jn(e,n,t))||Un(e,"core/block",t),io=(0,g.createRegistrySelector)(e=>(0,g.createSelector)((e,t=null)=>{if(!t)return;const n=(0,p.getBlockTypes)().filter(n=>Jn(e,n,t));return Un(e,"core/block",t)&&n.push("core/block"),n},(t,n)=>[(0,p.getBlockTypes)(),..._t(e)(t,n)])),so=(0,g.createSelector)((e,t=null)=>(I()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),io(e,t)),(e,t)=>io.getDependants(e,t));function lo(e,t=null){if(!t)return;const{defaultBlock:n,directInsert:o}=e.blockListSettings[t]??{};return n&&o?n:void 0}function ao(e,t=null){return I()('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),lo(e,t)}const co=(0,g.createRegistrySelector)(e=>(t,n)=>{const o=U(e(he)).getPatternBySlug(n);return o?mt(o):null}),uo=e=>(t,n)=>[...vt(e)(t),..._t(e)(t,n)],po=new WeakMap;function ho(e){let t=po.get(e);return t||(t={...e,get blocks(){return mt(e).blocks}},po.set(e,t)),t}const go=(0,g.createRegistrySelector)(e=>(0,g.createSelector)((t,n=null,o=Ct)=>{const{getAllPatterns:r}=U(e(he)),i=r(),{allowedBlockTypes:s}=vo(t);return i.filter(({inserter:e=!0})=>!!e).map(ho).filter(e=>kt(ft(e),s)).filter(e=>ft(e).every(({blockName:e})=>!1!==o[dt]?Gn(t,e,n):Hn(t,e,n)))},uo(e))),mo=(0,g.createRegistrySelector)(e=>(0,g.createSelector)((t,n,o=null)=>{if(!n)return St;const r=e(he).__experimentalGetAllowedPatterns(o),i=Array.isArray(n)?n:[n],s=r.filter(e=>e?.blockTypes?.some?.(e=>i.includes(e)));return 0===s.length?St:s},(t,n,o)=>uo(e)(t,o))),fo=(0,g.createRegistrySelector)(e=>(I()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),e(he).getPatternsByBlockTypes)),bo=(0,g.createRegistrySelector)(e=>(0,g.createSelector)((t,n,o=null)=>{if(!n)return St;if(n.some(({clientId:e,innerBlocks:n})=>n.length||jo(t,e)))return St;const r=Array.from(new Set(n.map(({name:e})=>e)));return e(he).getPatternsByBlockTypes(r,o)},(t,n,o)=>uo(e)(t,o)));function ko(e,t){return e.blockListSettings[t]}function vo(e){return e.settings}function _o(e){return e.blocks.isPersistentChange}const yo=(0,g.createSelector)((e,t=[])=>t.reduce((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t,{}),e=>[e.blockListSettings]),xo=(0,g.createRegistrySelector)(e=>(0,g.createSelector)((t,n)=>{I()("wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle",{since:"6.6",ver
2sion:"6.8"});const o=U(e(he)).getReusableBlocks().find(e=>e.id===n);return o?o.title?.raw:null},()=>[U(e(he)).getReusableBlocks()]));function So(e){return e.blocks.isIgnoredChange}function wo(e){return e.lastBlockAttributesChange}function Co(){return I()('wp.data.select( "core/block-editor" ).hasBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),!1}function Bo(e){return!!e.automaticChangeStatus}function Io(e,t){return e.highlightedBlock===t}function jo(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Eo=(0,g.createSelector)((e,t)=>{if(!t.length)return null;const n=Zt(e);if(t.includes(Bt(e,n)))return n;const o=ln(e),r=Qt(e,n||o[0],t);return r?r[r.length-1]:null},(e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]);function To(e,t,n){const{lastBlockInserted:o}=e;return o.clientIds?.includes(t)&&o.source===n}function Mo(e,t){return e.blockVisibility?.[t]??!0}function Po(){I()("wp.data.select( 'core/block-editor' ).getHoveredBlockClientId",{since:"6.9",version:"7.1"})}const Ro=(0,g.createSelector)(e=>{const t=new Set(Object.keys(e.blockVisibility).filter(t=>e.blockVisibility[t]));return 0===t.size?wt:t},e=>[e.blockVisibility]);function Ao(e,t){if("default"!==Lo(e,t))return!1;if(!Yn(e,t))return!0;if(Xe(e)){const n=Ye(e);if(n){const o=yn(e,n);if(o?.includes(t))return!0}else if(t&&!Yt(e,t))return!0}return!(0,p.hasBlockSupport)(Bt(e,t),"__experimentalDisableBlockOverlay",!1)&&jo(e,t)&&!Sn(e,t)&&!wn(e,t,!0)}function No(e,t){let n=e.blocks.parents.get(t);for(;n;){if(Ao(e,n))return!0;n=e.blocks.parents.get(n)}return!1}function Lo(e,t=""){return null===t&&(t=""),e.derivedBlockEditingModes?.has(t)?e.derivedBlockEditingModes.get(t):e.blockEditingModes.has(t)?e.blockEditingModes.get(t):"default"}const Do=(0,g.createRegistrySelector)(e=>(t,n="")=>{const o=n||Zt(t);if(!o)return!1;const{getGroupingBlockName:r}=e(p.store),i=Et(t,o),s=r();return i&&(i.name===s||(0,p.getBlockType)(i.name)?.transforms?.ungroup)&&!!i.innerBlocks.length&&Wn(t,o)}),Oo=(0,g.createRegistrySelector)(e=>(t,n=St)=>{const{getGroupingBlockName:o}=e(p.store),r=o(),i=n?.length?n:sn(t),s=i?.length?Yt(t,i[0]):void 0;return Gn(t,r,s)&&i.length&&Kn(t,i)}),zo=(e,t)=>(I()("wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent",{since:"6.1",version:"6.7"}),Ge(e,t));function Vo(e){return I()("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks",{since:"6.1",version:"6.7"}),Ke(e)}function Fo(e){return I()("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingFocusModeToRevert",{since:"6.5",version:"6.7"}),Ze(e)}const Ho=window.wp.a11y,Uo=["inserterMediaCategories","blockInspectorAnimation","mediaSideload"];function Go(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let o=e;Object.hasOwn(o,"__unstableIsPreviewMode")&&(I()("__unstableIsPreviewMode argument in wp.data.dispatch('core/block-editor').updateSettings",{since:"6.8",alternative:"isPreviewMode"}),o={...o},o.isPreviewMode=o.__unstableIsPreviewMode,delete o.__unstableIsPreviewMode);let r=o;if(t&&"web"===h.Platform.OS){r={};for(const e in o)Uo.includes(e)||(r[e]=o[e])}return{type:"UPDATE_SETTINGS",settings:r,reset:n}}function $o(){return{type:"HIDE_BLOCK_INTERFACE"}}function Wo(){return{type:"SHOW_BLOCK_INTERFACE"}}const Ko=(e,t=!0,n=!1)=>({select:o,dispatch:r,registry:i})=>{if(!e||!e.length)return;var s;if(s=e,e=Array.isArray(s)?s:[s],!o.canRemoveBlocks(e))return;const l=!n&&o.getBlockRemovalRules();if(l){let n=function(e){const t=[],n=[...e];for(;n.length;){const{innerBlocks:e,...o}=n.shift();n.push(...e),t.push(o)}return t};const i=n(e.map(o.getBlock));let s;for(const n of l)if(s=n.callback(i),s)return void r(qo(e,t,s))}t&&r.selectPreviousBlock(e[0],t),i.batch(()=>{r({type:"REMOVE_BLOCKS",clientIds:e}),r(Zo())})},Zo=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function qo(e,t,n){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,message:n}}function Yo(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function Xo(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function Qo(e){return{type:"SET_OPENED_BLOCK_SETTINGS_MENU",clientId:e}}function Jo(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function er(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function tr(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function nr(e){return({select:t,dispatch:n,registry:o})=>{const r=U(o.select(Ii)).getTemporarilyEditingFocusModeToRevert();
2n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:"contentOnly"}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:"contentOnly"}),n.updateSettings({focusMode:r}),n.__unstableSetTemporarilyEditingAsBlocks()}}function or(){return{type:"START_DRAGGING"}}function rr(){return{type:"STOP_DRAGGING"}}function ir(e){return{type:"SET_BLOCK_EXPANDED_IN_LIST_VIEW",clientId:e}}function sr(e){return{type:"SET_INSERTION_POINT",value:e}}const lr=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)},ar=(e=100)=>({select:t,dispatch:n})=>{if(100!==e){const e=t.getBlockSelectionStart(),o=t.getSectionRootClientId();if(e){let r;if(o){const n=t.getBlockOrder(o);r=n?.includes(e)?e:t.getBlockParents(e).find(e=>n.includes(e))}else r=t.getBlockHierarchyRootClientId(e);r?n.selectBlock(r):n.clearSelectedBlock(),(0,Ho.speak)((0,T.__)("You are currently in zoom-out mode."))}}n({type:"SET_ZOOM_LEVEL",zoom:e})};function cr(){return{type:"RESET_ZOOM_LEVEL"}}function ur(e,t){return{type:"TOGGLE_BLOCK_SPOTLIGHT",clientId:e,hasBlockSpotlight:t}}const dr=window.wp.notices,pr=window.wp.preferences,hr="Â";function gr(e){if(e)return Object.keys(e).find(t=>{const n=e[t];return("string"==typeof n||n instanceof de.RichTextData)&&-1!==n.toString().indexOf(hr)})}function mr(e){for(const[t,n]of Object.entries(e.attributes))if("rich-text"===n.source||"html"===n.source)return t}const fr=e=>Array.isArray(e)?e:[e],br=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(kr(e))},kr=e=>({select:t,dispatch:n})=>{const o=t.getTemplate(),r=t.getTemplateLock(),i=!o||"all"!==r||(0,p.doBlocksMatchTemplate)(e,o);if(i!==t.isValidTemplate())return n.setTemplateValidity(i),i};function vr(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function _r(e){return I()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function yr(e,t,n={uniqueByBlock:!1}){return"boolean"==typeof n&&(n={uniqueByBlock:n}),{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:fr(e),attributes:t,options:n}}function xr(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Sr(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}function wr(){return I()('wp.data.dispatch( "core/block-editor" ).hoverBlock',{since:"6.9",version:"7.1"}),{type:"DO_NOTHING"}}const Cr=(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)}},Br=e=>({select:t,dispatch:n})=>{const o=t.getNextBlockClientId(e);o&&n.selectBlock(o)};function Ir(){return{type:"START_MULTI_SELECT"}}function jr(){return{type:"STOP_MULTI_SELECT"}}const Er=(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,Ho.speak)((0,T.sprintf)((0,T._n)("%s block selected.","%s blocks selected.",i),i),"assertive")};function Tr(){return{type:"CLEAR_SELECTED_BLOCK"}}function Mr(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}const Pr=(e,t,n,o=0,r)=>({select:i,dispatch:s,registry:l})=>{e=fr(e),t=fr(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 Rr(e,t){return Pr(e,t)}const Ar=e=>(t,n)=>({select:o,dispatch:r})=>{o.canMoveBlocks(t)&&r({type:e,clientIds:fr(t),rootClientId:n})},Nr=Ar("MOVE_BLOCKS_DOWN"),Lr=Ar("MOVE_BLOCKS_UP"),Dr=(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 Or(e,t="",n="",o){return Dr([e],t,n,o)}function zr(e,t,n,o,r){return Vr([e],t,n,o,0,r)}const Vr=(e,t,n,o=!0,r=0,i)=>({select:s,dispatch:l})=>{null!==r&&"object"==typeof r&&(i=r,r=0,I()("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=fr(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 Hr=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function Ur(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const Gr=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=e.getBlocks(),o=e.getTemplate(),r=(0,p.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;
2const s=n.getBlockRootClientId(r.clientId);if(s!==n.getBlockRootClientId(i.clientId))return;const l=n.getBlockOrder(s);let a,c;l.indexOf(r.clientId)>l.indexOf(i.clientId)?(a=i,c=r):(a=r,c=i);const u=e?c:a,d=n.getBlock(u.clientId),h=(0,p.getBlockType)(d.name);if(!h.merge)return;const g=a,m=c,f=n.getBlock(g.clientId),b=n.getBlock(m.clientId),k=f.attributes[g.attributeKey],v=b.attributes[m.attributeKey];let _=(0,de.create)({html:k}),y=(0,de.create)({html:v});_=(0,de.remove)(_,g.offset,_.text.length),y=(0,de.insert)(y,hr,0,m.offset);const x=(0,p.cloneBlock)(f,{[g.attributeKey]:(0,de.toHTMLString)({value:_})}),S=(0,p.cloneBlock)(b,{[m.attributeKey]:(0,de.toHTMLString)({value:y})}),w=e?x:S,C=f.name===b.name?[w]:(0,p.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(x.attributes,e.attributes)}const I=gr(B),j=B[I],E=(0,de.create)({html:j}),T=E.text.indexOf(hr),M=(0,de.remove)(E,T,T+1),P=(0,de.toHTMLString)({value:M});B[I]=P;const R=n.getSelectedBlockClientIds(),A=[...e?C:[],{...d,attributes:{...d.attributes,...B}},...e?[]:C];t.batch(()=>{o.selectionChange(d.clientId,I,T,T),o.replaceBlocks(R,A,0,n.getSelectedBlocksInitialCaretPosition())})},Wr=(e=[])=>({registry:t,select:n,dispatch:o})=>{const r=n.getSelectionStart(),i=n.getSelectionEnd(),s=n.getBlockRootClientId(r.clientId),l=n.getBlockRootClientId(i.clientId);if(s!==l)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=c,h=u,g=n.getBlock(d.clientId),m=n.getBlock(h.clientId),f=(0,p.getBlockType)(g.name),b=(0,p.getBlockType)(m.name),k="string"==typeof d.attributeKey?d.attributeKey:mr(f),v="string"==typeof h.attributeKey?h.attributeKey:mr(b),_=n.getBlockAttributes(d.clientId),y=_?.metadata?.bindings;if(y?.[k]){if(e.length){const{createWarningNotice:e}=t.dispatch(dr.store);return void e((0,T.__)("Blocks can't be inserted into other blocks with bindings"),{type:"snackbar"})}return void o.insertAfterBlock(d.clientId)}if(!k||!v||void 0===r.offset||void 0===i.offset)return;if(d.clientId===h.clientId&&k===v&&d.offset===h.offset)if(e.length){if((0,p.isUnmodifiedDefaultBlock)(g))return void o.replaceBlocks([d.clientId],e,e.length-1,-1)}else if(!n.getBlockOrder(d.clientId).length){let e=function(){const e=(0,p.getDefaultBlockName)();return n.canInsertBlockType(e,s)?(0,p.createBlock)(e):(0,p.createBlock)(n.getBlockName(d.clientId))};const t=_[k].length;if(0===d.offset&&t)return void o.insertBlocks([e()],n.getBlockIndex(d.clientId),s,!1);if(d.offset===t)return void o.insertBlocks([e()],n.getBlockIndex(d.clientId)+1,s)}const x=g.attributes[k],S=m.attributes[v];let w=(0,de.create)({html:x}),C=(0,de.create)({html:S});w=(0,de.remove)(w,d.offset,w.text.length),C=(0,de.remove)(C,0,h.offset);let B={...g,innerBlocks:g.clientId===m.clientId?[]:g.innerBlocks,attributes:{...g.attributes,[k]:(0,de.toHTMLString)({value:w})}},I={...m,clientId:g.clientId===m.clientId?(0,p.createBlock)(m.name).clientId:m.clientId,attributes:{...m.attributes,[v]:(0,de.toHTMLString)({value:C})}};const j=(0,p.getDefaultBlockName)();if(g.clientId===m.clientId&&j&&I.name!==j&&n.canInsertBlockType(j,s)){const e=(0,p.switchToBlockType)(I,j);1===e?.length&&(I=e[0])}if(!e.length)return void o.replaceBlocks(n.getSelectedBlockClientIds(),[B,I]);let E;const M=[],P=[...e],R=P.shift(),A=(0,p.getBlockType)(B.name),N=A.merge&&R.name===A.name?[R]:(0,p.switchToBlockType)(R,A.name);if(N?.length){const e=N.shift();B={...B,attributes:{...B.attributes,...A.merge(B.attributes,e.attributes)}},M.push(B),E={clientId:B.clientId,attributeKey:k,offset:(0,de.create)({html:B.attributes[k]}).text.length},P.unshift(...N)}else(0,p.isUnmodifiedBlock)(B)||M.push(B),M.push(R);const L=P.pop(),D=(0,p.getBlockType)(I.name);if(P.length&&M.push(...P),L){const e=D.merge&&D.name===L.name?[L]:(0,p.switchToBlockType)(L,D.name);if(e?.length){const t=e.pop();M.push({...I,attributes:{...I.attributes,...D.merge(t.attributes,I.attributes)}}),M.push(...e),E={clientId:I.clientId,attributeKey:v,offset:(0,de.create)({html:t.attributes[v]}).text.length}}else M.push(L),(0,p.isUnmodifiedBlock)(I)||M.push(I)}else(0,p.isUnmodifiedBlock)(I)||M.push(I);t.batch(()=>{o.replaceBlocks(n.getSelectedBlockClientIds(),M,M.length-1,0),E&&o.selectionChange(E.clientId,E.attributeKey,E.offset,E.offset)})},Kr=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:o.clientId}})},Zr=(e,t)=>
2({registry:n,select:o,dispatch:r})=>{const i=e,s=t,l=o.getBlock(i),a=(0,p.getBlockType)(l.name);if(!a||"disabled"===o.getBlockEditingMode(i)||"disabled"===o.getBlockEditingMode(s))return;const c=o.getBlock(s);if(!a.merge&&(0,p.getBlockSupport)(l.name,"__experimentalOnMerge")){const e=(0,p.switchToBlockType)(c,a.name);if(1!==e?.length)return void r.selectBlock(l.clientId);const[t]=e;return t.innerBlocks.length<1?void r.selectBlock(l.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,p.isUnmodifiedDefaultBlock)(l))return void r.removeBlock(i,o.isBlockSelected(i));if((0,p.isUnmodifiedDefaultBlock)(c))return void r.removeBlock(s,o.isBlockSelected(s));if(!a.merge)return void((0,p.isUnmodifiedBlock)(c,"content")?r.removeBlock(s,o.isBlockSelected(s)):r.selectBlock(l.clientId));const u=(0,p.getBlockType)(c.name),{clientId:d,attributeKey:h,offset:g}=o.getSelectionStart(),m=(d===i?a:u).attributes[h],f=(d===i||d===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,p.cloneBlock)(l),k=(0,p.cloneBlock)(c);if(f){const e=d===i?b:k,t=e.attributes[h],n=(0,de.insert)((0,de.create)({html:t}),hr,g,g);e.attributes[h]=(0,de.toHTMLString)({value:n})}const v=l.name===c.name?[k]:(0,p.switchToBlockType)(k,l.name);if(!v||!v.length)return;const _=a.merge(b.attributes,v[0].attributes);if(f){const e=gr(_),t=_[e],n=(0,de.create)({html:t}),o=n.text.indexOf(hr),i=(0,de.remove)(n,o,o+1),s=(0,de.toHTMLString)({value:i});_[e]=s,r.selectionChange(l.clientId,e,o,o)}r.replaceBlocks([l.clientId,c.clientId],[{...l,attributes:{...l.attributes,..._}},...v.slice(1)],0)},qr=(e,t=!0)=>Ko(e,t);function Yr(e,t){return qr([e],t)}function Xr(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 Qr(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Jr(){return{type:"START_TYPING"}}function ei(){return{type:"STOP_TYPING"}}function ti(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function ni(){return{type:"STOP_DRAGGING_BLOCKS"}}function oi(){return I()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function ri(){return I()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function ii(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const si=(e,t,n)=>({dispatch:o})=>{const r=(0,p.getDefaultBlockName)();if(!r)return;const i=(0,p.createBlock)(r,e);return o.insertBlock(i,n,t)};function li(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function ai(e){return Go(e,{stripExperimentalSettings:!0})}function ci(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function ui(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function di(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const pi=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=e=>setTimeout(e,100)}=window;t(()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})})},hi=e=>({registry:t})=>{t.dispatch(pr.store).set("core","editorTool",e),"navigation"===e?(0,Ho.speak)((0,T.__)("You are currently in Write mode.")):"edit"===e&&(0,Ho.speak)((0,T.__)("You are currently in Design mode."))};function gi(){return I()('wp.data.dispatch( "core/block-editor" ).setBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),{type:"DO_NOTHING"}}const mi=(e,t=!0)=>({select:n,dispatch:o})=>{if(!e||!e.length)return;const r=n.getBlocksByClientId(e);if(r.some(e=>!e))return;if(r.map(e=>e.name).some(e=>!(0,p.hasBlockSupport)(e,"multiple",!0)))return;
2const i=n.getBlockRootClientId(e[0]),s=fr(e),l=n.getBlockIndex(s[s.length-1]),a=r.map(e=>(0,p.__experimentalCloneSanitizedBlock)(e));return o.insertBlocks(a,l+1,i,t),a.length>1&&t&&o.multiSelect(a[0].clientId,a[a.length-1].clientId),a.map(e=>e.clientId)},fi=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 l=(0,p.createBlock)(i.name,{...i.attributes,...s});return n.insertBlock(l,r,o)},bi=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 l=(0,p.createBlock)(i.name,{...i.attributes,...s});return n.insertBlock(l,r+1,o)};function ki(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const vi=(e,t=150)=>async({dispatch:n})=>{n(ki(e,!0)),await new Promise(e=>setTimeout(e,t)),n(ki(e,!1))};function _i(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function yi(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function xi(e,t){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e,focusModeToRevert:t}}const Si=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 wi(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function Ci(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}const Bi={reducer:ae,selectors:t,actions:i},Ii=(0,g.createReduxStore)(he,{...Bi,persist:["preferences"]}),ji=(0,g.registerStore)(he,{...Bi,persist:["preferences"]});function Ei(...e){const{clientId:t=null}=C();return(0,g.useSelect)(n=>U(n(Ii)).getBlockSettings(t,...e),[t,...e])}function Ti(e){I()("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]=Ei(e);return t}U(ji).registerPrivateActions(r),U(ji).registerPrivateSelectors(e),U(Ii).registerPrivateActions(r),U(Ii).registerPrivateSelectors(e);const Mi=window.wp.styleEngine,Pi="1600px",Ri="320px",Ai=1,Ni=.25,Li=.75,Di="14px";function Oi({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:o=Ri,maximumViewportWidth:r=Pi,scaleFactor:i=Ai,minimumFontSizeLimit:s}){if(s=zi(s)?s:Di,n){const o=zi(n);if(!o?.unit)return null;const r=zi(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),Ni),Li),i=Vi(o.value*n,3);e=r?.value&&i<r?.value?`${r.value}${r.unit}`:`${i}${o.unit}`}}const l=zi(e),a=l?.unit||"rem",c=zi(t,{coerceTo:a});if(!l||!c)return null;const u=zi(e,{coerceTo:"rem"}),d=zi(r,{coerceTo:a}),p=zi(o,{coerceTo:a});if(!d||!p||!u)return null;const h=d.value-p.value;if(!h)return null;const g=Vi(p.value/100,3),m=Vi(g,3)+a,f=Vi(((c.value-l.value)/h*100||1)*i,3);return`clamp(${e}, ${u.value}${u.unit} + ((1vw - ${m}) * ${f}), ${t})`}function zi(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:Vi(u,3),unit:c}}function Vi(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}function Fi(e){if(!e)return{};if("object"==typeof e)return e;let t;switch(e){case"normal":case"400":t=(0,T._x)("Regular","font weight");break;case"bold":case"700":t=(0,T._x)("Bold","font weight");break;case"100":t=(0,T._x)("Thin","font weight");break;case"200":t=(0,T._x)("Extra Light","font weight");break;case"300":t=(0,T._x)("Light","font weight");break;case"500":t=(0,T._x)("Medium","font weight");break;case"600":t=(0,T._x)("Semi Bold","font weight");break;case"800":t=(0,T._x)("Extra Bold","font weight");break;case"900":t=(0,T._x)("Black","font weight");break;case"1000":t=(0,T._x)("Extra Black","font weight");break;default:t=e}return{name:t,value:e}}const Hi=[{name:(0,T._x)("Regular","font style"),value:"normal"}
2,{name:(0,T._x)("Italic","font style"),value:"italic"}],Ui=[{name:(0,T._x)("Thin","font weight"),value:"100"},{name:(0,T._x)("Extra Light","font weight"),value:"200"},{name:(0,T._x)("Light","font weight"),value:"300"},{name:(0,T._x)("Regular","font weight"),value:"400"},{name:(0,T._x)("Medium","font weight"),value:"500"},{name:(0,T._x)("Semi Bold","font weight"),value:"600"},{name:(0,T._x)("Bold","font weight"),value:"700"},{name:(0,T._x)("Extra Bold","font weight"),value:"800"},{name:(0,T._x)("Black","font weight"),value:"900"},{name:(0,T._x)("Extra Black","font weight"),value:"1000"}];function Gi(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(Fi(t))}}const o=Fi("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,T._x)("Regular","font style");break;case"italic":t=(0,T._x)("Italic","font style");break;case"oblique":t=(0,T._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,T._x)("Bold","font weight"),value:"700"}),t.some(e=>"italic"===e.value)||t.push({name:(0,T._x)("Italic","font style"),value:"italic"}),r&&(t=Hi,n=Ui),t=0===t.length?Hi:t,n=0===n.length?Ui:n,t.forEach(({name:e,value:t})=>{n.forEach(({name:n,value:r})=>{const i="normal"===t?n:(0,T.sprintf)((0,T._x)("%1$s %2$s","font"),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 $i(e,t){const{size:n}=e;if(!n||"0"===n||!1===e?.fluid)return n;if(!Wi(t?.typography)&&!Wi(e))return n;let o=function(e){const t=e?.typography,n=e?.layout,o=zi(n?.wideSize)?n?.wideSize:null;return Wi(t)&&o?{fluid:{maxViewportWidth:o,...t.fluid}}:{fluid:t?.fluid}}(t);o="object"==typeof o?.fluid?o?.fluid:{};return Oi({minimumFontSize:e?.fluid?.min,maximumFontSize:e?.fluid?.max,fontSize:n,minimumFontSizeLimit:o?.minFontSize,maximumViewportWidth:o?.maxViewportWidth,minimumViewportWidth:o?.minViewportWidth})||n}function Wi(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function Ki(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 Zi="body",qi=":root",Yi=[{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)=>$i(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",classes:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]}],Xi={"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 Qi(){return(0,m.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function Ji(e,t,n,o,r){const i=[me(e,["blocks",t,...n]),me(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)return"slug"===o||Ji(e,t,n,"slug",s.slug)[o]===s[o]?s:void 0}}}}
2function es(e,t,n){if(!n||"string"!=typeof n){if("string"!=typeof n?.ref)return n;if(!(n=me(e,n.ref))||n?.ref)return n}let o;if(n.startsWith("var:"))o=n.slice(4).split("|");else{if(!n.startsWith("var(--wp--")||!n.endsWith(")"))return n;o=n.slice(10,-1).split("--")}const[r,...i]=o;return"preset"===r?function(e,t,n,[o,r]){const i=Yi.find(e=>e.cssVarInfix===o);if(!i)return n;const s=Ji(e.settings,t,i.path,"slug",r);if(s){const{valueKey:n}=i;return es(e,t,s[n])}return n}(e,t,n,i):"custom"===r?function(e,t,n,o){const r=me(e.settings,["blocks",t,"custom",...o])??me(e.settings,["custom",...o]);return r?es(e,t,r):n}(e,t,n,i):n}function ts(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 ns(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:E()(e?.styles,t?.styles)&&E()(e?.settings,t?.settings)}function os(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,Mi.getCSSValueFromRawStyle)(me(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 rs=(0,h.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}});rs.displayName="GlobalStylesContext";const is={settings:{},styles:{}},ss=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","border.color","border.radius","border.style","border.width","border.radiusSizes","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"],ls=()=>{const{user:e,setUserConfig:t}=(0,h.useContext)(rs),n={settings:e.settings,styles:e.styles};return[!!n&&!E()(n,is),(0,h.useCallback)(()=>t(is),[t])]};function as(e,t,n="all"){const{setUserConfig:o,...r}=(0,h.useContext)(rs),i=t?".blocks."+t:"",s=e?"."+e:"",l=`settings${i}${s}`,a=`settings${s}`,c="all"===n?"merged":n;return[(0,h.useMemo)(()=>{const t=r[c];if(!t)throw"Unsupported source";if(e)return me(t,l)??me(t,a);let n={};return ss.forEach(e=>{const o=me(t,`settings${i}.${e}`)??me(t,`settings.${e}`);void 0!==o&&(n=ge(n,e.split("."),o))}),n},[r,c,e,l,a,i]),e=>{o(t=>ge(t,l.split("."),e))}]}function cs(e,t,n="all",{shouldDecodeEncode:o=!0}={}){const{merged:r,base:i,user:s,setUserConfig:l}=(0,h.useContext)(rs),a=e?"."+e:"",c=t?`styles.blocks.${t}${a}`:`styles${a}`;let u,d;switch(n){case"all":u=me(r,c),d=o?es(r,t,u):u;break;case"user":u=me(s,c),d=o?es(r,t,u):u;break;case"base":u=me(i,c),d=o?es(i,t,u):u;break;default:throw"Unsupported source"}return[d,n=>{l(i=>ge(i,c.split("."),o?function(e,t,n,o){if(!o)return o;const r=Xi[n],i=Yi.find(e=>e.cssVarInfix===r);if(!i)return o;const{valueKey:s,path:l}=i,a=Ji(e,t,l,s,o);return a?`var:preset|${r}|${a.slug}`:o}(r.settings,t,e,n):n))}]}function us(e,t,n){const{supportedStyles:o,supports:r}=(0,g.useSelect)(e=>({supportedStyles:U(e(p.store)).getSupportedStyles(t,n),supports:e(p.store).getBlockType(t)?.supports}),[t,n]);return(0,h.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
2=>{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 ds(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,o=e?.color?.palette?.default,r=e?.color?.defaultPalette;return(0,h.useMemo)(()=>{const e=[];return n&&n.length&&e.push({name:(0,T._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,T._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,T._x)("Custom","Indicates this palette is created by the user."),colors:t}),e},[t,n,o,r])}function ps(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,o=e?.color?.gradients?.default,r=e?.color?.defaultGradients;return(0,h.useMemo)(()=>{const e=[];return n&&n.length&&e.push({name:(0,T._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&o&&o.length&&e.push({name:(0,T._x)("Default","Indicates this palette comes from WordPress."),gradients:o}),t&&t.length&&e.push({name:(0,T._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e},[t,n,o,r])}function hs(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=hs(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}const gs=function(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=hs(e))&&(o&&(o+=" "),o+=t);return o},ms=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map(([e,t])=>[e,ms(t)]).filter(([,e])=>void 0!==e);return t.length?Object.fromEntries(t):void 0};function fs(e,t,n,o,r,i){if(Object.values(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=me(s,e);t&&(l={...l,attributes:ge(l.attributes,e,t)})})}),l}function bs(e,t,n){const o=(0,p.getBlockSupport)(e,t),r=o?.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}const ks=new WeakMap;function vs({id:e,css:t}){return _s({id:e,css:t})}function _s({id:e,css:t,assets:n,__unstableType:o,variation:r,clientId:i}={}){const{setStyleOverride:s,deleteStyleOverride:l}=U((0,g.useDispatch)(Ii)),a=(0,g.useRegistry)(),c=(0,h.useId)();(0,h.useEffect)(()=>{if(!t&&!n)return;const u=e||c,d={id:e,css:t,assets:n,__unstableType:o,variation:r,clientId:i};return ks.get(a)||ks.set(a,[]),ks.get(a).push([u,d]),window.queueMicrotask(()=>{ks.get(a)?.length&&a.batch(()=>{ks.get(a).forEach(e=>{s(...e)}),ks.set(a,[])})}),()=>{const e=ks.get(a)?.find(([e])=>e===u);e?ks.set(a,ks.get(a).filter(([e])=>e!==u)):l(u)}},[e,t,i,n,o,c,s,l,a])}function ys(e,t){const[n,o,r,i,s,l,a,c,u,d,p,g,m,f,b,k,v,_,y,x,S,w,C,B,I,j,E,T,M,P,R,A,N,L,D,O,z,V,F,H,U,G,$,W,K,Z,q,Y,X,Q,J,ee,te,ne,oe,re,ie]=Ei("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.radiu
2s","border.style","border.width","border.radiusSizes","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 us((0,h.useMemo)(()=>({background:{backgroundImage:n,backgroundSize:o},color:{palette:{custom:V,theme:H,default:U},gradients:{custom:q,theme:Y,default:X},duotone:{custom:W,theme:K,default:Z},defaultGradients:Q,defaultPalette:G,defaultDuotone:$,custom:z,customGradient:J,customDuotone:F,background:ee,link:te,heading:oe,button:re,text:ne},typography:{fontFamilies:{custom:r,default:i,theme:s},fontSizes:{custom:a,default:c,theme:u},customFontSize:d,defaultFontSizes:l,fontStyle:p,fontWeight:g,lineHeight:m,textAlign:f,textColumns:b,textDecoration:k,textTransform:_,letterSpacing:y,writingMode:v},spacing:{spacingSizes:{custom:I,default:j,theme:E},customSpacingSize:B,defaultSpacingSizes:C,padding:x,margin:S,blockGap:w,units:T},border:{color:A,radius:N,style:L,width:D,radiusSizes:O},dimensions:{aspectRatio:M,minHeight:P},layout:R,parentLayout:t,shadow:ie}),[n,o,r,i,s,l,a,c,u,d,p,g,m,f,b,k,_,y,v,x,S,w,C,B,I,j,E,T,M,P,R,t,A,N,L,D,O,z,V,F,H,U,G,$,W,K,Z,q,Y,X,Q,J,ee,te,ne,oe,re,ie]),e)}const xs=(0,h.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,h.useEffect)(()=>(i(r),()=>{i(void 0)})),null});(0,f.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",function(e){const{apiVersion:t=1}=e;return t<2&&(0,p.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e});const Ss=window.wp.components;var ws={default:(0,Ss.createSlotFill)("BlockControls"),block:(0,Ss.createSlotFill)("BlockControlsBlock"),inline:(0,Ss.createSlotFill)("BlockFormatControls"),other:(0,Ss.createSlotFill)("BlockControlsOther"),parent:(0,Ss.createSlotFill)("BlockControlsParent")};function Cs({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const r=function(e,t){const n=C();return n[b]?ws[e]?.Fill:n[k]&&t?ws.parent.Fill:null}(e,o);if(!r)return null;const i=(0,d.jsxs)(d.Fragment,{children:["default"===e&&(0,d.jsx)(Ss.ToolbarGroup,{controls:t}),n]});return(0,d.jsx)(Ss.__experimentalStyleProvider,{document,children:(0,d.jsx)(r,{children:e=>{const{forwardedContext:t=[]}=e;return t.reduce((e,[t,n])=>(0,d.jsx)(t,{...n,children:e}),i)}})})}const Bs=window.wp.warning;var Is=n.n(Bs);const{ComponentsContext:js}=U(Ss.privateApis);function Es({group:e="default",...t}){const n=(0,h.useContext)(Ss.__experimentalToolbarContext),o=(0,h.useContext)(js),r=(0,h.useMemo)(()=>({forwardedContext:[[Ss.__experimentalToolbarContext.Provider,{value:n}],[js.Provider,{value:o}]]}),[n,o]),i=ws[e],s=(0,Ss.__experimentalUseSlotFills)(i.name);if(!i)return Is()(`Unknown BlockControls group "${e}" provided.`),null;if(!s?.length)return null;const{Slot:l}=i,a=(0,d.jsx)(l,{...t,bubblesVirtually:!0,fillProps:r});return"default"===e?a:(0,d.jsx)(Ss.ToolbarGroup,{children:a})}const Ts=Cs;Ts.Slot=Es;const Ms=e=>(0,d.jsx)(Cs,{group:"inline",...e});Ms.Slot=e=>(0,d.jsx)(Es,{group:"inline",...e});var Ps=Ts,Rs=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})}),As=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})}),Ns=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})}),Ls=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})}),Ds=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"})}),Os=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),zs=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})});const Vs={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:" >
2 :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 Fs(e,t=""){return e.split(",").map(e=>`${e}${t?` ${t}`:""}`).join(",")}function Hs(e,t=Vs,n,o){let r="";return t?.[n]?.spacingStyles?.length&&o&&t[n].spacingStyles.forEach(t=>{r+=`${Fs(e,t.selector.trim())} { `,r+=Object.entries(t.rules).map(([e,t])=>`${e}: ${t||o}`).join("; "),r+="; }"}),r}function Us(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,T.sprintf)((0,T.__)("Max %s wide"),t)),i.test(n)&&(r.wide=(0,T.sprintf)((0,T.__)("Max %s wide"),n)),r}var Gs=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z"})}),$s=(0,d.jsxs)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ce.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,d.jsx)(ce.Path,{d:"m4.5 7.5v9h1.5v-9z"}),(0,d.jsx)(ce.Path,{d:"m18 7.5v9h1.5v-9z"})]}),Ws=(0,d.jsxs)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ce.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,d.jsx)(ce.Path,{d:"m7.5 6h9v-1.5h-9z"}),(0,d.jsx)(ce.Path,{d:"m7.5 19.5h9v-1.5h-9z"})]}),Ks=(0,d.jsxs)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ce.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,d.jsx)(ce.Path,{d:"m16.5 6h-9v-1.5h9z"})]}),Zs=(0,d.jsxs)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ce.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,d.jsx)(ce.Path,{d:"m18 16.5v-9h1.5v9z"})]}),qs=(0,d.jsxs)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ce.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,d.jsx)(ce.Path,{d:"m16.5 19.5h-9v-1.5h9z"})]}),Ys=(0,d.jsxs)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ce.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,d.jsx)(ce.Path,{d:"m4.5 16.5v-9h1.5v9z"})]});const Xs=8,Qs=["top","right","bottom","left"],Js={top:void 0,right:void 0,bottom:void 0,left:void 0},el={custom:Gs,axial:Gs,horizontal:$s,vertical:Ws,top:Ks,right:Zs,bottom:qs,left:Ys},tl={default:(0,T.__)("Spacing control"),top:(0,T.__)("Top"),bottom:(0,T.__)("Bottom"),left:(0,T.__)("Left"),right:(0,T.__)("Right"),mixed:(0,T.__)("Mixed"),vertical:(0,T.__)("Vertical"),horizontal:(0,T.__)("Horizontal"),axial:(0,T.__)("Horizontal & vertical"),custom:(0,T.__)("Custom")},nl={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function ol(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}function rl(e,t){if(!ol(e))return e;const n=ll(e),o=t.find(e=>String(e.slug)===n);return o?.size}function il(e,t){if(!e||ol(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 sl(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function ll(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 al(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 cl(e,t="0"){const n=function(e){if(!e)return null;const t="string"==typeof e;
2return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!n)return null;const o=sl(n?.top)||t,r=sl(n?.left)||t;return o===r?o:`${o} ${r}`}var ul=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})}),dl=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})}),pl=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})}),hl=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})}),gl=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})});const ml={top:{icon:ul,title:(0,T._x)("Align top","Block vertical alignment setting")},center:{icon:dl,title:(0,T._x)("Align middle","Block vertical alignment setting")},bottom:{icon:pl,title:(0,T._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:hl,title:(0,T._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:gl,title:(0,T._x)("Space between","Block vertical alignment setting")}},fl=["top","center","bottom"];var bl=function({value:e,onChange:t,controls:n=fl,isCollapsed:o=!0,isToolbar:r}){const i=ml[e],s=ml.top,l=r?Ss.ToolbarGroup:Ss.ToolbarDropdownMenu,a=r?{isCollapsed:o}:{};return(0,d.jsx)(l,{icon:i?i.icon:s.icon,label:(0,T._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map(n=>{return{...ml[n],isActive:e===n,role:o?"menuitemradio":void 0,onClick:(r=n,()=>t(e===r?void 0:r))};var r}),...a})};const kl=e=>(0,d.jsx)(bl,{...e,isToolbar:!1}),vl=e=>(0,d.jsx)(bl,{...e,isToolbar:!0}),_l={left:Rs,center:As,right:Ns,"space-between":Ls,stretch:Ds};var yl=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?_l[o]:_l.left,a=[{name:"left",icon:Rs,title:(0,T.__)("Justify items left"),isActive:"left"===o,onClick:()=>s("left")},{name:"center",icon:As,title:(0,T.__)("Justify items center"),isActive:"center"===o,onClick:()=>s("center")},{name:"right",icon:Ns,title:(0,T.__)("Justify items right"),isActive:"right"===o,onClick:()=>s("right")},{name:"space-between",icon:Ls,title:(0,T.__)("Space between items"),isActive:"space-between"===o,onClick:()=>s("space-between")},{name:"stretch",icon:Ds,title:(0,T.__)("Stretch items"),isActive:"stretch"===o,onClick:()=>s("stretch")}],c=i?Ss.ToolbarGroup:Ss.ToolbarDropdownMenu,u=i?{isCollapsed:t}:{};return(0,d.jsx)(c,{icon:l,popoverProps:r,label:(0,T.__)("Change items justification"),controls:a.filter(t=>e.includes(t.name)),...u})};const xl=e=>(0,d.jsx)(yl,{...e,isToolbar:!1}),Sl=e=>(0,d.jsx)(yl,{...e,isToolbar:!0}),wl={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Cl={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},Bl={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},Il=["wrap","nowrap"];var jl={name:"flex",label:(0,T.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:o=!0,allowJustification:r=!0}=n;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(Ss.Flex,{children:[r&&(0,d.jsx)(Ss.FlexItem,{children:(0,d.jsx)(Ml,{layout:e,onChange:t})}),o&&(0,d.jsx)(Ss.FlexItem,{children:(0,d.jsx)(Rl,{layout:e,onChange:t})})]}),(0,d.jsx)(Pl,{layout:e,onChange:t})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){const{allowVerticalAlignment:o=!0,allowJustification:r=!0}=n;return r||o?(0,d.jsxs)(Ps,{group:"block",__experimentalShareWithChildBlocks:!0,children:[r&&(0,d.jsx)(Ml,{layout:e,onChange:t,isToolbar:!0}),o&&(0,d.jsx)(El,{layout:e,onChange:t})]}):null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:i=Vs}){const{orientation:s="horizontal"}=t,l=n?.spacing?.blockGap&&!bs(o,"spacing","blockGap")?cl(n?.spacing?.blockGap,"0.5em"):void 0,a=wl[t.justifyContent],c=Il.includes(t.flexWrap)?t.flexWrap:"wrap",u=Bl[t.verticalAlignment],d=Cl[t.justifyContent]||Cl.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=`${Fs(e)} {\n\t\t\t\t${h.join("; ")};\n\t\t\t}`),r&&l&&(p+=Hs(e,i,"flex",l)),p},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function El({layout:e,onChange:t}){const{orientation:n="horizontal"}=e,o="horizontal"===n?"center":"top",{verticalAlignment:r=o}=e;return(0,d.jsx)(kl,{onChange:n=>{t({...e,verticalAlignment:n})},value:r,controls:"horizontal"===n?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]})}const Tl={placement:"bottom-start"};function Ml({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,d.jsx)(xl,{allowedControls:s,value:o,onChange:i,popoverProps:Tl});const l=[{value:"left",icon:Rs,label:(0,T.__)("Justify items left")},{value:"center",icon:As,label:(0,T.__)("Justify items center")},{value:"right",icon:Ns,label:(0,T.__)("Justify items right")}];return"horizontal"===r?l.push({value:"space-between",icon:Ls,label:(0,T.__)("Space between items")}):l.push({value:"stretch",icon:Ds,label:(0,T.__)("Stretch items")}),(0,d.jsx)(Ss.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Justification"),value:o,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls",children:l.map(({value:e,icon:t,label:n})=>(0,d.jsx)(Ss.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:n},e))})}function Pl({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,d.jsx)(Ss.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function Rl({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:o,justifyContent:r}=e;return(0,d.jsxs)(Ss.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,T.__)("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,d.jsx)(Ss.__experimentalToggleGroupControlOptionIcon,{icon:Os,value:"horizontal",label:(0,T.__)("Horizontal")}),(0,d.jsx)(Ss.__experimentalToggleGroupControlOptionIcon,{icon:zs,value:"vertical",label:(0,T.__)("Vertical")})]})}var Al={name:"default",label:(0,T.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:o,layoutDefinitions:r=Vs}){const i=cl(t?.spacing?.blockGap);let s="";bs(n,"spacing","blockGap")||(i?.top?s=cl(i?.top):"string"==typeof i&&(s=cl(i)));let l="";return o&&s&&(l+=Hs(e,r,"default",s)),l},getOrientation:()=>"vertical",getAlignments(e,t){const n=Us(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}},Nl=(0,h.forwardRef)(({icon:e,size:t=24,...n},o)=>(0,h.cloneElement)(e,{width:t,height:t,...n,ref:o})),Ll=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"})}),Dl=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z"})}),Ol={name:"constrained",label:(0,T.__)("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:Rs,label:(0,T.__)("Justify items left")},{value:"center",icon:As,label:(0,T.__)("Justify items center")},{value:"right",icon:Ns,label:(0,T.__)("Justify items right")}],[c]=Ei("spacing.units"),u=(0,Ss.__experimentalUseCustomUnits)({availableUnits:c||["%","px","em","rem","vw"]});return(0,d.jsxs)(Ss.__experimentalVStack,{spacing:4,className:"block-editor-hooks__layout-constrained",children:[l&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Content width"),labelPosition:"top",value:r||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:u,prefix:(0,d.jsx)(Ss.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,d.jsx)(Nl,{icon:Ll})})}),(0,d.jsx)(Ss.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Wide width"),labelPosition:"top",value:o||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:u,prefix:(0,d.jsx)(Ss.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,d.jsx)(Nl,{icon:Dl})})}),(0,d.jsx)("p",{className:"block-editor-hooks__layout-constrained-helptext",children:(0,T.__)("Customize the width for all elements that are assigned to the center or wide columns.")})]}),s&&(0,d.jsx)(Ss.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Justification"),value:i,onChange:n=>{t({...e,justifyContent:n})},children:a.map(({value:e,icon:t,label:n})=>(0,d.jsx)(Ss.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:n},e))})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){const{allowJustification:o=!0}=n;return o?(0,d.jsx)(Ps,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,d.jsx)(Vl,{layout:e,onChange:t})}):null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:i=Vs}){const{contentSize:s,wideSize:l,justifyContent:a}=t,c=cl(n?.spacing?.blockGap);let u="";bs(o,"spacing","blockGap")||(c?.top?u=cl(c?.top):"string"==typeof c&&(u=cl(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${Fs(e,">
2 :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${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${Fs(e,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${l??s};\n\t\t\t\t\t}\n\t\t\t\t\t${Fs(e,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return"left"===a?h+=`${Fs(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===a&&(h+=`${Fs(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${p}; }`),n?.spacing?.padding&&(0,Mi.getCSSRules)(n).forEach(t=>{if("paddingRight"===t.key){const n="0"===t.value?"0px":t.value;h+=`\n\t\t\t\t\t${Fs(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${Fs(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`}}),r&&u&&(h+=Hs(e,i,"constrained",u)),h},getOrientation:()=>"vertical",getAlignments(e){const t=Us(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}};const zl={placement:"bottom-start"};function Vl({layout:e,onChange:t}){const{justifyContent:n="center"}=e;return(0,d.jsx)(xl,{allowedControls:["left","center","right"],value:n,onChange:n=>{t({...e,justifyContent:n})},popoverProps:zl})}const Fl={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},Hl=[{value:"px",label:"px",default:0},{value:"rem",label:"rem",default:0},{value:"em",label:"em",default:0}];var Ul={name:"grid",label:(0,T.__)("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,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Wl,{layout:e,onChange:t}),(0,d.jsxs)(Ss.__experimentalVStack,{spacing:4,children:[r&&(0,d.jsx)($l,{layout:e,onChange:t,allowSizingOnChildren:o}),i&&(0,d.jsx)(Gl,{layout:e,onChange:t})]})]})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:i=Vs}){const{minimumColumnWidth:s=null,columnCount:l=null,rowCount:a=null}=t,c=n?.spacing?.blockGap&&!bs(o,"spacing","blockGap")?cl(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=`${Fs(e)} { ${d.join("; ")}; }`),r&&c&&(u+=Hs(e,i,"grid",c)),u},getOrientation:()=>"horizontal",getAlignments:()=>[]};function Gl({layout:e,onChange:t}){const{minimumColumnWidth:n,columnCount:o,isManualPlacement:r}=e,i=n||(r||o?null:"12rem"),[s,l="rem"]=(0,Ss.__experimentalParseQuantityAndUnitFromRawValue)(i);return(0,d.jsxs)("fieldset",{className:"block-editor-hooks__grid-layout-minimum-width-control",children:[(0,d.jsx)(Ss.BaseControl.VisualLabel,{as:"legend",children:(0,T.__)("Minimum column width")}),(0,d.jsxs)(Ss.Flex,{gap:4,children:[(0,d.jsx)(Ss.FlexItem,{isBlock:!0,children:(0,d.jsx)(Ss.__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:Hl,min:0,label:(0,T.__)("Minimum column width"),hideLabelFromVision:!0})}),(0,d.jsx)(Ss.FlexItem,{isBlock:!0,children:(0,d.jsx)(Ss.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:n=>{t({...e,minimumColumnWidth:[n,l].join("")})},value:s||0,min:0,max:Fl[l]||600,withInputField:!1,label:(0,T.__)("Minimum column width"),hideLabelFromVision:!0})})]})]})}function $l({layout:e,onChange:t,allowSizingOnChildren:n}){const o=window.__experimentalEnableGridInteractivity?void 0:3,{columnCount:r=o,rowCount:i,isManualPlacement:s}=e;return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("fieldset",{className:"block-editor-hooks__grid-layout-columns-and-rows-controls",children:[(!window.__experimentalEnableGridInteractivity||!s)&&(0,d.jsx)(Ss.BaseControl.VisualLabel,{as:"legend",children:(0,T.__)("Columns")}),(0,d.jsxs)(Ss.Flex,{gap:4,children:[(0,d.jsx)(Ss.FlexItem,{isBlock:!0,children:(0,d.jsx)(Ss.__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,T.__)("Columns"),hideLabelFromVision:!window.__experimentalEnableGridInteractivity||!s})}),(0,d.jsx)(Ss.FlexItem,{isBlock:!0,children:window.__experimentalEnableGridInteractivity&&n&&s?(0,d.jsx)(Ss.__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,T.__)("Rows")}):(0,d.jsx)(Ss.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:r??1,onChange:n=>t({...e,columnCount:""===n||"0"===n?1:n}),min:1,max:16,withInputField:!1,label:(0,T.__)("Columns"),hideLabelFromVision:!0})})]})]})})}function Wl({layout:e,onChange:t}){const{columnCount:n,rowCount:o,minimumColumnWidth:r,isManualPlacement:i}=e,[s,l]=(0,h.useState)(n||3),[a,c]=(0,h.useState)(o),[u,p]=(0,h.useState)(r||"12rem"),g=i||n&&!window.__experimentalEnableGridInteractivity?"manual":"auto",m="manual"===g?(0,T.__)("Grid items can be manually placed in any position on the grid."):(0,T.__)("Grid items are placed automatically depending on their order.");return(0,d.jsxs)(Ss.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Grid item position"),value:g,onChange:i=>{"manual"===i?p(r||"12rem"):(l(n||3),c(o)),t({...e,columnCount:"manual"===i?s:null,rowCount:"manual"===i&&window.__experimentalEnableGridInteractivity?a:void 0,isManualPlacement:!("manual"!==i||!window.__experimentalEnableGridInteractivity)||void 0,minimumColumnWidth:"auto"===i?u:null})},isBlock:!0,help:window.__experimentalEnableGridInteractivity?m:void 0,children:[(0,d.jsx)(Ss.__experimentalToggleGroupControlOption,{value:"auto",label:(0,T.__)("Auto")},"auto"),(0,d.jsx)(Ss.__experimentalToggleGroupControlOption,{value:"manual",label:(0,T.__)("Manual")},"manual")]})}const Kl=[Al,jl,Ol,Ul];function Zl(e="default"){return Kl.find(t=>t.name===e)}const ql={type:"default"},Yl=(0,h.createContext)(ql);Yl.displayName="BlockLayoutContext";const Xl=Yl.Provider;function Ql(){return(0,h.useContext)(Yl)}const Jl=[],ea=["none","left","center","right","wide","full"],ta=["wide","full"];function na(e=ea){e.includes("none")||(e=["none",...e]);const t=1===e.length&&"none"===e[0],[n,o,r]=(0,g.useSelect)(e=>{if(t)return[!1,!1,!1];const n=e(Ii).getSettings();return[n.alignWide??!1,n.supportsLayout,n.__unstableIsBlockBasedTheme]},[t]),i=Ql();if(t)return Jl;const s=Zl(i?.type);if(o){const t=s.getAlignments(i,r).filter(t=>e.includes(t.name));return 1===t.length&&"none"===t[0].name?Jl:t}if("default"!==s.name&&"constrained"!==s.name)return Jl;const l=e.filter(e=>i.alignments?i.alignments.includes(e):!(!n&&ta.includes(e))&&ea.includes(e)).map(e=>({name:e}));return 1===l.length&&"none"===l[0].name?Jl:l}var oa=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"})}),ra=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"})}),ia=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5
2h8V20ZM5 9h14v6H5V9Z"})}),sa=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z"})});const la={none:{icon:Ll,title:(0,T._x)("None","Alignment option")},left:{icon:oa,title:(0,T.__)("Align left")},center:{icon:ra,title:(0,T.__)("Align center")},right:{icon:ia,title:(0,T.__)("Align right")},wide:{icon:Dl,title:(0,T.__)("Wide width")},full:{icon:sa,title:(0,T.__)("Full width")}};var aa=function({value:e,onChange:t,controls:n,isToolbar:o,isCollapsed:r=!0}){const i=na(n);if(!i.length)return null;function s(n){t([e,"none"].includes(n)?void 0:n)}const l=la[e],a=la.none,c=o?Ss.ToolbarGroup:Ss.ToolbarDropdownMenu,u={icon:l?l.icon:a.icon,label:(0,T.__)("Align")},p=o?{isCollapsed:r,controls:i.map(({name:t})=>({...la[t],isActive:e===t||!e&&"none"===t,role:r?"menuitemradio":void 0,onClick:()=>s(t)}))}:{toggleProps:{description:(0,T.__)("Change alignment")},children:({onClose:t})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(Ss.MenuGroup,{className:"block-editor-block-alignment-control__menu-group",children:i.map(({name:n,info:o})=>{const{icon:r,title:i}=la[n],l=n===e||!e&&"none"===n;return(0,d.jsx)(Ss.MenuItem,{icon:r,iconPosition:"left",className:gs("components-dropdown-menu__menu-item",{"is-active":l}),isSelected:l,onClick:()=>{s(n),t()},role:"menuitemradio",info:o,children:i},n)})})})};return(0,d.jsx)(c,{...u,...p})};const ca=e=>(0,d.jsx)(aa,{...e,isToolbar:!1}),ua=e=>(0,d.jsx)(aa,{...e,isToolbar:!0});function da(e){const t=C(),{clientId:n=""}=t,{setBlockEditingMode:o,unsetBlockEditingMode:r}=(0,g.useDispatch)(Ii),i=(0,g.useSelect)(e=>n?null:e(Ii).getBlockEditingMode(),[n]);return(0,h.useEffect)(()=>(e&&o(n,e),()=>{e&&r(n)}),[n,e,o,r]),n?t[v]:i}const pa=["left","center","right","wide","full"],ha=["wide","full"];function ga(e,t=!0,n=!0){let o;return o=Array.isArray(e)?pa.filter(t=>e.includes(t)):!0===e?[...pa]:[],!n||!0===e&&!t?o.filter(e=>!ha.includes(e)):o}var ma={shareWithChildBlocks:!0,edit:function({name:e,align:t,setAttributes:n}){const o=na(ga((0,p.getBlockSupport)(e,"align"),(0,p.hasBlockSupport)(e,"alignWide",!0))).map(({name:e})=>e),r=da();return o.length&&"default"===r?(0,d.jsx)(Ps,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,d.jsx)(ca,{value:t,onChange:t=>{if(!t){const n=(0,p.getBlockType)(e),o=n?.attributes?.align?.default;o&&(t="")}n({align:t})},controls:o})}):null},useBlockProps:function({name:e,align:t}){return na(ga((0,p.getBlockSupport)(e,"align"),(0,p.hasBlockSupport)(e,"alignWide",!0))).some(e=>e.name===t)?{"data-align":t}:{}},addSaveProps:function(e,t,n){const{align:o}=n;return ga((0,p.getBlockSupport)(t,"align"),(0,p.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=gs(`align${o}`,e.className)),e},attributeKeys:["align"],hasSupport:e=>(0,p.hasBlockSupport)(e,"align",!1)};(0,f.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",function(e){return"type"in(e.attributes?.align??{})||(0,p.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...pa,""]}}),e});const fa=(0,Ss.createSlotFill)("InspectorControls"),ba=(0,Ss.createSlotFill)("InspectorAdvancedControls"),ka=(0,Ss.createSlotFill)("InspectorControlsBindings"),va=(0,Ss.createSlotFill)("InspectorControlsBackground"),_a=(0,Ss.createSlotFill)("InspectorControlsBorder"),ya=(0,Ss.createSlotFill)("InspectorControlsColor"),xa=(0,Ss.createSlotFill)("InspectorControlsFilter"),Sa=(0,Ss.createSlotFill)("InspectorControlsDimensions"),wa=(0,Ss.createSlotFill)("InspectorControlsPosition"),Ca=(0,Ss.createSlotFill)("InspectorControlsTypography"),Ba=(0,Ss.createSlotFill)("InspectorControlsListView"),Ia=(0,Ss.createSlotFill)("InspectorControlsStyles");var ja={default:fa,advanced:ba,background:va,bindings:ka,border:_a,color:ya,dimensions:Sa,effects:(0,Ss.createSlotFill)("InspectorControlsEffects"),filter:xa,list:Ba,position:wa,settings:fa,styles:Ia,typography:Ca};const Ea=(0,Ss.createSlotFill)(Symbol("PrivateInspectorControlsAllowedBlocks"));function Ta({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:o}){n&&(I()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const r=C(),i=ja[t]?.Fill;return i?r[b]?(0,d.jsx)(Ss.__experimentalStyleProvider,{document,children:(0,d.jsx)(i,{children:t=>(0,d.jsx)(Pa,{fillProps:t,children:e,resetAllFilter:o})})}):null:(Is()(`Unknown InspectorControls group "${t}" provided.`),null)}function Ma({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:o}=(0,h.useContext)(Ss.__experimentalToolsPanelContext);return(0,h.useEffect)(()=>
2{if(e&&n&&o)return n(e),()=>{o(e)}},[e,n,o]),t}function Pa({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:o=[]}=n,r=(0,d.jsx)(Ma,{resetAllFilter:t,children:e});return o.reduce((e,[t,n])=>(0,d.jsx)(t,{...n,children:e}),r)}function Ra({children:e,group:t,label:n}){const{updateBlockAttributes:o}=(0,g.useDispatch)(Ii),{getBlockAttributes:r,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:l}=(0,g.useSelect)(Ii),a=Qi(),c=s(),u=(0,h.useCallback)((e=[])=>{const t={},n=l()?i():[c];n.forEach(n=>{const{style:o}=r(n);let i={style:o};e.forEach(e=>{i={...i,...e(i)}}),i={...i,style:ms(i.style)},t[n]=i}),o(n,t,!0)},[r,i,l,c,o]);return(0,d.jsx)(Ss.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:n,resetAll:u,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:a,children:e},c)}function Aa({Slot:e,fillProps:t,...n}){const o=(0,h.useContext)(Ss.__experimentalToolsPanelContext),r=(0,h.useMemo)(()=>({...t??{},forwardedContext:[...t?.forwardedContext??[],[Ss.__experimentalToolsPanelContext.Provider,{value:o}]]}),[o,t]);return(0,d.jsx)(e,{...n,fillProps:r,bubblesVirtually:!0})}function Na({__experimentalGroup:e,group:t="default",label:n,fillProps:o,...r}){e&&(I()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const i=ja[t],s=(0,Ss.__experimentalUseSlotFills)(i?.name);if(!i)return Is()(`Unknown InspectorControls group "${t}" provided.`),null;if(!s?.length)return null;const{Slot:l}=i;return n?(0,d.jsx)(Ra,{group:t,label:n,children:(0,d.jsx)(Aa,{...r,fillProps:o,Slot:l})}):(0,d.jsx)(l,{...r,fillProps:o,bubblesVirtually:!0})}const La=Ta;La.Slot=Na;const Da=e=>(0,d.jsx)(Ta,{...e,group:"advanced"});Da.Slot=e=>(0,d.jsx)(Na,{...e,group:"advanced"}),Da.slotName="InspectorAdvancedControls";var Oa=La,za=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M7 11.5h10V13H7z"})});const Va=window.wp.url,Fa=window.wp.dom,Ha=window.wp.blob,Ua=window.wp.keycodes;var Ga=(0,d.jsxs)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ce.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,d.jsx)(ce.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"})]}),$a=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}),Wa=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}),Ka=(0,Ss.withFilters)("editor.MediaUpload")(()=>null),Za=function({fallback:e=null,children:t}){const n=(0,g.useSelect)(e=>{const{getSettings:t}=e(Ii);return!!t().mediaUpload},[]);return n?t:e};const qa=window.wp.isShallowEqual;var Ya=n.n(qa),Xa=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}),Qa=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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.8
211c1.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"})}),Ja=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),ec=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),tc=function e({children:t,settingsOpen:n,setSettingsOpen:o}){const r=(0,m.useReducedMotion)(),i=r?h.Fragment:Ss.__unstableAnimatePresence,s=r?"div":Ss.__unstableMotion.div,l=`link-control-settings-drawer-${(0,m.useInstanceId)(e)}`;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>o(!n),icon:(0,T.isRTL)()?Ja:ec,"aria-controls":l,children:(0,T._x)("Advanced","Additional link settings")}),(0,d.jsx)(i,{children:n&&(0,d.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,d.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:t})})})]})},nc=n(1609);function oc(e){return"function"==typeof e}class rc extends h.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,h.createRef)(),this.inputRef=e.inputRef||(0,h.createRef)(),this.updateSuggestions=(0,m.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,Va.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,T.sprintf)((0,T._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,T.__)("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 Ua.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Ua.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;
2case Ua.ENTER:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Ua.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case Ua.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Ua.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(i),this.props.speak((0,T.__)("Link selected.")));break;case Ua.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,d.jsxs)(d.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){const{label:e=null,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,T.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:s="",hideLabelFromVision:l=!1,help:a=null,disabled:c=!1}=this.props,{loading:u,showSuggestions:p,selectedSuggestion:h,suggestionsListboxId:g,suggestionOptionIdPrefix:m}=this.state,f=`url-input-control-${o}`,b={id:f,label:e,className:gs("block-editor-url-input",t,{"is-full-width":n}),hideLabelFromVision:l},k={id:f,value:s,required:!0,type:"text",onChange:c?()=>{}:this.onChange,onFocus:c?()=>{}:this.onFocus,placeholder:r,onKeyDown:c?()=>{}:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,T.__)("URL"),"aria-expanded":p,"aria-autocomplete":"list","aria-owns":g,"aria-activedescendant":null!==h?`${m}-${h}`:void 0,ref:this.inputRef,disabled:c,suffix:this.props.suffix,help:a};return i?i(b,k,u):(0,d.jsxs)(Ss.BaseControl,{__nextHasNoMarginBottom:!0,...b,children:[(0,d.jsx)(Ss.__experimentalInputControl,{...k,__next40pxDefaultSize:!0}),u&&(0,d.jsx)(Ss.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)=>
2({role:"option",tabIndex:"-1",id:`${l}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===i||void 0});return oc(t)?t({suggestions:o,selectedSuggestion:i,suggestionsListProps:c,buildSuggestionItemProps:u,isLoading:a,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!r?.length,currentInputValue:r}):(0,d.jsx)(Ss.Popover,{placement:"bottom",focusOnMount:!1,children:(0,d.jsx)("div",{...c,className:gs("block-editor-url-input__suggestions",{[`${e}__suggestions`]:e}),children:o.map((e,t)=>(0,nc.createElement)(Ss.Button,{__next40pxDefaultSize:!0,...u(0,t),key:e.id,className:gs("block-editor-url-input__suggestion",{"is-selected":t===i}),onClick:()=>this.handleOnClick(e)},e.title))})})}}var ic=(0,m.compose)(m.withSafeTimeout,Ss.withSpokenMessages,m.withInstanceId,(0,g.withSelect)((e,t)=>{if(oc(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(Ii);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}}))(rc),sc=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),lc=({searchTerm:e,onClick:t,itemProps:n,buttonText:o})=>{if(!e)return null;let r;return r=o?"function"==typeof o?o(e):o:(0,h.createInterpolateElement)((0,T.sprintf)((0,T.__)("Create: <mark>%s</mark>"),e),{mark:(0,d.jsx)("mark",{})}),(0,d.jsx)(Ss.MenuItem,{...n,iconPosition:"left",icon:sc,className:"block-editor-link-control__search-item",onClick:t,children:r})}
2,ac=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.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"})}),cc=(0,d.jsxs)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ce.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,d.jsx)(ce.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"})]}),uc=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}
2),dc=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.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"})}),pc=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.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"})}),hc=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z"})}),gc=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}
2),mc=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.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"})});const fc={post:{icon:ac,label:(0,T.__)("Post")},page:{icon:cc,label:(0,T.__)("Page")},post_tag:{icon:uc,label:(0,T.__)("Tag")},category:{icon:dc,label:(0,T.__)("Category")},attachment:{icon:pc,label:(0,T.__)("Attachment")}};function bc({isURL:e,suggestion:t}){let n=null;return e?n=hc:t.type in fc&&(n=fc[t.type].icon,"page"===t.type&&(t.isFrontPage&&(n=gc),t.isBlogHome&&(n=mc))),n?(0,d.jsx)(Nl,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function kc(e){const t=e?.trim();return t?.length?e?.replace(/^\/?/,"/"):e}function vc(e){const t=e?.trim();return t?.length?e?.replace(/\/$/,""):e}const _c=({itemProps:e,suggestion:t,searchTerm:n,onClick:o,isURL:r=!1,shouldShowType:i=!1})=>{const s=r?(0,T.__)("Press ENTER to add this link"):(l=t.url)?(0,m.pipe)(Va.safeDecodeURI,Va.getPath,e=>null==e||e!=e?"":e,((e,...t)=>(...n)=>e(...n,...t))(Va.filterURLForDisplay,24),vc,kc)(l):l;var l;return(0,d.jsx)(Ss.MenuItem,{...e,info:s,iconPosition:"left",icon:(0,d.jsx)(bc,{suggestion:t,isURL:r}),onClick:o,shortcut:i&&yc(t),className:"block-editor-link-control__search-item",children:(0,d.jsx)(Ss.TextHighlight,{text:(0,Fa.__unstableStripHTML)(t.title),highlight:n})})};function yc(e){return e.isFrontPage?(0,T.__)("Front page"):e.isBlogHome?(0,T.__)("Blog home"):e.type in fc?fc[e.type].label:e.type}var xc=_c;const Sc=e=>(I()("wp.blockEditor.__experimentalLinkControlSearchItem",{since:"6.8"}),(0,d.jsx)(_c,{...e})),wc="__CREATE__",Cc="link",Bc="mailto",Ic="internal",jc=[Cc,Bc,"tel",Ic],Ec=[{id:"opensInNewTab",title:(0,T.__)("Open in new tab")}];function Tc({withCreateSuggestion:e,currentInputValue:t,handleSuggestionClick:n,suggestionsListProps:o,buildSuggestionItemProps:r,suggestions:i,selectedSuggestion:s,isLoading:l,isInitialSuggestions:a,createSuggestionButtonText:c,suggestionsQuery:u}){const p=gs("block-editor-link-control__search-results",{"is-loading":l}),h=1===i.length&&jc.includes(i[0].type),g=e&&!h&&!a,m=!u?.type,f=a?(0,T.__)("Suggestions"):(0,T.sprintf)((0,T.__)('Search results for "%s"'),t);return(0,d.jsx)("div",{className:"block-editor-link-control__search-results-wrapper",children:(0,d.jsx)("div",{...o,className:p,"aria-label":f,children:(0,d.jsx)(Ss.MenuGroup,{children:i.map((e,o)=>g&&wc===e.type?(0,d.jsx)(lc,{searchTerm:t,buttonText:c,onClick:()=>n(e),itemProps:r(e,o),isSelected:o===s},e.type):wc===e.type?null:(0,d.jsx)(xc,{itemProps:r(e,o),suggestion:e,index:o,onClick:()=>{n(e)},isSelected:o===s,isURL:jc.includes(e.type),searchTerm:t,shouldShowType:m,isFrontPage:e?.isFrontPage,isBlogHome:e?.isBlogHome}
2,`${e.id}-${e.type}`))})})})}var Mc=Tc;const Pc=e=>(I()("wp.blockEditor.__experimentalLinkControlSearchResults",{since:"6.8"}),(0,d.jsx)(Tc,{...e}));function Rc(e){if(e.includes(" "))return!1;const t=(0,Va.getProtocol)(e),n=(0,Va.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,Va.isValidFragment)(e);return n||r||i||o}const Ac=()=>Promise.resolve([]),Nc=e=>{let t=Cc;const n=(0,Va.getProtocol)(e)||"";return n.includes("mailto")&&(t=Bc),n.includes("tel")&&(t="tel"),e?.startsWith("#")&&(t=Ic),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,Va.prependHTTP)(e):e,type:t}])};const Lc=()=>Promise.resolve([]),Dc=()=>{},Oc=(0,h.forwardRef)(({value:e,children:t,currentLink:n={},className:o=null,placeholder:r=null,withCreateSuggestion:i=!1,onCreateSuggestion:s=Dc,onChange:l=Dc,onSelect:a=Dc,showSuggestions:c=!0,renderSuggestions:u=e=>(0,d.jsx)(Mc,{...e}),fetchSuggestions:p=null,allowDirectEntry:m=!0,showInitialSuggestions:f=!1,suggestionsQuery:b={},withURLSuggestion:k=!0,createSuggestionButtonText:v,hideLabelFromVision:_=!1,suffix:y,isEntity:x=!1},S)=>{const w=function(e,t,n){const{fetchSearchSuggestions:o,pageOnFront:r,pageForPosts:i}=(0,g.useSelect)(e=>{const{getSettings:t}=e(Ii);return{pageOnFront:t().pageOnFront,pageForPosts:t().pageForPosts,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}},[]),s=t?Nc:Ac;return(0,h.useCallback)((t,{isInitialSuggestions:l})=>Rc(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||Rc(e)||!o?l:l.concat({title:e,url:e,type:wc})})(t,{...e,isInitialSuggestions:l},o,n,r,i),[s,o,r,i,e,n])}(b,m,i),C=c?p||w:Lc,[B,I]=(0,h.useState)(),j=async e=>{let t=e;if(wc!==e.type){if(m||t&&Object.keys(t).length>=1){const{id:e,url:o,...r}=n??{};a({...r,...t},t)}}else try{t=await s(e.title),t?.url&&a(t)}catch(e){}},E=r??(0,T.__)("Search or type URL"),M=_&&""!==r?E:(0,T.__)("Link");return(0,d.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,d.jsx)(ic,{disableSuggestions:n?.url===e,label:M,hideLabelFromVision:_,className:o,value:e,onChange:(e,t)=>
2{l(e),I(t)},placeholder:E,__experimentalRenderSuggestions:c?e=>u({...e,withCreateSuggestion:i,createSuggestionButtonText:v,suggestionsQuery:b,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),j(t)}}):null,__experimentalFetchLinkSuggestions:C,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:f,onSubmit:(t,n)=>{const o=t||B;o||e?.trim()?.length?j(o||{url:e}):n.preventDefault()},inputRef:S,suffix:y,disabled:x}),t]})});var zc=Oc;const Vc=e=>(I()("wp.blockEditor.__experimentalLinkControlSearchInput",{since:"6.8"}),(0,d.jsx)(Oc,{...e}));var Fc=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})}),Hc=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),Uc=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})});const{Slot:Gc,Fill:$c}=(0,Ss.createSlotFill)("BlockEditorLinkControlViewer");function Wc(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function Kc({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:o=!1,onRemove:r}){const i=(0,g.useSelect)(e=>e(pr.store).get("core","showIconLabels"),[]),s=n?e?.url:null,{richData:l,isFetching:a}=function(e){const[t,n]=(0,h.useReducer)(Wc,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,g.useSelect)(e=>{const{getSettings:t}=e(Ii);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}},[]);return(0,h.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}(s),c=l&&Object.keys(l).length,u=e&&(0,Va.filterURLForDisplay)((0,Va.safeDecodeURI)(e.url),24)||"",p=!e?.url?.length,f=!p&&(0,Fa.__unstableStripHTML)(l?.title||e?.title||u),b=!e?.url||f.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i,"").replace(/^www\./i,"")===u;let k;k=l?.icon?(0,d.jsx)("img",{src:l?.icon,alt:""}):p?(0,d.jsx)(Nl,{icon:Fc,size:32}):(0,d.jsx)(Nl,{icon:hc});const{createNotice:v}=(0,g.useDispatch)(dr.store),_=(0,m.useCopyToClipboard)(e.url,()=>{v("info",(0,T.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})});return(0,d.jsx)("div",{role:"group","aria-label":(0,T.__)("Manage link"),className:gs("block-editor-link-control__search-item",{"is-current":!0,"is-rich":c,"is-fetching":!!a,"is-preview":!0,"is-error":p,"is-url-title":f===u}),children:(0,d.jsxs)("div",{className:"block-editor-link-control__search-item-top",children:[(0,d.jsxs)("span",{className:"block-editor-link-control__search-item-header",role:"figure","aria-label":(0,T.__)("Link information"),children:[(0,d.jsx)("span",{className:gs("block-editor-link-control__search-item-icon",{"is-image":l?.icon}),children:k}),(0,d.jsx)("span",{className:"block-editor-link-control__search-item-details",children:p?(0,d.jsx)("span",{className:"block-editor-link-control__search-item-error-notice",children:(0,T.__)("Link is empty")}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.ExternalLink,{className:"block-editor-link-control__search-item-title",href:e.url,children:(0,d.jsx)(Ss.__experimentalTruncate,{numberOfLines:1,children:f})}),!b&&(0,d.jsx)("span",{className:"block-editor-link-control__search-item-info",children:(0,d.jsx)(Ss.__experimentalTruncate,{numberOfLines:1,children:u})})]})})]}),(0,d.jsx)(Ss.Button,{icon:Hc,label:(0,T.__)("Edit link"),onClick:t,size:"compact",showTooltip:!i}),o&&(0,d.jsx)(Ss.Button,{icon:Xa,label:(0,T.__)("Remove link"),onClick:r,size:"compact",showTooltip:!i}),(0,d.jsx)(Ss.Button,{icon:Uc,label:(0,T.__)("Copy link"),ref:_,accessibleWhenDisabled:!0,disabled:p,size:"compact",showTooltip:!i}),(0,d.jsx)(Gc,{fillProps:e})]})})}const Zc=()=>{};
2var qc=({value:e,onChange:t=Zc,settings:n})=>{if(!n||!n.length)return null;const o=n=>o=>{t({...e,[n.id]:o})},r=n.map(n=>{if("render"in n){if("function"==typeof n.render){const o=n.render(n,e,t);return(0,d.jsx)("div",{className:"block-editor-link-control__setting",children:o},n.id)}return null}return(0,d.jsx)(Ss.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",label:n.title,onChange:o(n),checked:!!e&&!!e[n.id],help:n?.help},n.id)}).filter(Boolean);return(0,d.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,d.jsx)(Ss.VisuallyHidden,{as:"legend",children:(0,T.__)("Currently selected link settings")}),r]})};var Yc=n(2017),Xc=n.n(Yc);const Qc=()=>{},Jc="core/block-editor",eu="linkControlSettingsDrawer";function tu({searchInputPlaceholder:e,value:t,settings:n=Ec,onChange:o=Qc,onRemove:r,onCancel:i,noDirectEntry:s=!1,showSuggestions:l=!0,showInitialSuggestions:a,forceIsEditingLink:c,createSuggestion:u,withCreateSuggestion:p,inputValue:f="",suggestionsQuery:b={},noURLSuggestion:k=!1,createSuggestionButtonText:v,hasRichPreviews:_=!1,hasTextControl:y=!1,renderControlBottom:x=null,handleEntities:S=!1}){void 0===p&&u&&(p=!0);const[w,C]=(0,h.useState)(!1),{advancedSettingsPreference:B}=(0,g.useSelect)(e=>({advancedSettingsPreference:e(pr.store).get(Jc,eu)??!1}),[]),{set:I}=(0,g.useDispatch)(pr.store),j=B||w,E=(0,h.useRef)(!0),M=(0,h.useRef)(),P=(0,h.useRef)(),R=(0,h.useRef)(),A=(0,h.useRef)(!1),N=n.map(({id:e})=>e),[L,D,O,z,V]=function(e){const[t,n]=(0,h.useState)(e||{}),[o,r]=(0,h.useState)(e);return Xc()(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),F=S&&!!L?.id,H=(0,m.useInstanceId)(tu,"link-control"),U=F?`${H}__help`:null,G=t&&!(0,qa.isShallowEqualObjects)(L,t),[$,W]=(0,h.useState)(void 0!==c?c:!t||!t.url),{createPage:K,isCreatingPage:Z,errorMessage:q}=function(e){const t=(0,h.useRef)(),[n,o]=(0,h.useState)(!1),[r,i]=(0,h.useState)(null);return(0,h.useEffect)(()=>()=>{t.current&&t.current.cancel()},[]),{createPage:async function(n){o(!0),i(null);try{return t.current=(e=>{let t=!1;return{promise:new Promise((n,o)=>{e.then(e=>t?o({isCanceled:!0}):n(e),e=>o(t?{isCanceled:!0}:e))}),cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw i(e.message||(0,T.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(u);(0,h.useEffect)(()=>{void 0!==c&&W(c)},[c]),(0,h.useEffect)(()=>{E.current||((Fa.focus.focusable.find(M.current)[0]||M.current).focus(),A.current=!1)},[$,Z]),(0,h.useEffect)(()=>(E.current=!1,()=>{E.current=!0}),[]);const Y=t?.url?.trim()?.length>0,X=()=>{A.current=!!M.current?.contains(M.current.ownerDocument.activeElement),W(!1)},Q=()=>{G&&o({...t,...L,url:te}),X()},[J,ee]=(0,h.useState)(!1);(0,h.useEffect)(()=>{J&&(R.current?.focus(),ee(!1))},[J]);const te=f||L?.url||"",ne=!te?.trim()?.length,oe=r&&t&&!$&&!Z,re=$&&Y,ie=Y&&y,se=($||!t)&&!Z,le=!G||ne,ae=!!n?.length&&$&&Y;return(0,d.jsxs)("div",{tabIndex:-1,ref:M,className:"block-editor-link-control",children:[Z&&(0,d.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,d.jsx)(Ss.Spinner,{})," ",(0,T.__)("Creating"),"â¦"]}),se&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:gs({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":ie,"has-actions":re}),children:[ie&&(0,d.jsx)(Ss.TextControl,{__nextHasNoMarginBottom:!0,ref:P,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,T.__)("Text"),value:L?.title,onChange:z,onKeyDown:e=>{const{keyCode:t}=e;t!==Ua.ENTER||ne||(e.preventDefault(),Q())},__next40pxDefaultSize:!0}),(0,d.jsx)(zc,{ref:R,currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:te,withCreateSuggestion:p,onCreateSuggestion:K,onChange:O,onSelect:e=>{const t=Object.keys(e).reduce((t,n)=>(N.includes(n)||(t[n]=e[n]),t),{});
2o({...L,...t,title:L?.title||e?.title}),X()},showInitialSuggestions:a,allowDirectEntry:!s,showSuggestions:l,suggestionsQuery:b,withURLSuggestion:!k,createSuggestionButtonText:v,hideLabelFromVision:!ie,isEntity:F,suffix:(0,d.jsx)(nu,{isEntity:F,showActions:re,isDisabled:le,onUnlink:()=>{const{id:e,kind:t,type:n,...o}=L;D({...o,id:void 0,kind:void 0,type:void 0,url:void 0}),ee(!0)},onSubmit:Q,helpTextId:U})}),F&&U&&(0,d.jsx)("p",{id:U,className:"block-editor-link-control__help",children:(0,T.sprintf)((0,T.__)("Synced with the selected %s."),L?.type||"item")})]}),q&&(0,d.jsx)(Ss.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:q})]}),t&&!$&&!Z&&(0,d.jsx)(Kc,{value:t,onEditClick:()=>W(!0),hasRichPreviews:_,hasUnlinkControl:oe,onRemove:()=>{r(),W(!0)}},t?.url),ae&&(0,d.jsx)("div",{className:"block-editor-link-control__tools",children:!ne&&(0,d.jsx)(tc,{settingsOpen:j,setSettingsOpen:e=>{I&&I(Jc,eu,e),C(e)},children:(0,d.jsx)(qc,{value:L,settings:n,onChange:V(N)})})}),re&&(0,d.jsxs)(Ss.__experimentalHStack,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),D(t),Y?X():r?.(),i?.()},children:(0,T.__)("Cancel")}),(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:le?Qc:Q,className:"block-editor-link-control__search-submit","aria-disabled":le,children:(0,T.__)("Apply")})]}),!Z&&x&&x()]})}function nu({isEntity:e,showActions:t,isDisabled:n,onUnlink:o,onSubmit:r,helpTextId:i}){return e?(0,d.jsx)(Ss.Button,{icon:Xa,onClick:o,"aria-describedby":i,showTooltip:!0,label:(0,T.__)("Unsync and edit"),__next40pxDefaultSize:!0}):t?void 0:(0,d.jsx)(Ss.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,d.jsx)(Ss.Button,{onClick:n?Qc:r,label:(0,T.__)("Submit"),icon:Qa,className:"block-editor-link-control__search-submit","aria-disabled":n,size:"small"})})}tu.ViewerFill=$c,tu.DEFAULT_LINK_SETTINGS=Ec;const ou=e=>(I()("wp.blockEditor.__experimentalLinkControl",{since:"6.8",alternative:"wp.blockEditor.LinkControl"}),(0,d.jsx)(tu,{...e}));ou.ViewerFill=tu.ViewerFill,ou.DEFAULT_LINK_SETTINGS=tu.DEFAULT_LINK_SETTINGS;var ru=tu;const iu=()=>{};let su=0;var lu=(0,m.compose)([(0,g.withDispatch)(e=>{const{createNotice:t,removeNotice:n}=e(dr.store);return{createNotice:t,removeNotice:n}}),(0,Ss.withFilters)("editor.MediaReplaceFlow")])(({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:o,accept:r,onError:i,onSelect:s,onSelectURL:l,onReset:a,onToggleFeaturedImage:c,useFeaturedImage:u,onFilesUpload:p=iu,name:h=(0,T.__)("Replace"),createNotice:m,removeNotice:f,children:b,multiple:k=!1,addToGallery:v,handleUpload:_=!0,popoverProps:y,renderToggle:x})=>{const{getSettings:S}=(0,g.useSelect)(Ii),w="block-editor/media-replace-flow/error-notice/"+ ++su,C=e=>{const t=(0,Fa.__unstableStripHTML)(e);i?i(t):setTimeout(()=>{m("error",t,{speak:!0,id:w,isDismissible:!0})},1e3)},B=(e,t)=>{u&&c&&c(),t(),s(e),(0,Ho.speak)((0,T.__)("The media file has been replaced")),f(w)},I=e=>{e.keyCode===Ua.DOWN&&(e.preventDefault(),e.target.click())},j=k&&!(!o||0===o.length)&&o.every(e=>"image"===e||e.startsWith("image/"));return(0,d.jsx)(Ss.Dropdown,{popoverProps:y,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>x?x({"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:I,children:h}):(0,d.jsx)(Ss.ToolbarButton,{"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:I,children:h}),renderContent:({onClose:i})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(Ss.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,d.jsxs)(Za,{children:[(0,d.jsx)(Ka,{gallery:j,addToGallery:v,multiple:k,value:k?n:t,onSelect:e=>B(e,i),allowedTypes:o,render:({open:e})=>(0,d.jsx)(Ss.MenuItem,{icon:Ga,onClick:e,children:(0,T.__)("Open Media Library")})}),(0,d.jsx)(Ss.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!_)return t(),s(n);p(n),S().mediaUpload({allowedTypes:o,filesList:n,onFileChange:([e])=>{B(e,t)},onError:C})})(e,i)},accept:r,multiple:!!k,render:({openFileDialog:e})=>(0,d.jsx)(Ss.MenuItem,{icon:$a,onClick:()=>{e()},children:(0,T._x)("Upload","verb")})})]}),c&&(0,d.jsx)(Ss.MenuItem,{icon:Wa,onClick:c,isPressed:u,children:(0,T.__)("Use featured image")}),e&&a&&(0,d.jsx)(Ss.MenuItem,{onClick:()=>{a(),i()},children:(0,T.__)("Reset")}),"function"==typeof b?b({onClose:i}):b]}),l&&(0,d.jsxs)("form",{className:"block-editor-media-flow__url-input",children:[(0,d.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,T.__)("Current media URL:")}),(0,d.jsx)(ru,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>
2{l(e)},searchInputPlaceholder:(0,T.__)("Paste or type URL")})]})]})})});const au="image",cu={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},uu=()=>{},du=e=>{window.requestAnimationFrame(()=>{const[t]=Fa.focus.tabbable.find(e?.current);t&&t.focus()})},pu=e=>{if(!(!e||isNaN(e.x)&&isNaN(e.y)))return`${100*(isNaN(e.x)?.5:e.x)}% ${100*(isNaN(e.y)?.5:e.y)}%`},hu=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 gu({as:e="span",imgUrl:t,toggleProps:n={},filename:o,label:r,onToggleCallback:i=uu}){const{isOpen:s,...l}=n;(0,h.useEffect)(()=>{void 0!==s&&i(s)},[s,i]);const a=()=>(0,d.jsxs)(Ss.__experimentalHStack,{justify:"flex-start",as:"span",className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[t&&(0,d.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator-wrapper","aria-hidden":!0,children:(0,d.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:`url(${t})`}})}),(0,d.jsxs)(Ss.FlexItem,{as:"span",style:t?{}:{flexGrow:1},children:[(0,d.jsx)(Ss.__experimentalTruncate,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:r}),(0,d.jsx)(Ss.VisuallyHidden,{as:"span",children:t?(0,T.sprintf)((0,T.__)("Backgroun
2d image: %s"),o||r):(0,T.__)("No background image selected")})]})]});return"button"===e?(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,...l,children:a()}):a()}function mu({label:e,filename:t,url:n,children:o,onToggle:r=uu,hasImageValue:i,onReset:s,containerRef:l}){if(!i)return;const a=e||(0,Va.getFilename)(n)||(0,T.__)("Add background image");return(0,d.jsx)(Ss.Dropdown,{popoverProps:cu,renderToggle:({onToggle:e,isOpen:o})=>{const i={onClick:e,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":o,"aria-label":(0,T.__)("Background size, position and repeat options."),isOpen:o};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(gu,{imgUrl:n,filename:t,label:a,toggleProps:i,as:"button",onToggleCallback:r}),s&&(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,label:(0,T.__)("Reset"),className:"block-editor-global-styles-background-panel__reset",size:"small",icon:za,onClick:()=>{s(),o&&e(),du(l)}})]})},renderContent:()=>(0,d.jsx)(Ss.__experimentalDropdownContentWrapper,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:o})})}function fu(){return(0,d.jsx)(Ss.Placeholder,{className:"block-editor-global-styles-background-panel__loading",children:(0,d.jsx)(Ss.Spinner,{})})}function bu({onChange:e,style:t,inheritedValue:n,onRemoveImage:o=uu,onResetImage:r=uu,displayInPanel:i,defaultValues:s,containerRef:l}){const[a,c]=(0,h.useState)(!1),{getSettings:u}=(0,g.useSelect)(Ii),{id:p,title:m,url:f}=t?.background?.backgroundImage||{...n?.background?.backgroundImage},{createErrorNotice:b}=(0,g.useDispatch)(dr.store),k=e=>{b(e,{type:"snackbar"}),c(!1)},v=n=>{if(!n||!n.url)return e(ge(t,["background","backgroundImage"],void 0)),void c(!1);if((0,Ha.isBlobURL)(n.url))return void c(!0);if(n.media_type&&n.media_type!==au||!n.media_type&&n.type&&n.type!==au)return void k((0,T.__)("Only images can be used as a background image."));const o=t?.background?.backgroundSize||s?.backgroundSize,r=t?.background?.backgroundPosition;e(ge(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})),c(!1),du(l)},_=!xu(t)&&xu(n),y=m||(0,Va.getFilename)(f)||(0,T.__)("Add background image");return(0,d.jsxs)("div",{className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[a&&(0,d.jsx)(fu,{}),(0,d.jsx)(lu,{mediaId:p,mediaURL:f,allowedTypes:[au],accept:"image/*",onSelect:v,popoverProps:{className:gs({"block-editor-global-styles-background-panel__media-replace-popover":i})},name:(0,d.jsx)(gu,{imgUrl:f,filename:m,label:y}),renderToggle:e=>(0,d.jsx)(Ss.Button,{...e,__next40pxDefaultSize:!0}),onError:k,onReset:()=>{du(l),r()},children:_&&(0,d.jsx)(Ss.MenuItem,{onClick:()=>{du(l),e(ge(t,["background"],{backgroundImage:"none"})),o()},children:(0,T.__)("Remove")})}),(0,d.jsx)(Ss.DropZone,{onFilesDrop:e=>{u().mediaUpload({allowedTypes:[au],filesList:e,onFileChange([e]){v(e)},onError:k,multiple:!1})},label:(0,T.__)("Drop to upload")})]})}function ku({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 p=!("no-repeat"===i||"cover"===u&&void 0===i),h=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(ge(t,["background"],{...t?.background,backgroundPosition:r,backgroundRepeat:o,backgroundSize:n}))},g=!a&&l&&"contain"===r?o?.backgroundPosition:a;return(0,d.jsxs)(Ss.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,d.jsx)(Ss.FocalPointPicker,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Focal point"),url:s,value:hu(g),onChange:n=>{e(ge(t,["background","backgroundPosition"],pu(n)))}}),(0,d.jsx)(Ss.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Fixed background"),checked:"fixed"===c,onChange:()=>e(ge(t,["background","backgroundAttachment"],"fixed"===c?"scroll":"fixed"))}),(0,d.jsxs)(Ss.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:(0,T.__)("Size"),value:u,onChange:h,isBlock:!0,help:(m=r||o?.backgroundSize,"cover"===m||void 0===m?(0,T.__)("Image covers the space evenly."):"contain"===m?(0,T.__)("Image is contained without distortion."):(0,T.__)("Image has a fixed width.")),children:[(0,d.jsx)(Ss.__experimentalToggleGroupControlOption,{value:"cover",label:(0,T._x)("Cover","Size option for background image control")},"cover"),(0,d.jsx)(Ss.__experimentalToggleGroupControlOption,{value:"contain",label:(0,T._x)("Contain","Size option for background image control")},"contain"),(0,d.jsx)(Ss.__experimentalToggleGroupControlOption,{value:"auto",label:(0,T._x)("Tile","Size option for background image control")},"tile")]}),(0,d.jsxs)(Ss.__experimentalHStack,{justify:"flex-start",spacing:2,as:"span",children:[(0,d.jsx)(Ss.__experimentalUnitControl,{"aria-label":(0,T.__)("Backgroun
2d image width"),onChange:h,value:r,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,T.__)("Auto"),disabled:"auto"!==u||void 0===u}),(0,d.jsx)(Ss.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Repeat"),checked:p,onChange:()=>e(ge(t,["background","backgroundRepeat"],!0===p?"no-repeat":"repeat")),disabled:"cover"===u})]})]});var m}function vu({value:e,onChange:t,inheritedValue:n=e,settings:o,defaultValues:r={}}){const{globalStyles:i,_links:s}=(0,g.useSelect)(e=>{const{getSettings:t}=e(Ii),n=t();return{globalStyles:n[N],_links:n[L]}},[]),l=(0,h.useMemo)(()=>{const e={background:{}};return n?.background?(Object.entries(n?.background).forEach(([t,n])=>{e.background[t]=os(n,{styles:i,_links:s})}),e):n},[i,s,n]),a=()=>t(ge(e,["background"],{})),{title:c,url:u}=e?.background?.backgroundImage||{...l?.background?.backgroundImage},p=xu(e)||xu(l),m=p&&"none"!==(e?.background?.backgroundImage||n?.background?.backgroundImage)&&(o?.background?.backgroundSize||o?.background?.backgroundPosition||o?.background?.backgroundRepeat),[f,b]=(0,h.useState)(!1),k=(0,h.useRef)();return(0,d.jsx)("div",{ref:k,className:gs("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":f}),children:m?(0,d.jsx)(mu,{label:c,filename:c,url:u,onToggle:b,hasImageValue:p,onReset:a,containerRef:k,children:(0,d.jsxs)(Ss.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,d.jsx)(bu,{onChange:t,style:e,inheritedValue:l,displayInPanel:!0,onResetImage:()=>{b(!1),a()},onRemoveImage:()=>b(!1),defaultValues:r,containerRef:k}),(0,d.jsx)(ku,{onChange:t,style:e,defaultValues:r,inheritedValue:l})]})}):(0,d.jsx)(bu,{onChange:t,style:e,inheritedValue:l,defaultValues:r,onResetImage:()=>{b(!1),a()},onRemoveImage:()=>b(!1),containerRef:k})})}const _u={backgroundImage:!0};function yu(e){return"web"===h.Platform.OS&&e?.background?.backgroundImage}function xu(e){return!!e?.background?.backgroundImage?.id||"string"==typeof e?.background?.backgroundImage||!!e?.background?.backgroundImage?.url}function Su({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r,headerLabel:i}){const s=Qi();return(0,d.jsx)(Ss.__experimentalToolsPanel,{label:i,resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:s,children:r})}function wu({as:e=Su,value:t,onChange:n,inheritedValue:o,settings:r,panelId:i,defaultControls:s=_u,defaultValues:l={}
2,headerLabel:a=(0,T.__)("Background image")}){const c=yu(r),u=(0,h.useCallback)(e=>({...e,background:{}}),[]);return(0,d.jsx)(e,{resetAllFilter:u,value:t,onChange:n,panelId:i,headerLabel:a,children:c&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{hasValue:()=>!!t?.background,label:(0,T.__)("Image"),onDeselect:()=>n(ge(t,["background"],{})),isShownByDefault:s.backgroundImage,panelId:i,children:(0,d.jsx)(vu,{value:t,onChange:n,settings:r,inheritedValue:o,defaultControls:s,defaultValues:l})})})}const Cu="background",Bu={backgroundSize:"cover",backgroundPosition:"50% 50%"};function Iu(e,t="any"){const n=(0,p.getBlockSupport)(e,Cu);return!!(!0===n||("any"===t?n?.backgroundImage||n?.backgroundSize||n?.backgroundRepeat:n?.[t]))}function ju(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:Bu.backgroundSize}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(t={backgroundPosition:Bu.backgroundPosition}),t}function Eu(e){return xu(e)?"has-background":""}function Tu({children:e}){const t=(0,h.useCallback)(e=>({...e,style:{...e.style,background:void 0}}),[]);return(0,d.jsx)(Oa,{group:"background",resetAllFilter:t,children:e})}function Mu({clientId:e,name:t,setAttributes:n,settings:o}){const{style:r,inheritedValue:i}=(0,g.useSelect)(n=>{const{getBlockAttributes:o,getSettings:r}=n(Ii),i=r();return{style:o(e)?.style,inheritedValue:i[N]?.blocks?.[t]}},[e,t]);if(!yu(o)||!Iu(t,"backgroundImage"))return null;const s={...o,background:{...o.background,backgroundSize:o?.background?.backgroundSize&&Iu(t,"backgroundSize")}},l=(0,p.getBlockSupport)(t,[Cu,"defaultControls"]);return(0,d.jsx)(wu,{inheritedValue:i,as:Tu,panelId:e,defaultValues:Bu,settings:s,onChange:e=>{n({style:ms(e)})},defaultControls:l,value:r})}var Pu={useBlockProps:function({name:e,style:t}){if(!Iu(e)||!t?.background?.backgroundImage)return;const n=ju(t?.background);return n?{style:{...n}}:void 0},attributeKeys:["style"],hasSupport:Iu};(0,f.addFilter)("blocks.registerBlockType","core/lock/addAttribute",function(e){return"type"in(e.attributes?.lock??{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e});var Ru=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}),Au=(0,h.memo)(function({icon:e,showColors:t=!1,className:n,context:o}){"block-default"===e?.src&&(e={src:Ru});const r=(0,d.jsx)(Ss.Icon,{icon:e&&e.src?e.src:e,context:o}),i=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,d.jsx)("span",{style:i,className:gs("block-editor-block-icon",n,{"has-colors":t}),children:r})}),Nu=function({blockTypes:e,value:t,onItemChange:n}){return(0,d.jsx)("ul",{className:"block-editor-block-manager__checklist",children:e.map(e=>(0,d.jsxs)("li",{className:"block-editor-block-manager__checklist-item",children:[(0,d.jsx)(Ss.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.title,checked:t.includes(e.name),onChange:(...t)=>n(e,...t)}),(0,d.jsx)(Au,{icon:e.icon})]},e.name))})},Lu=function e({title:t,blockTypes:n,selectedBlockTypes:o,onChange:r}){const i=(0,m.useInstanceId)(e),s=(0,h.useCallback)((e,t)=>{r(t?[...o,e]:o.filter(({name:t})=>t!==e.name))},[o,r]),l=(0,h.useCallback)(e=>{r(e?[...o,...n.filter(e=>!o.find(({name:t})=>t===e.name))]:o.filter(e=>!n.find(({name:t})=>t===e.name)))},[n,o,r]);if(!n.length)return null;const a=n.map(({name:e})=>e).filter(e=>(o??[]).some(t=>t.name===e)),c="block-editor-block-manager__category-title-"+i,u=a.length===n.length,p=!u&&a.length>0;return(0,d.jsxs)("div",{role:"group","aria-labelledby":c,className:"block-editor-block-manager__category",children:[(0,d.jsx)(Ss.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:u,onChange:l,className:"block-editor-block-manager__category-title",indeterminate:p,label:(0,d.jsx)("span",{id:c,children:t})}),(0,d.jsx)(Nu,{blockTypes:n,value:a,onItemChange:s})]})};function Du({blockTypes:e,selectedBlockTypes:t,onChange:n,showSelectAll:o=!0}){const r=(0,m.useDebounce)(Ho.speak,500),[i,s]=(0,h.useState)(""),{categories:l,isMatchingSearchTerm:a}=(0,g.useSelect)(e=>({categories:e(p.store).getCategories(),isMatchingSearchTerm:e(p.store).isMatchingSearchTerm}
2),[]),c=e.filter(e=>!i||a(e,i)),u=t.length>0&&t.length!==e.length,f=e.length>0&&t.length===e.length;return(0,h.useEffect)(()=>{if(!i)return;const e=c.length,t=(0,T.sprintf)((0,T._n)("%d result found.","%d results found.",e),e);r(t)},[c?.length,i,r]),(0,d.jsxs)(Ss.__experimentalVStack,{className:"block-editor-block-manager__content",spacing:4,children:[(0,d.jsx)(Ss.SearchControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Search for a block"),placeholder:(0,T.__)("Search for a block"),value:i,onChange:e=>s(e),className:"block-editor-block-manager__search"}),o&&(0,d.jsx)(Ss.CheckboxControl,{className:"block-editor-block-manager__select-all",label:(0,T.__)("Select all"),checked:f,onChange:()=>{n(f?[]:e)},indeterminate:u,__nextHasNoMarginBottom:!0}),(0,d.jsxs)("div",{tabIndex:"0",role:"region","aria-label":(0,T.__)("Available block types"),className:"block-editor-block-manager__results",children:[0===c.length&&(0,d.jsx)("p",{className:"block-editor-block-manager__no-results",children:(0,T.__)("No blocks found.")}),l.map(e=>(0,d.jsx)(Lu,{title:e.title,blockTypes:c.filter(t=>t.category===e.slug),selectedBlockTypes:t,onChange:n},e.slug)),(0,d.jsx)(Lu,{title:(0,T.__)("Uncategorized"),blockTypes:c.filter(({category:e})=>!e),selectedBlockTypes:t,onChange:n})]})]})}function Ou({clientId:e,blockTypes:t,selectedBlockTypes:n,onClose:o}){const[r,i]=(0,h.useState)(n),{updateBlockAttributes:s}=(0,g.useDispatch)(Ii);return(0,d.jsx)(Ss.Modal,{title:(0,T.__)("Manage allowed blocks"),onRequestClose:o,overlayClassName:"block-editor-block-allowed-blocks-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,d.jsxs)(Ss.__experimentalVStack,{as:"form",onSubmit:n=>{n.preventDefault(),(()=>{const n=r.length===t.length,i=r.map(({name:e})=>e);s(e,{allowedBlocks:n?void 0:i}),o()})()},spacing:"4",children:[(0,d.jsx)(Ss.__experimentalText,{children:(0,T.__)("Select which blocks can be added inside this container.")}),(0,d.jsx)(Du,{blockTypes:t,selectedBlockTypes:r,onChange:e=>{i(e)}}),(0,d.jsxs)(Ss.Flex,{className:"block-editor-block-allowed-blocks-modal__actions",justify:"flex-end",expanded:!1,children:[(0,d.jsx)(Ss.FlexItem,{children:(0,d.jsx)(Ss.Button,{variant:"tertiary",onClick:o,__next40pxDefaultSize:!0,children:(0,T.__)("Cancel")})}),(0,d.jsx)(Ss.FlexItem,{children:(0,d.jsx)(Ss.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,T.__)("Apply")})})]})]})})}function zu({clientId:e}){const[t,n]=(0,h.useState)(!1),{blockTypes:o,selectedBlockNames:r}=(0,g.useSelect)(t=>{const{getBlockAttributes:n}=t(Ii);return{blockTypes:t(p.store).getBlockTypes(),selectedBlockNames:n(e)?.allowedBlocks}},[e]),i=o.filter(e=>(0,p.hasBlockSupport)(e,"inserter",!0)&&(!e.parent||e.parent.includes("core/post-content")));if(!i)return null;const s=void 0===r?i:i.filter(e=>r.includes(e.name));return(0,d.jsxs)("div",{className:"block-editor-block-allowed-blocks-control",children:[(0,d.jsxs)(Ss.BaseControl,{help:(0,T.__)("Specify which blocks are allowed inside this container."),__nextHasNoMarginBottom:!0,children:[(0,d.jsx)(Ss.BaseControl.VisualLabel,{children:(0,T.__)("Allowed Blocks")}),(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{n(!0)},className:"block-editor-block-allowed-blocks-control__button",children:(0,T.__)("Manage allowed blocks")})]}),t&&(0,d.jsx)(Ou,{clientId:e,blockTypes:i,selectedBlockTypes:s,onClose:()=>n(!1)})]})}var Vu={edit:function({clientId:e}){return(0,g.useSelect)(t=>"contentOnly"===t(Ii).getBlockEditingMode(e),[e])?null:(0,d.jsx)(Ea.Fill,{children:(0,d.jsx)(zu,{clientId:e})})},attributeKeys:["allowedBlocks"],hasSupport:e=>(0,p.hasBlockSupport)(e,"allowedBlocks")};(0,f.addFilter)("blocks.registerBlockType","core/allowedBlocks/attribute",function(e){return e?.attributes?.allowedBlocks?.type||(0,p.hasBlockSupport)(e,"allowedBlocks")&&(e.attributes={...e.attributes,allowedBlocks:{type:"array"}}),e}),(0,f.addFilter)("blocks.switchToBlockType.transformedBlock","core/allowedBlocks/addTransforms",function(e,t,n,o){if(!(0,p.hasBlockSupport)(e.name,"allowedBlocks"))return e;if(1!==t.length&&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(o.length>1&&t.length>1&&o.length!==t.length)return e;if(e.attributes.allowedBlocks)return e;const r=t[n]?.attributes?.allowedBlocks;
2if(!r)return e;const i=(0,p.getBlockType)(e.name),s=i?.allowedBlocks||[];if(!s.length)return{...e,attributes:{...e.attributes,allowedBlocks:r}};const l=r.filter(e=>s.includes(e));return{...e,attributes:{...e.attributes,allowedBlocks:l}}});const Fu=/[\s#]/g,Hu={type:"string",source:"attribute",attribute:"id",selector:"*"};var Uu={addSaveProps:function(e,t,n){return(0,p.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e},edit:function({anchor:e,setAttributes:t}){if("default"!==da())return null;const n="web"===h.Platform.OS;return(0,d.jsx)(Oa,{group:"advanced",children:(0,d.jsx)(Ss.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,T.__)("HTML anchor"),help:(0,d.jsxs)(d.Fragment,{children:[(0,T.__)("Enter a word or two â without spaces â to make a unique web address just for this block, called an âanchorâ. Then, youâll be able to link directly to this section of your page."),n&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsx)(Ss.ExternalLink,{href:(0,T.__)("https://wordpress.org/documentation/article/page-jumps/"),children:(0,T.__)("Learn more about anchors")})]})]}),value:e||"",placeholder:n?null:(0,T.__)("Add an anchor"),onChange:e=>{e=e.replace(Fu,"-"),t({anchor:e})},autoCapitalize:"none",autoComplete:"off"})})},attributeKeys:["anchor"],hasSupport:e=>(0,p.hasBlockSupport)(e,"anchor")};(0,f.addFilter)("blocks.registerBlockType","core/anchor/attribute",function(e){return"type"in(e.attributes?.anchor??{})||(0,p.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Hu}),e});var Gu={addSaveProps:function(e,t,n){return(0,p.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e},attributeKeys:["ariaLabel"],hasSupport:e=>(0,p.hasBlockSupport)(e,"ariaLabel")};(0,f.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",function(e){return e?.attributes?.ariaLabel?.type||(0,p.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:{type:"string"}}),e});var $u={edit:function({className:e,setAttributes:t}){return"default"!==da()?null:(0,d.jsx)(Oa,{group:"advanced",children:(0,d.jsx)(Ss.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off",label:(0,T.__)("Additional CSS class(es)"),value:e||"",onChange:e=>{t({className:""!==e?e:void 0})},help:(0,T.__)("Separate multiple classes with spaces.")})})},addSaveProps:function(e,t,n){return(0,p.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=gs(e.className,n.className)),e},attributeKeys:["className"],hasSupport:e=>(0,p.hasBlockSupport)(e,"customClassName",!0)};(0,f.addFilter)("blocks.registerBlockType","core/editor/custom-class-name/attribute",function(e){return(0,p.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e}),(0,f.addFilter)("blocks.switchToBlockType.transformedBlock","core/customClassName/addTransforms",function(e,t,n,o){if(!(0,p.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&&void 0===e.attributes.className)return{...e,attributes:{...e.attributes,className:o}}}return e}),(0,f.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",function(e,t){return(0,p.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,p.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,p.getBlockDefaultClassName)(t.name)),e});var Wu={grad:.9,turn:360,rad:360/(2*Math.PI)},Ku=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Zu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},qu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Yu=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Xu=function(e){return{r:qu(e.r,0,255),g:qu(e.g,0,255),b:qu(e.b,0,255),a:qu(e.a)}},Qu=function(e){return{r:Zu(e.r),g:Zu(e.g),b:Zu(e.b),a:Zu(e.a,3)}},Ju=/^#([0-9a-f]{3,8})$/i,ed=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},td=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}},nd=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}},od=function(e){return{h:Yu(e.h),s:qu(e.s,0,100),l:qu(e.l,0,100),a:qu(e.a)}},rd=function(e){return{h:Zu(e.h),s:Zu(e.s),l:Zu(e.l),a:Zu(e.a,3)}},id=function(e){return nd((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},sd=function(e){return{h:(t=td(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},ld=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ad=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,cd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\
vendor: 6,861 bytes, line 2
2s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ud=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dd={string:[[function(e){var t=Ju.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?Zu(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?Zu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=cd.exec(e)||ud.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Xu({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=ld.exec(e)||ad.exec(e);if(!t)return null;var n,o,r=od({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Wu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return id(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 Ku(t)&&Ku(n)&&Ku(o)?Xu({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(!Ku(t)||!Ku(n)||!Ku(o))return null;var s=od({h:Number(t),s:Number(n),l:Number(o),a:Number(i)});return id(s)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,i=void 0===r?1:r;if(!Ku(t)||!Ku(n)||!Ku(o))return null;var s=function(e){return{h:Yu(e.h),s:qu(e.s,0,100),v:qu(e.v,0,100),a:qu(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(i)});return nd(s)},"hsv"]]},pd=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]},hd=function(e,t){var n=sd(e);return{h:n.h,s:qu(n.s+100*t,0,100),l:n.l,a:n.a}},gd=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},md=function(e,t){var n=sd(e);return{h:n.h,s:n.s,l:qu(n.l+100*t,0,100),a:n.a}},fd=function(){function e(e){this.parsed=function(e){return"string"==typeof e?pd(e.trim(),dd.string):"object"==typeof e&&null!==e?pd(e,dd.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return Zu(gd(this.rgba),2)},e.prototype.isDark=function(){return gd(this.rgba)<.5},e.prototype.isLight=function(){return gd(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=Qu(this.rgba)).r,n=e.g,o=e.b,i=(r=e.a)<1?ed(Zu(255*r)):"","#"+ed(t)+ed(n)+ed(o)+i;var e,t,n,o,r,i},e.prototype.toRgb=function(){return Qu(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Qu(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 rd(sd(this.rgba))},e.prototype.toHslString=function(){return t=(e=rd(sd(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=td(this.rgba),{h:Zu(e.h),s:Zu(e.s),v:Zu(e.v),a:Zu(e.a,3)};var e},e.prototype.invert=function(){return bd({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),bd(hd(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),bd(hd(this.rgba,-e))},e.prototype.grayscale=function(){return bd(hd(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),bd(md(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),bd(md(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?bd({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Zu(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=sd(this.rgba);return"number"==typeof e?bd({h:e,s:t.s,l:t.l,a:t.a}):Zu(t.h)},e.prototype.isEqual=function(e){return this.toHex()===bd(e).toHex()},e}(),bd=function(e){return e instanceof fd?e:new fd(e)},kd=[],vd=function(e){e.forEach(function(e){kd.indexOf(e)<0&&(e(fd,dd),kd.push(e))})};function _d(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",s
2andybrown:"#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 yd=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},xd=function(e){return.2126*yd(e.r)+.7152*yd(e.g)+.0722*yd(e.b)};function Sd(e){e.prototype.luminance=function(){return e=xd(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=xd(i))>(a=xd(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}}vd([_d,Sd]);const{kebabCase:wd}=U(Ss.privateApis),Cd=(e,t,n)=>{if(t){const n=e?.find(e=>e.slug===t);if(n)return n}return{color:n}},Bd=(e,t)=>e?.find(e=>e.color===t);function Id(e,t){if(e&&t)return`has-${wd(t)}-${e}`}function jd(){const[e,t,n,o,r,i,s,l,a,c]=Ei("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"),u={disableCustomColors:!e,disableCustomGradients:!i};return u.colors=(0,h.useMemo)(()=>{const e=[];return n&&n.length&&e.push({name:(0,T._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",colors:n}),r&&o&&o.length&&e.push({name:(0,T._x)("Default","Indicates this palette comes from WordPress."),slug:"default",colors:o}),t&&t.length&&e.push({name:(0,T._x)("Custom","Indicates this palette is created by the user."),slug:"custom",colors:t}),e},[t,n,o,r]),u.gradients=(0,h.useMemo)(()=>{const e=[];return l&&l.length&&e.push({name:(0,T._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",gradients:l}),c&&a&&a.length&&e.push({name:(0,T._x)("Default","Indicates this palette comes from WordPress."),slug:"default",gradients:a}),s&&s.length&&e.push({name:(0,T._x)("Custom","Indicates this palette is created by the user."),slug:"custom",gradients:s}),e},[s,l,a,c]),u.hasColorsOrGradients=!!u.colors.length||!!u.gradients.length,u}var Ed=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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 Td({isLinked:e,...t}){const n=e?(0,T.__)("Unlink radii"):(0,T.__)("Link radii");return(0,d.jsx)(Ss.Button,{...t,className:"components-border-radius-control__linked-button",size:"small",icon:e?Ed:Xa,iconSize:24,label:n})}function Md(e){return!!e?.includes&&("0"===e||e.includes("var:preset|border-radius|"))}function Pd(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|border-radius\|(.+)/);return t?t[1]:void 0}function Rd(e,t){if(!Md(e))return e;const n=0===parseFloat(e,10)?"0":Pd(e),o=t.find(e=>String(e.slug)===n);return o?.size}function Ad(e,t,n){const o=parseInt(e,10);if("selectList"===t){if(0===o)return}else if(0===o)return"0";return`var:preset|border-radius|${n[e]?.slug}`}function Nd(e,t){if(!e||Md(e)||"0"===e)return e;const n=t.find(t=>String(t.size)===String(e));return n?.slug?`var:preset|border-radius|${n.slug}`:e}var Ld=(0,d.jsxs)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ce.Path,{d:"m19 7.5
2h-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,d.jsx)(ce.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"})]}),Dd=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5Zm-12.5 9v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),Od=(0,d.jsxs)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ce.G,{opacity:".25",children:(0,d.jsx)(ce.Path,{d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),(0,d.jsx)(ce.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5.75a.25.25 0 0 0-.25.25v3h-1.5V6c0-.966.784-1.75 1.75-1.75h3v1.5H6Z"})]}),zd=(0,d.jsxs)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ce.G,{opacity:".25",children:(0,d.jsx)(ce.Path,{d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),(0,d.jsx)(ce.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5Z"})]}),Vd=(0,d.jsxs)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ce.G,{opacity:".25",children:(0,d.jsx)(ce.Path,{d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),(0,d.jsx)(ce.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.75 15v3c0 .138.112.25.25.25h3v1.5H6A1.75 1.75 0 0 1 4.25 18v-3h1.5Z"})]}),Fd=(0,d.jsxs)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ce.G,{opacity:".25",children:(0,d.jsx)(ce.Path,{d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),(0,d.jsx)(ce.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 18.25h3a.25.25 0 0 0 .25-.25v-3h1.5v3A1.75 1.75 0 0 1 18 19.75h-3v-1.5Z"})]});const Hd={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},Ud=8,Gd=[],$d={all:(0,T.__)("Border radius"),topLeft:(0,T.__)("Top left"),topRight:(0,T.__)("Top right"),bottomLeft:(0,T.__)("Bottom left"),bottomRight:(0,T.__)("Bottom right")},Wd={all:Dd,topLeft:Od,topRight:zd,bottomLeft:Vd,bottomRight:Fd},Kd=0,Zd={px:100,em:20,rem:20};function qd({corner:e,onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,units:i,presets:s}){const l=n=>{t("all"===e?{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n}:{...a,[e]:n})},a="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};let c;if("all"===e){const e=function(e,t){if(!e||"object"!=typeof e)return e;const n={};return Object.keys(e).forEach(o=>{const r=e[o];if(Md(r)){const e=Rd(r,t);n[o]=void 0!==e?e:r}else n[o]=r}),n}(a,s),t=function(e={}){if("string"==typeof e)return e;const t=Object.values(e).map(e=>{const t=(0,Ss.__experimentalParseQuantityAndUnitFromRawValue)(e);return"string"==typeof e&&void 0===t[0]?[e,""]:t}),n=t.map(e=>e[0]??""),o=t.map(e=>e[1]),r=n.every(e=>e===n[0])?n[0]:"",i=(s=o,[...s].sort((e,t)=>
2s.filter(e=>e===t).length-s.filter(t=>t===e).length).shift());var s;return 0===r||r?`${r}${i||""}`:void 0}(e);c=Nd(t,s)}else c=Nd(a[e],s);const u=Md(c)?Rd(c,s):c,[p,g]=(0,Ss.__experimentalParseQuantityAndUnitFromRawValue)(u),m=c?g:n[e]||n.flat||"px",f=i&&i.find(e=>e.value===m),b=f?.step||1,[k,v]=(0,h.useState)(void 0!==c&&!Md(c)),_=s.length<=Ud,y=function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":Pd(e),o=t.findIndex(e=>String(e.slug)===n);return-1!==o?o:NaN}(c,s),x=s.slice(1,s.length-1).map((e,t)=>({value:t+1,label:void 0})),S=x.length>0;let w=[];_||(w=[...s,{name:(0,T.__)("Custom"),slug:"custom",size:u}].map((e,t)=>({key:t,name:e.name})));const C=Wd[e];return(0,d.jsxs)(Ss.__experimentalHStack,{children:[C&&(0,d.jsx)(Ss.Icon,{className:"components-border-radius-control__icon",icon:C,size:24}),(!S||k)&&(0,d.jsxs)("div",{className:"components-border-radius-control__input-controls-wrapper",children:[(0,d.jsx)(Ss.Tooltip,{text:$d[e],placement:"top",children:(0,d.jsx)("div",{className:"components-border-radius-control__tooltip-wrapper",children:(0,d.jsx)(Ss.__experimentalUnitControl,{className:"components-border-radius-control__unit-control","aria-label":$d[e],value:[p,m].join(""),onChange:e=>{if(!t)return;const n=!isNaN(parseFloat(e));l(n?e:void 0)},onUnitChange:t=>{const r={...n};"all"===e?(r.flat=t,r.topLeft=t,r.topRight=t,r.bottomLeft=t,r.bottomRight=t):r[e]=t,o(r)},size:"__unstable-large",min:Kd,units:i})})}),(0,d.jsx)(Ss.RangeControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:p??"",min:Kd,max:Zd[m],initialPosition:0,withInputField:!1,onChange:e=>{l(void 0!==e?`${e}${m}`:void 0)},step:b,__nextHasNoMarginBottom:!0})]}),S&&_&&!k&&(0,d.jsx)(Ss.RangeControl,{__next40pxDefaultSize:!0,className:"components-border-radius-control__range-control",value:y,onChange:e=>{l(Ad(e,"range",s))},withInputField:!1,"aria-valuenow":y,"aria-valuetext":s[y]?.name,renderTooltipContent:e=>void 0===c?void 0:s[e]?.name,min:0,max:s.length-1,marks:x,label:$d[e],hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),!_&&!k&&(0,d.jsx)(Ss.CustomSelectControl,{className:"components-border-radius-control__custom-select-control",value:w.find(e=>e.key===y)||w[w.length-1],onChange:e=>{e.selectedItem.key===w.length-1?v(!0):l(Ad(e.selectedItem.key,"selectList",s))},options:w,label:$d[e],hideLabelFromVision:!0,size:"__unstable-large"}),S&&(0,d.jsx)(Ss.Button,{label:k?(0,T.__)("Use border radius preset"):(0,T.__)("Set custom border radius"),icon:Ld,onClick:()=>{v(!k)},isPressed:k,size:"small",className:"components-border-radius-control__custom-toggle",iconSize:24})]})}function Yd({onChange:e,values:t,presets:n}){const[o,r]=(0,h.useState)(!function(e){return!(!e||"string"!=typeof e&&!Object.values(e).filter(e=>!!e||0===e).length)}(t)||!function(e={}){if("string"==typeof e)return!1;if(!e||"object"!=typeof e)return!1;const t=Object.values(e);if(0===t.length)return!1;const n=t[0];return!t.every(e=>e===n)}(t)),i=function(e){const t=e?.default??Gd,n=e?.custom??Gd,o=e?.theme??Gd;return(0,h.useMemo)(()=>{const e=[{name:(0,T.__)("None"),slug:"0",size:0},...n,...o,...t];return e.length>Ud?[{name:(0,T.__)("Default"),slug:"default",size:void 0},...e]:e},[n,o,t])}(n),[s,l]=(0,h.useState)({flat:"string"==typeof t?(0,Ss.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,Ss.__experimentalParseQuantityAndUnitFromRawValue)(t?.topLeft)[1],topRight:(0,Ss.__experimentalParseQuantityAndUnitFromRawValue)(t?.topRight)[1],bottomLeft:(0,Ss.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomLeft)[1],bottomRight:(0,Ss.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomRight)[1]}),[a]=Ei("spacing.units"),c=(0,Ss.__experimentalUseCustomUnits)({availableUnits:a||["px","em","rem"]});return(0,d.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,d.jsxs)(Ss.__experimentalHStack,{className:"components-border-radius-control__header",children:[(0,d.jsx)(Ss.BaseControl.VisualLabel,{as:"legend",children:(0,T.__)("Radius")}),(0,d.jsx)(Td,{onClick:()=>r(!o),isLinked:o})]}),o?(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(qd,{onChange:e,selectedUnits:s,setSelectedUnits:l,values:t,units:c,corner:"all",presets:i}
2)}):(0,d.jsx)(Ss.__experimentalVStack,{children:["topLeft","topRight","bottomLeft","bottomRight"].map(n=>(0,d.jsx)(qd,{onChange:e,selectedUnits:s,setSelectedUnits:l,values:t||Hd,units:c,corner:n,presets:i},n))})]})}var Xd=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})}),Qd=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.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"})});const Jd=[];function ep({shadow:e,onShadowChange:t,settings:n}){const o=ip(n);return(0,d.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,d.jsxs)(Ss.__experimentalVStack,{spacing:4,children:[(0,d.jsx)(Ss.__experimentalHeading,{level:5,children:(0,T.__)("Drop shadow")}),(0,d.jsx)(tp,{presets:o,activeShadow:e,onSelect:t}),(0,d.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(void 0),disabled:!e,accessibleWhenDisabled:!0,children:(0,T.__)("Clear")})})]})})}function tp({presets:e,activeShadow:t,onSelect:n}){return e?(0,d.jsx)(Ss.Composite,{role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,T.__)("Drop shadows"),children:e.map(({name:e,slug:o,shadow:r})=>(0,d.jsx)(np,{label:e,isActive:r===t,type:"unset"===o?"unset":"preset",onSelect:()=>n(r===t?void 0:r),shadow:r},o))}):null}function np({type:e,label:t,isActive:n,onSelect:o,shadow:r}){return(0,d.jsx)(Ss.Tooltip,{text:t,children:(0,d.jsx)(Ss.Composite.Item,{role:"option","aria-label":t,"aria-selected":n,className:gs("block-editor-global-styles__shadow__item",{"is-active":n}),render:(0,d.jsx)("button",{className:gs("block-editor-global-styles__shadow-indicator",{unset:"unset"===e}),onClick:o,style:{boxShadow:r},"aria-label":t,children:n&&(0,d.jsx)(Nl,{icon:Xd})})})})}function op({shadow:e,onShadowChange:t,settings:n}){return(0,d.jsx)(Ss.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:rp(e,t),renderContent:()=>(0,d.jsx)(Ss.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,d.jsx)(ep,{shadow:e,onShadowChange:t,settings:n})})})}function rp(e,t){return({onToggle:n,isOpen:o})=>{const r=(0,h.useRef)(void 0),i={onClick:n,className:gs("block-editor-global-styles__shadow-dropdown-toggle",{"is-open":o}),"aria-expanded":o,ref:r},s={onClick:()=>{o&&n(),t(void 0),r.current?.focus()},className:gs("block-editor-global-styles__shadow-editor__remove-button",{"is-open":o}),label:(0,T.__)("Remove")};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,...i,children:(0,d.jsxs)(Ss.__experimentalHStack,{justify:"flex-start",children:[(0,d.jsx)(Nl,{className:"block-editor-global-styles__toggle-icon",icon:Qd,size:24}),(0,d.jsx)(Ss.FlexItem,{children:(0,T.__)("Drop shadow")})]})}),!!e&&(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,size:"small",icon:za,...s})]})}}function ip(e){return(0,h.useMemo)(()=>{if(!e?.shadow)return Jd;const t=e?.shadow?.defaultPresets,{default:n,theme:o,custom:r}=e?.shadow?.presets??{},i={name:(0,T.__)("Unset"),slug:"unset",shadow:"none"},s=[...t&&n||Jd,...o||Jd,...r||Jd];return s.length&&s.unshift(i),s},[e])}function sp(e){return Object.values(lp(e)).some(Boolean)}function lp(e){return{hasBorderColor:ap(e),hasBorderRadius:cp(e),hasBorderStyle:up(e),hasBorderWidth:dp(e),hasShadow:pp(e)}}function ap(e){return e?.border?.color}function cp(e){return e?.border?.radius}function up(e){return e?.border?.style}function dp(e){return e?.border?.width}function pp(e){const t=ip(e);return!!e?.shadow&&t.length>0}function hp({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r,label:i}){const s=Qi();return(0,d.jsx)(Ss.__experimentalToolsPanel,{label:i,resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:s,children:r})}const gp={radius:!0,color:!0,width:!0,shadow:!0}
2;function mp({as:e=hp,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,name:s,defaultControls:l=gp}){const a=ds(r),c=(0,h.useCallback)(e=>es({settings:r},"",e),[r]),u=e=>{const t=a.flatMap(({colors:e})=>e).find(({color:t})=>t===e);return t?"var:preset|color|"+t.slug:e},p=(0,h.useMemo)(()=>{if((0,Ss.__experimentalHasSplitBorders)(o?.border)){const e={...o?.border};return["top","right","bottom","left"].forEach(t=>{e[t]={...e[t],color:c(e[t]?.color)}}),e}return{...o?.border,color:o?.border?.color?c(o?.border?.color):void 0}},[o?.border,c]),g=e=>n({...t,border:e}),m=ap(r),f=up(r),b=dp(r),k=cp(r),v=(0,h.useMemo)(()=>"object"!=typeof o?.border?.radius?c(o?.border?.radius):{topLeft:c(o?.border?.radius?.topLeft),topRight:c(o?.border?.radius?.topRight),bottomLeft:c(o?.border?.radius?.bottomLeft),bottomRight:c(o?.border?.radius?.bottomRight)},[o?.border?.radius,c]),_=e=>g({...p,radius:e}),y=()=>{const e=t?.border?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},x=pp(r),S=c(o?.shadow),w=r?.shadow?.presets??{},C=w.custom??w.theme??w.default??[],B=e=>{const o=C?.find(({shadow:t})=>t===e)?.slug;n(ge(t,["shadow"],o?`var:preset|shadow|${o}`:e||void 0))},I=(0,h.useCallback)(e=>({...e,border:void 0,shadow:void 0}),[]),j=l?.color||l?.width,E=m||f||b||k,M=Bp({blockName:s,hasShadowControl:x,hasBorderControl:E});return(0,d.jsxs)(e,{resetAllFilter:I,value:t,onChange:n,panelId:i,label:M,children:[(b||m)&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{hasValue:()=>(0,Ss.__experimentalIsDefinedBorder)(t?.border),label:(0,T.__)("Border"),onDeselect:()=>(()=>{if(y())return g({radius:t?.border?.radius});g(void 0)})(),isShownByDefault:j,panelId:i,children:(0,d.jsx)(Ss.BorderBoxControl,{colors:a,enableAlpha:!0,enableStyle:f,onChange:e=>{const t={...e};(0,Ss.__experimentalHasSplitBorders)(t)?["top","right","bottom","left"].forEach(e=>{t[e]&&(t[e]={...t[e],color:u(t[e]?.color)})}):t&&(t.color=u(t.color)),g({radius:p?.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:p,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!x,label:(0,T.__)("Border")})}),k&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{hasValue:y,label:(0,T.__)("Radius"),onDeselect:()=>_(void 0),isShownByDefault:l.radius,panelId:i,children:(0,d.jsx)(Yd,{presets:r?.border?.radiusSizes,values:v,onChange:e=>{_(e||void 0)}})}),x&&(0,d.jsxs)(Ss.__experimentalToolsPanelItem,{label:(0,T.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>B(void 0),isShownByDefault:l.shadow,panelId:i,children:[E?(0,d.jsx)(Ss.BaseControl.VisualLabel,{as:"legend",children:(0,T.__)("Shadow")}):null,(0,d.jsx)(op,{shadow:S,onShadowChange:B,settings:r})]})]})}const fp="__experimentalBorder",bp="shadow",kp=(e,t,n)=>{let o;return e.some(e=>e.colors.some(e=>e[t]===n&&(o=e,!0))),o},vp=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=kp(e,"slug",t);if(n)return n}if(!n)return{color:void 0};return kp(e,"color",n)||{color:n}};function _p(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function yp(e){if((0,Ss.__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:ms(o),borderColor:n}}function xp(e){return(0,Ss.__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 Sp({label:e,children:t,resetAllFilter:n}){const o=(0,h.useCallback)(e=>{const t=xp(e),o=n(t);return{...e,...yp(o)}},[n]);return(0,d.jsx)(Oa,{group:"border",resetAllFilter:o,label:e,children:t})}function wp({clientId:e,name:t,setAttributes:n,settings:o}){const r=sp(o),{style:i,borderColor:s}=(0,g.useSelect)(function(t){const{style:n,borderColor:o}=t(Ii).getBlockAttributes(e)||{};return{style:n,borderColor:o}},[e]),l=(0,h.useMemo)(()=>xp({style:i,borderColor:s}),[i,s]);if(!r)return null;const a={...(0,p.getBlockSupport)(t,[fp,"__experimentalDefaultControls"]),...(0,p.getBlockSupport)(t,[bp,"__experimentalDefaultControls"])};
2return(0,d.jsx)(mp,{as:Sp,panelId:e,settings:o,value:l,onChange:e=>{n(yp(e))},defaultControls:a})}function Cp(e,t="any"){if("web"!==h.Platform.OS)return!1;const n=(0,p.getBlockSupport)(e,fp);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function Bp({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const o=lp(ys(e));return t||n||!e||(t=o?.hasBorderColor||o?.hasBorderStyle||o?.hasBorderWidth||o?.hasBorderRadius,n=o?.hasShadow),t&&n?(0,T.__)("Border & Shadow"):n?(0,T.__)("Shadow"):(0,T.__)("Border")}function Ip(e,t,n){if(!Cp(t,"color")||bs(t,fp,"color"))return e;const o=jp(n),r=gs(e.className,o);return e.className=r||void 0,e}function jp(e){const{borderColor:t,style:n}=e,o=Id("border-color",t);return gs({"has-border-color":t||n?.border?.color,[o]:!!o})}var Ep={useBlockProps:function({name:e,borderColor:t,style:n}){const{colors:o}=jd();if(!Cp(e,"color")||bs(e,fp,"color"))return{};const{color:r}=vp({colors:o,namedColor:t}),{color:i}=vp({colors:o,namedColor:_p(n?.border?.top?.color)}),{color:s}=vp({colors:o,namedColor:_p(n?.border?.right?.color)}),{color:l}=vp({colors:o,namedColor:_p(n?.border?.bottom?.color)}),{color:a}=vp({colors:o,namedColor:_p(n?.border?.left?.color)});return Ip({style:ms({borderTopColor:i||r,borderRightColor:s||r,borderBottomColor:l||r,borderLeftColor:a||r})||{}},e,{borderColor:t,style:n})},addSaveProps:Ip,attributeKeys:["borderColor","style"],hasSupport:e=>Cp(e,"color")};function Tp(e){if(e)return`has-${e}-gradient-background`}function Mp(e,t){const n=e?.find(e=>e.slug===t);return n&&n.gradient}function Pp(e,t){const n=e?.find(e=>e.gradient===t);return n}function Rp(e,t){const n=Pp(e,t);return n&&n.slug}function Ap({gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}={}){const{clientId:n}=C(),[o,r,i]=Ei("color.gradients.custom","color.gradients.theme","color.gradients.default"),s=(0,h.useMemo)(()=>[...o||[],...r||[],...i||[]],[o,r,i]),{gradient:l,customGradient:a}=(0,g.useSelect)(o=>{const{getBlockAttributes:r}=o(Ii),i=r(n)||{};return{customGradient:i[t],gradient:i[e]}},[n,e,t]),{updateBlockAttributes:c}=(0,g.useDispatch)(Ii),u=(0,h.useCallback)(o=>{const r=Rp(s,o);c(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})},[s,n,c]),d=Tp(l);let p;return p=l?Mp(s,l):a,{gradientClass:d,gradientValue:p,setGradient:u}}(0,f.addFilter)("blocks.registerBlockType","core/border/addAttributes",function(e){return Cp(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e});const{Tabs:Np}=U(Ss.privateApis),Lp=["colors","disableCustomColors","gradients","disableCustomGradients"],Dp="color",Op="gradient";function zp({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,className:i,label:s,onColorChange:l,onGradientChange:a,colorValue:c,gradientValue:u,clearable:p,showTitle:h=!0,enableAlpha:g,headingLevel:m}){const f=l&&(e&&e.length>0||!n),b=a&&(t&&t.length>0||!o);if(!f&&!b)return null;const k={[Dp]:(0,d.jsx)(Ss.ColorPalette,{value:c,onChange:b?e=>{l(e),a()}:l,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:r,clearable:p,enableAlpha:g,headingLevel:m}),[Op]:(0,d.jsx)(Ss.GradientPicker,{value:u,onChange:f?e=>{a(e),l()}:a,gradients:t,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,clearable:p,headingLevel:m})},v=e=>(0,d.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:k[e]});return(0,d.jsx)(Ss.BaseControl,{__nextHasNoMarginBottom:!0,className:gs("block-editor-color-gradient-control",i),children:(0,d.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,d.jsxs)(Ss.__experimentalVStack,{spacing:1,children:[h&&(0,d.jsx)("legend",{children:(0,d.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,d.jsx)(Ss.BaseControl.VisualLabel,{children:s})})}),f&&b&&(0,d.jsx)("div",{children:(0,d.jsxs)(Np,{defaultTabId:u?Op:!!f&&Dp,children:[(0,d.jsxs)(Np.TabList,{children:[(0,d.jsx)(Np.Tab,{tabId:Dp,children:(0,T.__)("Color")}),(0,d.jsx)(Np.Tab,{tabId:Op,children:(0,T.__)("Gradient")})]}),(0,d.jsx)(Np.TabPanel,{tabId:Dp,className:"block-editor-color-gradient-control__panel",focusable:!1,children:k.color}),(0,d.jsx)(Np.TabPanel,{tabId:Op,className:"block-editor-color-gradient-control__panel",focusable:!1,children:k.gradient})]})}),!b&&v(Dp),!f&&v(Op)]})})})}function Vp(e){const[t,n,o,r]=Ei("color.palette","color.gradients","color.custom","color.customGradient");return(0,d.jsx)(zp,{colors:t,gradients:n,disableCustomColors:!o,disableCustomGradients:!r,...e})}var Fp=function(e){return Lp.every(t=>e.hasOwnProperty(t))?(0,d.jsx)(zp,{...e}):(0,d.jsx)(Vp,{...e})};function Hp(e){const t=Up(e),n=Zp(e),o=Gp(e),r=Wp(e),i=Kp(e),s=$p(e);return t||n||o||r||i||s}function Up(e){const t=ds(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function Gp(e){const t=ds(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function $p(e){const t=ds(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function Wp(e){const t=ds(e),n=ps(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function Kp(e){const t=ds(e),n=ps(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function Zp(e){const t=ds(e),n=ps(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function qp({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const i=Qi();return(0,d.jsx)(Ss.__experimentalToolsPanel,{label:(0,T.__)("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,d.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:r})})}const Yp={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0}
2,Xp={placement:"left-start",offset:36,shift:!0},{Tabs:Qp}=U(Ss.privateApis),Jp=({indicators:e,label:t})=>(0,d.jsxs)(Ss.__experimentalHStack,{justify:"flex-start",children:[(0,d.jsx)(Ss.__experimentalZStack,{isLayered:!1,offset:-8,children:e.map((e,t)=>(0,d.jsx)(Ss.Flex,{expanded:!1,children:(0,d.jsx)(Ss.ColorIndicator,{colorValue:e})},t))}),(0,d.jsx)(Ss.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",children:t})]});function eh({isGradient:e,inheritedValue:t,userValue:n,setValue:o,colorGradientControlSettings:r}){return(0,d.jsx)(Fp,{...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 th({label:e,hasValue:t,resetValue:n,isShownByDefault:o,indicators:r,tabs:i,colorGradientControlSettings:s,panelId:l}){const a=i.find(e=>void 0!==e.userValue),{key:c,...u}=i[0]??{},p=(0,h.useRef)(void 0);return(0,d.jsx)(Ss.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:o,panelId:l,children:(0,d.jsx)(Ss.Dropdown,{popoverProps:Xp,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:o,isOpen:i})=>{const s={onClick:o,className:gs("block-editor-panel-color-gradient-settings__dropdown",{"is-open":i}),"aria-expanded":i,ref:p};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.Button,{...s,__next40pxDefaultSize:!0,children:(0,d.jsx)(Jp,{indicators:r,label:e})}),t()&&(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,label:(0,T.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:za,onClick:()=>{n(),i&&o(),p.current?.focus()}})]})},renderContent:()=>(0,d.jsx)(Ss.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,d.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[1===i.length&&(0,d.jsx)(eh,{...u,colorGradientControlSettings:s},c),i.length>1&&(0,d.jsxs)(Qp,{defaultTabId:a?.key,children:[(0,d.jsx)(Qp.TabList,{children:i.map(e=>(0,d.jsx)(Qp.Tab,{tabId:e.key,children:e.label},e.key))}),i.map(e=>{const{key:t,...n}=e;return(0,d.jsx)(Qp.TabPanel,{tabId:t,focusable:!1,children:(0,d.jsx)(eh,{...n,colorGradientControlSettings:s},t)},t)})]})]})})})})}function nh({as:e=qp,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:s=Yp,children:l}){const a=ds(r),c=ps(r),u=r?.color?.custom,p=r?.color?.customGradient,g=a.length>0||u,m=c.length>0||p,f=e=>es({settings:r},"",e),b=e=>{const t=a.flatMap(({colors:e})=>e).find(({color:t})=>t===e);return t?"var:preset|color|"+t.slug:e},k=e=>{const t=c.flatMap(({gradients:e})=>e).find(({gradient:t})=>t===e);return t?"var:preset|gradient|"+t.slug:e},v=Zp(r),_=f(o?.color?.background),y=f(t?.color?.background),x=f(o?.color?.gradient),S=f(t?.color?.gradient),w=Gp(r),C=f(o?.elements?.link?.color?.text),B=f(t?.elements?.link?.color?.text),I=f(o?.elements?.link?.[":hover"]?.color?.text),j=f(t?.elements?.link?.[":hover"]?.color?.text),E=Up(r),M=f(o?.color?.text),P=f(t?.color?.text),R=e=>{let o=ge(t,["color","text"],b(e));M===C&&(o=ge(o,["elements","link","color","text"],b(e))),n(o)},A=[{name:"caption",label:(0,T.__)("Captions"),showPanel:$p(r)},{name:"button",label:(0,T.__)("Button"),showPanel:Kp(r)},{name:"heading",label:(0,T.__)("Heading"),showPanel:Wp(r)},{name:"h1",label:(0,T.__)("H1"),showPanel:Wp(r)},{name:"h2",label:(0,T.__)("H2"),showPanel:Wp(r)},{name:"h3",label:(0,T.__)("H3"),showPanel:Wp(r)},{name:"h4",label:(0,T.__)("H4"),showPanel:Wp(r)},{name:"h5",label:(0,T.__)("H5"),showPanel:Wp(r)},{name:"h6",label:(0,T.__)("H6"),showPanel:Wp(r)}],N=(0,h.useCallback)(e=>({...e,color:void 0,elements:{...e?.elements,link:{...e?.elements?.link,color:void 0,":hover":{color:void 0}},...A.reduce((t,n)=>({...t,[n.name]:{...e?.elements?.[n.name],color:void 0}}),{})}}),[]),L=[E&&{key:"text",label:(0,T.__)("Text"),hasValue:()=>!!P,resetValue:()=>R(void 0),isShownByDefault:s.text,indicators:[M],tabs:[{key:"text",label:(0,T.__)("Text"),inheritedValue:M,setValue:R,userValue:P}]}
2,v&&{key:"background",label:(0,T.__)("Background"),hasValue:()=>!!y||!!S,resetValue:()=>{const e=ge(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:s.background,indicators:[x??_],tabs:[g&&{key:"background",label:(0,T.__)("Color"),inheritedValue:_,setValue:e=>{const o=ge(t,["color","background"],b(e));o.color.gradient=void 0,n(o)},userValue:y},m&&{key:"gradient",label:(0,T.__)("Gradient"),inheritedValue:x,setValue:e=>{const o=ge(t,["color","gradient"],k(e));o.color.background=void 0,n(o)},userValue:S,isGradient:!0}].filter(Boolean)},w&&{key:"link",label:(0,T.__)("Link"),hasValue:()=>!!B||!!j,resetValue:()=>{let e=ge(t,["elements","link",":hover","color","text"],void 0);e=ge(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:s.link,indicators:[C,I],tabs:[{key:"link",label:(0,T.__)("Default"),inheritedValue:C,setValue:e=>{n(ge(t,["elements","link","color","text"],b(e)))},userValue:B},{key:"hover",label:(0,T.__)("Hover"),inheritedValue:I,setValue:e=>{n(ge(t,["elements","link",":hover","color","text"],b(e)))},userValue:j}]}].filter(Boolean);return A.forEach(({name:e,label:r,showPanel:i})=>{if(!i)return;const l=f(o?.elements?.[e]?.color?.background),a=f(o?.elements?.[e]?.color?.gradient),c=f(o?.elements?.[e]?.color?.text),u=f(t?.elements?.[e]?.color?.background),d=f(t?.elements?.[e]?.color?.gradient),p=f(t?.elements?.[e]?.color?.text),h="caption"!==e;L.push({key:e,label:r,hasValue:()=>!!(p||u||d),resetValue:()=>{const o=ge(t,["elements",e,"color","background"],void 0);o.elements[e].color.gradient=void 0,o.elements[e].color.text=void 0,n(o)},isShownByDefault:s[e],indicators:h?[c,a??l]:[c],tabs:[g&&{key:"text",label:(0,T.__)("Text"),inheritedValue:c,setValue:o=>{n(ge(t,["elements",e,"color","text"],b(o)))},userValue:p}
2,g&&h&&{key:"background",label:(0,T.__)("Background"),inheritedValue:l,setValue:o=>{const r=ge(t,["elements",e,"color","background"],b(o));r.elements[e].color.gradient=void 0,n(r)},userValue:u},m&&h&&{key:"gradient",label:(0,T.__)("Gradient"),inheritedValue:a,setValue:o=>{const r=ge(t,["elements",e,"color","gradient"],k(o));r.elements[e].color.background=void 0,n(r)},userValue:d,isGradient:!0}].filter(Boolean)})}),(0,d.jsxs)(e,{resetAllFilter:N,value:t,onChange:n,panelId:i,children:[L.map(e=>{const{key:t,...n}=e;return(0,d.jsx)(th,{...n,colorGradientControlSettings:{colors:a,disableCustomColors:!u,gradients:c,disableCustomGradients:!p},panelId:i},t)}),l]})}vd([_d,Sd]);var oh=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,p=l||o;if(!u&&!p)return null;const h=[{color:u,description:(0,T.__)("text color")},{color:p,description:(0,T.__)("link color")}],g=bd(c),m=g.alpha()<1,f=g.brightness(),b={level:"AA",size:i||!1!==i&&r>=24?"large":"small"};let k="",v="";for(const e of h){if(!e.color)continue;const t=bd(e.color),n=t.isReadable(g,b),o=t.alpha()<1;if(!n){if(m||o)continue;k=f<t.brightness()?(0,T.sprintf)((0,T.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,T.sprintf)((0,T.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),v=(0,T.__)("This color combination may be hard for people to read.");break}o&&a&&(k=(0,T.__)("Transparent text may be hard for people to read."),v=(0,T.__)("Transparent text may be hard for people to read."))}return k?((0,Ho.speak)(v),(0,d.jsx)("div",{className:"block-editor-contrast-checker",children:(0,d.jsx)(Ss.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:k})})):null};const rh=(0,h.createContext)({refsMap:(0,m.observableMap)()});function ih({children:e}){const t=(0,h.useMemo)(()=>({refsMap:(0,m.observableMap)()}),[]);return(0,d.jsx)(rh.Provider,{value:t,children:e})}function sh(e){const{refsMap:t}=(0,h.useContext)(rh);return(0,m.useRefEffect)(n=>(t.set(e,n),()=>t.delete(e)),[e])}function lh(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function ah(e,t){const{refsMap:n}=(0,h.useContext)(rh);(0,h.useLayoutEffect)(()=>{lh(t,n.get(e));const o=n.subscribe(e,()=>lh(t,n.get(e)));return()=>{o(),lh(t,null)}},[n,e,t])}function ch(e){const[t,n]=(0,h.useState)(null);return ah(e,n),t}function uh(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function dh(e,t){return Object.keys(t).some(n=>e[n]!==t[n])?t:e}function ph({clientId:e}){const t=ch(e),[n,o]=(0,h.useReducer)(dh,{});return(0,h.useLayoutEffect)(()=>{function e(){o(function(e){if(!e)return{};const t=e.querySelector("a"),n=t?.innerText?uh(t,"color"):void 0,o=uh(e,"color");let r=e,i=uh(r,"background-color");for(;"rgba(0, 0, 0, 0)"===i&&r.parentNode&&r.parentNode.nodeType===r.parentNode.ELEMENT_NODE;)r=r.parentNode,i=uh(r,"background-color");return{textColor:o,backgroundColor:i,linkColor:n}}(t))}t&&window.requestAnimationFrame(()=>window.requestAnimationFrame(e))}),(0,d.jsx)(oh,{backgroundColor:n.backgroundColor,textColor:n.textColor,linkColor:n.linkColor,enableAlphaChecker:!0})}rh.displayName="BlockRefsContext";const hh="color",gh=e=>{const t=(0,p.getBlockSupport)(e,hh);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},mh=e=>{if("web"!==h.Platform.OS)return!1;const t=(0,p.getBlockSupport)(e,hh);return null!==t&&"object"==typeof t&&!!t.link},fh=e=>{const t=(0,p.getBlockSupport)(e,hh);return null!==t&&"object"==typeof t&&!!t.gradients},bh=e=>{const t=(0,p.getBlockSupport)(e,hh);return t&&!1!==t.background},kh=e=>{const t=(0,p.getBlockSupport)(e,hh);return t&&!1!==t.text};function vh(e,t,n){if(!gh(t)||bs(t,hh))return e;const o=fh(t),{backgroundColor:r,textColor:i,gradient:s,style:l}=n,a=e=>!bs(t,hh,e),c=a("text")?Id("color",i):void 0,u=a("gradients")?Tp(s):void 0,d=a("background")?Id("background-color",r):void 0,p=a("background")||a("gradients"),h=r||l?.color?.background||o&&(s||l?.color?.gradient),g=gs(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 _h(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:ms(l),textColor:n,backgroundColor:r,gradient:s}}function yh(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 xh({children:e,resetAllFilter:t}){const n=(0,h.useCallback)(e=>{const n=yh(e),o=t(n);return{...e,..._h(o)}},[t]);return(0,d.jsx)(Oa,{group:"color",resetAllFilter:n,children:e})}function Sh({clientId:e,name:t,setAttributes:n,settings:o}){const r=Hp(o),{style:i,textColor:s,backgroundColor:l,gradient:a}=(0,g.useSelect)(function(t){const{style:n,textColor:o,backgroundColor:r,gradient:i}=t(Ii).getBlockAttributes(e)||{};return{style:n,textColor:o,backgroundColor:r,gradient:i}},[e]),c=(0,h.useMemo)(()=>yh({style:i,textColor:s,backgroundColor:l,gradient:a}),[i,s,l,a]);if(!r)return null;const u=(0,p.getBlockSupport)(t,[hh,"__experimentalDefaultControls"]),m="web"===h.Platform.OS&&!c?.color?.gradient&&(o?.color?.text||o?.color?.link)&&!1!==(0,p.getBlockSupport)(t,[hh,"enableContrastChecker"]);return(0,d.jsx)(nh,{as:xh,panelId:e,settings:o,value:c,onChange:e=>{n(_h(e))},defaultControls:u,enableContrastChecker:!1!==(0,p.getBlockSupport)(t,[hh,"enableContrastChecker"]),children:m&&(0,d.jsx)(ph,{clientId:e})})}var wh={useBlockProps:function({name:e,backgroundColor:t,textColor:n,gradient:o,style:r}){const[i,s,l]=Ei("color.palette.custom","color.palette.theme","color.palette.default"),a=(0,h.useMemo)(()=>[...i||[],...s||[],...l||[]],[i,s,l]);if(!gh(e)||bs(e,hh))return{};const c={};n&&!bs(e,hh,"text")&&(c.color=Cd(a,n)?.color),t&&!bs(e,hh,"background")&&(c.backgroundColor=Cd(a,t)?.color);const u=vh({style:c},e,{textColor:n,backgroundColor:t,gradient:o,style:r}),d=t||r?.color?.background||o||r?.color?.gradient;return{...u,className:gs(u.className,!d&&Eu(r))}},addSaveProps:vh,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:gh};const Ch={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function Bh({__next40pxDefaultSize:e=!1,__nextHasNoMarginBottom:t=!1,value:n="",onCh
2ange:o,fontFamilies:r,className:i,...s}){const[l]=Ei("typography.fontFamilies");if(r||(r=l),!r||0===r.length)return null;const a=[{key:"",name:(0,T.__)("Default")},...r.map(({fontFamily:e,name:t})=>({key:e,name:t||e,style:{fontFamily:e}}))];t||I()("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"}),e||void 0!==s.size&&"default"!==s.size||I()("36px default size for wp.blockEditor.__experimentalFontFamilyControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."});const c=a.find(e=>e.key===n)??"";return(0,d.jsx)(Ss.CustomSelectControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,T.__)("Font"),value:c,onChange:({selectedItem:e})=>o(e.key),options:a,className:gs("block-editor-font-family-control",i,{"is-next-has-no-margin-bottom":t}),...s})}(0,f.addFilter)("blocks.registerBlockType","core/color/addAttribute",function(e){return gh(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),fh(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e}),(0,f.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",function(e,t,n,o){const r=e.name;return fs({linkColor:mh(r),textColor:kh(r),backgroundColor:bh(r),gradient:fh(r)},Ch,e,t,n,o)});const Ih=(e,t)=>e?t?(0,T.__)("Appearance"):(0,T.__)("Font style"):(0,T.__)("Font weight");function jh(e){const{__next40pxDefaultSize:t=!1,onChange:n,hasFontStyles:o=!0,hasFontWeights:r=!0,fontFamilyFaces:i,value:{fontStyle:s,fontWeight:l},...a}=e,c=o||r,u=Ih(o,r),p={key:"default",name:(0,T.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:g,fontWeights:m,combinedStyleAndWeightOptions:f}=Gi(i),b=(0,h.useMemo)(()=>o&&r?(()=>{const e=[p];return f&&e.push(...f),e})():o?(()=>{const e=[p];return g.forEach(({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})}),e})():(()=>{const e=[p];return m.forEach(({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})}),e})(),[e.options,g,m,f]),k=b.find(e=>e.style.fontStyle===s&&e.style.fontWeight===l)||b[0];return t||void 0!==a.size&&"default"!==a.size||I()("36px default size for wp.blockEditor.__experimentalFontAppearanceControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),c&&(0,d.jsx)(Ss.CustomSelectControl,{...a,className:"components-font-appearance-control",__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,label:u,describedBy:k?o?r?(0,T.sprintf)((0,T.__)("Currently selected font appearance: %s"),k.name):(0,T.sprintf)((0,T.__)("Currently selected font style: %s"),k.name):(0,T.sprintf)((0,T.__)("Currently selected font weight: %s"),k.name):(0,T.__)("No selected font appearance"),options:b,value:k,onChange:({selectedItem:e})=>n(e.style)})}var Eh=({__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 1.5;default:return e}},l=i?t:"";return e||void 0!==r.size&&"default"!==r.size||I()("36px default size for wp.blockEditor.LineHeightControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,d.jsx)("div",{className:"block-editor-line-height-control",children:(0,d.jsx)(Ss.__experimentalNumberControl,{...r,__shouldNotWarnDeprecated36pxSize:!0,__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()}
2,label:(0,T.__)("Line height"),placeholder:1.5,step:.01,spinFactor:10,value:l,min:0,spinControls:"custom"})})};function Th({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",...r}){const[i]=Ei("spacing.units"),s=(0,Ss.__experimentalUseCustomUnits)({availableUnits:i||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return e||void 0!==r.size&&"default"!==r.size||I()("36px default size for wp.blockEditor.__experimentalLetterSpacingControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,d.jsx)(Ss.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...r,label:(0,T.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:s,onChange:n})}var Mh=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})}),Ph=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})}),Rh=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})}),Ah=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z"})});const Nh=[{label:(0,T.__)("Align text left"),value:"left",icon:Mh},{label:(0,T.__)("Align text center"),value:"center",icon:Ph},{label:(0,T.__)("Align text right"),value:"right",icon:Rh},{label:(0,T.__)("Justify text"),value:"justify",icon:Ah}],Lh=["left","center","right"];function Dh({className:e,value:t,onChange:n,options:o=Lh}){const r=(0,h.useMemo)(()=>Nh.filter(e=>o.includes(e.value)),[o]);return r.length?(0,d.jsx)(Ss.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,T.__)("Text alignment"),className:gs("block-editor-text-alignment-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:r.map(e=>(0,d.jsx)(Ss.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value))}):null}var Oh=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}),zh=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}),Vh=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"})});const Fh=[{label:(0,T.__)("None"),value:"none",icon:za},{label:(0,T.__)("Uppercase"),value:"uppercase",icon:Oh},{label:(0,T.__)("Lowercase"),value:"lowercase",icon:zh},{label:(0,T.__)("Capitalize"),value:"capitalize",icon:Vh}];function Hh({className:e,value:t,onChange:n}){return(0,d.jsx)(Ss.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,T.__)("Letter case"),className:gs("block-editor-text-transform-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:Fh.map(e=>(0,d.jsx)(Ss.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value))})}var Uh=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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-.
26-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})}),Gh=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})});const $h=[{label:(0,T.__)("None"),value:"none",icon:za},{label:(0,T.__)("Underline"),value:"underline",icon:Uh},{label:(0,T.__)("Strikethrough"),value:"line-through",icon:Gh}];function Wh({value:e,onChange:t,className:n}){return(0,d.jsx)(Ss.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,T.__)("Decoration"),className:gs("block-editor-text-decoration-control",n),value:e,onChange:n=>{t(n===e?void 0:n)},children:$h.map(e=>(0,d.jsx)(Ss.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value))})}var Kh=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}),Zh=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})});const qh=[{label:(0,T.__)("Horizontal"),value:"horizontal-tb",icon:Kh},{label:(0,T.__)("Vertical"),value:(0,T.isRTL)()?"vertical-lr":"vertical-rl",icon:Zh}];function Yh({className:e,value:t,onChange:n}){return(0,d.jsx)(Ss.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,T.__)("Orientation"),className:gs("block-editor-writing-mode-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:qh.map(e=>(0,d.jsx)(Ss.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value))})}const Xh=1,Qh=6;function Jh(e){const t=tg(e),n=ng(e),o=og(e),r=rg(e),i=sg(e),s=ig(e),l=lg(e),a=ag(e),c=cg(e),u=eg(e);return t||n||o||r||i||s||u||l||a||c}function eg(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 tg(e){return["default","theme","custom"].some(t=>e?.typography?.fontFamilies?.[t]?.length)}function ng(e){return e?.typography?.lineHeight}function og(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function rg(e){return e?.typography?.letterSpacing}function ig(e){return e?.typography?.textTransform}function sg(e){return e?.typography?.textAlign}function lg(e){return e?.typography?.textDecoration}function ag(e){return e?.typography?.writingMode}function cg(e){return e?.typography?.textColumns}function ug({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const i=Qi();return(0,d.jsx)(Ss.__experimentalToolsPanel,{label:(0,T.__)("Typography"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:i,children:r})}const dg={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function pg({as:e=ug,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:s=dg,fitText:l=!1}){const a=e=>es({settings:r},"",e),c=tg(r),u=a(o?.typography?.fontFamily),{fontFamilies:p,fontFamilyFaces:g}=(0,h.useMemo)(()=>function(e,t){const n=e?.typography?.fontFamilies,o=["default","theme","custom"].flatMap(e=>n?.[e]??[]),r=o.find(e=>e.fontFamily===t)?.fontFace??[];return{fontFamilies:o,fontFamilyFaces:r}}(r,u),[r,u]),m=e=>{const o=p?.find(({fontFamily:t})=>t===e)?.slug;let r=ge(t,["typography","fontFamily"],o?`var:preset|font-family|${o}`:e||void 0);const i=p?.find(({fontFamily:t})=>t===e)?.fontFace??[],{fontStyles:s,fontWeights:l}=Gi(i),a=s?.some(({value:e})=>e===B),c=l?.some(({value:e})=>e?.toString()===I?.toString());if(!a||!c){const{nearestFontStyle:e,nearestFontWeight:t}=function(e,t,n){let o=t,r=n;const{fontStyles:i,fontWeights:s,combinedStyleAndWeightOptions:l}
2=Gi(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===Ki(s,n))?.style?.fontStyle),c||(r=n?Ki(s,n):l?.find(e=>e.style.fontStyle===(o||t))?.style?.fontWeight),{nearestFontStyle:o,nearestFontWeight:r}}(i,B,I);e||t?r={...r,typography:{...r?.typography,fontStyle:e||void 0,fontWeight:t||void 0}}:(B||I)&&(r={...r,typography:{...r?.typography,fontStyle:void 0,fontWeight:void 0}})}n(r)},f=eg(r),b=!r?.typography?.customFontSize,k=function(e){const t=e?.typography?.fontSizes,n=!!e?.typography?.defaultFontSizes;return[...t?.custom??[],...t?.theme??[],...n?t?.default??[]:[]]}(r),v=a(o?.typography?.fontSize),_=(()=>{const e=o?.typography?.fontSize;if(!e||"string"!=typeof e)return;if(e.startsWith("var:preset|font-size|"))return e.replace("var:preset|font-size|","");const t=e.match(/^var\(--wp--preset--font-size--([^)]+)\)$/);return t?t[1]:void 0})(),y=(e,o)=>{n(ge(t,["typography","fontSize"],(o?.slug?`var:preset|font-size|${o?.slug}`:e)||void 0))},x=og(r),S=function(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,T.__)("Appearance"):(0,T.__)("Font style"):(0,T.__)("Font weight")}(r),w=r?.typography?.fontStyle,C=r?.typography?.fontWeight,B=a(o?.typography?.fontStyle),I=a(o?.typography?.fontWeight),j=(0,h.useCallback)(({fontStyle:e,fontWeight:o})=>{e===B&&o===I||n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:o||void 0}})},[B,I,n,t]),E=(0,h.useCallback)(()=>{j({})},[j]),M=ng(r),P=a(o?.typography?.lineHeight),R=e=>{n(ge(t,["typography","lineHeight"],e||void 0))},A=rg(r),N=a(o?.typography?.letterSpacing),L=e=>{n(ge(t,["typography","letterSpacing"],e||void 0))},D=cg(r),O=a(o?.typography?.textColumns),z=e=>{n(ge(t,["typography","textColumns"],e||void 0))},V=ig(r),F=a(o?.typography?.textTransform),H=e=>{n(ge(t,["typography","textTransform"],e||void 0))},U=lg(r),G=a(o?.typography?.textDecoration),$=e=>{n(ge(t,["typography","textDecoration"],e||void 0))},W=ag(r),K=a(o?.typography?.writingMode),Z=e=>{n(ge(t,["typography","writingMode"],e||void 0))},q=sg(r),Y=a(o?.typography?.textAlign),X=e=>{n(ge(t,["typography","textAlign"],e||void 0))},Q=(0,h.useCallback)(e=>({...e,typography:{}}),[]);return(0,d.jsxs)(e,{resetAllFilter:Q,value:t,onChange:n,panelId:i,children:[c&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{label:(0,T.__)("Font"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>m(void 0),isShownByDefault:s.fontFamily,panelId:i,children:(0,d.jsx)(Bh,{fontFamilies:p,value:u,onChange:m,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),f&&!l&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{label:(0,T.__)("Size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>y(void 0),isShownByDefault:s.fontSize,panelId:i,children:(0,d.jsx)(Ss.FontSizePicker,{value:_||v,valueMode:_?"slug":"literal",onChange:y,fontSizes:k,disableCustomFontSizes:b,withReset:!1,withSlider:!0,size:"__unstable-large"})}),x&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{className:"single-column",label:S,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:E,isShownByDefault:s.fontAppearance,panelId:i,children:(0,d.jsx)(jh,{value:{fontStyle:B,fontWeight:I},onChange:j,hasFontStyles:w,hasFontWeights:C,fontFamilyFaces:g,size:"__unstable-large"})}),M&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{className:"single-column",label:(0,T.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>R(void 0),isShownByDefault:s.lineHeight,panelId:i,children:(0,d.jsx)(Eh,{__unstableInputWidth:"auto",value:P,onChange:R,size:"__unstable-large"})}),A&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{className:"single-column",label:(0,T.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>L(void 0),isShownByDefault:s.letterSpacing,panelId:i,children:(0,d.jsx)(Th,{value:N,onChange:L,size:"__unstable-large",__unstableInputWidth:"auto"})}),D&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{className:"single-column",label:(0,T.__)("Columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>z(void 0),isShownByDefault:s.textColumns,panelId:i,children:(0,d.jsx)(Ss.__experimentalNumberControl,{label:(0,T.__)("Columns"),max:Qh,min:Xh,onChange:z,size:"__unstable-large",spinControls:"custom",value:O,initialPosition:1})}),U&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{className:"single-column",label:(0,T.__)("Decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>$(void 0),isShownByDefault:s.textDecoration,panelId:i,children:(0,d.jsx)(Wh,{value:G,onChange:$,size:"__unstable-large",__unstableInputWidth:"auto"})}),W&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{className:"single-column",label:(0,T.__)("Orientation"),hasValue:()=>!!t?.typography?.writingMode,onDeselect:()=>Z(void 0),isShownByDefault:s.writingMode,panelId:i,children:(0,d.jsx)(Yh,{value:K,onChange:Z,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),V&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{label:(0,T.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>H(void 0),isShownByDefault:s.textTransform,panelId:i,children:(0,d.jsx)(Hh,{value:F,onChange:H,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),q&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{label:(0,T.__)("Text alignment"),hasValue:()=>!!t?.typography?.textAlign,onDeselect:()=>X(void 0),isShownByDefault:s.textAlign,panelId:i,children:(0,d.jsx)(Dh,{value:Y,onChange:X,size:"__unstable-large",__nextHasNoMarginBottom:!0})})]})}const hg=window.wp.tokenList;var gg=n.n(hg);const mg="typography.__experimentalFontFamily",{kebabCase:fg}=U(Ss.privateApis);function bg(e,t,n){if(!(0,p.hasBlockSupport)(t,mg))return e;if(bs(t,Hg,"fontFamily"))return e;if(!n?.fontFamily)return e;const o=new(gg())(e.className);o.add(`has-${fg(n?.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}var kg={useBlockProps:function({name:e,fontFamily:t}){return bg({},e,{fontFamily:t})},addSaveProps:bg,attributeKeys:["fontFamily"],hasSupport:e=>(0,p.hasBlockSupport)(e,mg)};(0,f.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",function(e){return(0,p.hasBlockSupport)(e,mg)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e});const{kebabCase:vg}=U(Ss.privateApis),_g=(e,t,n)=>{if(t){const n=e?.find(({slug:e})=>e===t);if(n)return n}return{size:n}};function yg(e,t){const n=e?.find(({size:e})=>e===t);return n||{size:t}}function xg(e){if(e)return`has-${vg(e)}-font-size`}const Sg="typography.fontSize";function wg(e,t,n){if(!(0,p.hasBlockSupport)(t,Sg))return e;if(bs(t,Hg,"fontSize"))return e;const o=new(gg())(e.className);o.add(xg(n.fontSize));const r=o.value;return e.className=r||void 0,e}var Cg={useBlockProps:function({name:e,fontSize:t,style:n}){const[o,r,i]=Ei("typography.fontSizes","typography.fluid","layout");if(!(0,p.hasBlockSupport)(e,Sg)||bs(e,Hg,"fontSize")||!t&&!n?.typography?.fontSize)return;let s;return n?.typography?.fontSize&&(s={style:{fontSize:$i({size:n.typography.fontSize},{typography:{fluid:r},layout:i})}}),t&&(s={style:{fontSize:_g(o,t,n?.typography?.fontSize).size}}),s?wg(s,e,{fontSize:t}):void 0},addSaveProps:wg,attributeKeys:["fontSize","style","fitText"],hasSupport:e=>(0,p.hasBlockSupport)(e,Sg)};const Bg={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,f.addFilter)("blocks.registerBlockType","core/font/addAttribute",function(e){return(0,p.hasBlockSupport)(e,Sg)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e}),(0,f.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",function(e,t,n,o){const r=e.name;return fs({fontSize:(0,p.hasBlockSupport)(r,Sg)},Bg,e,t,n,o)});const Ig=[{icon:Mh,title:(0,T.__)("Align text left"),align:"left"},{icon:Ph,title:(0,T.__)("Align text center"),align:"center"},{icon:Rh,title:(0,T.__)("Align text right"),align:"right"}],jg={placement:"bottom-start"};
2var Eg=function({value:e,onChange:t,alignmentControls:n=Ig,label:o=(0,T.__)("Align text"),description:r=(0,T.__)("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?Ss.ToolbarGroup:Ss.ToolbarDropdownMenu,u=s?{isCollapsed:i}:{toggleProps:{description:r},popoverProps:jg};return(0,d.jsx)(c,{icon:a?a.icon:(0,T.isRTL)()?Rh:Mh,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})};const Tg=e=>(0,d.jsx)(Eg,{...e,isToolbar:!1}),Mg=e=>(0,d.jsx)(Eg,{...e,isToolbar:!0}),Pg="typography.textAlign",Rg=[{icon:Mh,title:(0,T.__)("Align text left"),align:"left"},{icon:Ph,title:(0,T.__)("Align text center"),align:"center"},{icon:Rh,title:(0,T.__)("Align text right"),align:"right"}],Ag=["left","center","right"],Ng=[];function Lg(e){return Array.isArray(e)?Ag.filter(t=>e.includes(t)):!0===e?Ag:Ng}var Dg={edit:function({style:e,name:t,setAttributes:n}){const o=ys(t),r=o?.typography?.textAlign,i=da();if(!r||"default"!==i)return null;const s=Lg((0,p.getBlockSupport)(t,Pg));if(!s.length)return null;const l=Rg.filter(e=>s.includes(e.align));return(0,d.jsx)(Ps,{group:"block",children:(0,d.jsx)(Tg,{value:e?.typography?.textAlign,onChange:t=>{const o={...e,typography:{...e?.typography,textAlign:t}};n({style:ms(o)})},alignmentControls:l})})},useBlockProps:function({name:e,style:t}){if(!t?.typography?.textAlign)return null;if(!Lg((0,p.getBlockSupport)(e,Pg)).length)return null;if(bs(e,Hg,"textAlign"))return null;const n=t.typography.textAlign;return{className:gs({[`has-text-align-${n}`]:n})}},addSaveProps:function(e,t,n){if(!n?.style?.typography?.textAlign)return e;const{textAlign:o}=n.style.typography;return Lg((0,p.getBlockSupport)(t,Pg)).includes(o)&&!bs(t,Hg,"textAlign")&&(e.className=gs(`has-text-align-${o}`,e.className)),e},attributeKeys:["style"],hasSupport:e=>(0,p.hasBlockSupport)(e,Pg,!1)};const Og={},zg="typography.fitText";(0,f.addFilter)("blocks.registerBlockType","core/fit-text/addAttribute",function(e){return(0,p.hasBlockSupport)(e,zg)?e.attributes?.fitText?e:{...e,attributes:{...e.attributes,fitText:{type:"boolean"}}}:e});var Vg={useBlockProps:function({name:e,fitText:t,clientId:n}){return function({fitText:e,name:t,clientId:n}){const o=(0,p.hasBlockSupport)(t,zg),r=ch(n),{blockAttributes:i,parentId:s,blockMode:l}=(0,g.useSelect)(t=>{if(!n||!o||!e)return Og;const r=t(Ii).getBlockMode(n);return"html"===r?{blockMode:r}:{blockAttributes:t(Ii).getBlockAttributes(n),parentId:t(Ii).getBlockRootClientId(n),blockMode:r}},[n,o,e]),a=(0,h.useCallback)(()=>{if(!r||!o||!e)return;const t=`fit-text-${n}`;let i=r.ownerDocument.getElementById(t);i||(i=r.ownerDocument.createElement("style"),i.id=t,r.ownerDocument.head.appendChild(i));const s=`#block-${n}`;!function(e,t){if(!e)return;t(0);const n=function(e,t){const n=e.scrollHeight>e.clientHeight;let o=5,r=2400,i=o;const s=window.getComputedStyle(e);let l=parseFloat(s.paddingLeft)||0,a=parseFloat(s.paddingRight)||0;const c=document.createRange();c.selectNodeContents(e);let u=e;const d=e.parentElement;if(d){const e=window.getComputedStyle(d);"flex"===e?.display&&(u=d,l+=parseFloat(e.paddingLeft)||0,a+=parseFloat(e.paddingRight)||0)}let p=u.clientHeight;for(;o<=r;){const s=Math.floor((o+r)/2);t(s);const d=c.getBoundingClientRect().width,h=e.scrollWidth<=u.clientWidth&&d<=u.clientWidth-l-a,g=n||e.scrollHeight<=u.clientHeight||e.scrollHeight<=p;u.clientHeight>p&&(p=u.clientHeight),h&&g?(i=s,o=s+1):r=s-1}return c.detach(),i}(e,t);t(n)}(r,e=>{i.textContent=0===e?"":`${s} { font-size: ${e}px !important; }`})},[r,n,o,e]);(0,h.useEffect)(()=>{if(!(e&&r&&n&&o&&"html"!==l))return;const t=r,i=t.style.visibility;let s,c=null,u=null,d=null;return c=window.requestAnimationFrame(()=>{t.style.visibility="hidden",u=window.requestAnimationFrame(()=>{a(),d=setTimeout(()=>{t.style.visibility=i},10)})}),window.ResizeObserver&&t.parentElement&&(s=new window.ResizeObserver(a),s.observe(t.parentElement),s.observe(t)),()=>{null!==c&&window.cancelAnimationFrame(c),null!==u&&window.cancelAnimationFrame(u),null!==d&&clearTimeout(d),s&&s.disconnect();const e=`fit-text-${n}`,o=t.ownerDocument.getElementById(e);o&&o.remove()}},[e,n,s,a,r,o,l]),(0,h.useEffect)(()=>
2{if(e&&r&&o&&"html"!==l){const e=window.requestAnimationFrame(()=>{r&&a()});return()=>window.cancelAnimationFrame(e)}},[i,e,a,r,o,l])}({fitText:t,name:e,clientId:n}),t&&(0,p.hasBlockSupport)(e,zg)?{className:"has-fit-text"}:{}},addSaveProps:function(e,t,n){if(!(0,p.hasBlockSupport)(t,zg))return e;const{fitText:o}=n;if(!o)return e;const r=e.className?`${e.className} has-fit-text`:"has-fit-text";return{...e,className:r}},attributeKeys:["fitText"],hasSupport:e=>(0,p.hasBlockSupport)(e,zg),edit:()=>null};function Fg(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>!t.includes(e)))}const Hg="typography",Ug=["typography.lineHeight",Sg,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",mg,Pg,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing",zg];function Gg(e){const t={...Fg(e,["fontFamily"])},n=e?.typography?.fontSize,o=e?.typography?.fontFamily,r="string"==typeof n&&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={...Fg(t.typography,["fontFamily"]),fontSize:r?void 0:n},{style:ms(t),fontFamily:i,fontSize:r}}function $g(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 Wg({children:e,resetAllFilter:t}){const n=(0,h.useCallback)(e=>{const n=$g(e),o=t(n);return{...e,...Gg(o)}},[t]);return(0,d.jsx)(Oa,{group:"typography",resetAllFilter:n,children:e})}function Kg({clientId:e,name:t,setAttributes:n,settings:o}){const{style:r,fontFamily:i,fontSize:s,fitText:l}=(0,g.useSelect)(function(t){const{style:n,fontFamily:o,fontSize:r,fitText:i}=t(Ii).getBlockAttributes(e)||{};return{style:n,fontFamily:o,fontSize:r,fitText:i}},[e]),a=Jh(o),c=(0,h.useMemo)(()=>$g({style:r,fontFamily:i,fontSize:s}),[r,s,i]);if(!a)return null;const u=(0,p.getBlockSupport)(t,[Hg,"__experimentalDefaultControls"]);return(0,d.jsx)(pg,{as:Wg,panelId:e,settings:o,value:c,onChange:e=>{n(Gg(e))},defaultControls:u,fitText:l})}const Zg=[],qg=new Intl.Collator("und",{numeric:!0}).compare;function Yg(){const[e,t,n,o]=Ei("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),r=e??Zg,i=t??Zg,s=n&&!1!==o?n:Zg;return(0,h.useMemo)(()=>{const e=[{name:(0,T.__)("None"),slug:"0",size:0},...r,...i,...s];return e.every(({slug:e})=>/^[0-9]/.test(e))&&e.sort((e,t)=>qg(e.slug,t.slug)),e.length>Xs?[{name:(0,T.__)("Default"),slug:"default",size:void 0},...e]:e},[r,i,s])}const Xg={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 Qg({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:o,onMouseOut:r,onMouseOver:i,showSideInLabel:s=!0,side:l,spacingSizes:a,type:c,value:u}){u=il(u,a);let p=a;const f=a.length<=Xs,b=(0,g.useSelect)(e=>{const t=e(Ii).getSettings();return t?.disableCustomSpacingSizes}),[k,v]=(0,h.useState)(!b&&void 0!==u&&!ol(u)),[_,y]=(0,h.useState)(n),x=(0,m.usePrevious)(u);u&&x!==u&&!ol(u)&&!0!==k&&v(!0);const[S]=Ei("spacing.units"),w=(0,Ss.__experimentalUseCustomUnits)({availableUnits:S||["px","em","rem"]});let C=null;f||k||void 0===u||!(!ol(u)||ol(u)&&t)?t||(C=k?rl(u,a):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":ll(e),o=t.findIndex(e=>String(e.slug)===n);return-1!==o?o:NaN}(u,a)):(p=[...a,{name:t?(0,T.__)("Mixed"):(0,T.sprintf)((0,T.__)("Custom (%s)"),u),slug:"custom",size:u}],C=p.length-1);const B=(0,h.useMemo)(()=>(0,Ss.__experimentalParseQuantityAndUnitFromRawValue)(C),[C])[1]||w[0]?.value,I=parseFloat(C,10),j=(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|${a[e]?.slug}`},E=t?(0,T.__)("Mixed"):null,M=p.map((e,t)=>({key:t,name:e.name})),P=a.slice(1,a.length-1).map((e,t)=>({value:t+1,label:void 0})),R=Qs.includes(l)&&s?tl[l]:"",A=s?c?.toLowerCase():c,N=(0,T.sprintf)((0,T._x)("%1$s %2$s","spacing"),R,A).trim();return(0,d.jsxs)(Ss.__experimentalHStack,{className:"spacing-sizes-control__wrapper",children:[e&&(0,d.jsx)(Ss.Icon,{className:"spacing-sizes-control__icon",icon:e,size:24}),k&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.__experimentalUnitControl,{onMouseOver:i,onMouseOut:r,onFocus:i,onBlur:r,onChange:e=>o((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:C,units:w,min:_,placeholder:E,disableUnits:t,label:N,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large",onDragStart:()=>{"-"===u?.charAt(0)&&y(0)},onDrag:()=>{"-"===u?.charAt(0)&&y(0)},onDragEnd:()=>{y(n)}}),(0,d.jsx)(Ss.RangeControl,{__next40pxDefaultSize:!0,onMouseOver:i,onMouseOut:r,onFocus:i,onBlur:r,value:I,min:0,max:Xg[B]?.max??10,step:Xg[B]?.steps??.1,withInputField:!1,onChange:e=>{o([e,B].join(""))},className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0,label:N,hideLabelFromVision:!0})]}),f&&!k&&(0,d.jsx)(Ss.RangeControl,{__next40pxDefaultSize:!0,onMouseOver:i,onMouseOut:r,className:"spacing-sizes-control__range-control",value:C,onChange:e=>o(j(e)),onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===u&&o("0")},withInputField:!1,"aria-valuenow":C,"aria-valuetext":a[C]?.name,renderTooltipContent:e=>void 0===u?void 0:a[e]?.name,min:0,max:a.length-1,marks:P,label:N,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:i,onBlur:r}),!f&&!k&&(0,d.jsx)(Ss.CustomSelectControl,{className:"spacing-sizes-control__custom-select-control",value:M.find(e=>e.key===C)||"",onChange:e=>{o(j(e.selectedItem.key,"selectList"))},options:M,label:N,hideLabelFromVision:!0,size:"__unstable-large",onMouseOver:i,onMouseOut:r,onFocus:i,onBlur:r}),!b&&(0,d.jsx)(Ss.Button,{label:k?(0,T.__)("Use size preset"):(0,T.__)("Set custom size"),icon:Ld,onClick:()=>{v(!k)},isPressed:k,size:"small",className:"spacing-sizes-control__custom-toggle",iconSize:24})]})}const Jg=["vertical","horizontal"];
2function em({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]=il(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?Jg.filter(e=>al(r,e)):Jg;return(0,d.jsx)(d.Fragment,{children:c.map(t=>{const r="vertical"===t?l.top:l.left;return(0,d.jsx)(Qg,{icon:el[t],label:tl[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 tm({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:i,type:s,values:l}){const a=r?.length?Qs.filter(e=>r.includes(e)):Qs,c=e=>n=>{const o={...Object.keys(l).reduce((e,t)=>(e[t]=il(l[t],i),e),{})};o[e]=n,t(o)};return(0,d.jsx)(d.Fragment,{children:a.map(t=>(0,d.jsx)(Qg,{icon:el[t],label:tl[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 nm({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:i,spacingSizes:s,type:l,values:a}){return(0,d.jsx)(Qg,{label:tl[i],minimumCustomValue:e,onChange:(c=i,e=>{const n={...Object.keys(a).reduce((e,t)=>(e[t]=il(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 om({isLinked:e,...t}){const n=e?(0,T.__)("Unlink sides"):(0,T.__)("Link sides");return(0,d.jsx)(Ss.Button,{...t,size:"small",icon:e?Ed:Xa,iconSize:24,label:n})}function rm({inputProps:e,label:t,minimumCustomValue:n=0,onChange:o,onMouseOut:r,onMouseOver:i,showSideInLabel:s=!0,sides:l=Qs,useSelect:a,values:c}){const u=Yg(),p=c||Js,g=1===l?.length,m=l?.includes("horizontal")&&l?.includes("vertical")&&2===l?.length,[f,b]=(0,h.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(al(t)&&(l||a))return nl.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?nl.custom:t[0]}(p,l)),k={...e,minimumCustomValue:n,onChange:e=>{const t={...c,...e};o(t)},onMouseOut:r,onMouseOver:i,sides:l,spacingSizes:u,type:t,useSelect:a,values:p},v=Qs.includes(f)&&s?tl[f]:"",_=(0,T.sprintf)((0,T._x)("%1$s %2$s","spacing"),t,v).trim();return(0,d.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,d.jsxs)(Ss.__experimentalHStack,{className:"spacing-sizes-control__header",children:[(0,d.jsx)(Ss.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:_}),!g&&!m&&(0,d.jsx)(om,{label:t,onClick:()=>{b(f===nl.axial?nl.custom:nl.axial)},isLinked:f===nl.axial})]}),(0,d.jsx)(Ss.__experimentalVStack,{spacing:.5,children:f===nl.axial?(0,d.jsx)(em,{...k}):f===nl.custom?(0,d.jsx)(tm,{...k}):(0,d.jsx)(nm,{side:f,...k,showSideInLabel:s})})]})}const im={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 sm({label:e=(0,T.__)("Height"),onChange:t,value:n}){const o=parseFloat(n),[r]=Ei("spacing.units"),i=(0,Ss.__experimentalUseCustomUnits)({availableUnits:r||["%","px","em","rem","vh","vw"]}),s=(0,h.useMemo)(()=>(0,Ss.__experimentalParseQuantityAndUnitFromRawValue)(n),[n])[1]||i[0]?.value||"px";return(0,d.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,d.jsx)(Ss.BaseControl.VisualLabel,{as:"legend",children:e}),(0,d.jsxs)(Ss.Flex,{children:[(0,d.jsx)(Ss.FlexItem,{isBlock:!0,children:(0,d.jsx)(Ss.__experimentalUnitControl,{value:n,units:i,onChange:t,onUnitChange:e=>{const[o,r]=(0,Ss.__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,d.jsx)(Ss.FlexItem,{isBlock:!0,children:(0,d.jsx)(Ss.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,d.jsx)(Ss.RangeControl,{__next40pxDefaultSize:!0,value:o,min:0,max:im[s]?.max??100,step:im[s]?.step??.1,withInputField:!1,onChange:e=>{t([e,s].join(""))},__nextHasNoMarginBottom:!0,label:e,hideLabelFromVision:!0})})})]})]})}function lm(e,t){const{getBlockOrder:n,getBlockAttributes:o}=(0,g.useSelect)(Ii);return(r,i)=>{const s=(i-1)*t+r-1;let l=0;for(const r of n(e)){const{columnStart:e,rowStart:n}=o(r).style?.layout??{};(n-1)*t+e-1<s&&l++}return l}}function am(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,T.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,T.__)("Specify a fixed width."):"fixed"===e?(0,T.__)("Specify a fixed height."):(0,T.__)("Fit contents.")}function cm({value:e={},onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}){const{type:i,default:{type:s="default"}={}}=n??{},l=i||s;return"flex"===l?(0,d.jsx)(um,{childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}):"grid"===l?(0,d.jsx)(pm,{childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}):null}function um({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}){const{selfStretch:i,flexSize:s}=e,{orientation:l="horizontal"}=n??{},a="horizontal"===l?(0,T.__)("Width"):(0,T.__)("Height"),[c]=Ei("spacing.units"),u=(0,Ss.__experimentalUseCustomUnits)({availableUnits:c||["%","px","em","rem","vh","vw"]});return(0,h.useEffect)(()=>{"fixed"!==i||s||t({...e,selfStretch:"fit"})},[]),(0,d.jsxs)(Ss.__experimentalVStack,{as:Ss.__experimentalToolsPanelItem,spacing:2,hasValue:()=>!!i,label:a,onDeselect:()=>{t({selfStretch:void 0,flexSize:void 0})},isShownByDefault:o,panelId:r,children:[(0,d.jsxs)(Ss.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:dm(n),value:i||"fit",help:am(i,n),onChange:e=>{t({selfStretch:e,flexSize:"fixed"!==e?null:s})},isBlock:!0,children:[(0,d.jsx)(Ss.__experimentalToggleGroupControlOption,{value:"fit",label:(0,T._x)("Fit","Intrinsic block width in flex layout")},"fit"),(0,d.jsx)(Ss.__experimentalToggleGroupControlOption,{value:"fill",label:(0,T._x)("Grow","Block with expanding width in flex layout")},"fill"),(0,d.jsx)(Ss.__experimentalToggleGroupControlOption,{value:"fixed",label:(0,T._x)("Fixed","Block with fixed width in flex layout")},"fixed")]}),"fixed"===i&&(0,d.jsx)(Ss.__experimentalUnitControl,{size:"__unstable-large",units:u,onChange:e=>{t({selfStretch:i,flexSize:e})},value:s,min:0,label:a,hideLabelFromVision:!0})]})}function dm(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,T.__)("Width"):(0,T.__)("Height")}function pm({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}){const{columnStart:i,rowStart:s,columnSpan:l,rowSpan:a}=e,{columnCount:c,rowCount:u}=n??{},p=(0,g.useSelect)(e=>
2e(Ii).getBlockRootClientId(r)),{moveBlocksToPosition:h,__unstableMarkNextChangeAsNotPersistent:m}=(0,g.useDispatch)(Ii),f=lm(p,c||3),b=c?c-(i??1)+1:void 0,k=window.__experimentalEnableGridInteractivity&&u?u-(s??1)+1:void 0;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(Ss.Flex,{as:Ss.__experimentalToolsPanelItem,hasValue:()=>!!l||!!a,label:(0,T.__)("Grid span"),onDeselect:()=>{t({columnSpan:void 0,rowSpan:void 0})},isShownByDefault:o,panelId:r,children:[(0,d.jsx)(Ss.FlexItem,{style:{width:"50%"},children:(0,d.jsx)(Ss.__experimentalInputControl,{size:"__unstable-large",label:(0,T.__)("Column span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10),o=b?Math.min(n,b):n;t({columnStart:i,rowStart:s,rowSpan:a,columnSpan:o})},value:l??1,min:1,max:b})}),(0,d.jsx)(Ss.FlexItem,{style:{width:"50%"},children:(0,d.jsx)(Ss.__experimentalInputControl,{size:"__unstable-large",label:(0,T.__)("Row span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10),o=k?Math.min(n,k):n;t({columnStart:i,rowStart:s,columnSpan:l,rowSpan:o})},value:a??1,min:1,max:k})})]}),window.__experimentalEnableGridInteractivity&&(0,d.jsxs)(Ss.Flex,{as:Ss.__experimentalToolsPanelItem,hasValue:()=>!!i||!!s,label:(0,T.__)("Grid placement"),onDeselect:()=>{t({columnStart:void 0,rowStart:void 0})},isShownByDefault:!1,panelId:r,children:[(0,d.jsx)(Ss.FlexItem,{style:{width:"50%"},children:(0,d.jsx)(Ss.__experimentalInputControl,{size:"__unstable-large",label:(0,T.__)("Column"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:n,rowStart:s,columnSpan:l,rowSpan:a}),m(),h([r],p,p,f(n,s))},value:i??1,min:1,max:c?c-(l??1)+1:void 0})}),(0,d.jsx)(Ss.FlexItem,{style:{width:"50%"},children:(0,d.jsx)(Ss.__experimentalInputControl,{size:"__unstable-large",label:(0,T.__)("Row"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:i,rowStart:n,columnSpan:l,rowSpan:a}),m(),h([r],p,p,f(i,n))},value:s??1,min:1,max:u?u-(a??1)+1:void 0})})]})]})}function hm({panelId:e,value:t,onChange:n=()=>{},options:o,defaultValue:r="auto",hasValue:i,isShownByDefault:s=!0}){const l=t??"auto",[a,c,u]=Ei("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),p=c?.map(({name:e,ratio:t})=>({label:e,value:t})),h=a?.map(({name:e,ratio:t})=>({label:e,value:t})),g=[{label:(0,T._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...u?h:[],...p||[],{label:(0,T._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,d.jsx)(Ss.__experimentalToolsPanelItem,{hasValue:i||(()=>l!==r),label:(0,T.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:s,panelId:e,children:(0,d.jsx)(Ss.SelectControl,{label:(0,T.__)("Aspect ratio"),value:l,options:o??g,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0})})}const gm=["horizontal","vertical"];function mm(e){const t=fm(e),n=bm(e),o=km(e),r=vm(e),i=_m(e),s=ym(e),l=xm(e),a=Sm(e);return"web"===h.Platform.OS&&(t||n||o||r||i||s||l||a)}function fm(e){return e?.layout?.contentSize}function bm(e){return e?.layout?.wideSize}function km(e){return e?.spacing?.padding}function vm(e){return e?.spacing?.margin}function _m(e){return e?.spacing?.blockGap}function ym(e){return e?.dimensions?.minHeight}function xm(e){return e?.dimensions?.aspectRatio}function Sm(e){const{type:t="default",default:{type:n="default"}={},allowSizingOnChildren:o=!1}=e?.parentLayout??{},r=("flex"===n||"flex"===t||"grid"===n||"grid"===t)&&o;return!!e?.layout&&r}function wm(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 Cm(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function Bm({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const i=Qi();return(0,d.jsx)(Ss.__experimentalToolsPanel,{label:(0,T.__)("Dimensions"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:i,children:r})}const Im={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,aspectRatio:!0,childLayout:!0};
2function jm({as:e=Bm,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:s=Im,onVisualize:l=()=>{},includeLayoutControls:a=!1}){const{dimensions:c,spacing:u}=r,p=e=>e&&"object"==typeof e?Object.keys(e).reduce((t,n)=>(t[n]=es({settings:{dimensions:c,spacing:u}},"",e[n]),t),{}):es({settings:{dimensions:c,spacing:u}},"",e),g=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),m=(0,Ss.__experimentalUseCustomUnits)({availableUnits:r?.spacing?.units||["%","px","em","rem","vw"]}),f=-1/0,[b,k]=(0,h.useState)(f),v=fm(r)&&a,_=p(o?.layout?.contentSize),y=e=>{n(ge(t,["layout","contentSize"],e||void 0))},x=bm(r)&&a,S=p(o?.layout?.wideSize),w=e=>{n(ge(t,["layout","wideSize"],e||void 0))},C=km(r),B=Cm(p(o?.spacing?.padding)),I=Array.isArray(r?.spacing?.padding)?r?.spacing?.padding:r?.spacing?.padding?.sides,j=I&&I.some(e=>gm.includes(e)),E=e=>{const o=wm(e,I);n(ge(t,["spacing","padding"],o))},M=()=>l("padding"),P=vm(r),R=Cm(p(o?.spacing?.margin)),A=Array.isArray(r?.spacing?.margin)?r?.spacing?.margin:r?.spacing?.margin?.sides,N=A&&A.some(e=>gm.includes(e)),L=e=>{const o=wm(e,A);n(ge(t,["spacing","margin"],o))},D=()=>l("margin"),O=_m(r),z=Array.isArray(r?.spacing?.blockGap)?r?.spacing?.blockGap:r?.spacing?.blockGap?.sides,V=z&&z.some(e=>gm.includes(e)),F=p(o?.spacing?.blockGap),H=function(e,t){return e?"string"==typeof e?t?{top:e,right:e,bottom:e,left:e}:{top:e}:{...e,right:e?.left,bottom:e?.top}:e}(F,V),U=e=>{n(ge(t,["spacing","blockGap"],e))},G=e=>{e||U(null),!V&&e?.hasOwnProperty("top")?U(e.top):U({top:e?.top,left:e?.left})},$=ym(r),W=p(o?.dimensions?.minHeight),K=e=>{const o=ge(t,["dimensions","minHeight"],e);n(ge(o,["dimensions","aspectRatio"],void 0))},Z=xm(r),q=p(o?.dimensions?.aspectRatio),Y=Sm(r),X=o?.layout,Q=(0,h.useCallback)(e=>({...e,layout:ms({...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}}),[]),J=()=>l(!1);return(0,d.jsxs)(e,{resetAllFilter:Q,value:t,onChange:n,panelId:i,children:[(v||x)&&(0,d.jsx)("span",{className:"span-columns",children:(0,T.__)("Set the width of the main content area.")}),v&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{label:(0,T.__)("Content width"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>y(void 0),isShownByDefault:s.contentSize??Im.contentSize,panelId:i,children:(0,d.jsx)(Ss.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Content width"),labelPosition:"top",value:_||"",onChange:e=>{y(e)},units:m,prefix:(0,d.jsx)(Ss.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,d.jsx)(Nl,{icon:Ll})})})}),x&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{label:(0,T.__)("Wide width"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>w(void 0),isShownByDefault:s.wideSize??Im.wideSize,panelId:i,children:(0,d.jsx)(Ss.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Wide width"),labelPosition:"top",value:S||"",onChange:e=>{w(e)},units:m,prefix:(0,d.jsx)(Ss.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,d.jsx)(Nl,{icon:Dl})})})}),C&&(0,d.jsxs)(Ss.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,T.__)("Padding"),onDeselect:()=>E(void 0),isShownByDefault:s.padding??Im.padding,className:gs({"tools-panel-item-spacing":g}),panelId:i,children:[!g&&(0,d.jsx)(Ss.BoxControl,{__next40pxDefaultSize:!0,values:B,onChange:E,label:(0,T.__)("Padding"),sides:I,units:m,allowReset:!1,splitOnAxis:j,inputProps:{onMouseOver:M,onMouseOut:J}}),g&&(0,d.jsx)(rm,{values:B,onChange:E,label:(0,T.__)("Padding"),sides:I,units:m,allowReset:!1,onMouseOver:M,onMouseOut:J})]}),P&&(0,d.jsxs)(Ss.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,T.__)("Margin"),onDeselect:()=>L(void 0),isShownByDefault:s.margin??Im.margin,className:gs({"tools-panel-item-spacing":g}),panelId:i,children:[!g&&(0,d.jsx)(Ss.BoxControl,{__next40pxDefaultSize:!0,values:R,onChange:L,inputProps:{min:b,onDragStart:()=>{k(0)},onDragEnd:()=>{k(f)},onMouseOver:D,onMouseOut:J},label:(0,T.__)("Margin"),sides:A,units:m,allowReset:!1,splitOnAxis:N}),g&&(0,d.jsx)(rm,{values:R,onChange:L,minimumCustomValue:-1/0,label:(0,T.__)("Margin"),sides:A,units:m,allowReset:!1,onMouseOver:D,onMouseOut:J})]}),O&&(0,d.jsxs)(Ss.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,T.__)("Block spacing"),onDeselect:()=>U(void 0),isShownByDefault:s.blockGap??Im.blockGap,className:gs({"tools-panel-item-spacing":g,"single-column":!g&&!V}),panelId:i,children:[!g&&(V?(0,d.jsx)(Ss.BoxControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Block spacing"),min:0,onChange:G,units:m,sides:z,values:H,allowReset:!1,splitOnAxis:V}):(0,d.jsx)(Ss.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Block spacing"),min:0,onChange:U,units:m,value:F})),g&&(0,d.jsx)(rm,{label:(0,T.__)("Block spacing"),min:0,onChange:G,showSideInLabel:!1,sides:V?z:["top"],values:H,allowReset:!1})]}),Y&&(0,d.jsx)(cm,{value:X,onChange:e=>{n({...t,layout:{...e}})},parentLayout:r?.parentLayout,panelId:i,isShownByDefault:s.childLayout??Im.childLayout}),$&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,T.__)("Minimum height"),onDeselect:()=>{K(void 0)},isShownByDefault:s.minHeight??Im.minHeight,panelId:i,children:(0,d.jsx)(sm,{label:(0,T.__)("Minimum height"),value:W,onChange:K})}),Z&&(0,d.jsx)(hm,{hasValue:()=>!!t?.dimensions?.aspectRatio,value:q,onChange:e=>{const o=ge(t,["dimensions","aspectRatio"],e);n(ge(o,["dimensions","minHeight"],void 0))},panelId:i,isShownByDefault:s.aspectRatio??Im.aspectRatio})]})}const Em=new WeakMap;var Tm=function(e){const t=(0,m.useRefEffect)(t=>{function n(n){const{deltaX:o,deltaY:r,target:i}=n,s=e.current;let l=Em.get(s);
2l||(l=(0,Fa.getScrollContainer)(s),Em.set(s,l));const a=(0,Fa.getScrollContainer)(i);t.contains(a)||l.scrollBy(o,r)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}},[e]);return e?t:null};const Mm=".block-editor-block-list__block",Pm=".block-list-appender",Rm=".block-editor-button-block-appender";function Am(e,t){return e.closest(Mm)===t.closest(Mm)}function Nm(e,t){return t.closest([Mm,Pm,Rm].join(","))===e}function Lm(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Mm);return t?t.id.slice(6):void 0}function Dm(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 Om(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 zm(e){const t=window.getComputedStyle(e);return"auto"===t.overflowX||"scroll"===t.overflowX||"auto"===t.overflowY||"scroll"===t.overflowY}const Vm=["core/navigation"];function Fm(e){const t=e.ownerDocument.defaultView;if(!t)return new window.DOMRectReadOnly;let n=e.getBoundingClientRect();const o=e.getAttribute("data-type");if(o&&Vm.includes(o)){const t=[e];let o;for(;o=t.pop();)if(!zm(o))for(const e of o.children)Om(e)&&(n=Dm(n,e.getBoundingClientRect()),t.push(e))}const r=Math.max(n.left,0),i=Math.min(n.right,t.innerWidth);return n=new window.DOMRectReadOnly(r,n.top,i-r,n.height),n}const Hm=Number.MAX_SAFE_INTEGER,Um=(0,h.forwardRef)(function({clientId:e,bottomClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,shift:i=!0,...s},l){const a=ch(e),c=ch(t??e),u=(0,m.useMergeRefs)([l,Tm(r)]),[p,g]=(0,h.useReducer)(e=>(e+1)%Hm,0);(0,h.useLayoutEffect)(()=>{if(!a)return;const e=new window.MutationObserver(g);return e.observe(a,{attributes:!0}),()=>{e.disconnect()}},[a]);const f=(0,h.useMemo)(()=>{if(!(p<0||!a||t&&!c))return{getBoundingClientRect:()=>c?Dm(Fm(a),Fm(c)):Fm(a),contextElement:a}},[p,a,t,c]);return!a||t&&!c?null:(0,d.jsx)(Ss.Popover,{ref:u,animate:!1,focusOnMount:!1,anchor:f,__unstableSlotName:o,inline:!o,placement:"top-start",resize:!1,flip:!1,shift:i,...s,className:gs("block-editor-block-popover",s.className),variant:"unstyled",children:n})});var Gm=(0,h.forwardRef)(({clientId:e,bottomClientId:t,children:n,...o},r)=>(0,d.jsx)(Um,{...o,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:r,children:n}));function $m({selectedElement:e,additionalStyles:t={},children:n}){const[o,r]=(0,h.useState)(e.offsetWidth),[i,s]=(0,h.useState)(e.offsetHeight);(0,h.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,h.useMemo)(()=>({position:"absolute",width:o,height:i,...t}),[o,i,t]);return(0,d.jsx)("div",{style:l,children:n})}var Wm=(0,h.forwardRef)(function({clientId:e,bottomClientId:t,children:n,shift:o=!1,additionalStyles:r,...i},s){t??=e;const l=ch(e);return(0,d.jsx)(Um,{ref:s,clientId:e,bottomClientId:t,shift:o,...i,children:l&&e===t?(0,d.jsx)($m,{selectedElement:l,additionalStyles:r,children:n}):n})});function Km({clientId:e,value:t,computeStyle:n,forceShow:o}){const r=ch(e),[i,s]=(0,h.useReducer)(()=>n(r));(0,h.useEffect)(()=>{if(!r)return;const e=new window.MutationObserver(s);return e.observe(r,{attributes:!0,attributeFilter:["style","class"]}),()=>{e.disconnect()}},[r]);const l=(0,h.useRef)(t),[a,c]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{if(Ya()(t,l.current)||o)return;c(!0),l.current=t;const e=setTimeout(()=>{c(!1)},400);return()=>{c(!1),clearTimeout(e)}},[t,o]),a||o?(0,d.jsx)(Wm,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,d.jsx)("div",{className:"block-editor__spacing-visualizer",style:i})}):null}function Zm(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function qm({clientId:e,value:t,forceShow:n}){return(0,d.jsx)(Km,{clientId:e,value:t?.spacing?.margin,computeStyle:e=>{const t=Zm(e,"margin-top"),n=Zm(e,"margin-right"),o=Zm(e,"margin-bottom"),r=Zm(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 Ym({clientId:e,value:t,forceShow:n}){return(0,d.jsx)(Km,{clientId:e,value:t?.spacing?.padding,computeStyle:e=>({borderTopWidth:Zm(e,"padding-top"),borderRightWidth:Zm(e,"padding-right"),borderBottomWidth:Zm(e,"padding-bottom"),borderLeftWidth:Zm(e,"padding-left")}),forceShow:n})}const Xm="dimensions",Qm="spacing";function Jm({children:e,resetAllFilter:t}){const n=(0,h.useCallback)(e=>{const n=e.style,o=t(n);return{...e,style:o}},[t]);return(0,d.jsx)(Oa,{group:"dimensions",resetAllFilter:n,children:e})}function ef({clientId:e,name:t,setAttributes:n,settings:o}){const r=mm(o),i=(0,g.useSelect)(t=>t(Ii).getBlockAttributes(e)?.style,[e]),[s,l]=function(){const[e,t]=(0,h.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=U((0,g.useDispatch)(Ii));return(0,h.useEffect)(()=>{e?n():o()},[e,o,n]),[e,t]}();if(!r)return null;const a={...(0,p.getBlockSupport)(t,[Xm,"__experimentalDefaultControls"]),...(0,p.getBlockSupport)(t,[Qm,"__experimentalDefaultControls"])};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(jm,{as:Jm,panelId:e,settings:o,value:i,onChange:e=>{n({style:ms(e)})},defaultControls:a,onVisualize:l}),!!o?.spacing?.padding&&(0,d.jsx)(Ym,{forceShow:"padding"===s,clientId:e,value:i}),!!o?.spacing?.margin&&(0,d.jsx)(qm,{forceShow:"margin"===s,clientId:e,value:i})]})}function tf(e,t="any"){if("web"!==h.Platform.OS)return!1;const n=(0,p.getBlockSupport)(e,Xm);return!(!0!==n&&("any"===t?!n?.aspectRatio&&!n?.minHeight:!n?.[t]))}var nf={useBlockProps:function({name:e,minHeight:t,style:n}){if(!tf(e,"aspectRatio")||bs(e,Xm,"aspectRatio"))return{};const o=gs({"has-aspect-ratio":!!n?.dimensions?.aspectRatio}),r={};return n?.dimensions?.aspectRatio?r.minHeight="unset":(t||n?.dimensions?.minHeight)&&(r.aspectRatio="unset"),{className:o,style:r}},attributeKeys:["minHeight","style"],hasSupport:e=>tf(e,"aspectRatio")};function of(){I()("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}const rf=[...Ug,fp,hh,Xm,Cu,Qm,bp],sf=e=>rf.some(t=>(0,p.hasBlockSupport)(e,t));function lf(e={}){const t={};
2return(0,Mi.getCSSRules)(e).forEach(e=>{t[e.key]=e.value}),t}const af={[`${fp}.__experimentalSkipSerialization`]:["border"],[`${hh}.__experimentalSkipSerialization`]:[hh],[`${Hg}.__experimentalSkipSerialization`]:[Hg],[`${Xm}.__experimentalSkipSerialization`]:[Xm],[`${Qm}.__experimentalSkipSerialization`]:[Qm],[`${bp}.__experimentalSkipSerialization`]:[bp]},cf={...af,[`${Xm}.aspectRatio`]:[`${Xm}.aspectRatio`],[`${Cu}`]:[Cu]},uf={[`${Xm}.aspectRatio`]:!0,[`${Cu}`]:!0},df={gradients:"gradient"};function pf(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;pf(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]}),o}function hf(e,t,n,o=cf){if(!sf(t))return e;let{style:r}=n;return Object.entries(o).forEach(([e,n])=>{const o=uf[e]||(0,p.getBlockSupport)(t,e);!0===o&&(r=pf(r,n)),Array.isArray(o)&&o.forEach(e=>{const t=df[e]||e;r=pf(r,[[...n,t]])})}),e.style={...lf(r),...e.style},e}var gf={edit:function({clientId:e,name:t,setAttributes:n,__unstableParentLayout:o}){const r=ys(t,o),i=da(),s={clientId:e,name:t,setAttributes:n,settings:{...r,typography:{...r.typography,textAlign:!1}}};return"default"!==i?null:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Sh,{...s}),(0,d.jsx)(Mu,{...s}),(0,d.jsx)(Kg,{...s}),(0,d.jsx)(wp,{...s}),(0,d.jsx)(ef,{...s})]})},hasSupport:sf,addSaveProps:hf,attributeKeys:["style"],useBlockProps:function({name:e,style:t}){const n=(0,m.useInstanceId)(ff,"wp-elements"),o=`.${n}`,r=t?.elements,i=(0,h.useMemo)(()=>{if(!r)return;const t=[];return mf.forEach(({elementType:n,pseudo:i,elements:s})=>{if(bs(e,hh,n))return;const l=r?.[n];if(l){const e=ts(o,p.__EXPERIMENTAL_ELEMENTS[n]);t.push((0,Mi.compileCSS)(l,{selector:e})),i&&i.forEach(e=>{l[e]&&t.push((0,Mi.compileCSS)(l[e],{selector:ts(o,`${p.__EXPERIMENTAL_ELEMENTS[n]}${e}`)}))})}s&&s.forEach(e=>{r[e]&&t.push((0,Mi.compileCSS)(r[e],{selector:ts(o,p.__EXPERIMENTAL_ELEMENTS[e])}))})}),t.length>0?t.join(""):void 0},[o,r,e]);return vs({css:i}),hf({className:n},e,{style:t},af)}};const mf=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],ff={};(0,f.addFilter)("blocks.registerBlockType","core/style/addAttribute",function(e){return sf(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e}),(0,f.addFilter)("blocks.registerBlockType","core/settings/addAttribute",function(e){return t=e,(0,p.hasBlockSupport)(t,"__experimentalSettings",!1)?(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e;var t});var bf=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})}),kf=function e({id:t,colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:i,value:s,onChange:l}){let a;a="unset"===s?(0,d.jsx)(Ss.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):s?(0,d.jsx)(Ss.DuotoneSwatch,{values:s}):(0,d.jsx)(Nl,{icon:bf});const c=(0,T.__)("Apply duotone filter"),u=`${(0,m.useInstanceId)(e,"duotone-control",t)}__description`;return(0,d.jsx)(Ss.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,T.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,d.jsx)(Ss.ToolbarButton,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==Ua.DOWN||(n.preventDefault(),t())},label:c,icon:a}),renderContent:()=>(0,d.jsxs)(Ss.MenuGroup,{label:(0,T.__)("Duotone"),children:[(0,d.jsx)("p",{children:(0,T.__)("Create a two-tone color effect without losing your original image.")}),(0,d.jsx)(Ss.DuotonePicker,{"aria-label":c,"aria-describedby":u,colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:i,value:s,onChange:l})]})})};function vf(e){return`${e}{filter:none}`}function _f(e,t){return`${e}{filter:url(#${t})}`}function yf(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach(e=>{const n=bd(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\tfocu
2sable="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 xf(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 me(i,`${a}.root`,null)||me(i,a,null)||e;const t=me(s,`${a}.__experimentalSelector`,null);return t?ts(c,t):e}let d;return l&&(d=me(i,a,null)),d||(o?xf(e,u[0],n):null)}const Sf=[];function wf(e,{presetSetting:t,defaultSetting:n}){const o=!e?.color?.[n],r=e?.color?.[t]?.custom||Sf,i=e?.color?.[t]?.theme||Sf,s=e?.color?.[t]?.default||Sf;return(0,h.useMemo)(()=>[...r,...i,...o?Sf:s],[o,r,i,s])}function Cf(e){return Bf(e)}function Bf(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function If({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const i=Qi();return(0,d.jsx)(Ss.__experimentalToolsPanel,{label:(0,T._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:i,children:r})}const jf={duotone:!0},Ef={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,T.__)("Duotone")},Tf=({indicator:e,label:t})=>(0,d.jsxs)(Ss.__experimentalHStack,{justify:"flex-start",children:[(0,d.jsx)(Ss.__experimentalZStack,{isLayered:!1,offset:-8,children:(0,d.jsx)(Ss.Flex,{expanded:!1,children:"unset"!==e&&e?(0,d.jsx)(Ss.DuotoneSwatch,{values:e}):(0,d.jsx)(Ss.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"})})}),(0,d.jsx)(Ss.FlexItem,{title:t,children:t})]}),Mf=(e,t)=>({onToggle:n,isOpen:o})=>{const r=(0,h.useRef)(void 0),i={onClick:n,className:gs("block-editor-global-styles-filters-panel__dropdown-toggle",{"is-open":o}),"aria-expanded":o,ref:r},s={onClick:()=>{o&&n(),t(),r.current?.focus()},className:"block-editor-panel-duotone-settings__reset",label:(0,T.__)("Reset")};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,...i,children:(0,d.jsx)(Tf,{indicator:e,label:(0,T.__)("Duotone")})}),e&&(0,d.jsx)(Ss.Button,{size:"small",icon:za,...s})]})};function Pf({as:e=If,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:s=jf}){const l=Bf(r),a=wf(r,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),c=wf(r,{presetSetting:"palette",defaultSetting:"defaultPalette"}),u=(p=o?.filter?.duotone,es({settings:r},"",p));var p;const g=e=>{const o=a.find(({colors:t})=>t===e),r=o?`var:preset|duotone|${o.slug}`:e;n(ge(t,["filter","duotone"],r))},m=()=>g(void 0),f=(0,h.useCallback)(e=>({...e,filter:{...e.filter,duotone:void 0}}),[]);return(0,d.jsx)(e,{resetAllFilter:f,value:t,onChange:n,panelId:i,children:l&&(0,d.jsx)(Ss.__experimentalToolsPanelItem,{label:(0,T.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:m,isShownByDefault:s.duotone,panelId:i,children:(0,d.jsx)(Ss.Dropdown,{popoverProps:Ef,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:Mf(u,m),renderContent:()=>(0,d.jsx)(Ss.__experimentalDropdownContentWrapper,{paddingSize:"small",children:(0,d.jsxs)(Ss.MenuGroup,{label:(0,T.__)("Duotone"),children:[(0,d.jsx)("p",{children:(0,T.__)("Create a two-tone color effect without losing your original image.")}),(0,d.jsx)(Ss.DuotonePicker,{colorPalette:c,duotonePalette:a,disableCustomColors:!0,disableCustomDuotone:!0,value:u,onChange:g})]})})})})})}const Rf=[],Af=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function Nf({presetSetting:e,defaultSetting:t}){const[n,o,r,i]=Ei(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,h.useMemo)(()=>[...o||Rf,...r||Rf,...n&&i||Rf],[n,o,r,i])}function Lf(e,t){if(!e)return;const n=t?.find(({slug:t})=>e===`var:preset|duotone|${t}`);return n?n.colors:void 0}vd([_d]);var Df={shareWithChildBlocks:!0,edit:function({style:e,setAttributes:t,name:n}){const o=e?.color?.duotone,r=ys(n),i=da(),s=Nf({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),l=Nf({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[a,c]=Ei("color.custom","color.customDuotone"),u=!a,p=!c||0===l?.length&&u;if(0===s?.length&&p)return null;if("default"!==i)return null;const h="unset"===o||Array.isArray(o)?o:Lf(o,s);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Oa,{group:"filter",children:(0,d.jsx)(Pf,{value:{filter:{duotone:h}},onChange:n=>{const o={...e,color:{...n?.filter}};t({style:ms(o)})},settings:r})}),(0,d.jsx)(Ps,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,d.jsx)(kf,{duotonePalette:s,colorPalette:l,disableCustomDuotone:p,disableCustomColors:u,value:h,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:o??n}};t({style:ms(r)})},settings:r})})]})},useBlockProps:function({clientId:e,name:t,style:n}){const o=(0,m.useInstanceId)(Of),r=(0,h.useMemo)(()=>{const e=(0,p.getBlockType)(t);if(e){if(!(0,p.getBlockSupport)(e,"filter.duotone",!1))return null;const t=(0,p.getBlockSupport)(e,"color.__experimentalDuotone",!1);if(t){const n=xf(e);return"string"==typeof t?ts(n,t):n}return xf(e,"filter.duotone",{fallback:!0})}},[t]),i=n?.color?.duotone,s=`wp-duotone-${o}`,l=r&&i;return function({clientId:e,id:t,selector:n,attribute:o}){const r=Nf({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=Array.isArray(o),s=i?void 0:Lf(o,r),l="string"==typeof o&&s;let a=null;l?a=s:("string"==typeof o&&!l||i)&&(a=o);const c=n.split(",").map(e=>`.${t}${e.trim()}`).join(", "),u=Array.isArray(a)||"unset"===a;_s(u?{css:"unset"!==a?_f(c,t):vf(c),__unstableType:"presets"}:void 0),_s(u?{assets:"unset"!==a?yf(t,a):"",__unstableType:"svgs"}:void 0);const d=ch(e);(0,h.useEffect)(()=>
2{if(u&&d&&Af){const e=d.style.display;d.style.setProperty("display","inline-block"),d.offsetHeight,d.style.setProperty("display",e)}},[u,d,a])}({clientId:e,id:s,selector:r,attribute:i}),{className:l?s:""}},attributeKeys:["style"],hasSupport:e=>(0,p.hasBlockSupport)(e,"filter.duotone")};const Of={};function zf(e){return(0,g.useSelect)(t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(Ii),{getBlockType:r,getActiveBlockVariation:i}=t(p.store),s=n(e),l=r(s);if(!l)return null;const a=o(e),c=i(s,a),u=(0,p.isReusableBlock)(l)||(0,p.isTemplatePart)(l),d=(u?(0,p.__experimentalGetBlockLabel)(l,a):void 0)||l.title,h=function(e){const t=e?.style?.position?.type;return"sticky"===t?(0,T.__)("Sticky"):"fixed"===t?(0,T.__)("Fixed"):null}(a),g={isSynced:u,title:d,icon:l.icon,description:l.description,anchor:a?.anchor,positionLabel:h,positionType:a?.style?.position?.type,name:a?.metadata?.name};return c?{isSynced:u,title:c.title||l.title,icon:c.icon||l.icon,description:c.description||l.description,anchor:a?.anchor,positionLabel:h,positionType:a?.style?.position?.type,name:a?.metadata?.name}:g},[e])}(0,f.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",function(e){return(0,p.hasBlockSupport)(e,"filter.duotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e});const Vf="position",Ff={key:"default",value:"",name:(0,T.__)("Default")},Hf={key:"sticky",value:"sticky",name:(0,T._x)("Sticky","Name for the value of the CSS position property"),hint:(0,T.__)("The block will stick to the top of the window instead of scrolling.")},Uf={key:"fixed",value:"fixed",name:(0,T._x)("Fixed","Name for the value of the CSS position property"),hint:(0,T.__)("The block will not move when the page is scrolled.")},Gf=["top","right","bottom","left"],$f=["sticky","fixed"];function Wf(e){const t=e?.style?.position?.type;return"sticky"===t||"fixed"===t}function Kf({name:e}={}){const[t,n]=Ei("position.fixed","position.sticky"),o=!t&&!n;return r=e,!(0,p.getBlockSupport)(r,Vf)||o;var r}function Zf({style:e={},clientId:t,name:n,setAttributes:o}){const r=function(e){const t=(0,p.getBlockSupport)(e,Vf);return!(!0!==t&&!t?.fixed)}(n),i=function(e){const t=(0,p.getBlockSupport)(e,Vf);return!(!0!==t&&!t?.sticky)}(n),s=e?.position?.type,{firstParentClientId:l}=(0,g.useSelect)(e=>{const{getBlockParents:n}=e(Ii),o=n(t);return{firstParentClientId:o[o.length-1]}},[t]),a=zf(l),c=i&&s===Hf.value&&a?(0,T.sprintf)((0,T.__)("The block will stick to the scrollable area of the parent %s block."),a.title):null,u=(0,h.useMemo)(()=>{const e=[Ff];return(i||s===Hf.value)&&e.push(Hf),(r||s===Uf.value)&&e.push(Uf),e},[r,i,s]),m=s&&u.find(e=>e.value===s)||Ff;return h.Platform.select({web:u.length>1?(0,d.jsx)(Oa,{group:"position",children:(0,d.jsx)(Ss.BaseControl,{__nextHasNoMarginBottom:!0,help:c,children:(0,d.jsx)(Ss.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Position"),hideLabelFromVision:!0,describedBy:(0,T.sprintf)((0,T.__)("Currently selected position: %s"),m.name),options:u,value:m,onChange:({selectedItem:t})=>{(t=>{const n={...e,position:{...e?.position,type:t,top:"sticky"===t||"fixed"===t?"0px":void 0}};o({style:ms(n)})})(t.value)},size:"__unstable-large"})})}):null,native:null})}var qf={edit:function(e){return Kf(e)?null:(0,d.jsx)(Zf,{...e})},useBlockProps:function({name:e,style:t}){const n=(0,p.hasBlockSupport)(e,Vf),o=Kf({name:e}),r=n&&!o,i=(0,m.useInstanceId)(Yf);let s;r&&(s=function({selector:e,style:t}){let n="";const{type:o}=t?.position||{};return $f.includes(o)?(n+=`${e} {`,n+=`position: ${o};`,Gf.forEach(e=>{void 0!==t?.position?.[e]&&(n+=`${e}: ${t.position[e]};`)}),"sticky"!==o&&"fixed"!==o||(n+="z-index: 10"),n+="}",n):n}({selector:`.wp-container-${i}.wp-container-${i}`,style:t})||"");const l=gs({[`wp-container-${i}`]:r&&!!s,[`is-position-${t?.position?.type}`]:r&&!!s&&!!t?.position?.type});return vs({css:s}),{className:l}},attributeKeys:["style"],hasSupport:e=>(0,p.hasBlockSupport)(e,Vf)};const Yf={},Xf={button:"wp-element-button",caption:"wp-element-caption"},Qf={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"},{kebabCase:Jf}=U(Ss.privateApis);function eb(e={},t,n){let o=[];return Object.keys(e).forEach(r=>{const i=t+Jf(r.replace("/","-")),s=e[r];if(s instanceof Object){const e=i+n;o=[...o,...eb(s,e,n)]}else o.push(`${i}: ${s}`)}),o}const tb=(e,t)=>{const n={};return Object.entries(e).forEach(([e,o])=>{if("root"===e||!t?.[e])return;const r="string"==typeof o;
2if(r||Object.entries(o).forEach(([o,r])=>{if("root"===o||!t?.[e][o])return;const i=nb({[e]:{[o]:t[e][o]}});n[r]=[...n[r]||[],...i],delete t[e][o]}),r||o.root){const i=r?o:o.root,s=nb({[e]:t[e]});n[i]=[...n[i]||[],...s],delete t[e]}}),n};function nb(e={},t="",n,o={},r=!1){const i=Zi===t,s=Object.entries(p.__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=me(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(!me(u,[o],!1))return;const r=n.startsWith("--")?n:Jf(n);t.push(`${r}: ${(0,Mi.getCSSValueFromRawStyle)(me(u,[o]))}`)});else if(me(e,c,!1)){const n=o.startsWith("--")?o:Jf(o);t.push(`${n}: ${(0,Mi.getCSSValueFromRawStyle)(me(e,c))}`)}return t},[]);return e.background&&(e.background?.backgroundImage&&(e.background.backgroundImage=os(e.background.backgroundImage,o)),!i&&e.background?.backgroundImage?.id&&(e={...e,background:{...e.background,...ju(e.background)}})),(0,Mi.getCSSRules)(e).forEach(e=>{if(i&&(n||r)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:Jf(e.key);let l=os(e.value,o);"font-size"===t&&(l=$i({size:l},o?.settings)),"aspect-ratio"===t&&s.push("min-height: unset"),s.push(`${t}: ${l}`)}),s}function ob({layoutDefinitions:e=Vs,style:t,selector:n,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:i}){let s="",l=o?cl(t?.spacing?.blockGap):"";if(r&&(n===Zi?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===Zi?`:root :where(.${e})${t?.selector||""}`:`:root :where(${n}-${e})${t?.selector||""}`:n===Zi?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,s+=`${i} { ${r.join("; ")}; }`}})}),n===Zi&&o&&(s+=`${qi} { --wp--style--block-gap: ${l}; }`)),n===Zi&&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=[];t.rules&&Object.entries(t.rules).forEach(([e,t])=>{n.push(`${e}: ${t}`)}),n.length&&(s+=`.${e}${t?.selector||""} { ${n.join("; ")}; }`)})})}return s}const rb=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function ib(e){if(!e)return{};const t=Object.entries(e).filter(([e])=>rb.includes(e)).map(([e,t])=>[e,JSON.parse(JSON.stringify(t))]);return Object.fromEntries(t)}const sb=(e,t)=>{const n=[];if(!e?.settings)return n;const o=e=>{let t={};return Yi.forEach(({path:n})=>{const o=me(e,n,!1);!1!==o&&(t=ge(t,n,o))}),t},r=o(e.settings),i=e.settings?.custom;return(Object.keys(r).length>0||i)&&n.push({presets:r,custom:i,selector:qi}),Object.entries(e.settings?.blocks??{}).forEach(([e,r])=>{const i=o(r),s=r.custom;(Object.keys(i).length>0||s)&&n.push({presets:i,custom:s,selector:t[e]?.selector})}),n},lb=(e,t)=>{const n=sb(e,t);let o="";return n.forEach(({presets:t,custom:n,selector:r})=>{const i=function(e={},t){return Yi.reduce((n,{path:o,valueKey:r,valueFunc:i,cssVarInfix:s})=>{const l=me(e,o,[]);return["default","theme","custom"].forEach(e=>{l[e]&&l[e].forEach(e=>{r&&!i?n.push(`--wp--preset--${s}--${Jf(e.slug)}: ${e[r]}`):i&&"function"==typeof i&&n.push(`--wp--preset--${s}--${Jf(e.slug)}: ${i(e,t)}`)})}),n},[])}(t,e?.settings),s=eb(n,"--wp--custom--","--");s.length>0&&i.push(...s),i.length>0&&(o+=`${r}{${i.join(";")};}`)}),o},ab=(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=((e,t)=>{const n=[];if(!e?.styles)return n;const o=ib(e.styles);return o&&n.push({styles:o,selector:Zi,skipSelectorWrapper:!0}),Object.entries(p.__EXPERIMENTAL_ELEMENTS).forEach(([t,o])=>{e.styles?.elements?.[t]&&n.push({styles:e.styles?.elements?.[t],selector:o,skipSelectorWrapper:!Xf[t]})}),Object.entries(e.styles?.blocks??{}
2).forEach(([e,o])=>{const r=ib(o);if(o?.variations){const i={};Object.entries(o.variations).forEach(([o,r])=>{i[o]=ib(r),r?.css&&(i[o].css=r.css);const s=t[e]?.styleVariationSelectors?.[o];Object.entries(r?.elements??{}).forEach(([e,t])=>{t&&p.__EXPERIMENTAL_ELEMENTS[e]&&n.push({styles:t,selector:ts(s,p.__EXPERIMENTAL_ELEMENTS[e])})}),Object.entries(r?.blocks??{}).forEach(([e,o])=>{const r=ts(s,t[e]?.selector),i=ts(s,t[e]?.duotoneSelector),l=function(e,t){if(!e||!t)return;const n={};return Object.entries(t).forEach(([t,o])=>{"string"==typeof o&&(n[t]=ts(e,o)),"object"==typeof o&&(n[t]={},Object.entries(o).forEach(([o,r])=>{n[t][o]=ts(e,r)}))}),n}(s,t[e]?.featureSelectors),a=ib(o);o?.css&&(a.css=o.css),n.push({selector:r,duotoneSelector:i,featureSelectors:l,fallbackGapValue:t[e]?.fallbackGapValue,hasLayoutSupport:t[e]?.hasLayoutSupport,styles:a}),Object.entries(o.elements??{}).forEach(([e,t])=>{t&&p.__EXPERIMENTAL_ELEMENTS[e]&&n.push({styles:t,selector:ts(r,p.__EXPERIMENTAL_ELEMENTS[e])})})})}),r.variations=i}t?.[e]?.selector&&n.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:r,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors}),Object.entries(o?.elements??{}).forEach(([o,r])=>{r&&t?.[e]&&p.__EXPERIMENTAL_ELEMENTS[o]&&n.push({styles:r,selector:t[e]?.selector.split(",").map(e=>p.__EXPERIMENTAL_ELEMENTS[o].split(",").map(t=>e+" "+t)).join(",")})})}),n})(e,t),c=sb(e,t),u=e?.settings?.useRootPaddingAwareAlignments,{contentSize:d,wideSize:h}=e?.settings?.layout||{},g=l.marginReset||l.rootPadding||l.layoutStyles;let m="";if(l.presets&&(d||h)&&(m+=`${qi} {`,m=d?m+` --wp--style--global--content-size: ${d};`:m,m=h?m+` --wp--style--global--wide-size: ${h};`:m,m+="}"),g&&(m+=":where(body) {margin: 0;",l.rootPadding&&u&&(m+="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"),m+="}"),l.blockStyles&&a.forEach(({selector:t,duotoneSelector:s,styles:a,fallbackGapValue:c,hasLayoutSupport:d,featureSelectors:p,styleVariationSelectors:h,skipSelectorWrapper:g})=>{if(p){const e=tb(p,a);Object.entries(e).forEach(([e,t])=>{if(t.length){const n=t.join(";");m+=`:root :where(${e}){${n};}`}})}if(s){const e={};a?.filter&&(e.filter=a.filter,delete a.filter);const t=nb(e);t.length&&(m+=`${s}{${t.join(";")};}`)}r||Zi!==t&&!d||(m+=ob({style:a,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:c}));const f=nb(a,t,u,e,i);f?.length&&(m+=`${g?t:`:root :where(${t})`}{${f.join(";")};}`),a?.css&&(m+=ub(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=tb(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(";");m+=`:root :where(${o}){${r};}`}})}const t=nb(o,n,u,e);t.length&&(m+=`:root :where(${n}){${t.join(";")};}`),o?.css&&(m+=ub(o.css,`:root :where(${n})`))}});const b=Object.entries(a).filter(([e])=>e.startsWith(":"));b?.length&&b.forEach(([e,n])=>{const o=nb(n);if(!o?.length)return;const r=`:root :where(${t.split(",").map(t=>t+e).join(",")}){${o.join(";")};}`;m+=r})}),l.layoutStyles&&(m+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",m+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",m+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),l.blockGap&&n){const t=cl(e?.styles?.spacing?.blockGap)||"0.5em";m+=`:root :where(.wp-site-blocks) > * { margin-block-start: ${t}; margin-block-end: 0; }`,m+=":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",m+=":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}
2return l.presets&&c.forEach(({selector:e,presets:t})=>{Zi!==e&&qi!==e||(e="");const n=function(e="*",t={}){return Yi.reduce((n,{path:o,cssVarInfix:r,classes:i})=>{if(!i)return n;const s=me(t,o,[]);return["default","theme","custom"].forEach(t=>{s[t]&&s[t].forEach(({slug:t})=>{i.forEach(({classSuffix:o,propertyName:i})=>{const s=`.has-${Jf(t)}-${o}`,l=e.split(",").map(e=>`${e}${s}`).join(","),a=`var(--wp--preset--${r}--${Jf(t)})`;n+=`${l}{${i}: ${a} !important;}`})})}),n},"")}(e,t);n.length>0&&(m+=n)}),m};const cb=(e,t,n)=>{const o={};return e.forEach(e=>{const r=e.name,i=xf(e);let s=xf(e,"filter.duotone");if(!s){const t=xf(e),n=(0,p.getBlockSupport)(e,"color.__experimentalDuotone",!1);s=n&&ts(t,n)}const l=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,a=e?.supports?.spacing?.blockGap?.__experimentalDefault,c=t(r),u={};c?.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);u[o]=r});const d=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(Qf).forEach(([t,o])=>{const r=xf(e,t);r&&(n[o]=r)}),n})(e,i);o[r]={duotoneSelector:s,fallbackGapValue:a,featureSelectors:Object.keys(d).length?d:void 0,hasLayoutSupport:l,name:r,selector:i,styleVariationSelectors:c?.length?u:void 0}}),o};function ub(e,t){let n="";return e&&""!==e.trim()?(e.split("&").forEach(e=>{if(e&&""!==e.trim())if(e.includes("{")){const o=e.replace("}","").split("{");
2if(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(" ")?ts(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()}}`}else n+=`:root :where(${t}){${e.trim()}}`}),n):n}function db(e={},t){const[n]=as("spacing.blockGap"),o=null!==n,r=!o,i=(0,g.useSelect)(e=>{const{getSettings:t}=e(Ii);return!!t().disableLayoutStyles}),{getBlockStyles:s}=(0,g.useSelect)(p.store);return(0,h.useMemo)(()=>{if(!e?.styles||!e?.settings)return[];const n=(h=e,h.styles?.blocks?.["core/separator"]&&h.styles?.blocks?.["core/separator"].color?.background&&!h.styles?.blocks?.["core/separator"].color?.text&&!h.styles?.blocks?.["core/separator"].border?.color?{...h,styles:{...h.styles,blocks:{...h.styles.blocks,"core/separator":{...h.styles.blocks["core/separator"],color:{...h.styles.blocks["core/separator"].color,text:h.styles?.blocks["core/separator"].color.background}}}}}:h),l=cb((0,p.getBlockTypes)(),s),a=lb(n,l),c=ab(n,l,o,r,i,t),u=function(e,t){return sb(e,t).flatMap(({presets:e})=>function(e={}){return Yi.filter(e=>"duotone"===e.path.at(-1)).flatMap(t=>{const n=me(e,t.path,{});return["default","theme"].filter(e=>n[e]).flatMap(e=>n[e].map(e=>yf(`wp-duotone-${e.slug}`,e.colors))).join("")})}(e))}(n,l),d=[{css:a,isGlobalStyles:!0},{css:c,isGlobalStyles:!0},{css:n.styles.css??"",isGlobalStyles:!0},{assets:u,__unstableType:"svg",isGlobalStyles:!0}];var h;return(0,p.getBlockTypes)().forEach(e=>{if(n.styles.blocks[e.name]?.css){const t=l[e.name].selector;d.push({css:ub(n.styles.blocks[e.name]?.css,t),isGlobalStyles:!0})}}),[d,n.settings]},[o,r,e,i,t,s])}function pb(e=!1){const{merged:t}=(0,h.useContext)(rs);return db(t,e)}const hb="is-style-";function gb(e){return e?e.split(/\s+/).reduce((e,t)=>{if(t.startsWith(hb)){const n=t.slice(9);"default"!==n&&e.push(n)}return e},[]):[]}function mb({override:e}){_s(e)}function fb(e,t,n){if(!e?.styles?.blocks?.[t]?.variations?.[n])return;const o=t=>{Object.keys(t).forEach(n=>{const r=t[n];if("object"==typeof r&&null!==r)if(void 0!==r.ref)if("string"!=typeof r.ref||""===r.ref.trim())delete t[n];else{const o=me(e,r.ref);o?t[n]=o:delete t[n]}else o(r),0===Object.keys(r).length&&delete t[n]})},r=JSON.parse(JSON.stringify(e.styles.blocks[t].variations[n]));return o(r),r}var bb={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>gb(e).length>0,useBlockProps:function({name:e,className:t,clientId:n}){const{getBlockStyles:o}=(0,g.useSelect)(p.store),r=function(e,t=[]){const n=gb(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=`${hb}${r}-${n}`,{settings:s,styles:l}=function(e,t,n){const{merged:o}=(0,h.useContext)(rs),{globalSettings:r,globalStyles:i}=(0,g.useSelect)(e=>{const t=e(Ii).getSettings();return{globalSettings:t.__experimentalFeatures,globalStyles:t[N]}},[]);return(0,h.useMemo)(()=>{const s=fb({settings:o?.settings??r,styles:o?.styles??i},e,t);return{settings:o?.settings??r,styles:{blocks:{[e]:{variations:{[`${t}-${n}`]:s}}}}}},[o,r,i,t,n,e])}(e,r,n),a=(0,h.useMemo)(()=>{if(!r)return;const e={settings:s,styles:l},t=cb((0,p.getBlockTypes)(),o,n);return ab(e,t,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})},[r,s,l,o,n]);return _s({id:`variation-${n}`,css:a,__unstableType:"variation",variation:r,clientId:n}),r?{className:i}:{}}};const kb="layout",{kebabCase:vb}=U(Ss.privateApis);function _b(e){return(0,p.hasBlockSupport)(e,"layout")||(0,p.hasBlockSupport)(e,"__experimentalLayout")}function yb(e={},t=""){const{layout:n}=e,{default:o}=(0,p.getBlockSupport)(t,kb)||{},r=n?.inherit||n?.contentSize||n?.wideSize?{...n,type:"constrained"}:n||o||{},i=[];if(Vs[r?.type||"default"]?.className){const e=Vs[r?.type||"default"]?.className,n=t.split("/"),o=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;i.push(e,o)}return(0,g.useSelect)(e=>(r?.inherit||r?.contentSize||"constrained"===r?.type)&&e(Ii).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments,[r?.contentSize,r?.inherit,r?.type])&&i.push("has-global-padding"),r?.orientation&&i.push(`is-${vb(r.orientation)}`),r?.justifyContent&&i.push(`is-content-justification-${vb(r.justifyContent)}`),r?.flexWrap&&"nowrap"===r.flexWrap&&i.push("is-nowrap"),i}var xb={shareWithChildBlocks:!0,edit:function({layout:e,setAttributes:t,name:n,clientId:o}){const r=ys(n),{layout:i}=r,{themeSupportsLayout:s}=(0,g.useSelect)(e=>{const{getSettings:t}=e(Ii);return{themeSupportsLayout:t().supportsLayout}},[]);if("default"!==da())return null;const l=(0,p.getBlockSupport)(n,kb,{}),a={...i,...l},{allowSwitching:c,allowEditing:u=!0,allowInheriting:h=!0,default:m}=a;if(!u)return null;const f={...l,...e},{type:b,default:{type:k="default"}={}}=f,v=b||k,_=!(!h||v&&"default"!==v&&"constrained"!==v&&!f.inherit),y=e||m||{},{inherit:x=!1,contentSize:S=null}=y;if(("default"===v||"constrained"===v)&&!s)return null;const w=Zl(v),C=Zl("constrained"),B=!y.type&&(S||x),I=!!x||!!S,j=e=>t({layout:e});return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Oa,{children:(0,d.jsxs)(Ss.PanelBody,{title:(0,T.__)("Layout"),children:[_&&(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(Ss.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Inner blocks use content width"),checked:"constrained"===w?.name||I,onChange:()=>t({layout:{type:"constrained"===w?.name||I?"default":"constrained"}}),help:"constrained"===w?.name||I?(0,T.__)("Nested blocks use content width with options for full and wide widths."):(0,T.__)("Nested blocks will fill the width of this container.")})}),!x&&c&&(0,d.jsx)(Sb,{type:v,onChange:e=>t({layout:{type:e}})}),w&&"default"!==w.name&&(0,d.jsx)(w.inspectorControls,{layout:y,onChange:j,layoutBlockSupport:a,name:n,clientId:o}),C&&B&&(0,d.jsx)(C.inspectorControls,{layout:y,onChange:j,layoutBlockSupport:a,name:n,clientId:o})]})}),!x&&w&&(0,d.jsx)(w.toolBarControls,{layout:y,onChange:j,layoutBlockSupport:l,name:n,clientId:o})]})},attributeKeys:["layout"],hasSupport:e=>_b(e)};function Sb({type:e,onChange:t}){return(0,d.jsx)(Ss.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,isBlock:!0,label:(0,T.__)("Layout type"),__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onCh
2ange:t,children:Kl.map(({name:e,label:t})=>(0,d.jsx)(Ss.__experimentalToggleGroupControlOption,{value:e,label:t},e))})}function wb({block:e,props:t,blockGapSupport:n,layoutClasses:o}){const{name:r,attributes:i}=t,s=(0,m.useInstanceId)(e),{layout:l}=i,{default:a}=(0,p.getBlockSupport)(r,kb)||{},c=l?.inherit||l?.contentSize||l?.wideSize?{...l,type:"constrained"}:l||a||{},u=`wp-container-${vb(r)}-is-layout-`,h=`.${u}${s}`,g=null!==n,f=Zl(c?.type||"default"),b=f?.getLayoutStyle?.({blockName:r,selector:h,layout:c,style:i?.style,hasBlockGapSupport:g}),k=gs({[`${u}${s}`]:!!b},o);return vs({css:b}),(0,d.jsx)(e,{...t,__unstableLayoutClassNames:k})}const Cb=(0,m.createHigherOrderComponent)(e=>t=>{const{clientId:n,name:o,attributes:r}=t,i=_b(o),s=yb(r,o),l=(0,g.useSelect)(e=>{if(!i)return;const{getSettings:t,getBlockSettings:o}=U(e(Ii)),{disableLayoutStyles:r}=t();if(r)return;const[s]=o(n,"spacing.blockGap");return{blockGapSupport:s}},[i,n]);return l?(0,d.jsx)(wb,{block:e,props:t,layoutClasses:s,...l}):(0,d.jsx)(e,{...t,__unstableLayoutClassNames:i?s:void 0})},"withLayoutStyles");function Bb(e,t){return Array.from({length:t},(t,n)=>e+n)}(0,f.addFilter)("blocks.registerBlockType","core/layout/addAttribute",function(e){return"type"in(e.attributes?.layout??{})||_b(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e}),(0,f.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Cb);class Ib{constructor({columnStart:e,rowStart:t,columnEnd:n,rowEnd:o,columnSpan:r,rowSpan:i}={}){this.columnStart=e??1,this.rowStart=t??1,this.columnEnd=void 0!==r?this.columnStart+r-1:n??this.columnStart,this.rowEnd=void 0!==i?this.rowStart+i-1: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 jb(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Eb(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 Tb(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 Mb(e){const t=jb(e,"grid-template-columns"),n=jb(e,"grid-template-rows"),o=jb(e,"border-top-width"),r=jb(e,"border-right-width"),i=jb(e,"border-bottom-width"),s=jb(e,"border-left-width"),l=jb(e,"padding-top"),a=jb(e,"padding-right"),c=jb(e,"padding-bottom"),u=jb(e,"padding-left"),d=t.split(" ").length,p=n.split(" ").length;return{numColumns:d,numRows:p,numItems:d*p,currentColor:jb(e,"color"),style:{gridTemplateColumns:t,gridTemplateRows:n,gap:jb(e,"gap"),inset:`\n\t\t\t\tcalc(${l} + ${o})\n\t\t\t\tcalc(${a} + ${r})\n\t\t\t\tcalc(${c} + ${i})\n\t\t\t\tcalc(${u} + ${s})\n\t\t\t`}}}const Pb=[(0,h.createInterpolateElement)((0,T.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,d.jsx)("kbd",{})}),(0,h.createInterpolateElement)((0,T.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,d.jsx)("kbd",{})}),(0,h.createInterpolateElement)((0,T.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,d.jsx)("kbd",{})}),(0,T.__)("Drag files into the editor to automatically insert media blocks."),(0,T.__)("Change a block's type by pressing the block icon on the toolbar.")];var Rb=function(){const[e]=(0,h.useState)(Math.floor(Math.random()*Pb.length));return(0,d.jsx)(Ss.Tip,{children:Pb[e]})},Ab=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),Nb=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})});const{Badge:Lb}=U(Ss.privateApis);var Db=function({title:e,icon:t,description:n,blockType:o,className:r,name:i,allowParentNavigation:s,children:l}){o&&(I()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=o));const a=(0,g.useSelect)(e=>{if(!s)return;const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(Ii);return n(t(),"core/navigation",!0)[0]},[s]),{selectBlock:c}=(0,g.useDispatch)(Ii);return(0,d.jsxs)("div",{className:gs("block-editor-block-card",r),children:[s&&a&&(0,d.jsx)(Ss.Button,{onClick:()=>c(a),label:(0,T.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0}
2,icon:(0,T.isRTL)()?Ab:Nb,size:"small"}),(0,d.jsx)(Au,{icon:t,showColors:!0}),(0,d.jsxs)(Ss.__experimentalVStack,{spacing:1,children:[(0,d.jsxs)("h2",{className:"block-editor-block-card__title",children:[(0,d.jsx)("span",{className:"block-editor-block-card__name",children:i?.length?i:e}),!!i?.length&&(0,d.jsx)(Lb,{children:e})]}),n&&(0,d.jsx)(Ss.__experimentalText,{className:"block-editor-block-card__description",children:n}),l]})]})},Ob=(e=>(e.Unknown="REDUX_UNKNOWN",e.Add="ADD_ITEM",e.Prepare="PREPARE_ITEM",e.Cancel="CANCEL_ITEM",e.Remove="REMOVE_ITEM",e.PauseItem="PAUSE_ITEM",e.ResumeItem="RESUME_ITEM",e.PauseQueue="PAUSE_QUEUE",e.ResumeQueue="RESUME_QUEUE",e.OperationStart="OPERATION_START",e.OperationFinish="OPERATION_FINISH",e.AddOperations="ADD_OPERATIONS",e.CacheBlobUrl="CACHE_BLOB_URL",e.RevokeBlobUrls="REVOKE_BLOB_URLS",e.UpdateSettings="UPDATE_SETTINGS",e))(Ob||{}),zb=(e=>(e.Processing="PROCESSING",e.Paused="PAUSED",e))(zb||{}),Vb=(e=>(e.Prepare="PREPARE",e.Upload="UPLOAD",e))(Vb||{});const Fb={queue:[],queueStatus:"active",blobUrls:{},settings:{mediaUpload:()=>{}}};var Hb=function(e=Fb,t={type:Ob.Unknown}){switch(t.type){case Ob.PauseQueue:return{...e,queueStatus:"paused"};case Ob.ResumeQueue:return{...e,queueStatus:"active"};case Ob.Add:return{...e,queue:[...e.queue,t.item]};case Ob.Cancel:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,error:t.error}:e)};case Ob.Remove:return{...e,queue:e.queue.filter(e=>e.id!==t.id)};case Ob.OperationStart:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,currentOperation:t.operation}:e)};case Ob.AddOperations:return{...e,queue:e.queue.map(e=>e.id!==t.id?e:{...e,operations:[...e.operations||[],...t.operations]})};case Ob.OperationFinish:return{...e,queue:e.queue.map(e=>{if(e.id!==t.id)return e;const n=e.operations?e.operations.slice(1):[],o=e.attachment||t.item.attachment?{...e.attachment,...t.item.attachment}:void 0;return{...e,currentOperation:void 0,operations:n,...t.item,attachment:o,additionalData:{...e.additionalData,...t.item.additionalData}}})};case Ob.CacheBlobUrl:{const n=e.blobUrls[t.id]||[];return{...e,blobUrls:{...e.blobUrls,[t.id]:[...n,t.blobUrl]}}}case Ob.RevokeBlobUrls:{const n={...e.blobUrls};return delete n[t.id],{...e,blobUrls:n}}case Ob.UpdateSettings:return{...e,settings:{...e.settings,...t.settings}}}return e};function Ub(e){return e.queue}function Gb(e){return e.queue.length>=1}function $b(e,t){return e.queue.some(e=>e.attachment?.url===t||e.sourceUrl===t)}function Wb(e,t){return e.queue.some(e=>e.attachment?.id===t||e.sourceAttachmentId===t)}function Kb(e){return e.settings}function Zb(e){return e.queue}function qb(e,t){return e.queue.find(e=>e.id===t)}function Yb(e,t){return 0===e.queue.filter(e=>t===e.batchId).length}function Xb(e,t){return e.queue.some(e=>e.currentOperation===Vb.Upload&&e.additionalData.post===t)}function Qb(e,t){return e.queue.find(e=>e.status===zb.Paused&&e.additionalData.post===t)}function Jb(e){return"paused"===e.queueStatus}function ek(e,t){return e.blobUrls[t]||[]}const tk={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let nk;const ok=new Uint8Array(16);function rk(){if(!nk&&(nk="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!nk))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return nk(ok)}const ik=[];for(let e=0;e<256;++e)ik.push((e+256).toString(16).slice(1));const sk=function(e,t,n){if(tk.randomUUID&&!t&&!e)return tk.randomUUID();const o=(e=e||{}).random||(e.rng||rk)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=o[e];return t}return function(e,t=0){return ik[e[t+0]]+ik[e[t+1]]+ik[e[t+2]]+ik[e[t+3]]+"-"+ik[e[t+4]]+ik[e[t+5]]+"-"+ik[e[t+6]]+ik[e[t+7]]+"-"+ik[e[t+8]]+ik[e[t+9]]+"-"+ik[e[t+10]]+ik[e[t+11]]+ik[e[t+12]]+ik[e[t+13]]+ik[e[t+14]]+ik[e[t+15]]}(o)};class lk extends Error{code;file;constructor({code:e,message:t,file:n,cause:o}){super(t,{cause:o}),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.file=n}}function ak(e,t){if(!t)return;const n=t.some(t=>t.includes("/")?t===e.type:e.type.startsWith(`${t}/`));if(e.type&&!n)throw new lk({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,T.sprintf)((0,T.__)("%s: Sorry, this file type is not supported here."),e.name),file:e})}function ck(e,t){const n=(o=t)?Object.entries(o).flatMap(([e,t])=>{const[n]=t.split("/");return[t,...e.split("|").map(e=>`${n}/${e}`)]}):null;var o;if(!n)return;const r=n.includes(e.type);if(e.type&&!r)throw new lk({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,T.sprintf)((0,T.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e})}function uk(e,t){if(e.size<=0)throw new lk({code:"EMPTY_FILE",message:(0,T.sprintf)((0,T.__)("%s: This file is empty."),e.name),file:e});if(t&&e.size>t)throw new lk({code:"SIZE_ABOVE_LIMIT",message:(0,T.sprintf)((0,T.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e})}function dk({files:e,onChange:t,onSuccess:n,onError:o,onBatchSuccess:r,additionalData:i,allowedTypes:s}){return async({select:l,dispatch:a})=>{const c=sk();for(const u of e){try{ak(u,s),ck(u,l.getSettings().allowedMimeTypes)}catch(e){o?.(e);continue}try{uk(u,l.getSettings().maxUploadFileSize)}catch(e){o?.(e);continue}a.addItem({file:u,batchId:c,onChange:t,onSuccess:n,onBatchSuccess:r,onError:o,additionalData:i})}}}function pk(e,t,n=!1){return async({select:o,dispatch:r})=>{const i=o.getItem(e);if(i){if(i.abortController?.abort(),!n){const{onError:e}=i;e?.(t??new Error("Upload cancelled")),!e&&t&&console.error("Upload cancelled",t)}r({type:Ob.Cancel,id:e,error:t}),r.removeItem(e),r.revokeBlobUrls(e),i.batchId&&o.isBatchUploaded(i.batchId)&&i.onBatchSuccess?.()}}}function hk(e){return function(e,t){return new File([e],t,{type:e.type,lastModified:e.lastModified})}(e,e.name)}class gk extends File{constructor(e="stub-file"){super([],e)}}function mk({file:e,batchId:t,onChange:n,onSuccess:o,onBatchSuccess:r,onError:i,additionalData:s={},sourceUrl:l,sourceAttachmentId:a,abortController:c,operations:u}
2){return async({dispatch:d})=>{const p=sk(),h=function(e){if(e instanceof File)return e;const t=e.type.split("/")[1],n="application/pdf"===e.type?"document":e.type.split("/")[0];return new File([e],`${n}.${t}`,{type:e.type})}(e);let g;h instanceof gk||(g=(0,Ha.createBlobURL)(h),d({type:Ob.CacheBlobUrl,id:p,blobUrl:g})),d({type:Ob.Add,item:{id:p,batchId:t,status:zb.Processing,sourceFile:hk(h),file:h,attachment:{url:g},additionalData:{convert_format:!1,...s},onChange:n,onSuccess:o,onBatchSuccess:r,onError:i,sourceUrl:l,sourceAttachmentId:a,abortController:c||new AbortController,operations:Array.isArray(u)?u:[Vb.Prepare]}}),d.processItem(p)}}function fk(e){return async({select:t,dispatch:n})=>{if(t.isPaused())return;const o=t.getItem(e),{attachment:r,onChange:i,onSuccess:s,onBatchSuccess:l,batchId:a}=o,c=Array.isArray(o.operations?.[0])?o.operations[0][0]:o.operations?.[0];if(r&&i?.([r]),!c)return r&&s?.([r]),n.revokeBlobUrls(e),void(a&&t.isBatchUploaded(a)&&l?.());if(c)switch(n({type:Ob.OperationStart,id:e,operation:c}),c){case Vb.Prepare:n.prepareItem(o.id);break;case Vb.Upload:n.uploadItem(e)}}}function bk(){return{type:Ob.PauseQueue}}function kk(){return async({select:e,dispatch:t})=>{t({type:Ob.ResumeQueue});for(const n of e.getAllItems())t.processItem(n.id)}}function vk(e){return async({select:t,dispatch:n})=>{t.getItem(e)&&n({type:Ob.Remove,id:e})}}function _k(e,t){return async({dispatch:n})=>{n({type:Ob.OperationFinish,id:e,item:t}),n.processItem(e)}}function yk(e){return async({dispatch:t})=>{const n=[Vb.Upload];t({type:Ob.AddOperations,id:e,operations:n}),t.finishOperation(e,{})}}function xk(e){return async({select:t,dispatch:n})=>{const o=t.getItem(e);t.getSettings().mediaUpload({filesList:[o.file],additionalData:o.additionalData,signal:o.abortController?.signal,onFileChange:([t])=>{(0,Ha.isBlobURL)(t.url)||n.finishOperation(e,{attachment:t})},onSuccess:([t])=>{n.finishOperation(e,{attachment:t})},onError:t=>{n.cancelItem(e,t)}})}}function Sk(e){return async({select:t,dispatch:n})=>{const o=t.getBlobUrls(e);for(const e of o)(0,Ha.revokeBlobURL)(e);n({type:Ob.RevokeBlobUrls,id:e})}}function wk(e){return{type:Ob.UpdateSettings,settings:e}}const{lock:Ck,unlock:Bk}=(0,F.__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/upload-media"),Ik="core/upload-media",jk={reducer:Hb,selectors:s,actions:a},Ek=(0,g.createReduxStore)(Ik,{reducer:Hb,selectors:s,actions:a});(0,g.register)(Ek),Bk(Ek).registerPrivateActions(c),Bk(Ek).registerPrivateSelectors(l);const Tk=(0,m.createHigherOrderComponent)(e=>({useSubRegistry:t=!0,...n})=>{const o=(0,g.useRegistry)(),[r]=(0,h.useState)(()=>new WeakMap),i=function(e,t,n){if(!n)return t;let o=e.get(t);return o||(o=(0,g.createRegistry)({},t),o.registerStore(Ik,jk),e.set(t,o)),o}(r,o,t);return i===o?(0,d.jsx)(e,{registry:o,...n}):(0,d.jsx)(g.RegistryProvider,{value:i,children:(0,d.jsx)(e,{registry:i,...n})})},"withRegistryProvider")(e=>{const{children:t,settings:n}=e,{updateSettings:o}=Bk((0,g.useDispatch)(Ek));return(0,h.useEffect)(()=>{o(n)},[n,o]),(0,d.jsx)(d.Fragment,{children:t})});var Mk=Tk,Pk=(0,m.createHigherOrderComponent)(e=>({useSubRegistry:t=!0,...n})=>{const o=(0,g.useRegistry)(),[r]=(0,h.useState)(()=>new WeakMap),i=function(e,t,n){if(!n)return t;let o=e.get(t);return o||(o=(0,g.createRegistry)({},t),o.registerStore(he,Bi),e.set(t,o)),o}(r,o,t);return i===o?(0,d.jsx)(e,{registry:o,...n}):(0,d.jsx)(g.RegistryProvider,{value:i,children:(0,d.jsx)(e,{registry:i,...n})})},"withRegistryProvider");const Rk=()=>{};function Ak({clientId:e=null,value:t,selection:n,onChange:o=Rk,onInput:r=Rk}){const i=(0,g.useRegistry)(),{resetBlocks:s,resetSelection:l,replaceInnerBlocks:a,setHasControlledInnerBlocks:c,__unstableMarkNextChangeAsNotPersistent:u}=i.dispatch(Ii),{getBlockName:d,getBlocks:m,getSelectionStart:f,getSelectionEnd:b}=i.select(Ii),k=(0,g.useSelect)(t=>!e||t(Ii).areInnerBlocksControlled(e),[e]),v=(0,h.useRef)({incoming:null,outgoing:[]}),_=(0,h.useRef)(!1),y=()=>{t&&(u(),e?i.batch(()=>{c(e,!0);const n=t.map(e=>(0,p.cloneBlock)(e));_.current&&(v.current.incoming=n),u(),a(e,n)}):(_.current&&(v.current.incoming=t),s(t)))},x=(0,h.useRef)(r),S=(0,h.useRef)(o);(0,h.useEffect)(()=>{x.current=r,S.current=o},[r,o]),(0,h.useEffect)(()=>{v.current.outgoing.includes(t)?v.current.outgoing[v.current.outgoing.length-1]===t&&(v.current.outgoing=[]):m(e)!==t&&(v.current.outgoing=[],y(),n&&l(n.selectionStart,n.selectionEnd,n.initialPosition))},[t,e]);const w=(0,h.useRef)(!1);(0,h.useEffect)(()=>{w.current?k||(v.current.outgoing=[],y()):w.current=!0},[k]),(0,h.useEffect)(()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:o,areInnerBlocksControlled:r}=i.select(Ii);let s=m(e),l=n(),a=!1;_.current=!0;const c=i.subscribe(()=>{if(null!==e&&null===d(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);(u||a&&!u&&i&&!l)&&(l=i,v.current.outgoing.push(s),(l?S.current:x.current)(s,{selection:{selectionStart:f(),selectionEnd:b(),initialPosition:t()}})),a=u},Ii);return()=>{_.current=!1,c()}},[i,e]),(0,h.useEffect)(()=>()=>{u(),e?(c(e,!1),u(),a(e,[])):s([])},[])}const Nk=window.wp.keyboardShortcuts;function Lk(){return null}Lk.Register=function(){const{registerShortcut:e}=(0,g.useDispatch)(Nk.store);return(0,h.useEffect)(()=>
2{e({name:"core/block-editor/copy",category:"block",description:(0,T.__)("Copy the selected block(s)."),keyCombination:{modifier:"primary",character:"c"}}),e({name:"core/block-editor/cut",category:"block",description:(0,T.__)("Cut the selected block(s)."),keyCombination:{modifier:"primary",character:"x"}}),e({name:"core/block-editor/paste",category:"block",description:(0,T.__)("Paste the selected block(s)."),keyCombination:{modifier:"primary",character:"v"}}),e({name:"core/block-editor/duplicate",category:"block",description:(0,T.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,T.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/paste-styles",category:"block",description:(0,T.__)("Paste the copied style to the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"v"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,T.__)("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,T.__)("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,T.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,T.__)("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,T.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,T.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,T.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,T.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,T.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}}),e({name:"core/block-editor/collapse-list-view",category:"list-view",description:(0,T.__)("Collapse all other items."),keyCombination:{modifier:"alt",character:"l"}}),e({name:"core/block-editor/group",category:"block",description:(0,T.__)("Create a group block from the selected multiple blocks."),keyCombination:{modifier:"primary",character:"g"}}),e({name:"core/block-editor/toggle-block-visibility",category:"block",description:(0,T.__)("Show or hide the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"h"}})},[e]),null};var Dk=Lk;const Ok=()=>{};function zk(e,{allowedTypes:t,additionalData:n={},filesList:o,onError:r=Ok,onFileChange:i,onSuccess:s,onBatchSuccess:l}){e.dispatch(Ek).addItems({files:o,onChange:i,onSuccess:s,onBatchSuccess:l,onError:({message:e})=>r(e),additionalData:n,allowedTypes:t})}const Vk=Pk(e=>{const{settings:t,registry:n,stripExperimentalSettings:o=!1}=e,r=function(e={}){return(0,h.useMemo)(()=>({mediaUpload:e.mediaUpload,mediaSideload:e.mediaSideload,maxUploadFileSize:e.maxUploadFileSize,allowedMimeTypes:e.allowedMimeTypes}),[e])}(t);let i=t;window.__experimentalMediaProcessing&&t.mediaUpload&&(i=(0,h.useMemo)(()=>({...t,mediaUpload:zk.bind(null,n)}),[t,n]));const{__experimentalUpdateSettings:s}=U((0,g.useDispatch)(Ii));(0,h.useEffect)(()=>{s({...i,__internalIsInitialized:!0},{stripExperimentalSettings:o,reset:!0})},[i,o,s]),Ak(e);const l=(0,d.jsxs)(Ss.SlotFillProvider,{passthrough:!0,children:[!i?.isPreviewMode&&(0,d.jsx)(Dk.Register,{}),(0,d.jsx)(ih,{children:e.children})]});return window.__experimentalMediaProcessing?(0,d.jsx)(Mk,{settings:r,useSubRegistry:!1,children:l}):l});var Fk=e=>(0,d.jsx)(Vk,{...e,stripExperimentalSettings:!0,children:e.children});const Hk=(0,h.createContext)({});function Uk({value:e,children:t}){const n=(0,h.useContext)(Hk),o=(0,h.useMemo)(()=>({...n,...e}),[n,e]);return(0,d.jsx)(Hk.Provider,{value:o,children:t})}Hk.displayName="BlockContext";var Gk=Hk;const $k="core/pattern-overrides";function Wk(e){return!e||0===Object.keys(e).length}function Kk(e){return e?.__default?.source===$k}function Zk(e,t){if(Kk(e)){const n={};for(const o of t){const t=e[o]?e[o]:{source:$k};n[o]=t}return n}return e}function qk(e){const{clientId:t}=C(),n=e||t,{updateBlockAttributes:o}=(0,g.useDispatch)(Ii),{getBlockAttributes:r}=(0,g.useRegistry)().select(Ii);return{updateBlockBindings:e=>{const{metadata:{bindings:t,...i}={}}=r(n),s={...t};Object.entries(e).forEach(([e,t])=>{t||!s[e]?s[e]=t:delete s[e]});const l={...i,bindings:s};Wk(l.bindings)&&delete l.bindings,o(n,{metadata:Wk(l)?void 0:l})},removeAllBlockBindings:()=>{const{metadata:{bindings:e,...t}={}}=r(n);o(n,{metadata:Wk(t)?void 0:t})}}}const Yk=(0,h.createContext)({});Yk.displayName="PrivateBlockContext";const Xk={},Qk=(0,Ss.withFilters)("editor.BlockEdit")(e=>{const{name:t}=e,n=(0,p.getBlockType)(t);if(!n)return null;const o=n.edit||n.save;return(0,d.jsx)(o,{...e})});var Jk=e=>{const{name:t,clientId:n,attributes:o,setAttributes:r}=e,i=(0,g.useRegistry)(),s=(0,p.getBlockType)(t),l=(0,h.useContext)(Gk),a=(0,g.useSelect)(e=>U(e(p.store)).getAllBlockBindingsSources(),[]),{bindableAttributes:c}=(0,h.useContext)(Yk),{blockBindings:u,context:m,hasPatternOverrides:f}=(0,h.useMemo)(()=>{const e=s?.usesContext?Object.fromEntries(Object.entries(l).filter(([e])=>s.usesContext.includes(e))):Xk;return o?.metadata?.bindings&&Object.values(o?.metadata?.bindings||{}
2).forEach(t=>{a[t?.source]?.usesContext?.forEach(t=>{e[t]=l[t]})}),{blockBindings:Zk(o?.metadata?.bindings,c),context:e,hasPatternOverrides:Kk(o?.metadata?.bindings)}},[t,s?.usesContext,l,o?.metadata?.bindings,a]),b=(0,g.useSelect)(e=>{if(!u)return o;const t={},r=new Map;for(const[e,t]of Object.entries(u)){const{source:n,args:o}=t,i=a[n];i&&c?.includes(e)&&r.set(i,{...r.get(i),[e]:{args:o}})}if(r.size)for(const[o,i]of r){let r={};o.getValues?r=o.getValues({select:e,context:m,clientId:n,bindings:i}):Object.keys(i).forEach(e=>{r[e]=o.label});for(const[e,n]of Object.entries(r))"url"!==e||n&&Rc(n)?t[e]=n:t[e]=null}return{...o,...t}},[o,c,u,n,m,t,a]),k=(0,h.useCallback)(e=>{u?i.batch(()=>{const t={...e},o=new Map;for(const[e,n]of Object.entries(t)){if(!u[e]||!c?.includes(e))continue;const r=u[e],i=a[r?.source];i?.setValues&&(o.set(i,{...o.get(i),[e]:{args:r.args,newValue:n}}),delete t[e])}if(o.size)for(const[e,t]of o)e.setValues({select:i.select,dispatch:i.dispatch,context:m,clientId:n,bindings:t});const s=!!m["pattern/overrides"];f&&s||!Object.keys(t).length||(f&&(delete t.caption,delete t.href),r(t))}):r(e)},[c,u,n,m,f,r,a,t,i]);if(!s)return null;if(s.apiVersion>1)return(0,d.jsx)(Qk,{...e,attributes:b,context:m,setAttributes:k});const v=(0,p.hasBlockSupport)(s,"className",!0)?(0,p.getBlockDefaultClassName)(t):null,_=gs(v,o?.className,e.className);return(0,d.jsx)(Qk,{...e,attributes:b,className:_,context:m,setAttributes:k})},ev=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),tv=function({className:e,actions:t,children:n,secondaryActions:o}){return(0,d.jsx)("div",{style:{display:"contents",all:"initial"},children:(0,d.jsx)("div",{className:gs(e,"block-editor-warning"),children:(0,d.jsxs)("div",{className:"block-editor-warning__contents",children:[(0,d.jsx)("p",{className:"block-editor-warning__message",children:n}),(t?.length>0||o)&&(0,d.jsxs)("div",{className:"block-editor-warning__actions",children:[t?.length>0&&t.map((e,t)=>(0,d.jsx)("span",{className:"block-editor-warning__action",children:e},t)),o&&(0,d.jsx)(Ss.DropdownMenu,{className:"block-editor-warning__secondary",icon:ev,label:(0,T.__)("More options"),popoverProps:{placement:"bottom-end",className:"block-editor-warning__dropdown"},noIcons:!0,children:()=>(0,d.jsx)(Ss.MenuGroup,{children:o.map((e,t)=>(0,d.jsx)(Ss.MenuItem,{onClick:e.onClick,children:e.title},t))})})]})]})})})};function nv({originalBlockClientId:e,name:t,onReplace:n}){const{selectBlock:o}=(0,g.useDispatch)(Ii),r=(0,p.getBlockType)(t);return(0,d.jsxs)(tv,{actions:[(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>o(e),children:(0,T.__)("Find original")},"find-original"),(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>n([]),children:(0,T.__)("Remove")},"remove")],children:[(0,d.jsxs)("strong",{children:[r?.title,": "]}),(0,T.__)("This block can only be used once.")]})}function ov({mayDisplayControls:e,mayDisplayParentControls:t,blockEditingMode:n,isPreviewMode:o,...r}){const{name:i,isSelected:s,clientId:l,attributes:a={},__unstableLayoutClassNames:c}=r,{layout:u=null,metadata:g={}}=a,{bindings:m}=g,f=(0,p.hasBlockSupport)(i,"layout",!1)||(0,p.hasBlockSupport)(i,"__experimentalLayout",!1),{originalBlockClientId:x}=(0,h.useContext)(Yk);return(0,d.jsxs)(w,{value:(0,h.useMemo)(()=>({name:i,isSelected:s,clientId:l,layout:f?u:null,__unstableLayoutClassNames:c,[b]:e,[k]:t,[v]:n,[_]:m,[y]:o}),[i,s,l,f,u,c,e,t,n,m,o]),children:[(0,d.jsx)(Jk,{...r}),x&&(0,d.jsx)(nv,{originalBlockClientId:x,name:i,onReplace:r.onReplace})]})}var rv=n(6687);function iv({title:e,rawContent:t,renderedContent:n,action:o,actionText:r,className:i}){return(0,d.jsxs)("div",{className:i,children:[(0,d.jsxs)("div",{className:"block-editor-block-compare__content",children:[(0,d.jsx)("h2",{className:"block-editor-block-compare__heading",children:e}),(0,d.jsx)("div",{className:"block-editor-block-compare__html",children:t}),(0,d.jsx)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor",children:(0,d.jsx)(h.RawHTML,{children:(0,Fa.safeHTML)(n)})})]}),(0,d.jsx)("div",{className:"block-editor-block-compare__action",children:(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"secondary",tabIndex:"0",onClick:o,children:r})})]})}var sv=function({block:e,onKeep:t,onConvert:n,convertor:o,convertButtonText:r}){const i=(s=o(e),(Array.isArray(s)?s:[s]).map(e=>(0,p.getSaveContent)(e.name,e.attributes,e.innerBlocks)).join(""));var s;const l=(a=e.originalContent,c=i,(0,rv.JJ)(a,c).map((e,t)=>{const n=gs({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,d.jsx)("span",{className:n,children:e.value},t)}));var a,c;return(0,d.jsxs)("div",{className:"block-editor-block-compare__wrapper",children:[(0,d.jsx)(iv,{title:(0,T.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,T.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,d.jsx)(iv,{title:(0,T.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:r,rawContent:l,renderedContent:i})]})};const lv=e=>(0,p.rawHandler)({HTML:e.originalContent});function av({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:o}=(0,g.useSelect)(t=>
2{const{canInsertBlockType:n,getBlock:o,getBlockRootClientId:r}=t(Ii),i=r(e);return{block:o(e),canInsertHTMLBlock:n("core/html",i),canInsertClassicBlock:n("core/freeform",i)}},[e]),{replaceBlock:r}=(0,g.useDispatch)(Ii),[i,s]=(0,h.useState)(!1),l=(0,h.useCallback)(()=>s(!1),[]),a=(0,h.useMemo)(()=>({toClassic(){const e=(0,p.createBlock)("core/freeform",{content:t.originalContent});return r(t.clientId,e)},toHTML(){const e=(0,p.createBlock)("core/html",{content:t.originalContent});return r(t.clientId,e)},toBlocks(){const e=lv(t);return r(t.clientId,e)},toRecoveredBlock(){const e=(0,p.createBlock)(t.name,t.attributes,t.innerBlocks);return r(t.clientId,e)}}),[t,r]),c=(0,h.useMemo)(()=>[{title:(0,T._x)("Resolve","imperative verb"),onClick:()=>s(!0)},n&&{title:(0,T.__)("Convert to HTML"),onClick:a.toHTML},o&&{title:(0,T.__)("Convert to Classic Block"),onClick:a.toClassic}].filter(Boolean),[n,o,a]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(tv,{actions:[(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,onClick:a.toRecoveredBlock,variant:"primary",children:(0,T.__)("Attempt recovery")},"recover")],secondaryActions:c,children:(0,T.__)("Block contains unexpected or invalid content.")}),i&&(0,d.jsx)(Ss.Modal,{title:(0,T.__)("Resolve Block"),onRequestClose:l,className:"block-editor-block-compare",children:(0,d.jsx)(sv,{block:t,onKeep:a.toHTML,onConvert:a.toBlocks,convertor:lv,convertButtonText:(0,T.__)("Convert to Blocks")})})]})}const cv=(0,d.jsx)(tv,{className:"block-editor-block-list__block-crash-warning",children:(0,T.__)("This block has encountered an error and cannot be previewed.")});var uv=()=>cv;class dv extends h.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var pv=dv,hv=n(5323),gv=function({clientId:e}){const[t,n]=(0,h.useState)(""),o=(0,g.useSelect)(t=>t(Ii).getBlock(e),[e]),{updateBlock:r}=(0,g.useDispatch)(Ii);return(0,h.useEffect)(()=>{n((0,p.getBlockContent)(o))},[o]),(0,d.jsx)(hv.A,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const i=(0,p.getBlockType)(o.name);if(!i)return;const s=(0,p.getBlockAttributes)(i,t,o.attributes),l=t||(0,p.getSaveContent)(i,s),[a]=t?(0,p.validateBlock)({...o,attributes:s,originalContent:l}):[!0];r(e,{attributes:s,originalContent:l,isValid:a}),t||n(l)},onChange:e=>n(e.target.value)})},mv=Mv(),fv=e=>Iv(e,mv),bv=Mv();fv.write=e=>Iv(e,bv);var kv=Mv();fv.onStart=e=>Iv(e,kv);var vv=Mv();fv.onFrame=e=>Iv(e,vv);var _v=Mv();fv.onFinish=e=>Iv(e,_v);var yv=[];fv.setTimeout=(e,t)=>{const n=fv.now()+t,o=()=>{const e=yv.findIndex(e=>e.cancel==o);~e&&yv.splice(e,1),Cv-=~e?1:0},r={time:n,handler:e,cancel:o};return yv.splice(xv(n),0,r),Cv+=1,jv(),r};var xv=e=>~(~yv.findIndex(t=>t.time>e)||~yv.length);fv.cancel=e=>{kv.delete(e),vv.delete(e),_v.delete(e),mv.delete(e),bv.delete(e)},fv.sync=e=>{Bv=!0,fv.batchedUpdates(e),Bv=!1},fv.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,fv.onStart(n)}return o.handler=e,o.cancel=()=>{kv.delete(n),t=null},o};var Sv="undefined"!=typeof window?window.requestAnimationFrame:()=>{};fv.use=e=>Sv=e,fv.now="undefined"!=typeof performance?()=>performance.now():Date.now,fv.batchedUpdates=e=>e(),fv.catch=console.error,fv.frameLoop="always",fv.advance=()=>{"demand"!==fv.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Tv()};var wv=-1,Cv=0,Bv=!1;function Iv(e,t){Bv?(t.delete(e),e(0)):(t.add(e),jv())}function jv(){wv<0&&(wv=0,"demand"!==fv.frameLoop&&Sv(Ev))}function Ev(){~wv&&(Sv(Ev),fv.batchedUpdates(Tv))}function Tv(){const e=wv;wv=fv.now();const t=xv(wv);t&&(Pv(yv.splice(0,t),e=>e.handler()),Cv-=t),Cv?(kv.flush(),mv.flush(e?Math.min(64,wv-e):16.667),vv.flush(),bv.flush(),_v.flush()):wv=-1}function Mv(){let e=new Set,t=e;return{add(n){Cv+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Cv-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Cv-=t.size,Pv(t,t=>t(n)&&e.add(t)),Cv+=e.size,t=e)}}}
vendor: 6,487 bytes, line 2
2function Pv(e,t){e.forEach(e=>{try{t(e)}catch(e){fv.catch(e)}})}var Rv=Object.defineProperty,Av={};function Nv(){}((e,t)=>{for(var n in t)Rv(e,n,{get:t[n],enumerable:!0})})(Av,{assign:()=>qv,colors:()=>Wv,createStringInterpolator:()=>Hv,skipAnimation:()=>Kv,to:()=>Uv,willAdvance:()=>Zv});var Lv={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Dv(e,t){if(Lv.arr(e)){if(!Lv.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 Ov=(e,t)=>e.forEach(t);function zv(e,t,n){if(Lv.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}var Vv=e=>Lv.und(e)?[]:Lv.arr(e)?e:[e];function Fv(e,t){if(e.size){const n=Array.from(e);e.clear(),Ov(n,t)}}var Hv,Uv,Gv=(e,...t)=>Fv(e,e=>e(...t)),$v=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Wv=null,Kv=!1,Zv=Nv,qv=e=>{e.to&&(Uv=e.to),e.now&&(fv.now=e.now),void 0!==e.colors&&(Wv=e.colors),null!=e.skipAnimation&&(Kv=e.skipAnimation),e.createStringInterpolator&&(Hv=e.createStringInterpolator),e.requestAnimationFrame&&fv.use(e.requestAnimationFrame),e.batchedUpdates&&(fv.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Zv=e.willAdvance),e.frameLoop&&(fv.frameLoop=e.frameLoop)},Yv=new Set,Xv=[],Qv=[],Jv=0,e_={get idle(){return!Yv.size&&!Xv.length},start(e){Jv>e.priority?(Yv.add(e),fv.onStart(t_)):(n_(e),fv(r_))},advance:r_,sort(e){if(Jv)fv.onFrame(()=>e_.sort(e));else{const t=Xv.indexOf(e);~t&&(Xv.splice(t,1),o_(e))}},clear(){Xv=[],Yv.clear()}};function t_(){Yv.forEach(n_),Yv.clear(),fv(r_)}function n_(e){Xv.includes(e)||o_(e)}function o_(e){Xv.splice(function(t){const n=t.findIndex(t=>t.priority>e.priority);return n<0?t.length:n}(Xv),0,e)}function r_(e){const t=Qv;for(let n=0;n<Xv.length;n++){const o=Xv[n];Jv=o.priority,o.idle||(Zv(o),o.advance(e),o.idle||t.push(o))}return Jv=0,(Qv=Xv).length=0,(Xv=t).length>0}var i_="[-+]?\\d*\\.?\\d+",s_=i_+"%";function l_(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var a_=new RegExp("rgb"+l_(i_,i_,i_)),c_=new RegExp("rgba"+l_(i_,i_,i_,i_)),u_=new RegExp("hsl"+l_(i_,s_,s_)),d_=new RegExp("hsla"+l_(i_,s_,s_,i_)),p_=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,h_=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,g_=/^#([0-9a-fA-F]{6})$/,m_=/^#([0-9a-fA-F]{8})$/;function f_(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 b_(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,i=f_(r,o,e+1/3),s=f_(r,o,e),l=f_(r,o,e-1/3);return Math.round(255*i)<<24|Math.round(255*s)<<16|Math.round(255*l)<<8}function k_(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function v_(e){return(parseFloat(e)%360+360)%360/360}function __(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function y_(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function x_(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=g_.exec(e))?parseInt(t[1]+"ff",16)>>>0:Wv&&void 0!==Wv[e]?Wv[e]:(t=a_.exec(e))?(k_(t[1])<<24|k_(t[2])<<16|k_(t[3])<<8|255)>>>0:(t=c_.exec(e))?(k_(t[1])<<24|k_(t[2])<<16|k_(t[3])<<8|__(t[4]))>>>0:(t=p_.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=m_.exec(e))?parseInt(t[1],16)>>>0:(t=h_.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=u_.exec(e))?(255|b_(v_(t[1]),y_(t[2]),y_(t[3])))>>>0:(t=d_.exec(e))?(b_(v_(t[1]),y_(t[2]),y_(t[3]))|__(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 S_=(e,t,n)=>{if(Lv.fun(e))return e;if(Lv.arr(e))return S_({range:e,output:t,extrapolate:n});if(Lv.str(e.output[0]))return Hv(e);const 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=>{const 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)}},w_=1.70158,C_=1.525*w_,B_=w_+1,I_=2*Math.PI/3,j_=2*Math.PI/4.5,E_=e=>{const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},T_={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=>B_*e*e*e-w_*e*e,easeOutBack:e=>1+B_*Math.pow(e-1,3)+w_*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-C_)/2:(Math.pow(2*e-2,2)*((C_+1)*(2*e-2)+C_)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*I_),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*I_)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*j_)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*j_)/2+1,easeInBounce:e=>1-E_(1-e),easeOutBounce:E_,easeInOutBounce:e=>e<.5?(1-E_(1-2*e))/2:(1+E_(2*e-1))/2,steps:(e,t="end")=>n=>{const o=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,0),1))(0,0,("end"===t?Math.floor(o):Math.ceil(o))/e)}},M_=Symbol.for("FluidValue.get"),P_=Symbol.for("FluidValue.observers"),R_=e=>Boolean(e&&e[M_]),A_=e=>e&&e[M_]?e[M_]():e,N_=e=>e[P_]||null;function L_(e,t){const n=e[P_];
2n&&n.forEach(e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)})}var D_=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");O_(this,e)}},O_=(e,t)=>H_(e,M_,t);function z_(e,t){if(e[M_]){let n=e[P_];n||H_(e,P_,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function V_(e,t){const n=e[P_];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[P_]=null,e.observerRemoved&&e.observerRemoved(o,t)}}var F_,H_=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),U_=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,G_=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,$_=new RegExp(`(${U_.source})(%|[a-z]+)`,"i"),W_=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,K_=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Z_=e=>{const[t,n]=q_(e);if(!t||$v())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&K_.test(n)?Z_(n):n||e},q_=e=>{const t=K_.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]},Y_=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,X_=e=>{F_||(F_=Wv?new RegExp(`(${Object.keys(Wv).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(e=>A_(e).replace(K_,Z_).replace(G_,x_).replace(F_,x_)),n=t.map(e=>e.match(U_).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]})),r=o.map(t=>S_({...e,output:t}));return e=>{const n=!$_.test(t[0])&&t.find(e=>$_.test(e))?.replace(U_,"");let o=0;return t[0].replace(U_,()=>`${r[o++](e)}${n||""}`).replace(W_,Y_)}},Q_="react-spring: ",J_=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Q_}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},ey=J_(console.warn);function ty(e){return Lv.str(e)&&("#"==e[0]||/\d/.test(e)||!$v()&&K_.test(e)||e in(Wv||{}))}J_(console.warn);var ny=$v()?nc.useEffect:nc.useLayoutEffect;var oy=[],ry=Symbol.for("Animated:node"),iy=e=>e&&e[ry],sy=(e,t)=>{return n=e,o=ry,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},ly=e=>e&&e[ry]&&e[ry].getPayload(),ay=class{constructor(){sy(this,this)}getPayload(){return this.payload||[]}},cy=class extends ay{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,Lv.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new cy(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Lv.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,Lv.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},uy=class extends cy{constructor(e){super(0),this._string=null,this._toString=S_({output:[e,e]})}static create(e){return new uy(e)}getValue(){const e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Lv.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=S_({output:[this.getValue(),e]})),this._value=0,super.reset()}},dy={dependencies:null},py=class extends ay{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return zv(this.source,(n,o)=>{var r;(r=n)&&r[ry]===r?t[o]=n.getValue(e):R_(n)?t[o]=A_(n):e||(t[o]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Ov(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return zv(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){dy.dependencies&&R_(e)&&dy.dependencies.add(e);const t=ly(e);t&&Ov(t,e=>this.add(e))}},hy=class extends py{constructor(e){super(e)}static create(e){return new hy(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((t,n)=>
2t.setValue(e[n])).some(Boolean):(super.setValue(e.map(gy)),!0)}};function gy(e){return(ty(e)?uy:cy).create(e)}function my(e){const t=iy(e);return t?t.constructor:Lv.arr(e)?hy:ty(e)?uy:cy}var fy=(e,t)=>{const n=!Lv.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,nc.forwardRef)((o,r)=>{const i=(0,nc.useRef)(null),s=n&&(0,nc.useCallback)(e=>{i.current=function(e,t){return e&&(Lv.fun(e)?e(t):e.current=t),t}(r,e)},[r]),[l,a]=function(e,t){const n=new Set;return dy.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new py(e),dy.dependencies=null,[e,n]}(o,t),c=function(){const e=(0,nc.useState)()[1],t=(()=>{const e=(0,nc.useRef)(!1);return ny(()=>(e.current=!0,()=>{e.current=!1}),[]),e})();return()=>{t.current&&e(Math.random())}}(),u=()=>{const e=i.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,l.getValue(!0)))&&c()},d=new by(u,a),p=(0,nc.useRef)();var h;ny(()=>(p.current=d,Ov(a,e=>z_(e,d)),()=>{p.current&&(Ov(p.current.deps,e=>V_(e,p.current)),fv.cancel(p.current.update))})),(0,nc.useEffect)(u,[]),h=()=>()=>{const e=p.current;Ov(e.deps,t=>V_(t,e))},(0,nc.useEffect)(h,oy);const g=t.getComponentProps(l.getValue());return nc.createElement(e,{...g,ref:s})})},by=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&fv.write(this.update)}},ky=Symbol.for("AnimatedComponent"),vy=e=>Lv.str(e)?e:e&&Lv.str(e.displayName)?e.displayName:Lv.fun(e)&&e.name||null;function _y(e,...t){return Lv.fun(e)?e(...t):e}var yy=(e,t)=>!0===e||!!(t&&e&&(Lv.fun(e)?e(t):Vv(e).includes(t))),xy=(e,t)=>Lv.obj(e)?t&&e[t]:e,Sy=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,wy=e=>e,Cy=(e,t=wy)=>{let n=By;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);Lv.und(n)||(o[r]=n)}return o},By=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Iy={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 jy(e){const t=function(e){const t={};let n=0;if(zv(e,(e,o)=>{Iy[o]||(t[o]=e,n++)}),n)return t}(e);if(t){const n={to:t};return zv(e,(e,o)=>o in t||(n[o]=e)),n}return{...e}}function Ey(e){return e=A_(e),Lv.arr(e)?e.map(Ey):ty(e)?Av.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Ty(e){return Lv.fun(e)||Lv.arr(e)&&Lv.obj(e[0])}var My={tension:170,friction:26,mass:1,damping:1,easing:T_.linear,clamp:!1},Py=class{constructor(){this.velocity=0,Object.assign(this,My)}};function Ry(e,t){if(Lv.und(t.decay)){const n=!Lv.und(t.tension)||!Lv.und(t.friction);!n&&Lv.und(t.frequency)&&Lv.und(t.damping)&&Lv.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var Ay=[],Ny=class{constructor(){this.changed=!1,this.values=Ay,this.toValues=null,this.fromValues=Ay,this.config=new Py,this.immediate=!1}};function Ly(e,{key:t,props:n,defaultProps:o,state:r,actions:i}){return new Promise((s,l)=>{let a,c,u=yy(n.cancel??o?.cancel,t);if(u)h();else{Lv.und(n.pause)||(r.paused=yy(n.pause,t));let e=o?.pause;!0!==e&&(e=r.paused||yy(e,t)),a=_y(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-fv.now()}function p(){a>0&&!Av.skipAnimation?(r.delayed=!0,c=fv.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 Dy=(e,t)=>1==t.length?t[0]:t.some(e=>e.cancelled)?Vy(e.get()):t.every(e=>e.noop)?Oy(e.get()):zy(e.get(),t.every(e=>e.finished)),Oy=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),zy=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Vy=e=>({value:e,cancelled:!0,finished:!1});function Fy(e,t,n,o){const{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;const c=Cy(t,(e,t)=>"onRest"===t?void 0:e);let u,d;const p=new Promise((e,t)=>
2(u=e,d=t)),h=e=>{const t=r<=(n.cancelId||0)&&Vy(o)||r!==n.asyncId&&zy(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const i=new Uy,s=new Gy;return(async()=>{if(Av.skipAnimation)throw Hy(n),s.result=zy(o,!1),d(s),s;h(i);const l=Lv.obj(e)?{...e}:{...t,to:e};l.parentId=r,zv(c,(e,t)=>{Lv.und(l[t])&&(l[t]=e)});const a=await o.start(l);return h(i),n.paused&&await new Promise(e=>{n.resumeQueue.add(e)}),a})()};let m;if(Av.skipAnimation)return Hy(n),zy(o,!1);try{let t;t=Lv.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(u),p]),m=zy(o.get(),!0,!1)}catch(e){if(e instanceof Uy)m=e.result;else{if(!(e instanceof Gy))throw e;m=e.result}}finally{r==n.asyncId&&(n.asyncId=i,n.asyncTo=i?l:void 0,n.promise=i?a:void 0)}return Lv.fun(s)&&fv.batchedUpdates(()=>{s(m,o,o.item)}),m})():a}function Hy(e,t){Fv(e.timeouts,e=>e.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var Uy=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},Gy=class extends Error{constructor(){super("SkipAnimationSignal")}},$y=e=>e instanceof Ky,Wy=1,Ky=class extends D_{constructor(){super(...arguments),this.id=Wy++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=iy(this);return e&&e.getValue()}to(...e){return Av.to(this,e)}interpolate(...e){return ey(`${Q_}The "interpolate" function is deprecated in v9 (use "to" instead)`),Av.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){L_(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||e_.sort(this),L_(this,{type:"priority",parent:this,priority:e})}},Zy=Symbol.for("SpringPhase"),qy=e=>(1&e[Zy])>0,Yy=e=>(2&e[Zy])>0,Xy=e=>(4&e[Zy])>0,Qy=(e,t)=>t?e[Zy]|=3:e[Zy]&=-3,Jy=(e,t)=>t?e[Zy]|=4:e[Zy]&=-5,ex=class extends Ky{constructor(e,t){if(super(),this.animation=new Ny,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Lv.und(e)||!Lv.und(t)){const n=Lv.obj(e)?{...e}:{...t,from:e};Lv.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Yy(this)||this._state.asyncTo)||Xy(this)}get goal(){return A_(this.animation.to)}get velocity(){const e=iy(this);return e instanceof cy?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return qy(this)}get isAnimating(){return Yy(this)}get isPaused(){return Xy(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{toValues:r}=o;const{config:i}=o,s=ly(o.to);!s&&R_(o.to)&&(r=Vv(A_(o.to))),o.values.forEach((l,a)=>{if(l.done)return;const c=l.constructor==uy?1:s?s[a].lastPosition:r[a];let u=o.immediate,d=c;if(!u){if(d=l.lastPosition,i.tension<=0)return void(l.done=!0);let t=l.elapsedTime+=e;const n=o.fromValues[a],r=null!=l.v0?l.v0:l.v0=Lv.arr(i.velocity)?i.velocity[a]:i.velocity;let s;const p=i.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n)));if(Lv.und(i.duration))if(i.decay){const e=!0===i.decay?.998:i.decay,o=Math.exp(-(1-e)*t);d=n+r/(1-e)*(1-o),u=Math.abs(l.lastPosition-d)<=p,s=r*o}else{s=null==l.lastVelocity?r:l.lastVelocity;const t=i.restVelocity||p/10,o=i.clamp?0:i.bounce,a=!Lv.und(o),h=n==c?l.v0>0:n<c;let g,m=!1;const f=1,b=Math.ceil(e/f);for(let e=0;e<b&&(g=Math.abs(s)>t,g||(u=Math.abs(c-d)<=p,!u));++e)a&&(m=d==c||d>c==h,m&&(s=-s*o,d=c)),s+=(1e-6*-i.tension*(d-c)+.001*-i.friction*s)/i.mass*f,d+=s*f}else{let o=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,l.durationProgress>0&&(l.elapsedTime=i.duration*l.durationProgress,t=l.elapsedTime+=e)),o=(i.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,l.durationProgress=o),d=n+i.easing(o)*(c-n),s=(d-l.lastPosition)/e,u=1==o}l.lastVelocity=s,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}
2s&&!s[a].done&&(u=!1),u?l.done=!0:t=!1,l.setValue(d,i.round)&&(n=!0)});const l=iy(this),a=l.getValue();if(t){const e=A_(o.to);a===e&&!n||i.decay?n&&i.decay&&this._onChange(a):(l.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return fv.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Yy(this)){const{to:e,config:t}=this.animation;fv.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 Lv.und(e)?(n=this.queue||[],this.queue=[]):n=[Lv.obj(e)?e:{...t,to:e}],Promise.all(n.map(e=>this._update(e))).then(e=>Dy(this,e))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Hy(this._state,e&&this._lastCallId),fv.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=Lv.obj(n)?n[t]:n,(null==n||Ty(n))&&(n=void 0),o=Lv.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return qy(this)||(e.reverse&&([n,o]=[o,n]),o=A_(o),Lv.und(o)?iy(this)||this._set(n):this._set(o)),r}_update({...e},t){const{key:n,defaultProps:o}=this;e.default&&Object.assign(o,Cy(e,(e,t)=>/^on/.test(t)?xy(e,n):e)),sx(this,e,"onProps"),lx(this,"onProps",e,this);const 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?");const i=this._state;return Ly(++this._lastCallId,{key:n,props:e,defaultProps:o,state:i,actions:{pause:()=>{Xy(this)||(Jy(this,!0),Gv(i.pauseQueue),lx(this,"onPause",zy(this,tx(this,this.animation.to)),this))},resume:()=>{Xy(this)&&(Jy(this,!1),Yy(this)&&this._resume(),Gv(i.resumeQueue),lx(this,"onResume",zy(this,tx(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then(n=>{if(e.loop&&n.finished&&(!t||!n.noop)){const t=nx(e);if(t)return this._update(t,!0)}return n})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Vy(this));const o=!Lv.und(e.to),r=!Lv.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Vy(this));this._lastToId=t.callId}const{key:i,defaultProps:s,animation:l}=this,{to:a,from:c}=l;let{to:u=a,from:d=c}=e;!r||o||t.default&&!Lv.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Dv(d,c);p&&(l.from=d),d=A_(d);const h=!Dv(u,a);h&&this._focus(u);const g=Ty(t.to),{config:m}=l,{decay:f,velocity:b}=m;(o||r)&&(m.velocity=0),t.config&&!g&&function(e,t,n){n&&(Ry(n={...n},t),t={...n,...t}),Ry(e,t),Object.assign(e,t);for(const t in My)null==e[t]&&(e[t]=My[t]);let{frequency:o,damping:r}=e;const{mass:i}=e;Lv.und(o)||(o<.01&&(o=.01),r<0&&(r=0),e.tension=Math.pow(2*Math.PI/o,2)*i,e.friction=4*Math.PI*r*i/o)}(m,_y(t.config,i),t.config!==s.config?_y(s.config,i):void 0);let k=iy(this);if(!k||Lv.und(u))return n(zy(this,!0));const v=Lv.und(t.reset)?r&&!t.default:!Lv.und(d)&&yy(t.reset,i),_=v?d:this.get(),y=Ey(u),x=Lv.num(y)||Lv.arr(y)||ty(y),S=!g&&(!x||yy(s.immediate||t.immediate,i));if(h){const e=my(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(y)}}const w=k.constructor;let C=R_(u),B=!1;if(!C){const e=v||!qy(this)&&p;(h||e)&&(B=Dv(Ey(_),y),C=!B),(Dv(l.immediate,S)||S)&&Dv(m.decay,f)&&Dv(m.velocity,b)||(C=!0)}if(B&&Yy(this)&&(l.changed&&!v?C=!0:C||this._stop(a)),!g&&((C||R_(a))&&(l.values=k.getPayload(),l.toValues=R_(u)?null:w==uy?[1]:Vv(y)),l.immediate!=S&&(l.immediate=S,S||v||this._set(a)),C)){const{onRest:e}=l;Ov(ix,e=>sx(this,t,e));const o=zy(this,tx(this,a));Gv(this._pendingCalls,o),this._pendingCalls.add(n),l.changed&&fv.batchedUpdates(()=>{l.changed=!v,e?.(o,this),v?_y(s.onRest,o):l.onStart?.(o,this)})}v&&this._set(_),g?n(Fy(t.to,t,this._state,this)):C?this._start():Yy(this)&&!h?this._pendingCalls.add(n):n(Oy(_))}_focus(e){const t=this.animation;e!==t.to&&(N_(this)&&this._detach(),t.to=e,N_(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;R_(t)&&(z_(t,this),$y(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;R_(e)&&V_(e,this)}_set(e,t=!0){const n=A_(e);
2if(!Lv.und(n)){const e=iy(this);if(!e||!Dv(n,e.getValue())){const o=my(n);e&&e.constructor==o?e.setValue(n):sy(this,o.create(n)),e&&fv.batchedUpdates(()=>{this._onChange(n,t)})}}return iy(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,lx(this,"onStart",zy(this,tx(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),_y(this.animation.onChange,e,this)),_y(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;iy(this).reset(A_(e.to)),e.immediate||(e.fromValues=e.values.map(e=>e.lastPosition)),Yy(this)||(Qy(this,!0),Xy(this)||this._resume())}_resume(){Av.skipAnimation?this.finish():e_.start(this)}_stop(e,t){if(Yy(this)){Qy(this,!1);const n=this.animation;Ov(n.values,e=>{e.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),L_(this,{type:"idle",parent:this});const o=t?Vy(this.get()):zy(this.get(),tx(this,e??n.to));Gv(this._pendingCalls,o),n.changed&&(n.changed=!1,lx(this,"onRest",o,this))}}};function tx(e,t){const n=Ey(t);return Dv(Ey(e.get()),n)}function nx(e,t=e.loop,n=e.to){const o=_y(t);if(o){const r=!0!==o&&jy(o),i=(r||e).reverse,s=!r||r.reset;return ox({...e,loop:t,default:!1,pause:void 0,to:!i||Ty(n)?n:void 0,from:s?e.from:void 0,reset:s,...r})}}function ox(e){const{to:t,from:n}=e=jy(e),o=new Set;return Lv.obj(t)&&rx(t,o),Lv.obj(n)&&rx(n,o),e.keys=o.size?Array.from(o):null,e}function rx(e,t){zv(e,(e,n)=>null!=e&&t.add(n))}var ix=["onStart","onRest","onChange","onPause","onResume"];function sx(e,t,n){e.animation[n]=t[n]!==Sy(t,n)?xy(t[n],e.key):void 0}function lx(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var ax=["onStart","onChange","onRest"],cx=1,ux=class{constructor(e,t){this.id=cx++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];Lv.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(ox(e)),this}start(e){let{queue:t}=this;return e?t=Vv(e).map(ox):this.queue=[],this._flush?this._flush(this,t):(px(this,t),function(e,t){return Promise.all(t.map(t=>dx(e,t))).then(t=>Dy(e,t))}(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Ov(Vv(t),t=>n[t].stop(!!e))}else Hy(this._state,this._lastAsyncId),this.each(t=>t.stop(!!e));return this}pause(e){if(Lv.und(e))this.start({pause:!0});else{const t=this.springs;Ov(Vv(e),e=>t[e].pause())}return this}resume(e){if(Lv.und(e))this.start({pause:!1});else{const t=this.springs;Ov(Vv(e),e=>t[e].resume())}return this}each(e){zv(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,Fv(e,([e,t])=>{t.value=this.get(),e(t,this,this._item)}));const i=!o&&this._started,s=r||i&&n.size?this.get():null;r&&t.size&&Fv(t,([e,t])=>{t.value=s,e(t,this,this._item)}),i&&(this._started=!1,Fv(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)}fv.onFrame(this._onFrame)}};async function dx(e,t,n){const{keys:o,to:r,from:i,loop:s,onRest:l,onResolve:a}=t,c=Lv.obj(t.default)&&t.default;s&&(t.loop=!1),!1===r&&(t.to=null),!1===i&&(t.from=null);const u=Lv.arr(r)||Lv.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Ov(ax,n=>{const o=t[n];if(Lv.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}});const d=e._state;t.pause===!d.paused?(d.paused=t.pause,Gv(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map(n=>e.springs[n].start(t)),h=!0===t.cancel||!0===Sy(t,"cancel");(u||h&&d.asyncId)&&p.push(Ly(++e._lastAsyncId,{props:t,state:d,actions:{pause:Nv,resume:Nv,start(t,n){h?(Hy(d,e._lastAsyncId),n(Vy(e))):(t.onRest=l,n(Fy(u,t,d,e)))}}})),d.paused&&await new Promise(e=>{d.resumeQueue.add(e)});const g=Dy(e,await Promise.all(p));if(s&&g.finished&&(!n||!g.noop)){const n=nx(t,s,r);if(n)return px(e,[n]),dx(e,n,!0)}return a&&fv.batchedUpdates(()=>a(g,e,e.item)),g}function px(e,t){Ov(t,t=>{!function(e,t,n){t.keys&&Ov(t.keys,o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)})}(e.springs,t,t=>function(e,t){const n=new ex;return n.key=e,t&&z_(n,t),n}(t,e))})}var hx,gx,mx=({children:e,...t})=>{const n=(0,nc.useContext)(fx),o=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){const[n]=(0,nc.useState)(()=>({inputs:t,result:e()})),o=(0,nc.useRef)(),r=o.current;let i=r;if(i){const n=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));n||(i={inputs:t,result:e()})}else i=n;return(0,nc.useEffect)(()=>{o.current=i,r==n&&(n.inputs=n.result=void 0)},[i]),i.result}(()=>({pause:o,immediate:r}),[o,r]);const{Provider:i}=fx;return nc.createElement(i,{value:t},e)},fx=(hx=mx,gx={}
2,Object.assign(hx,nc.createContext(gx)),hx.Provider._context=hx,hx.Consumer._context=hx,hx);mx.Provider=fx.Provider,mx.Consumer=fx.Consumer;var bx=class extends Ky{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=S_(...t);const n=this._get(),o=my(n);sy(this,o.create(n))}advance(e){const t=this._get();Dv(t,this.get())||(iy(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&vx(this._active)&&_x(this)}_get(){const e=Lv.arr(this.source)?this.source.map(A_):Vv(A_(this.source));return this.calc(...e)}_start(){this.idle&&!vx(this._active)&&(this.idle=!1,Ov(ly(this),e=>{e.done=!1}),Av.skipAnimation?(fv.batchedUpdates(()=>this.advance()),_x(this)):e_.start(this))}_attach(){let e=1;Ov(Vv(this.source),t=>{R_(t)&&z_(t,this),$y(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Ov(Vv(this.source),e=>{R_(e)&&V_(e,this)}),this._active.clear(),_x(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=Vv(this.source).reduce((e,t)=>Math.max(e,($y(t)?t.priority:0)+1),0))}};function kx(e){return!1!==e.idle}function vx(e){return!e.size||Array.from(e).every(kx)}function _x(e){e.idle||(e.idle=!0,Ov(ly(e),e=>{e.done=!0}),L_(e,{type:"idle",parent:e}))}Av.assign({createStringInterpolator:X_,to:(e,t)=>new bx(e,t)}),e_.advance;const yx=window.ReactDOM;var xx=/^--/;function Sx(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||xx.test(e)||Cx.hasOwnProperty(e)&&Cx[e]?(""+t).trim():t+"px"}var wx={},Cx={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},Bx=["Webkit","Ms","Moz","O"];Cx=Object.keys(Cx).reduce((e,t)=>(Bx.forEach(n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t]),e),Cx);var Ix=/^(matrix|translate|scale|rotate|skew)/,jx=/^(translate)/,Ex=/^(rotate|skew)/,Tx=(e,t)=>Lv.num(e)&&0!==e?e+t:e,Mx=(e,t)=>Lv.arr(e)?e.every(e=>Mx(e,t)):Lv.num(e)?e===t:parseFloat(e)===t,Px=class extends py{constructor({x:e,y:t,z:n,...o}){const r=[],i=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),i.push(e=>[`translate3d(${e.map(e=>Tx(e,"px")).join(",")})`,Mx(e,0)])),zv(o,(e,t)=>{if("transform"===t)r.push([e||""]),i.push(e=>[e,""===e]);else if(Ix.test(t)){if(delete o[t],Lv.und(e))return;const n=jx.test(t)?"px":Ex.test(t)?"deg":"";r.push(Vv(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Tx(r,n)})`,Mx(r,0)]:e=>[`${t}(${e.map(e=>Tx(e,n)).join(",")})`,Mx(e,t.startsWith("scale")?1:0)])}}),r.length&&(o.transform=new Rx(r,i)),super(o)}},Rx=class extends D_{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Ov(this.inputs,(n,o)=>{const r=A_(n[0]),[i,s]=this.transforms[o](Lv.arr(r)?r:n.map(A_));e+=" "+i,t=t&&s}),t?"none":e}observerAdded(e){1==e&&Ov(this.inputs,e=>Ov(e,e=>R_(e)&&z_(e,this)))}observerRemoved(e){0==e&&Ov(this.inputs,e=>Ov(e,e=>R_(e)&&V_(e,this)))}eventObserved(e){"change"==e.type&&(this._value=null),L_(this,e)}};Av.assign({batchedUpdates:yx.unstable_batchedUpdates,createStringInterpolator:X_,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,dar
2kgoldenrod: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 Ax=((e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=e=>new py(e),getComponentProps:o=e=>e}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},i=e=>{const t=vy(e)||"Anonymous";return(e=Lv.str(e)?i[e]||(i[e]=fy(e,r)):e[ky]||(e[ky]=fy(e,r))).displayName=`Animated(${t})`,e};return zv(e,(t,n)=>{Lv.arr(e)&&(n=vy(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;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{className:o,style:r,children:i,scrollTop:s,scrollLeft:l,viewBox:a,...c}=t,u=Object.values(c),d=Object.keys(c).map(t=>n||e.hasAttribute(t)?t:wx[t]||(wx[t]=t.replace(/([A-Z])/g,e=>"-"+e.toLowerCase())));void 0!==i&&(e.textContent=i);for(const t in r)if(r.hasOwnProperty(t)){const n=Sx(t,r[t]);xx.test(t)?e.style.setProperty(t,n):e.style[t]=n}
2d.forEach((t,n)=>{e.setAttribute(t,u[n])}),void 0!==o&&(e.className=o),void 0!==s&&(e.scrollTop=s),void 0!==l&&(e.scrollLeft=l),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new Px(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),Nx=Ax.animated;function Lx(e){return{top:e.offsetTop,left:e.offsetLeft}}var Dx=function({triggerAnimationOnChange:e,clientId:t}){const n=(0,h.useRef)(),{isTyping:o,getGlobalBlockCount:r,isBlockSelected:i,isFirstMultiSelectedBlock:s,isBlockMultiSelected:l,isAncestorMultiSelected:a,isDraggingBlocks:c}=(0,g.useSelect)(Ii),{previous:u,prevRect:d}=(0,h.useMemo)(()=>({previous:n.current&&Lx(n.current),prevRect:n.current&&n.current.getBoundingClientRect()}),[e]);return(0,h.useLayoutEffect)(()=>{if(!u||!n.current)return;const e=(0,Fa.getScrollContainer)(n.current),p=i(t),h=p||s(t),g=c();function m(){if(!g&&h&&d){const t=n.current.getBoundingClientRect().top-d.top;t&&(e.scrollTop+=t)}}if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||o()||r()>200)return void m();const f=p||l(t)||a(t);if(f&&g)return;const b=f?"1":"",k=new ux({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=b,m()}});n.current.style.transform=void 0;const v=Lx(n.current),_=Math.round(u.left-v.left),y=Math.round(u.top-v.top);return k.start({x:0,y:0,from:{x:_,y}}),()=>{k.stop(),k.set({x:0,y:0})}},[u,d,t,o,r,i,s,l,a,c]),n};function Ox({clientId:e,initialPosition:t}){const n=(0,h.useRef)(),{isBlockSelected:o,isMultiSelecting:r,isZoomOut:i}=U((0,g.useSelect)(Ii));return(0,h.useEffect)(()=>{if(!o(e)||r()||i())return;if(null==t)return;if(!n.current)return;const{ownerDocument:s}=n.current;if(Nm(n.current,s.activeElement))return;const l=Fa.focus.tabbable.find(n.current).filter(e=>(0,Fa.isTextField)(e)),a=-1===t,c=l[a?l.length-1:0]||n.current;if(Nm(n.current,c)){if(!n.current.getAttribute("contenteditable")){const e=Fa.focus.tabbable.findNext(n.current);if(e&&Nm(n.current,e)&&(0,Fa.isFormElement)(e))return void e.focus()}(0,Fa.placeCaretAtHorizontalEdge)(c,a)}else n.current.focus()},[t,e]),n}function zx(e){e.defaultPrevented||(e.preventDefault(),e.currentTarget.classList.toggle("is-hovered","mouseover"===e.type))}function Vx(e){const{isBlockSelected:t}=(0,g.useSelect)(Ii),{selectBlock:n,selectionChange:o}=(0,g.useDispatch)(Ii);return(0,m.useRefEffect)(r=>{function i(i){r.parentElement.closest('[contenteditable="true"]')||(t(e)?i.target.isContentEditable||o(e):Nm(r,i.target)&&n(e))}return r.addEventListener("focusin",i),()=>{r.removeEventListener("focusin",i)}},[t,n])}function Fx(e){return!e||"transparent"===e||"rgba(0, 0, 0, 0)"===e}function Hx({clientId:e,isSelected:t}){const{getBlockRootClientId:n,isZoomOut:o,hasMultiSelection:r}=U((0,g.useSelect)(Ii)),{insertAfterBlock:i,removeBlock:s,resetZoomLevel:l,startDraggingBlocks:a,stopDraggingBlocks:c}=U((0,g.useDispatch)(Ii));return(0,m.useRefEffect)(u=>{if(t)return u.addEventListener("keydown",d),u.addEventListener("dragstart",p),()=>{u.removeEventListener("keydown",d),u.removeEventListener("dragstart",p)};function d(t){const{keyCode:n,target:r}=t;n!==Ua.ENTER&&n!==Ua.BACKSPACE&&n!==Ua.DELETE||r!==u||(0,Fa.isTextField)(r)||(t.preventDefault(),n===Ua.ENTER&&o()?l():n===Ua.ENTER?i(e):s(e))}function p(t){if(u!==t.target||u.isContentEditable||u.ownerDocument.activeElement!==u||r())return void t.preventDefault();const o=JSON.stringify({type:"block",srcClientIds:[e],srcRootClientId:n(e)});t.dataTransfer.effectAllowed="move",t.dataTransfer.clearData(),t.dataTransfer.setData("wp-blocks",o);const{ownerDocument:i}=u,{defaultView:s}=i;s.getSelection().removeAllRanges();const l=i.createElement("div");l.style.width="1px",l.style.height="1px",l.style.position="fixed",l.style.visibility="hidden",i.body.appendChild(l),t.dataTransfer.setDragImage(l,0,0);const d=u.getBoundingClientRect(),p=u.cloneNode(!0);p.style.visibility="hidden",p.style.display="none";const h=u.id;u.id=null;let g=1;{let e=u;for(;e=e.parentElement;){const{scale:t}=s.getComputedStyle(e);
2if(t&&"none"!==t){g=parseFloat(t);break}}}const m=1/g;u.after(p);const f={};for(const e of["transform","transformOrigin","transition","zIndex","position","top","left","pointerEvents","opacity","backgroundColor"])f[e]=u.style[e];const b=s.scrollY,k=s.scrollX,v=t.clientX,_=t.clientY;u.style.position="relative",u.style.top="0px",u.style.left="0px";const y=t.clientX-d.left,x=t.clientY-d.top,S=d.height>200?200/d.height:1;if(u.style.zIndex="1000",u.style.transformOrigin=`${y*m}px ${x*m}px`,u.style.transition="transform 0.2s ease-out",u.style.transform=`scale(${S})`,u.style.opacity="0.9",Fx(s.getComputedStyle(u).backgroundColor)){let e="transparent",t=u;for(;t=t.parentElement;){const{backgroundColor:n}=s.getComputedStyle(t);if(!Fx(n)){e=n;break}}u.style.backgroundColor=e}let w=!1;function C(e){w||(w=!0,u.style.pointerEvents="none");const t=s.scrollY,n=s.scrollX;u.style.top=(e.clientY-_+t-b)*m+"px",u.style.left=(e.clientX-v+n-k)*m+"px"}function B(){i.removeEventListener("dragover",C),i.removeEventListener("dragend",B),i.removeEventListener("drop",B),i.removeEventListener("scroll",C);for(const[e,t]of Object.entries(f))u.style[e]=t;p.remove(),u.id=h,l.remove(),c(),document.body.classList.remove("is-dragging-components-draggable"),i.documentElement.classList.remove("is-dragging")}i.addEventListener("dragover",C),i.addEventListener("dragend",B),i.addEventListener("drop",B),i.addEventListener("scroll",C),a([e]),document.body.classList.add("is-dragging-components-draggable"),i.documentElement.classList.add("is-dragging")}},[e,t,n,i,s,o,l,r,a,c])}function Ux(){const e=(0,h.useContext)(VS);return(0,m.useRefEffect)(t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}},[e])}function Gx({isSelected:e}){const t=(0,m.useReducedMotion)();return(0,m.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 $x({clientId:e="",isEnabled:t=!0}={}){const{getEnabledClientIdsTree:n}=U((0,g.useSelect)(Ii));return(0,m.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 Wx=new Map;function Kx(e){const t=e.getAttribute("data-draggable");t&&(e.removeAttribute("data-draggable"),"true"!==t||e.getAttribute("draggable")||e.setAttribute("draggable","true"))}function Zx(e){const{target:t}=e,{ownerDocument:n,isContentEditable:o,tagName:r}=t,i=["INPUT","TEXTAREA"].includes(r),s=Wx.get(n);if(o||i)for(const e of s)"true"===e.getAttribute("draggable")&&e.contains(t)&&(e.removeAttribute("draggable"),e.setAttribute("data-draggable","true"));else for(const e of s)Kx(e)}function qx(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:o,wrapperProps:r={},isAligned:i,index:s,mode:l,name:a,blockApiVersion:c,blockTitle:u,isSelected:d,isSubtreeDisabled:p,hasOverlay:g,initialPosition:f,blockEditingMode:b,isHighlighted:k,isMultiSelected:v,isPartiallySelected:y,isReusable:x,isDragging:S,hasChildSelected:w,isEditingDisabled:B,hasEditableOutline:I,isTemporarilyEditingAsBlocks:j,defaultClassName:E,isSectionBlock:M,canMove:P,isBlockHidden:R}=(0,h.useContext)(Yk),A=(0,T.sprintf)((0,T.__)("Block: %s"),u),N="html"!==l||t?"":"-visual",L=(0,m.useRefEffect)(e=>(function(e,t){let n=Wx.get(e);n||(n=new Set,Wx.set(e,n),e.addEventListener("pointerdown",Zx)),n.add(t)}(e.ownerDocument,e),()=>{!function(e,t){const n=Wx.get(e);n&&(n.delete(t),Kx(t),0===n.size&&(Wx.delete(e),e.removeEventListener("pointerdown",Zx)))}(e.ownerDocument,e)}),[]),D=(0,m.useMergeRefs)([e.ref,Ox({clientId:n,initialPosition:f}),sh(n),Vx(n),Hx({clientId:n,isSelected:d}),(0,m.useRefEffect)(e=>(e.addEventListener("mouseout",zx),e.addEventListener("mouseover",zx),()=>{e.removeEventListener("mouseout",zx),e.removeEventListener("mouseover",zx),e.classList.remove("is-hovered")}),[]),Ux(),Dx({triggerAnimationOnChange:s,clientId:n}
2),(0,m.useDisabled)({isDisabled:!g}),$x({clientId:n,isEnabled:M}),Gx({isSelected:d}),P?L:void 0]),O=C(),z=O[_]?{"--wp-admin-theme-color":"var(--wp-block-synced-color)","--wp-admin-theme-color--rgb":"var(--wp-block-synced-color--rgb)"}:{};c<2&&n===O.clientId&&Is()(`Block type "${a}" must support API version 2 or higher to work correctly with "useBlockProps" method.`);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"===b?-1:0,draggable:!(!P||w)||void 0,...r,...e,ref:D,id:`block-${n}${N}`,role:"document","aria-label":A,"data-block":n,"data-type":a,"data-title":u,inert:p?"true":void 0,className:gs("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":g,"is-selected":d,"is-highlighted":k,"is-multi-selected":v,"is-partially-selected":y,"is-reusable":x,"is-dragging":S,"has-child-selected":w,"is-editing-disabled":B,"has-editable-outline":I,"has-negative-margin":V,"is-content-locked-temporarily-editing-as-blocks":j,"is-block-hidden":R},o,e.className,r.className,E),style:{...r.style,...e.style,...z}}}function Yx({children:e,isHtml:t,...n}){return(0,d.jsx)("div",{...qx(n,{__unstableIsHtml:t}),children:e})}function Xx({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:o,clientId:r,isSelected:i,isSelectionEnabled:s,className:l,__unstableLayoutClassNames:a,name:c,isValid:u,attributes:g,wrapperProps:m,setAttributes:f,onReplace:b,onRemove:k,onInsertBlocksAfter:v,onMerge:_,toggleSelection:y}){const{mayDisplayControls:x,mayDisplayParentControls:S,themeSupportsLayout:w,...C}=(0,h.useContext)(Yk),B=Ql()||{};let I=(0,d.jsx)(ov,{name:c,isSelected:i,attributes:g,setAttributes:f,insertBlocksAfter:n?void 0:v,onReplace:o?b:void 0,onRemove:o?k:void 0,mergeBlocks:o?_:void 0,clientId:r,isSelectionEnabled:s,toggleSelection:y,__unstableLayoutClassNames:a,__unstableParentLayout:Object.keys(B).length?B:void 0,mayDisplayControls:x,mayDisplayParentControls:S,blockEditingMode:C.blockEditingMode,isPreviewMode:C.isPreviewMode});const j=(0,p.getBlockType)(c);j?.getEditWrapperProps&&(m=function(e,t){const n={...e,...t};return e?.hasOwnProperty("className")&&t?.hasOwnProperty("className")&&(n.className=gs(e.className,t.className)),e?.hasOwnProperty("style")&&t?.hasOwnProperty("style")&&(n.style={...e.style,...t.style}),n}(m,j.getEditWrapperProps(g)));const E=m&&!!m["data-align"]&&!w,T=l?.includes("is-position-sticky");let M;if(E&&(I=(0,d.jsx)("div",{className:gs("wp-block",T&&l),"data-align":m["data-align"],children:I})),u)M="html"===t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{style:{display:"none"},children:I}),(0,d.jsx)(Yx,{isHtml:!0,children:(0,d.jsx)(gv,{clientId:r})})]}):j?.apiVersion>1?I:(0,d.jsx)(Yx,{children:I});else{const t=e?(0,p.serializeRawBlock)(e):(0,p.getSaveContent)(j,g);M=(0,d.jsxs)(Yx,{className:"has-warning",children:[(0,d.jsx)(av,{clientId:r}),(0,d.jsx)(h.RawHTML,{children:(0,Fa.safeHTML)(t)})]})}const{"data-align":P,...R}=m??{},A={...R,className:gs(R.className,P&&w&&`align${P}`,!(P&&T)&&l)};return(0,d.jsx)(Yk.Provider,{value:{wrapperProps:A,isAligned:E,...C},children:(0,d.jsx)(pv,{fallback:(0,d.jsx)(Yx,{className:"has-warning",children:(0,d.jsx)(uv,{})}),children:M})})}qx.save=p.__unstableGetBlockProps;const Qx=(0,g.withDispatch)((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:i,replaceBlocks:s,toggleSelection:l,__unstableMarkLastChangeAsPersistent:a,moveBlocksToPosition:c,removeBlock:u,selectBlock:d}=e(Ii);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(Ii),i=r(),{clientId:s,attributes:l}=t,a=i.length?i:[s],c="function"==typeof e?e(l):e;o(a,c)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:i}=t,{getBlockIndex:s}=n.select(Ii),l=s(o);r(e,l+1,i)},onMerge(e){const{clientId:o,rootClientId:l}=t,{getPreviousBlockClientId:a,getNextBlockClientId:h,getBlock:g,getBlockAttributes:m,getBlockName:f,getBlockOrder:b,getBlockIndex:k,getBlockRootClientId:v,canInsertBlockType:_}=n.select(Ii);function y(){const e=g(o),t=(0,p.getDefaultBlockName)(),r=(0,p.getBlockType)(t);if(f(o)!==t){const n=(0,p.switchToBlockType)(e,t);n&&n.length&&s(o,n)}else if((0,p.isUnmodifiedDefaultBlock)(e)){const e=h(o);e&&n.batch(()=>{u(o),d(e)})}else if(r.merge){const n=r.merge({},e.attributes);s([o],[(0,p.createBlock)(t,n)])}}function x(e,t=!0){const o=f(e),i="text"===(0,p.getBlockType)(o).category,s=v(e),l=b(e),[a]=l;1===l.length&&(0,p.isUnmodifiedBlock)(g(a))?u(e):i?n.batch(()=>
2{if(_(f(a),s))c([a],e,s,k(e));else{const n=(0,p.switchToBlockType)(g(a),(0,p.getDefaultBlockName)());n&&n.length&&n.every(e=>_(e.name,s))?(r(n,k(e),s,t),u(a,!1)):y()}!b(e).length&&(0,p.isUnmodifiedBlock)(g(e))&&u(e,!1)}):y()}if(e){if(l){const e=h(l);if(e){if(f(l)!==f(e))return void i(l,e);{const t=m(l),o=m(e);if(Object.keys(t).every(e=>t[e]===o[e]))return void n.batch(()=>{c(b(e),e,l),u(e,!1)})}}}const e=h(o);if(!e)return;b(e).length?x(e,!1):i(o,e)}else{const e=a(o);if(e)i(e,o);else if(l){const e=a(l);if(e&&f(l)===f(e)){const t=m(l),o=m(e);if(Object.keys(t).every(e=>t[e]===o[e]))return void n.batch(()=>{c(b(l),l,e),u(l,!1)})}x(l)}else y()}},onReplace(e,n,o){e.length&&!(0,p.isUnmodifiedDefaultBlock)(e[e.length-1])&&a();const r=1===e?.length&&Array.isArray(e[0])?e[0]:e;s([t.clientId],r,n,o)},onRemove(){u(t.clientId)},toggleSelection(e){l(e)}}});Xx=(0,m.compose)(Qx,(0,Ss.withFilters)("editor.BlockListBlock"))(Xx);var Jx=(0,h.memo)(function(e){const{clientId:t,rootClientId:n}=e,o=(0,g.useSelect)(e=>{const{isBlockSelected:o,getBlockMode:r,isSelectionEnabled:i,getTemplateLock:s,isSectionBlock:l,getBlockWithoutAttributes:a,getBlockAttributes:c,canRemoveBlock:u,canMoveBlock:d,getSettings:h,getTemporarilyEditingAsBlocks:g,getBlockEditingMode:m,getBlockName:f,isFirstMultiSelectedBlock:b,getMultiSelectedBlockClientIds:k,hasSelectedInnerBlock:v,getBlocksByName:_,getBlockIndex:y,isBlockMultiSelected:x,isBlockSubtreeDisabled:S,isBlockHighlighted:w,__unstableIsFullySelected:C,__unstableSelectionHasUnmergeableBlock:B,isBlockBeingDragged:I,isDragging:j,__unstableHasActiveBlockOverlayActive:E,getSelectedBlocksInitialCaretPosition:T}=U(e(Ii)),M=a(t);if(!M)return;const{hasBlockSupport:P,getActiveBlockVariation:R}=e(p.store),A=c(t),{name:N,isValid:L}=M,D=(0,p.getBlockType)(N),{supportsLayout:O,isPreviewMode:z,__experimentalBlockBindingsSupportedAttributes:V}=h(),F=V?.[N],H=D?.apiVersion>1,G={isPreviewMode:z,blockWithoutAttributes:M,name:N,attributes:A,isValid:L,themeSupportsLayout:O,index:y(t),isReusable:(0,p.isReusableBlock)(D),className:H?A.className:void 0,defaultClassName:H?(0,p.getBlockDefaultClassName)(N):void 0,blockTitle:D?.title,isBlockHidden:!1===A?.metadata?.blockVisibility,bindableAttributes:F};if(z)return G;const{isBlockHidden:$}=U(e(Ii)),W=o(t),K=u(t),Z=d(t),q=R(N,A),Y=x(t),X=v(t,!0),Q=m(t),J=(0,p.hasBlockSupport)(N,"multiple",!0)?[]:_(N),ee=J.length&&J[0]!==t;return{...G,mode:r(t),isSelectionEnabled:i(),isLocked:!!s(n),isSectionBlock:l(t),canRemove:K,canMove:Z,isSelected:W,isTemporarilyEditingAsBlocks:g()===t,blockEditingMode:Q,mayDisplayControls:W||b(t)&&k().every(e=>f(e)===N),mayDisplayParentControls:P(f(t),"__experimentalExposeControlsToChildren",!1)&&v(t),blockApiVersion:D?.apiVersion||1,blockTitle:q?.title||D?.title,isSubtreeDisabled:"disabled"===Q&&S(t),hasOverlay:E(t)&&!j(),initialPosition:W?T():void 0,isHighlighted:w(t),isMultiSelected:Y,isPartiallySelected:Y&&!C()&&!B(),isDragging:I(t),hasChildSelected:X,isEditingDisabled:"disabled"===Q,hasEditableOutline:"disabled"!==Q&&"disabled"===m(n),originalBlockClientId:!!ee&&J[0],isBlockHidden:$(t)}},[t,n]),{isPreviewMode:r,mode:i="visual",isSelectionEnabled:s=!1,isLocked:l=!1,canRemove:a=!1,canMove:c=!1,blockWithoutAttributes:u,name:m,attributes:f,isValid:b,isSelected:k=!1,themeSupportsLayout:v,isTemporarilyEditingAsBlocks:_,blockEditingMode:y,mayDisplayControls:x,mayDisplayParentControls:S,index:w,blockApiVersion:C,blockTitle:B,isSubtreeDisabled:I,hasOverlay:j,initialPosition:E,isHighlighted:T,isMultiSelected:M,isPartiallySelected:P,isReusable:R,isDragging:A,hasChildSelected:N,isSectionBlock:L,isEditingDisabled:D,hasEditableOutline:O,className:z,defaultClassName:V,originalBlockClientId:F,isBlockHidden:H,bindableAttributes:G}=o,$=(0,h.useMemo)(()=>({...u,attributes:f}),[u,f]);if(!o)return null;const W={isPreviewMode:r,clientId:t,className:z,index:w,mode:i,name:m,blockApiVersion:C,blockTitle:B,isSelected:k,isSubtreeDisabled:I,hasOverlay:j,initialPosition:E,blockEditingMode:y,isHighlighted:T,isMultiSelected:M,isPartiallySelected:P,isReusable:R,isDragging:A,hasChildSelected:N,isSectionBlock:L,isEditingDisabled:D,hasEditableOutline:O,isTemporarilyEditingAsBlocks:_,defaultClassName:V,mayDisplayControls:x,mayDisplayParentControls:S,originalBlockCl
2ientId:F,themeSupportsLayout:v,canMove:c,isBlockHidden:H,bindableAttributes:G};return!H||k||M||N?(0,d.jsx)(Yk.Provider,{value:W,children:(0,d.jsx)(Xx,{...e,mode:i,isSelectionEnabled:s,isLocked:l,canRemove:a,canMove:c,block:$,name:m,attributes:f,isValid:b,isSelected:k})}):null});const eS=window.wp.htmlEntities,tS="\ufeff";function nS({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:o,isManualGrid:r}=(0,g.useSelect)(t=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r,getBlockAttributes:i}=t(Ii),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,g.useDispatch)(Ii);if(n||r)return null;const l=(0,eS.decodeEntities)(o)||(0,T.__)("Type / to choose a block"),a=()=>{i(void 0,e),s()};return(0,d.jsxs)("div",{"data-root-client-id":e||"",className:gs("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,d.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,T.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Ua.ENTER!==e.keyCode&&Ua.SPACE!==e.keyCode||a()},onClick:()=>a(),onFocus:()=>{t&&a()},children:t?l:tS}),(0,d.jsx)(zB,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}function oS({rootClientId:e}){return(0,g.useSelect)(t=>t(Ii).canInsertBlockType((0,p.getDefaultBlockName)(),e))?(0,d.jsx)(nS,{rootClientId:e}):(0,d.jsx)(HB,{rootClientId:e,className:"block-list-appender__toggle"})}function rS({rootClientId:e,CustomAppender:t,className:n,tagName:o="div"}){const r=(0,g.useSelect)(t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:o,getBlockCount:r}=t(Ii),i=n();return o()&&e===i?.rootClientId&&0===r(e)},[e]);return(0,d.jsx)(o,{tabIndex:-1,className:gs("block-list-appender wp-block",n,{"is-drag-over":r}),contentEditable:!1,"data-block":!0,children:t?(0,d.jsx)(t,{}):(0,d.jsx)(oS,{rootClientId:e})})}const iS=Number.MAX_SAFE_INTEGER;var sS=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,operation:i="insert",nearestSide:s="right",...l}){const[a,c]=(0,h.useReducer)(e=>(e+1)%iS,0),{orientation:u,rootClientId:p,isVisible:m}=(0,g.useSelect)(n=>{const{getBlockListSettings:o,getBlockRootClientId:r,isBlockVisible:i}=n(Ii),s=r(e??t);return{orientation:o(s)?.orientation||"vertical",rootClientId:s,isVisible:i(e)&&i(t)}},[e,t]),f=ch(e),b=ch(t),k="vertical"===u,v=(0,h.useMemo)(()=>{if(!(a<0||!f&&!b)&&m)return{contextElement:"group"===i?b||f:f||b,getBoundingClientRect(){const e=f?f.getBoundingClientRect():null,t=b?b.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 k?(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,T.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),r=Math.max(r,0));return new window.DOMRect(n,o,r,l)}}},[f,b,a,k,m,i,s]),_=Tm(r);return(0,h.useLayoutEffect)(()=>{if(!f)return;const e=new window.MutationObserver(c);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}},[f]),(0,h.useLayoutEffect)(()=>{if(!b)return;const e=new window.MutationObserver(c);return e.observe(b,{attributes:!0}),()=>{e.disconnect()}},[b]),(0,h.useLayoutEffect)(()=>{if(f)return f.ownerDocument.defaultView.addEventListener("resize",c),()=>{f.ownerDocument.defaultView?.removeEventListener("resize",c)}},[f]),(f||b)&&m?(0,d.jsx)(Ss.Popover,{ref:_,animate:!1,anchor:v,focusOnMount:!1,__unstableSlotName:o,inline:!o,...l,className:gs("block-editor-block-popover","block-editor-block-popover__inbetween",l.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,d.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:n})},t+"--"+p):null};const lS={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};var aS=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,g.useSelect)(e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(Ii),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}},[]),o=(0,m.useReducedMotion)();return(0,d.jsx)(Wm,{clientId:n,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,d.jsx)(Ss.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:o?lS.show:lS.hide,animate:lS.show,exit:o?lS.show:lS.exit,className:"block-editor-block-popover__drop-zone-foreground"})})};const cS=(0,h.createContext)();function uS({__unstablePopoverSlot:e,__unstableContentRef:t,operation:n="insert",nearestSide:o="right"}){const{selectBlock:r,hideInsertionPoint:i}=(0,g.useDispatch)(Ii),s=(0,h.useContext)(cS),l=(0,h.useRef)(),{orientation:a,previousClientId:c,nextClientId:u,rootClientId:p,isInserterShown:f,isDistractionFree:b,isZoomOutMode:k}=(0,g.useSelect)(e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:o,isBlockBeingDragged:r,getPreviousBlockClientId:i,getNextBlockClientId:s,getSettings:l,isZoomOut:a}
2=U(e(Ii)),c=o(),u=t(c.rootClientId);if(!u.length)return{};let d=u[c.index-1],p=u[c.index];for(;r(d);)d=i(d);for(;r(p);)p=s(p);const h=l();return{previousClientId:d,nextClientId:p,orientation:n(c.rootClientId)?.orientation||"vertical",rootClientId:c.rootClientId,isDistractionFree:h.isDistractionFree,isInserterShown:c?.__unstableWithInserter,isZoomOutMode:a()}},[]),{getBlockEditingMode:v}=(0,g.useSelect)(Ii),_=(0,m.useReducedMotion)(),y=(0,h.useCallback)(e=>{!e&&s.current&&(s.current=!1)},[s]),x={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:f?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},S={start:{scale:_?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(b)return null;if(k&&"insert"!==n)return null;const w=gs("block-editor-block-list__insertion-point","horizontal"===a||"group"===n?"is-horizontal":"is-vertical");return(0,d.jsx)(sS,{previousClientId:c,nextClientId:u,__unstablePopoverSlot:e,__unstableContentRef:t,operation:n,nearestSide:o,children:(0,d.jsxs)(Ss.__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&&u&&"disabled"!==v(u)&&r(u,-1)},onFocus:function(e){e.target!==l.current&&(s.current=!0)},className:gs(w,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==l.current||s.current||i()},children:[(0,d.jsx)(Ss.__unstableMotion.div,{variants:x,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&(0,d.jsx)(Ss.__unstableMotion.div,{variants:S,className:gs("block-editor-block-list__insertion-point-inserter"),children:(0,d.jsx)(zB,{ref:y,position:"bottom center",clientId:u,rootClientId:p,__experimentalIsQuick:!0,onToggle:e=>{s.current=e},onSelectOrClose:()=>{s.current=!1}})})]})})}function dS(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:o}=(0,g.useSelect)(e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:o}=e(Ii),r=t();return{insertionPoint:r,isVisible:n(),isBlockListEmpty:0===o(r?.rootClientId)}},[]);return!n||o?null:"replace"===t.operation?(0,d.jsx)(aS,{...e},`${t.rootClientId}-${t.index}`):(0,d.jsx)(uS,{operation:t.operation,nearestSide:t.nearestSide,...e})}function pS(){const e=(0,h.useContext)(cS),t=(0,g.useSelect)(e=>e(Ii).getSettings().isDistractionFree||U(e(Ii)).isZoomOut(),[]),{getBlockListSettings:n,getBlockIndex:o,isMultiSelecting:r,getSelectedBlockClientIds:i,getSettings:s,getTemplateLock:l,__unstableIsWithinBlockOverlay:a,getBlockEditingMode:c,getBlockName:u,getBlockAttributes:d,getParentSectionBlock:p}=U((0,g.useSelect)(Ii)),{showInsertionPoint:f,hideInsertionPoint:b}=(0,g.useDispatch)(Ii);return(0,m.useRefEffect)(h=>{if(!t)return h.addEventListener("mousemove",g),()=>{h.removeEventListener("mousemove",g)};function g(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 b();let h;if(t.target.classList.contains("is-root-container")||(h=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),l(h)||"disabled"===c(h)||"core/block"===u(h)||h&&d(h).layout?.isManualPlacement)return;const g=n(h),m=g?.orientation||"vertical",k=!!g?.__experimentalCaptureToolbars,v=t.clientY,_=t.clientX;let y=Array.from(t.target.children).find(e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===m&&t.top>v||e.classList.contains("wp-block")&&"horizontal"===m&&((0,T.isRTL)()?t.right<_:t.left>_)});if(!y)return void b();if(!y.id&&(y=y.firstElementChild,!y))return void b();const x=y.id.slice(6);if(!x||a(x)||p(x))return;if(i().includes(x)&&"vertical"===m&&!k&&!s().hasFixedToolbar)return;const S=y.getBoundingClientRect();if("horizontal"===m&&(t.clientY>S.bottom||t.clientY<S.top)||"vertical"===m&&(t.clientX>S.right||t.clientX<S.left))return void b();const w=o(x);0!==w?f(h,w,{__unstableWithInserter:!0}):b()}},[e,n,o,r,f,b,i,t])}function hS(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,g.useSelect)(Ii),{clearSelectedBlock:o}=(0,g.useDispatch)(Ii),{clearBlockSelection:r}=e();return(0,m.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 gS(e){return(0,d.jsx)("div",{ref:hS(),...e})}cS.displayName="InsertionPointOpenRefContext";const mS=new WeakMap;function fS(){let e;return t=>(void 0!==e&&Ya()(e,t)||(e=t),e)}function bS(e){const[t]=(0,h.useState)(fS);return t(e)}function kS(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}function vS(e,t,n={}){const{operation:o="insert",nearestSide:r="right"}=n,{canInsertBlockType:i,getBlockIndex:s,getClientIdsOfDescendants:l,getBlockOrder:a,getBlocksByClientId:c,get
2Settings:u,getBlock:d}=(0,g.useSelect)(Ii),{getGroupingBlockName:m}=(0,g.useSelect)(p.store),{insertBlocks:f,moveBlocksToPosition:b,updateBlockAttributes:k,clearSelectedBlock:v,replaceBlocks:_,removeBlocks:y}=(0,g.useDispatch)(Ii),x=(0,g.useRegistry)(),S=(0,h.useCallback)((n,s=!0,l=0,c=[])=>{Array.isArray(n)||(n=[n]);const u=a(e)[t];if("replace"===o)_(u,n,void 0,l);else if("group"===o){const t=d(u);"left"===r?n.push(t):n.unshift(t);const o=n.map(e=>(0,p.createBlock)(e.name,e.attributes,e.innerBlocks)),s=n.every(e=>"core/image"===e.name),a=i("core/gallery",e),h=(0,p.createBlock)(s&&a?"core/gallery":m(),{layout:{type:"flex",flexWrap:s&&a?null:"nowrap"}},o);_([u,...c],h,void 0,l)}else f(n,t,e,s,l)},[a,e,t,o,_,d,r,i,m,f]),w=(0,h.useCallback)((n,r,i)=>{if("replace"===o){const o=c(n),r=a(e)[t];x.batch(()=>{y(n,!1),_(r,o,void 0,0)})}else b(n,r,e,i)},[o,a,c,b,x,y,_,t,e]),C=function(e,t,n,o,r,i,s,l,a){return c=>{const{srcRootClientId:u,srcClientIds:d,type:h,blocks:g}=kS(c);if("inserter"===h){s();const e=g.map(e=>(0,p.cloneBlock)(e));i(e,!0,null)}if("block"===h){const s=n(d[0]);if(u===e&&s===t)return;if(d.includes(e)||o(d).some(t=>t===e))return;if("group"===l){const e=d.map(e=>a(e));return void i(e,!0,null,d)}const c=u===e,p=d.length;r(d,u,c&&s<t?t-p:t)}}}(e,t,s,l,w,S,v,o,d),B=function(e,t,n,o,r){return i=>{if(!t().mediaUpload)return;const s=(0,p.findTransform)((0,p.getBlockTransforms)("from"),t=>"files"===t.type&&o(t.blockName,e)&&t.isMatch(i));if(s){const e=s.transform(i,n);r(e)}}}(e,u,k,i,S),I=function(e){return t=>{const n=(0,p.pasteHandler)({HTML:t,mode:"BLOCKS"});n.length&&e(n)}}(S);return e=>{const t=(0,Fa.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?I(n):t.length?B(t):C(e)}}function _S(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 yS(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const xS=30,SS=120,wS=120;function CS(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 BS(e,t){const{defaultView:n}=t;return!!(n&&e instanceof n.HTMLElement&&e.closest("[data-is-insertion-point]"))}const IS={};function jS({children:e,clientId:t}){const n=function(e){return(0,g.useSelect)(t=>{const n=t(Ii).getBlock(e);if(!n)return;const o=t(p.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,d.jsx)(Uk,{value:n,children:e})}const ES=(0,h.memo)(qS);function TS(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:o,defaultBlock:r,directInsert:i,__experimentalDefaultBlock:s,__experimentalDirectInsert:l,template:a,templateLock:c,wrapperRef:u,templateInsertUpdatesSelection:m,__experimentalCaptureToolbars:f,__experimentalAppenderTagName:b,renderAppender:k,orientation:v,placeholder:_,layout:y,name:x,blockType:S,parentLock:w,defaultLayout:C}=e;!function(e,t,n,o,r,i,s,l,a,c,u,d){const p=(0,g.useRegistry)(),m=bS(n),f=bS(o),b=void 0===a||"contentOnly"===t?t:a;(0,h.useLayoutEffect)(()=>{const t={allowedBlocks:m,prioritizedInserterBlocks:f,templateLock:b};if(void 0!==c&&(t.__experimentalCaptureToolbars=c),void 0!==u)t.orientation=u;else{const e=Zl(d?.type);t.orientation=e.getOrientation(d)}void 0!==s&&(I()("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),t.defaultBlock=s),void 0!==r&&(t.defaultBlock=r),void 0!==l&&(I()("__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&&I()("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),mS.get(p)||mS.set(p,{}),mS.get(p)[e]=t,window.queueMicrotask(()=>{const e=mS.get(p);if(Object.keys(e).length){const{updateBlockListSettings:t}=p.dispatch(Ii);t(e),mS.set(p,{})}})},[e,m,f,b,r,i,s,l,c,u,d,p])}(t,w,n,o,r,i,s,l,c,f,v,y),function(e,t,n,o){const r=(0,g.useRegistry)(),i=(0,h.useRef)(null);(0,h.useLayoutEffect)(()=>{let s=!1;const{getBlocks:l,getSelectedBlocksInitialCaretPosition:a,isBlockSelected:c}=r.select(Ii),{replaceInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:d}=r.dispatch(Ii);return window.queueMicrotask(()=>
2{if(s)return;const r=l(e),h=0===r.length||"all"===n||"contentOnly"===n,g=!E()(t,i.current);if(!h||!g)return;i.current=t;const m=(0,p.synchronizeBlocksWithTemplate)(r,t);E()(m,r)||(d(),u(e,m,0===r.length&&o&&0!==m.length&&c(e),a()))}),()=>{s=!0}},[t,n,e,r,o])}(t,a,c,m);const B=(0,p.getBlockSupport)(x,"layout")||(0,p.getBlockSupport)(x,"__experimentalLayout")||IS,{allowSizingOnChildren:j=!1}=B,T=y||B,M=(0,h.useMemo)(()=>({...C,...T,...j&&{allowSizingOnChildren:!0}}),[C,T,j]),P=(0,d.jsx)(ES,{rootClientId:t,renderAppender:k,__experimentalAppenderTagName:b,layout:M,wrapperRef:u,placeholder:_});return S?.providesContext&&0!==Object.keys(S.providesContext).length?(0,d.jsx)(jS,{clientId:t,children:P}):P}function MS(e){return Ak(e),(0,d.jsx)(TS,{...e})}const PS=(0,h.forwardRef)((e,t)=>{const n=RS({ref:t},e);return(0,d.jsx)("div",{className:"block-editor-inner-blocks",children:(0,d.jsx)("div",{...n})})});function RS(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o,dropZoneElement:r}=t,{clientId:i,layout:s=null,__unstableLayoutClassNames:l=""}=C(),a=(0,g.useSelect)(e=>{const{getBlockName:t,isZoomOut:n,getTemplateLock:o,getBlockRootClientId:r,getBlockEditingMode:s,getBlockSettings:l,getSectionRootClientId:a}=U(e(Ii));if(!i){const e=a();return{isDropZoneDisabled:n()&&""!==e}}const{hasBlockSupport:c,getBlockType:u}=e(p.store),d=t(i),h=s(i),g=r(i),[m]=l(i,"layout");let f="disabled"===h;if(n()){const e=a();f=i!==e}return{__experimentalCaptureToolbars:c(d,"__experimentalExposeControlsToChildren",!1),name:d,blockType:u(d),parentLock:o(g),parentClientId:g,isDropZoneDisabled:f,defaultLayout:m}},[i]),{__experimentalCaptureToolbars:c,name:u,blockType:f,parentLock:b,parentClientId:k,isDropZoneDisabled:v,defaultLayout:_}=a,y=function({dropZoneElement:e,rootClientId:t="",parentClientId:n="",isDisabled:o=!1}={}){const r=(0,g.useRegistry)(),[i,s]=(0,h.useState)({index:null,operation:"insert"}),{getBlockType:l,getBlockVariations:a,getGroupingBlockName:c}=(0,g.useSelect)(p.store),{canInsertBlockType:u,getBlockListSettings:d,getBlocks:f,getBlockIndex:b,getDraggedBlockClientIds:k,getBlockNamesByClientId:v,getAllowedBlocks:_,isDragging:y,isGroupable:x,isZ
2oomOut:S,getSectionRootClientId:w,getBlockParents:C}=U((0,g.useSelect)(Ii)),{showInsertionPoint:B,hideInsertionPoint:I,startDragging:j,stopDragging:E}=U((0,g.useDispatch)(Ii)),M=vS("before"===i.operation||"after"===i.operation?n:t,i.index,{operation:i.operation,nearestSide:i.nearestSide}),P=(0,m.useThrottle)((0,h.useCallback)((o,i)=>{y()||j();const h=k(),g=[t,...C(t,!0)];if(h.some(e=>g.includes(e)))return;const m=_(t),I=v([t])[0],E=v(h);if(!CS(l,m,E,I))return;const M=w();if(S()&&M!==t)return;const P=f(t).filter(e=>!((0,p.hasBlockSupport)(e.name,"visibility",!0)&&!1===e.attributes?.metadata?.blockVisibility));if(0===P.length)return void r.batch(()=>{s({index:0,operation:"insert"}),B(t,0,{operation:"insert"})});const R=P.map(e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,p.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>{const e=i.getElementById(`block-${t}`);return e?e.getBoundingClientRect():null},blockIndex:b(t),blockOrientation:d(t)?.orientation}}),A=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]=_S(t,e,["top","bottom"]);if(e.height>SS&&n<xS){if("top"===o)return[p,"before"];if("bottom"===o)return[p+1,"after"]}}const h=(0,T.isRTL)();if(u&&"horizontal"===d){const e=u.getBoundingClientRect(),[n,o]=_S(t,e,["left","right"]);if(e.width>wS&&n<xS){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();if(!p)return;let[g,m]=_S(t,p,r);const[f,b]=_S(t,p,["left","right"]),k=yS(t,p);e&&k?g=0:"vertical"===n&&"horizontal"!==d&&(k&&f<xS||!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;return null!==a?[a,"group",c]:m||f?[m?i:g,"replace"]:["after"===s?i+1:i,"insert"]}(R,{x:o.clientX,y:o.clientY},d(t)?.orientation,{dropZoneElement:e,parentBlockClientId:n,parentBlockOrientation:n?d(n)?.orientation:void 0,rootBlockIndex:b(t)}),[N,L,D]=A,O=R[N]?.isUnmodifiedDefaultBlock;if(!S()||O||"insert"===L){if("group"===L){const e=P[N],n=[e.name,...E].every(e=>"core/image"===e),o=u("core/gallery",t),r=x([e.clientId,k()]),i=a(c(),"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:N,operation:L,nearestSide:D});const e=["before","after"].includes(L)?n:t;B(e,N,{operation:L,nearestSide:D})})}},[y,_,t,v,k,l,w,S,f,d,e,n,b,r,j,B,u,x,a,c]),200);return(0,m.__experimentalUseDropZone)({dropZoneElement:e,isDisabled:o,onDrop:M,onDragOver(e){P(e,e.currentTarget.ownerDocument)},onDragLeave(e){const{ownerDocument:t}=e.currentTarget;BS(e.relatedTarget,t)||BS(e.target,t)||(P.cancel(),I())},onDragEnd(){P.cancel(),E(),I()}})}({dropZoneElement:r,rootClientId:i,parentClientId:k}),x=(0,m.useMergeRefs)([e.ref,o||v||s?.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:y]),S={__experimentalCaptureToolbars:c,layout:s,name:u,blockType:f,parentLock:b,defaultLayout:_,...t},w=S.value&&S.onChange?MS:TS;return{...e,ref:x,className:gs(e.className,"block-editor-block-list__layout",n?"":l),children:i?(0,d.jsx)(w,{...S,clientId:i}):(0,d.jsx)(qS,{...t})}}RS.save=p.__unstableGetInnerBlocksProps,PS.DefaultBlockAppender=function(){const{clientId:e}=C();return(0,d.jsx)(nS,{rootClientId:e})},PS.ButtonBlockAppender=function({showSeparator:e,isFloating:t,onAddBlock:n,isToggle:o}){const{clientId:r}=C();return(0,d.jsx)(HB,{className:gs({"block-list-appender__toggle":o}),rootClientId:r,showSeparator:e,isFloating:t,onAddBlock:n})},PS.Content=()=>RS.save().children;var AS=PS;const NS=new Set([Ua.UP,Ua.RIGHT,Ua.DOWN,Ua.LEFT,Ua.ENTER,Ua.BACKSPACE]);function LS(){const e=(0,g.useSelect)(e=>e(Ii).isTyping(),[]),{stopTyping:t}=(0,g.useDispatch)(Ii);return(0,m.useRefEffect)(n=>{if(!e)return;const{ownerDocument:o}=n;let r,i;function s(e){const{clientX:n,clientY:o}=e;
2r&&i&&(r!==n||i!==o)&&t(),r=n,i=o}return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)}},[e,t])}function DS(){const{isTyping:e}=(0,g.useSelect)(e=>{const{isTyping:t}=e(Ii);return{isTyping:t()}},[]),{startTyping:t,stopTyping:n}=(0,g.useDispatch)(Ii),o=LS(),r=(0,m.useRefEffect)(o=>{const{ownerDocument:r}=o,{defaultView:i}=r,s=i.getSelection();if(e){let e,t=function(t){const{target:o}=t;e=i.setTimeout(()=>{(0,Fa.isTextField)(o)||n()})},l=function(e){const{keyCode:t}=e;t!==Ua.ESCAPE&&t!==Ua.TAB||n()},a=function(){s.isCollapsed||n()};return o.addEventListener("focus",t),o.addEventListener("keydown",l),r.addEventListener("selectionchange",a),()=>{i.clearTimeout(e),o.removeEventListener("focus",t),o.removeEventListener("keydown",l),r.removeEventListener("selectionchange",a)}}function l(e){const{type:n,target:r}=e;(0,Fa.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&NS.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,m.useMergeRefs)([o,r])}var OS=function({children:e}){return(0,d.jsx)("div",{ref:DS(),children:e})};function zS({clientId:e,rootClientId:t="",position:n="top"}){const[o,r]=(0,h.useState)(!1),{sectionRootClientId:i,sectionClientIds:s,insertionPoint:l,blockInsertionPointVisible:a,blockInsertionPoint:c,blocksBeingDragged:u}=(0,g.useSelect)(e=>{const{getInsertionPoint:t,getBlockOrder:n,getSectionRootClientId:o,isBlockInsertionPointVisible:r,getBlockInsertionPoint:i,getDraggedBlockClientIds:s}=U(e(Ii)),l=o();return{sectionRootClientId:l,sectionClientIds:n(l),insertionPoint:t(),blockInsertionPoint:i(),blockInsertionPointVisible:r(),blocksBeingDragged:s()}},[]),p=(0,m.useReducedMotion)();if(!e)return;let f=!1;if(t!==i||!s||!s.includes(e))return null;const b=0===l?.index&&e===s[l.index],k=l&&l.hasOwnProperty("index")&&e===s[l.index-1];"top"===n&&(f=b||a&&0===c.index&&e===s[c.index]),"bottom"===n&&(f=k||a&&e===s[c.index-1]);const v=u[0],_=u.includes(e),y=s.indexOf(v),x=y>0?s[y-1]:null;return(_||x===e)&&(f=!1),(0,d.jsx)(Ss.__unstableAnimatePresence,{children:f&&(0,d.jsx)(Ss.__unstableMotion.div,{initial:{height:0},animate:{height:"calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)"},exit:{height:0},transition:{type:"tween",duration:p?0:.2,ease:[.6,0,.4,1]},className:gs("block-editor-block-list__zoom-out-separator",{"is-dragged-over":o}),"data-is-insertion-point":"true",onDragOver:()=>r(!0),onDragLeave:()=>r(!1),children:(0,d.jsx)(Ss.__unstableMotion.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0,transition:{delay:-.125}},transition:{ease:"linear",duration:.1,delay:.125},children:(0,T.__)("Drop pattern.")})})})}const VS=(0,h.createContext)();VS.displayName="IntersectionObserverContext";const FS=new WeakMap,HS={trailing:!0};function US({className:e,...t}){const{isOutlineMode:n,isFocusMode:o,temporarilyEditingAsBlocks:r}=(0,g.useSelect)(e=>{const{getSettings:t,getTemporarilyEditingAsBlocks:n,isTyping:o,hasBlockSpotlight:r}=U(e(Ii)),{outlineMode:i,focusMode:s}=t();return{isOutlineMode:i&&!o(),isFocusMode:s||r(),temporarilyEditingAsBlocks:n()}},[]),i=(0,g.useRegistry)(),{setBlockVisibility:s}=(0,g.useDispatch)(Ii),l=(0,m.useDebounce)((0,h.useCallback)(()=>{const e={};FS.get(i).forEach(([t,n])=>{e[t]=n}),s(e)},[i]),300,HS),a=(0,h.useMemo)(()=>{const{IntersectionObserver:e}=window;if(e)return new e(e=>{FS.get(i)||FS.set(i,[]);for(const t of e){const e=t.target.getAttribute("data-block");FS.get(i).push([e,t.isIntersecting])}l()})},[]),c=RS({ref:(0,m.useMergeRefs)([hS(),pS(),DS()]),className:gs("is-root-container",e,{"is-outline-mode":n,"is-focus-mode":o})},t);return(0,d.jsxs)(VS.Provider,{value:a,children:[(0,d.jsx)("div",{...c}),!!r&&(0,d.jsx)(GS,{clientId:r})]})}function GS({clientId:e}){const{stopEditingAsBlocks:t}=U((0,g.useDispatch)(Ii)),n=(0,g.useSelect)(t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t(Ii);return n(e)||o(e,!0)},[e]);return(0,h.useEffect)(()=>{n||t(e)},[n,e,t]),null}function $S(e){return(0,d.jsx)(w,{value:x,children:(0,d.jsx)(US,{...e})})}const WS=[],KS=new Set;function ZS({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:o,layout:r=ql}){const i=!1!==n,s=!!n,{order:l,isZoomOut:a,selectedBlocks:c,visibleBlocks:u,shouldRenderAppender:h}=(0,g.useSelect)(e=>{const{getSettings:n,getBlockOrder:o,getSelectedBlockClientIds:r,__unstableGetVisibleBlocks:l,getTemplateLock:a,getBlockEditingMode:c,isSectionBlock:u,isContainerInsertableToInContentOnlyMode:d,getBlockName:h,isZoomOut:g,canInsertBlockType:m}=U(e(Ii)),f=o(t);if(n().isPreviewMode)return{order:f,selectedBlocks:WS,visibleBlocks:KS};const b=r(),k=b[0],v=!(t||k||f.length&&m((0,p.getDefaultBlockName)(),t)),_=!(!t||!k||t!==k);return{order:f,selectedBlocks:b,visibleBlocks:l(),isZoomOut:g(),shouldRenderAppender:(!u(t)||d(h(k),t))&&"disabled"!==c(t)&&!a(t)&&i&&!g()&&(s||_||v)}},[t,i,s]);return(0,d.jsxs)(Xl,{value:r,children:[l.map(e=>(0,d.jsxs)(g.AsyncModeProvider,{value:!u.has(e)&&!c.includes(e),children:[a&&(0,d.jsx)(zS,{clientId:e,rootClientId:t,position:"top"}),(0,d.jsx)(Jx,{rootClientId:t,clientId:e}),a&&(0,d.jsx)(zS,{clientId:e,rootClientId:t,position:"bottom"})]},e)),l.length<1&&e,h&&(0,d.jsx)(rS,{tagName:o,rootClientId:t,CustomAppender:n})]})}function qS(e){return(0,d.jsx)(g.AsyncModeProvider,{value:!1,children:(0,d.jsx)(ZS,{...e})})}function YS(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:i,__unstableIsFullySelected:s}=e(Ii);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:i(),isFullSelection:s()}}function XS(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:i}=(0,g.useSelect)(YS,[]);return(0,m.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 QS(e,t,n,o){let r,i=Fa.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&&Am(e,e.firstElementChild)&&"true"===e.firstElementChild.getAttribute("contenteditable"))){if(!Fa.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 JS(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,g.useSelect)(Ii),{selectBlock:i}=(0,g.useDispatch)(Ii);return(0,m.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===Ua.UP,f=c===Ua.DOWN,b=c===Ua.LEFT,k=c===Ua.RIGHT,v=m||b,_=b||k,y=m||f,x=_||y,S=d||p||h||g,w=y?Fa.isVerticalEdge:Fa.isHorizontalEdge,{ownerDocument:C}=s,{defaultView:B}=C;if(!x)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===Ua.UP||t===Ua.DOWN,{tagName:r}=e,i=e.getAttribute("type");return o&&!n?"INPUT"!==r||!["date","datetime-local","month","number","range","t
2ime","week"].includes(i):"INPUT"===r?["button","checkbox","number","color","file","image","radio","reset","submit"].includes(i):"TEXTAREA"!==r}(u,c,S))return;y?l||(l=(0,Fa.computeCaretRect)(B)):l=null;const I=(0,Fa.isRTL)(u)?!v:v,{keepCaretInsideBlock:j}=n();if(d)(function(e,t){const n=QS(e,t,s);return n&&Lm(n)})(u,v)&&w(u,v)&&(s.contentEditable=!0,s.focus());else if(!y||!(0,Fa.isVerticalEdge)(u,v)||h&&!(0,Fa.isHorizontalEdge)(u,I)||j){if(_&&B.getSelection().isCollapsed&&(0,Fa.isHorizontalEdge)(u,I)&&!j){const e=QS(u,I,s);(0,Fa.placeCaretAtHorizontalEdge)(e,v),a.preventDefault()}}else{const e=QS(u,v,s,!0);e&&((0,Fa.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 ew(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,g.useSelect)(Ii),{multiSelect:o,selectBlock:r}=(0,g.useDispatch)(Ii),i=(0,Nk.__unstableUseShortcutEventMatch)();return(0,m.useRefEffect)(s=>{function l(l){if(!i("core/block-editor/select-all",l))return;const a=t();if(a.length<2&&!(0,Fa.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 tw(e,t){e.contentEditable=t,t&&e.focus()}function nw(){const{startMultiSelect:e,stopMultiSelect:t}=(0,g.useDispatch)(Ii),{isSelectionEnabled:n,hasSelectedBlock:o,isDraggingBlocks:r,isMultiSelecting:i}=(0,g.useSelect)(Ii);return(0,m.useRefEffect)(s=>{const{ownerDocument:l}=s,{defaultView:a}=l;let c,u,d;function p(){t(),a.removeEventListener("mouseup",p),u=a.requestAnimationFrame(()=>{if(!o())return;tw(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 h({buttons:t,target:o,relatedTarget:l}){o.contains(d)&&(o.contains(l)||r()||1===t&&(i()||s!==o&&"true"===o.getAttribute("contenteditable")&&n()&&(c=o,e(),a.addEventListener("mouseup",p),tw(s,!0))))}return s.addEventListener("mouseout",h),s.addEventListener("mousedown",function({target:e}){d=e}),()=>{s.removeEventListener("mouseout",h),a.removeEventListener("mouseup",p),a.cancelAnimationFrame(u)}},[e,t,n,o])}function ow(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function rw(e){const t=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;return t?.closest("[data-wp-block-attribute-key]")}function iw(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,g.useDispatch)(Ii),{getBlockParents:o,getBlockSelectionStart:r,isMultiSelecting:i}=(0,g.useSelect)(Ii);return(0,m.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,Fa.isSelectionForward)(e)?t.previousSibling??t.parentElement:t.childNodes[n]}(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()){ow(s,!1);let e=u.nodeType===u.ELEMENT_NODE?u:u.parentElement;e=e?.closest("[contenteditable]"),e?.focus()}return}let h=Lm(u),g=Lm(d);if(p){const e=r(),t=Lm(l.target),n=t!==g;(h===g&&c.isCollapsed||!g||n)&&(g=t),h!==e&&(h=e)}if(void 0!==h||void 0!==g)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=rw(u),l=rw(d);if(s&&l){const e=c.getRangeAt(0),t=(0,de.create)({element:s,range:e,__unstableIsEditableTree:!0}),o=(0,de.create)({element:l,range:e,__unstableIsEditableTree:!0}),r=t.start??t.end,i=o.start??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)}else ow(s,!1)}return l.addEventListener("selectionchange",c),a.addEventListener("mouseup",c),()=>{l.removeEventListener("selectionchange",c),a.removeEventListener("mouseup",c)}},[e,t,n,o])}function sw(){const{selectBlock:e}=(0,g.useDispatch)(Ii),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,g.useSelect)(Ii);return(0,m.useRefEffect)(r=>{function i(i){if(!t()||0!==i.button)return;const s=n(),l=Lm(i.target);
2i.shiftKey?s&&s!==l&&(r.contentEditable=!0,r.focus()):o()&&e(l)}return r.addEventListener("mousedown",i),()=>{r.removeEventListener("mousedown",i)}},[e,t,n,o])}function lw(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,getSelectedBlockClientId:n,__unstableIsSelectionMergeable:o,hasMultiSelection:r,getBlockName:i,canInsertBlockType:s,getBlockRootClientId:l,getSelectionStart:a,getSelectionEnd:c,getBlockAttributes:u}=(0,g.useSelect)(Ii),{replaceBlocks:d,__unstableSplitSelection:h,removeBlocks:f,__unstableDeleteSelection:b,__unstableExpandSelection:k,__unstableMarkAutomaticChange:v}=(0,g.useDispatch)(Ii);return(0,m.useRefEffect)(g=>{function m(e){"true"===g.contentEditable&&e.preventDefault()}function _(m){if(!m.defaultPrevented)if(r())m.keyCode===Ua.ENTER?(g.contentEditable=!1,m.preventDefault(),e()?d(t(),(0,p.createBlock)((0,p.getDefaultBlockName)())):h()):m.keyCode===Ua.BACKSPACE||m.keyCode===Ua.DELETE?(g.contentEditable=!1,m.preventDefault(),e()?f(t()):o()?b(m.keyCode===Ua.DELETE):k()):1!==m.key.length||m.metaKey||m.ctrlKey||(g.contentEditable=!1,o()?b(m.keyCode===Ua.DELETE):(m.preventDefault(),g.ownerDocument.defaultView.getSelection().removeAllRanges()));else if(m.keyCode===Ua.ENTER){if(m.shiftKey||e())return;const t=n(),o=i(t),r=a(),g=c();if(r.attributeKey===g.attributeKey){const e=u(t)[r.attributeKey],n=(0,p.getBlockTransforms)("from").filter(({type:e})=>"enter"===e),o=(0,p.findTransform)(n,t=>t.regExp.test(e));if(o)return d(t,o.transform({content:e})),void v()}if(!(0,p.hasBlockSupport)(o,"splitting",!1)&&!m.__deprecatedOnSplit)return;s(o,l(t))&&(h(),m.preventDefault())}}function y(e){r()&&(g.contentEditable=!1,o()?b():(e.preventDefault(),g.ownerDocument.defaultView.getSelection().removeAllRanges()))}return g.addEventListener("beforeinput",m),g.addEventListener("keydown",_),g.addEventListener("compositionstart",y),()=>{g.removeEventListener("beforeinput",m),g.removeEventListener("keydown",_),g.removeEventListener("compositionstart",y)}},[])}function aw(){const{getBlockName:e}=(0,g.useSelect)(Ii),{getBlockType:t}=(0,g.useSelect)(p.store),{createSuccessNotice:n}=(0,g.useDispatch)(dr.store);return(0,h.useCallback)((o,r)=>{let i="";if("copyStyles"===o)i=(0,T.__)("Styles copied to clipboard.");else if(1===r.length){const n=r[0],s=t(e(n))?.title;i="copy"===o?(0,T.sprintf)((0,T.__)('Copied "%s" to clipboard.'),s):(0,T.sprintf)((0,T.__)('Moved "%s" to clipboard.'),s)}else i="copy"===o?(0,T.sprintf)((0,T._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,T.sprintf)((0,T._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(i,{type:"snackbar"})},[n,e,t])}function cw({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch(e){return}n=function(e){const t=e.indexOf("\x3c!--StartFragment--\x3e");if(!(t>-1))return e;const n=(e=e.substring(t+20)).indexOf("\x3c!--EndFragment--\x3e");return n>-1&&(e=e.substring(0,n)),e}(n),n=function(e){return e.startsWith("<meta charset='utf-8'>")?e.slice(22):e}(n);const o=(0,Fa.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 uw=Symbol("requiresWrapperOnCopy");function dw(e,t,n){let o=t;const[r]=t;if(r&&n.select(p.store).getBlockType(r.name)[uw]){const{getBlockRootClientId:e,getBlockName:t,getBlockAttributes:i}=n.select(Ii),s=e(r.clientId),l=t(s);l&&(o=(0,p.createBlock)(l,i(s),o))}const i=(0,p.serialize)(o);var s;e.clipboardData.setData("text/plain",(s=(s=i).replace(/<br>/g,"\n"),(0,Fa.__unstableStripHTML)(s).trim().replace(/\n\n+/g,"\n\n"))),e.clipboardData.setData("text/html",i)}function pw(){const e=(0,g.useRegistry)(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:o,getSettings:r,getBlockName:i,__unstableIsFullySelected:s,__unstableIsSelectionCollapsed:l,__unstableIsSelectionMergeable:a,__unstableGetSelectedBlocksWithPartialSelection:c,canInsertBlockType:u,getBlockRo
2otClientId:d}=(0,g.useSelect)(Ii),{flashBlock:h,removeBlocks:f,replaceBlocks:b,__unstableDeleteSelection:k,__unstableExpandSelection:v,__unstableSplitSelection:_}=(0,g.useDispatch)(Ii),y=aw();return(0,m.useRefEffect)(g=>{function m(m){if(m.defaultPrevented)return;const x=n();if(0===x.length)return;if(!o()){const{target:e}=m,{ownerDocument:t}=e;if("copy"===m.type||"cut"===m.type?(0,Fa.documentHasUncollapsedSelection)(t):(0,Fa.documentHasSelection)(t)&&!t.activeElement.isContentEditable)return}const{activeElement:S}=m.target.ownerDocument;if(!g.contains(S))return;const w=a(),C=l()||s(),B=!C&&!w;if("copy"===m.type||"cut"===m.type)if(m.preventDefault(),1===x.length&&h(x[0]),B)v();else{let n;if(y(m.type,x),C)n=t(x);else{const[e,o]=c();n=[e,...t(x.slice(1,x.length-1)),o]}dw(m,n,e)}if("cut"===m.type)C&&!B?f(x):(m.target.ownerDocument.activeElement.contentEditable=!1,k());else if("paste"===m.type){const{__experimentalCanUserUseUnfilteredHTML:e,mediaUpload:t}=r();if("true"===m.clipboardData.getData("rich-text"))return;const{plainText:n,html:l,files:a}=cw(m),c=s();let h=[];if(a.length){if(!t)return void m.preventDefault();const e=(0,p.getBlockTransforms)("from");h=a.reduce((t,n)=>{const o=(0,p.findTransform)(e,e=>"files"===e.type&&e.isMatch([n]));return o&&t.push(o.transform([n])),t},[]).flat()}else h=(0,p.pasteHandler)({HTML:l,plainText:n,mode:c?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:e});if("string"==typeof h)return;if(c)return b(x,h,h.length-1,-1),void m.preventDefault();if(!o()&&!(0,p.hasBlockSupport)(i(x[0]),"splitting",!1)&&!m.__deprecatedOnSplit)return;const[g]=x,f=d(g),k=[];for(const e of h)if(u(e.name,f))k.push(e);else{const t=i(f),n=e.name!==t?(0,p.switchToBlockType)(e,t):[e];if(!n)return;for(const e of n)for(const t of e.innerBlocks)k.push(t)}_(k),m.preventDefault()}}return g.ownerDocument.addEventListener("copy",m),g.ownerDocument.addEventListener("cut",m),g.ownerDocument.addEventListener("paste",m),()=>{g.ownerDocument.removeEventListener("copy",m),g.ownerDocument.removeEventListener("cut",m),g.ownerDocument.removeEventListener("paste",m)}},[])}function hw(){const[e,t,n]=function(){const e=(0,h.useRef)(),t=(0,h.useRef)(),n=(0,h.useRef)(),{hasMultiSelection:o,getSelectedBlockClientId:r,getBlockCount:i,getBlockOrder:s,getLastFocus:l,getSectionRootClientId:a,isZoomOut:c}=U((0,g.useSelect)(Ii)),{setLastFocus:u}=U((0,g.useDispatch)(Ii)),p=(0,h.useRef)();function f(t){const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement;if(p.current)p.current=null;else if(o())e.current.focus();else if(r())l()?.current?l().current.focus():e.current.querySelector(`[data-block="${r()}"]`).focus();else if(c()){const t=a(),o=s(t);o.length?e.current.querySelector(`[data-block="${o[0]}"]`).focus():t?e.current.querySelector(`[data-block="${t}"]`).focus():n.focus()}else{const o=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,r=Fa.focus.tabbable.find(e.current);r.length&&(o?r[0]:r[r.length-1]).focus()}}const b=(0,d.jsx)("div",{ref:t,tabIndex:"0",onFocus:f}),k=(0,d.jsx)("div",{ref:n,tabIndex:"0",onFocus:f}),v=(0,m.useRefEffect)(o=>{function r(e){if(e.defaultPrevented)return;if(e.keyCode!==Ua.TAB)return;if(!n.current||!t.current)return;const{target:o,shiftKey:r}=e,i=r?"findPrevious":"findNext",s=Fa.focus.tabbable[i](o),l=o.closest("[data-block]"),a=l&&s&&(Am(l,s)||Nm(l,s));if((0,Fa.isFormElement)(s)&&a)return;const c=r?t:n;p.current=!0,c.current.focus({preventScroll:!0})}function s(e){u({...l(),current:e.target});const{ownerDocument:t}=o;!e.relatedTarget&&e.target.hasAttribute("data-block")&&t.activeElement===t.body&&0===i()&&o.focus()}function a(o){if(o.keyCode!==Ua.TAB)return;if("region"===o.target?.getAttribute("role"))return;if(e.current===o.target)return;const r=o.shiftKey?"findPrevious":"findNext",i=Fa.focus.tabbable[r](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:c}=o,{defaultView:d}=c;return d.addEventListener("keydown",a),o.addEventListener("keydown",r),o.addEventListener("focusout",s),()=>{d.removeEventListener("keydown",a),o.removeEventListener("keydown",r),o.removeEventListener("focusout",s
2)}},[]);return[b,(0,m.useMergeRefs)([e,v]),k]}(),o=(0,g.useSelect)(e=>e(Ii).hasMultiSelection(),[]);return[e,(0,m.useMergeRefs)([t,pw(),lw(),nw(),iw(),sw(),XS(),ew(),JS(),(0,m.useRefEffect)(e=>(e.tabIndex=0,e.dataset.hasMultiSelection=o,o?(e.setAttribute("aria-label",(0,T.__)("Multiple selected blocks")),()=>{delete e.dataset.hasMultiSelection,e.removeAttribute("aria-label")}):()=>{delete e.dataset.hasMultiSelection}),[o])]),n]}var gw=(0,h.forwardRef)(function({children:e,...t},n){const[o,r,i]=hw();return(0,d.jsxs)(d.Fragment,{children:[o,(0,d.jsx)("div",{...t,ref:(0,m.useMergeRefs)([r,n]),className:gs(t.className,"block-editor-writing-flow"),children:e}),i]})});let mw=null;function fw({frameSize:e,containerWidth:t,maxContainerWidth:n,scaleContainerWidth:o}){return(Math.min(t,n)-2*e)/o}function bw(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 kw(e){return(0,m.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;bw(e,window[t],n)},o.addEventListener(e,i[e]);return()=>{for(const e of r)o.removeEventListener(e,i[e])}})}function vw({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:r=0,readonly:i,forwardedRef:s,title:l=(0,T.__)("Editor canvas"),...a}){const{resolvedAssets:c,isPreviewMode:u}=(0,g.useSelect)(e=>{const{getSettings:t}=e(Ii),n=t();return{resolvedAssets:n.__unstableResolvedAssets,isPreviewMode:n.isPreviewMode}},[]),{styles:p="",scripts:f=""}=c,[b,k]=(0,h.useState)(),[v,_]=(0,h.useState)([]),y=hS(),[x,S,w]=hw(),C=(0,m.useRefEffect)(e=>{let t;function n(e){e.preventDefault()}function o(e){"A"===e.target.tagName&&e.target.getAttribute("href")?.startsWith("#")&&(e.preventDefault(),t.defaultView.location.hash=e.target.getAttribute("href").slice(1))}e._load=()=>{k(e.contentDocument)};const{ownerDocument:r}=e;function i(){const{contentDocument:i}=e,{documentElement:s}=i;t=i,s.classList.add("block-editor-iframe__html"),y(s),i.dir=r.dir;for(const e of mw||(mw=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(n.id.startsWith("wp-"))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},[]),mw))i.getElementById(e.id)||(i.head.appendChild(e.cloneNode(!0)),u||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),t.addEventListener("click",o)}return _(Array.from(r.body.classList).filter(e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e)),e.addEventListener("load",i),()=>{delete e._load,e.removeEventListener("load",i),t?.removeEventListener("dragover",n),t?.removeEventListener("drop",n),t?.removeEventListener("click",o)}},[]),{contentResizeListener:B,containerResizeListener:I,isZoomedOut:j,scaleContainerWidth:E}=function({frameSize:e,iframeDocument:t,maxContainerWidth:n=750,scale:o}){const[r,{height:i}]=(0,m.useResizeObserver)(),[s,{width:l,height:a}]=(0,m.useResizeObserver)(),c=(0,h.useRef)(0),u=1!==o,d=(0,m.useReducedMotion)(),p="auto-scaled"===o,g=(0,h.useRef)(!1),f=(0,h.useRef)(null);(0,h.useEffect)(()=>{u||(c.current=l)},[l,u]);const b=Math.max(c.current,l),k=p?fw({frameSize:e,containerWidth:l,maxContainerWidth:n,scaleContainerWidth:b}):o,v=(0,h.useRef)({scaleValue:k,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),_=(0,h.useRef)({scaleValue:k,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),y=(0,h.useCallback)(()=>{const{scrollTop:e}=v.current,{scrollTop:n}=_.current;return t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top",`${e}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next",`${n}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior",v.current.scrollHeight===v.current.containerHeight?"auto":"scroll"),t.documentElement.classList.add("zoom-out-animation"),t.documentElement.animate(function(e,t){const{scaleValue:n,frameSize:o,scrollTop:r}=e,{scaleValue:i,frameSize:s,scrollTop:l}=t;return[{translate:"0 0",scale:n,paddingTop:o/n+"px",paddingBottom:o/n+"px"},{translate:`0 ${r-l}px`,scale:i,paddingTop:s/i+"px",paddingBottom:s/i+"px"}]}
2(v.current,_.current),{easing:"cubic-bezier(0.46, 0.03, 0.52, 0.96)",duration:400})},[t]),x=(0,h.useCallback)(()=>{g.current=!1,f.current=null,t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",_.current.scaleValue),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${_.current.frameSize}px`),t.documentElement.classList.remove("zoom-out-animation"),t.documentElement.scrollTop=_.current.scrollTop,t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior"),v.current=_.current},[t]),S=(0,h.useRef)(!1);return(0,h.useEffect)(()=>{const e=t&&S.current!==u;if(S.current=u,e&&(g.current=!0,u))return t.documentElement.classList.add("is-zoomed-out"),()=>{t.documentElement.classList.remove("is-zoomed-out")}},[t,u]),(0,h.useEffect)(()=>{if(t&&(p&&1!==v.current.scaleValue&&(v.current.scaleValue=fw({frameSize:v.current.frameSize,containerWidth:l,maxContainerWidth:n,scaleContainerWidth:l})),k<1&&(g.current||(t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",k),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${e}px`)),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-content-height",`${i}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-inner-height",`${a}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-container-width",`${l}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale-container-width",`${b}px`)),g.current))if(g.current=!1,f.current){f.current.reverse();const e=v.current,t=_.current;v.current=t,_.current=e}else v.current.scrollTop=t.documentElement.scrollTop,v.current.scrollHeight=t.documentElement.scrollHeight,v.current.containerHeight=a,_.current={scaleValue:k,frameSize:e,containerHeight:t.documentElement.clientHeight},_.current.scrollHeight=function(e,t){const{scaleValue:n,scrollHeight:o}=e,{frameSize:r,scaleValue:i}=t;return o*(i/n)+2*r}(v.current,_.current),_.current.scrollTop=function(e,t){const{containerHeight:n,frameSize:o,scaleValue:r,scrollTop:i}=e,{containerHeight:s,frameSize:l,scaleValue:a,scrollHeight:c}=t;let u=i;u=(u+n/2-o)/r-n/2,u=(u+s/2)*a+l-s/2,u=i<=o?0:u;const d=c-s;return Math.round(Math.min(Math.max(0,u),Math.max(0,d)))}(v.current,_.current),f.current=y(),d?x():f.current.onfinish=x},[y,x,d,p,k,e,t,i,l,a,n,b]),{isZoomedOut:u,scaleContainerWidth:b,contentResizeListener:r,containerResizeListener:s}}({scale:o,frameSize:parseInt(r),iframeDocument:b}),M=(0,m.useDisabled)({isDisabled:!i}),P=(0,m.useMergeRefs)([kw(b),e,y,S,M]),R=`<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset="utf-8">\n\t\t<base href="${window.location.origin}">\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${p}\n\t\t${f}\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()<\/script>\n\t</body>\n</html>`,[A,N]=(0,h.useMemo)(()=>{const e=URL.createObjectURL(new window.Blob([R],{type:"text/html"}));return[e,()=>URL.revokeObjectURL(e)]},[R]);(0,h.useEffect)(()=>N,[N]);const L=n>=0&&!u,D=(0,d.jsxs)(d.Fragment,{children:[L&&x,(0,d.jsx)("iframe",{...a,style:{...a.style,height:a.style?.height,border:0},ref:(0,m.useMergeRefs)([s,C]),tabIndex:n,src:A,title:l,onKeyDown:e=>{if(a.onKeyDown&&a.onKeyDown(e),e.currentTarget.ownerDocument!==e.target.ownerDocument){const{stopPropagation:t}=e.nativeEvent;e.nativeEvent.stopPropagation=()=>{},e.stopPropagation(),e.nativeEvent.stopPropagation=t,bw(e,window.KeyboardEvent,e.currentTarget)}},children:b&&(0,h.createPortal)((0,d.jsxs)("body",{ref:P,className:gs("block-editor-iframe__body","editor-styles-wrapper",...v),children:[B,(0,d.jsx)(Ss.__experimentalStyleProvider,{document:b,children:t})]}),b.documentElement)}),L&&w]});return(0,d.jsxs)("div",{className:"block-editor-iframe__container",children:[I,(0,d.jsx)("div",{className:gs("block-editor-iframe__scale-container",j&&"is-zoomed-out"),style:{"--wp-block-editor-iframe-zoom-out-scale-container-width":j&&`${E}px`},children:D})]})}var _w=(0,h.forwardRef)(function(e,t){return(0,g.useSelect)(e=>e(Ii).getSettings().__internalIsInitialized,[])?(0,d.jsx)(vw,{...e,forwardedRef:t}):null});const yw={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},xw=new Set(["combinator","comma"]),Sw=(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(yw[e].source.replace("(?<argument>¶*)","(?<argument>.*)"),"gu");default:return yw[e]}});function ww(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 Cw=/(['"])([^\\\n]*?)\1/g,Bw=/\\./g;function Iw(e,t=yw){if(""===(e=e.trim()))return[];const n=[];e=(e=e.replace(Bw,(e,t)=>(n.push({value:e,offset:t}),"î".repeat(e.length)))).replace(Cw,(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=ww(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=yw){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}
2 found at index ${o}`);case"object":o+=e.content.length,e.pos=[o-e.content.length,o],xw.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=Sw(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 jw(e){if(Array.isArray(e))return e.map(e=>e.content).join("");switch(e.type){case"list":return e.list.map(jw).join(",");case"relative":return e.combinator+jw(e.right);case"complex":return jw(e.left)+e.combinator+jw(e.right);case"compound":return e.list.map(jw).join("");default:return e.content}}var Ew=n(6846),Tw=n.n(Ew),Mw=n(3614),Pw=n.n(Mw),Rw=n(9193),Aw=n.n(Rw),Nw=n(9370),Lw=n.n(Nw);const Dw=new Map,Ow=[{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)"}];var zw=(e,t="",n)=>{let o=Dw.get(t);return o||(o=new WeakMap,Dw.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{const i=[...t,...r?.ignoredSelectors??[],o];return new(Tw())([o&&Aw()({prefix:o,transform:(e,t,n)=>i.some(e=>e instanceof RegExp?t.match(e):t.includes(e))?t:Ow.some(e=>t.startsWith(e.content))?function(e,t){const n=Iw(t);let o=-1;for(let e=n.findLastIndex(({content:e,type:t})=>Ow.some(n=>e===n.content&&t===n.type))+1;e<n.length;e++)if("combinator"===n[e].type){o=e;break}const r=Iw(e);return n.splice(-1===o?n.length:o,0,{type:"combinator",content:" "},...r),jw(n)}(e,t):n}),n&&Lw()({rootUrl:n})].filter(Boolean)).process(e,{}).css}catch(e){return e instanceof Pw()?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 Vw(e,t){return(0,h.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=bd(s);l.luminance()>.5||0===l.alpha()?r.classList.remove("is-dark-theme"):r.classList.add("is-dark-theme")},[e,t])}vd([_d,Sd]);var Fw=(0,h.memo)(function({styles:e,scope:t,transformOptions:n}){const o=(0,g.useSelect)(e=>U(e(Ii)).getStyleOverrides(),[]),[r,i]=(0,h.useMemo)(()=>{const r=Object.values(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[zw(r.filter(e=>e?.css),t,n),r.filter(e=>"svgs"===e.__unstableType).map(e=>e.assets).join("")]},[e,o,t,n]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("style",{ref:Vw(r,t)}),r.map((e,t)=>(0,d.jsx)("style",{children:e},t)),(0,d.jsx)(Ss.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}})]})});const Hw=(0,h.memo)($S),Uw=2e3,Gw=[];function $w({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:o=Gw}){e||(e=t);const[r,{height:i}]=(0,m.useResizeObserver)(),{styles:s}=(0,g.useSelect)(e=>({styles:e(Ii).getSettings().styles}),[]),l=(0,h.useMemo)(()=>s?[...s,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o]:s,[s,o]),a=t/e,c=i?t/(i*a):0;return(0,d.jsx)(Ss.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${a})`,aspectRatio:c,maxHeight:i>Uw?Uw*a:void 0,minHeight:n},children:(0,d.jsxs)(_w,{contentRef:(0,m.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:Uw,minHeight:0!==a&&a<1&&n?n/a:n},children:[(0,d.jsx)(Fw,{styles:l}),r,(0,d.jsx)(Hw,{renderAppender:!1})]})})}function Ww(e){const[t,{width:n}]=(0,m.useResizeObserver)();return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{style:{position:"relative",width:"100%",height:0},children:t}),(0,d.jsx)("div",{className:"block-editor-block-preview__container",children:!!n&&(0,d.jsx)($w,{...e,containerWidth:n})})]})}const Kw=(0,window.wp.priorityQueue.createQueue)(),Zw=[],qw=(0,h.memo)(function({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:o=Zw,__experimentalMinHeight:r,__experimentalPadding:i}){r&&(n=r,I()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(o=[...o,{css:`body { padding: ${i}px; }`}],I()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const s=(0,g.useSelect)(e=>e(Ii).getSettings(),[]),l=(0,h.useMemo)(()=>({...s,focusMode:!1,isPreviewMode:!0}),[s]),a=(0,h.useMemo)(()=>Array.isArray(e)?e:[e],[e]);return e&&0!==e.length?(0,d.jsx)(Vk,{value:a,settings:l,children:(0,d.jsx)(Ww,{viewportWidth:t,minHeight:n,additionalStyles:o})}):null});qw.Async=function({children:e,placeholder:t}){const[n,o]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{const e={};return Kw.add(e,()=>{(0,h.flushSync)(()=>{o(!0)})}),()=>{Kw.cancel(e)}},[]),n?e:t};var Yw=qw;function Xw({blocks:e,props:t={},layout:n}){const o=(0,g.useSelect)(e=>e(Ii).getSettings(),[]),r=(0,h.useMemo)(()=>({...o,styles:void 0,focusMode:!1,isPreviewMode:!0}),[o]),i=(0,m.useDisabled)(),s=(0,m.useMergeRefs)([t.ref,i]),l=(0,h.useMemo)(()=>Array.isArray(e)?e:[e],[e]),a=(0,d.jsxs)(Vk,{value:l,settings:r,children:[(0,d.jsx)(Fw,{}),(0,d.jsx)(qS,{renderAppender:!1,layout:n})]});return{...t,ref:s,className:gs(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?a:null}}var Qw=function({item:e}){const{name:t,title:n,icon:o,description:r,initialAttributes:i,example:s}=e,l=(0,p.isReusableBlock)(e),a=(0,h.useMemo)(()=>s?(0,p.getBlockFromExample)(t,{attributes:{...s.attributes,...i},innerBlocks:s.innerBlocks}):(0,p.createBlock)(t,i),[t,s,i]),c=s?.viewportWidth??500,u=280/c,g=0!==u&&u<1?144/u:144;return(0,d.jsxs)("div",{className:"block-editor-inserter__preview-container",children:[(0,d.jsx)("div",{className:"block-editor-inserter__preview",children:l||s?(0,d.jsx)("div",{className:"block-editor-inserter__preview-content",children:(0,d.jsx)(Yw,{blocks:a,viewportWidth:c,minHeight:144,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(g)}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,d.jsx)("div",{className:"block-editor-inserter__preview-content-missing",children:(0,T.__)("No preview available.")})}),!l&&(0,d.jsx)(Db,{title:n,icon:o,description:r})]})},Jw=(0,h.forwardRef)(function({isFirst:e,as:t,children:n,...o},r){return(0,d.jsx)(Ss.Composite.Item,{ref:r,role:"option",accessibleWhenDisabled:!0,...o,render:o=>{const r={...o,tabIndex:e?0:o.tabIndex};return t?(0,d.jsx)(t,{...r,children:n}):"function"==typeof n?n(r):(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,...r,children:n})}})}),eC=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"})});function tC({count:e,icon:t,isPattern:n,fadeWhenDisabled:o}){const r=n&&(0,T.__)("Pattern");return(0,d.jsx)("div",{className:"block-editor-block-draggable-chip-wrapper",children:(0,d.jsx)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:(0,d.jsxs)(Ss.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[(0,d.jsx)(Ss.FlexItem,{children:t?(0,d.jsx)(Au,{icon:t}):r||(0,T.sprintf)((0,T._n)("%d block","%d blocks",e),e)}),(0,d.jsx)(Ss.FlexItem,{children:(0,d.jsx)(Au,{icon:eC})}),o&&(0,d.jsx)(Ss.FlexItem,{className:"block-editor-block-draggable-chip__disabled",children:(0,d.jsx)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}var nC=({isEnabled:e,blocks:t,icon:n,children:o,pattern:r})=>{const i=(0,g.useSelect)(e=>{const{getBlockType:n}=e(p.store);return 1===t.length&&n(t[0].name)?.icon},[t]),{startDragging:s,stopDragging:l}=U((0,g.useDispatch)(Ii)),a=(0,h.useMemo)(()=>r?.type===rt.user&&"unsynced"!==r?.syncStatus?[(0,p.createBlock)("core/block",{ref:r.id})]:void 0,[r?.type,r?.syncStatus,r?.id]);if(!e)return o({draggable:!1,onDragStart:void 0,onDragEnd:void 0});const c=a??t;return(0,d.jsx)(Ss.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:{type:"inserter",blocks:c},onDragStart:e=>{s();for(const t of c){const n=`wp-block:${t.name}`;e.dataTransfer.items.add("",n)}},onDragEnd:()=>
2{l()},__experimentalDragComponent:(0,d.jsx)(tC,{count:t.length,icon:n||!r&&i,isPattern:!!r}),children:({onDraggableStart:e,onDraggableEnd:t})=>o({draggable:!0,onDragStart:e,onDragEnd:t})})},oC=(0,h.memo)(function({className:e,isFirst:t,item:n,onSelect:o,onHover:r,isDraggable:i,...s}){const l=(0,h.useRef)(!1),a=n.icon?{backgroundColor:n.icon.background,color:n.icon.foreground}:{},c=(0,h.useMemo)(()=>[(0,p.createBlock)(n.name,n.initialAttributes,(0,p.createBlocksFromInnerBlocksTemplate)(n.innerBlocks))],[n.name,n.initialAttributes,n.innerBlocks]),u=(0,p.isReusableBlock)(n)&&"unsynced"!==n.syncStatus||(0,p.isTemplatePart)(n);return(0,d.jsx)(nC,{isEnabled:i&&!n.isDisabled,blocks:c,icon:n.icon,children:({draggable:i,onDragStart:c,onDragEnd:p})=>(0,d.jsx)("div",{className:gs("block-editor-block-types-list__list-item",{"is-synced":u}),draggable:i,onDragStart:e=>{l.current=!0,c&&(r(null),c(e))},onDragEnd:e=>{l.current=!1,p&&p(e)},children:(0,d.jsxs)(Jw,{isFirst:t,className:gs("block-editor-block-types-list__item",e),disabled:n.isDisabled,onClick:e=>{e.preventDefault(),o(n,(0,Ua.isAppleOS)()?e.metaKey:e.ctrlKey),r(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Ua.ENTER&&(e.preventDefault(),o(n,(0,Ua.isAppleOS)()?e.metaKey:e.ctrlKey),r(null))},onMouseEnter:()=>{l.current||r(n)},onMouseLeave:()=>r(null),...s,children:[(0,d.jsx)("span",{className:"block-editor-block-types-list__item-icon",style:a,children:(0,d.jsx)(Au,{icon:n.icon,showColors:!0})}),(0,d.jsx)("span",{className:"block-editor-block-types-list__item-title",children:(0,d.jsx)(Ss.__experimentalTruncate,{numberOfLines:3,children:n.title})})]})})})}),rC=(0,h.forwardRef)(function(e,t){const[n,o]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{n&&(0,Ho.speak)((0,T.__)("Use left and right arrow keys to move through blocks"))},[n]),(0,d.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)},...e})}),iC=(0,h.forwardRef)(function(e,t){return(0,d.jsx)(Ss.Composite.Group,{role:"presentation",ref:t,...e})});function sC(e,t){const n=[];for(let o=0,r=e.length;o<r;o+=t)n.push(e.slice(o,o+t));return n}var lC=function e({items:t=[],onSelect:n,onHover:o=()=>{},children:r,label:i,isDraggable:s=!0}){const l="block-editor-block-types-list",a=(0,m.useInstanceId)(e,l);return(0,d.jsxs)(rC,{className:l,"aria-label":i,children:[sC(t,3).map((e,t)=>(0,d.jsx)(iC,{children:e.map((e,r)=>(0,d.jsx)(oC,{item:e,className:(0,p.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:s&&!e.isDisabled,isFirst:0===t&&0===r,rowId:`${a}-${t}`},e.id))},t)),r]})},aC=function({title:e,icon:t,children:n}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,d.jsx)("h2",{className:"block-editor-inserter__panel-title",children:e}),(0,d.jsx)(Ss.Icon,{icon:t})]}),(0,d.jsx)("div",{className:"block-editor-inserter__panel-content",children:n})]})},cC=(e,t,n)=>{const o=(0,h.useMemo)(()=>({[dt]:!!n}),[n]),[r]=(0,g.useSelect)(t=>[t(Ii).getInserterItems(e,o)],[e,o]),{getClosestAllowedInsertionPoint:i}=U((0,g.useSelect)(Ii)),{createErrorNotice:s}=(0,g.useDispatch)(dr.store),[l,a]=(0,g.useSelect)(e=>{const{getCategories:t,getCollections:n}=e(p.store);return[t(),n()]},[]);return[r,l,a,(0,h.useCallback)(({name:n,initialAttributes:o,innerBlocks:r,syncStatus:l,content:a},c)=>{const u=i(n,e);if(null===u){const e=(0,p.getBlockType)(n)?.title??n;return void s((0,T.sprintf)((0,T.__)('Block "%s" can\'t be inserted.'),e),{type:"snackbar",id:"inserter-notice"})}const d="unsynced"===l?(0,p.parse)(a,{__unstableSkipMigrationLogs:!0}):(0,p.createBlock)(n,o,(0,p.createBlocksFromInnerBlocksTemplate)(r));t(d,void 0,c,u)},[i,e,t,s])]};function uC({key:e,children:t}){return(0,d.jsx)(h.Fragment,{children:t},e)}var dC=function({children:e}){return(0,d.jsx)(Ss.Composite,{focusShift:!0,focusWrap:"horizontal",render:uC,children:e})},pC=function(){return(0,d.jsx)("div",{className:"block-editor-inserter__no-results",children:(0,d.jsx)("p",{children:(0,T.__)("No results found.")})})};const hC=[];function gC({items:e,collections:t,categories:n,onSelectItem:o,onHover:r,showMostUsedBlocks:i,className:s}){const l=(0,h.useMemo)(()=>
2yt(e,"frecency","desc").slice(0,6),[e]),a=(0,h.useMemo)(()=>e.filter(e=>!e.category),[e]),c=(0,h.useMemo)(()=>{const n={...t};return Object.keys(t).forEach(t=>{n[t]=e.filter(e=>(e=>e.name.split("/")[0])(e)===t),0===n[t].length&&delete n[t]}),n},[e,t]);(0,h.useEffect)(()=>()=>r(null),[]);const u=(0,m.useAsyncList)(n),p=n.length===u.length,g=(0,h.useMemo)(()=>Object.entries(t),[t]),f=(0,m.useAsyncList)(p?g:hC);return(0,d.jsxs)("div",{className:s,children:[i&&e.length>3&&!!l.length&&(0,d.jsx)(aC,{title:(0,T._x)("Most used","blocks"),children:(0,d.jsx)(lC,{items:l,onSelect:o,onHover:r,label:(0,T._x)("Most used","blocks")})}),u.map(t=>{const n=e.filter(e=>e.category===t.slug);return n&&n.length?(0,d.jsx)(aC,{title:t.title,icon:t.icon,children:(0,d.jsx)(lC,{items:n,onSelect:o,onHover:r,label:t.title})},t.slug):null}),p&&a.length>0&&(0,d.jsx)(aC,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,T.__)("Uncategorized"),children:(0,d.jsx)(lC,{items:a,onSelect:o,onHover:r,label:(0,T.__)("Uncategorized")})}),f.map(([e,t])=>{const n=c[e];return n&&n.length?(0,d.jsx)(aC,{title:t.title,icon:t.icon,children:(0,d.jsx)(lC,{items:n,onSelect:o,onHover:r,label:t.title})},e):null})]})}var mC=(0,h.forwardRef)(function({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:o},r){const[i,s,l,a]=cC(e,t);if(!i.length)return(0,d.jsx)(pC,{});const c=[],u=[];for(const e of i)"reusable"!==e.category&&(e.isAllowedInCurrentRoot?c.push(e):u.push(e));return(0,d.jsx)(dC,{children:(0,d.jsxs)("div",{ref:r,children:[!!c.length&&(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(gC,{items:c,categories:s,collections:l,onSelectItem:a,onHover:n,showMostUsedBlocks:o,className:"block-editor-inserter__insertable-blocks-at-selection"})}),(0,d.jsx)(gC,{items:u,categories:s,collections:l,onSelectItem:a,onHover:n,showMostUsedBlocks:o,className:"block-editor-inserter__all-blocks"})]})})});function fC({selectedCategory:e,patternCategories:t,onClickCategory:n}){const o="block-editor-block-patterns-explorer__sidebar";return(0,d.jsx)("div",{className:`${o}__categories-list`,children:t.map(({name:t,label:r})=>(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,label:r,className:`${o}__categories-list__item`,isPressed:e===t,onClick:()=>{n(t)},children:r},t))})}function bC({searchValue:e,setSearchValue:t}){return(0,d.jsx)("div",{className:"block-editor-block-patterns-explorer__search",children:(0,d.jsx)(Ss.SearchControl,{__nextHasNoMarginBottom:!0,onChange:t,value:e,label:(0,T.__)("Search"),placeholder:(0,T.__)("Search")})})}var kC=function({selectedCategory:e,patternCategories:t,onClickCategory:n,searchValue:o,setSearchValue:r}){return(0,d.jsxs)("div",{className:"block-editor-block-patterns-explorer__sidebar",children:[(0,d.jsx)(bC,{searchValue:o,setSearchValue:r}),!o&&(0,d.jsx)(fC,{selectedCategory:e,patternCategories:t,onClickCategory:n})]})};function vC({currentPage:e,numPages:t,changePage:n,totalItems:o}){return(0,d.jsxs)(Ss.__experimentalVStack,{className:"block-editor-patterns__grid-pagination-wrapper",children:[(0,d.jsx)(Ss.__experimentalText,{variant:"muted",children:(0,T.sprintf)((0,T._n)("%s item","%s items",o),o)}),t>1&&(0,d.jsxs)(Ss.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination",children:[(0,d.jsxs)(Ss.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous",children:[(0,d.jsx)(Ss.Button,{variant:"tertiary",onClick:()=>n(1),disabled:1===e,"aria-label":(0,T.__)("First page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,d.jsx)("span",{children:"«"})}),(0,d.jsx)(Ss.Button,{variant:"tertiary",onClick:()=>n(e-1),disabled:1===e,"aria-label":(0,T.__)("Previous page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,d.jsx)("span",{children:"â¹"})})]}),(0,d.jsx)(Ss.__experimentalText,{variant:"muted",children:(0,T.sprintf)((0,T._x)("%1$s of %2$s","paging"),e,t)}),(0,d.jsxs)(Ss.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next",children:[(0,d.jsx)(Ss.Button,{variant:"tertiary",onClick:()=>n(e+1),disabled:e===t,"aria-label":(0,T.__)("Next page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,d.jsx)("span",{children:"âº"})}),(0,d.jsx)(Ss.Button,{variant:"tertiary",onClick:()=>n(t),disabled:e===t,"aria-label":(0,T.__)("Last page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,d.jsx)("span",{children:"»"})})]})]})]})}const _C=({showTooltip:e,title:t,children:n})=>e?(0,d.jsx)(Ss.Tooltip,{text:t,children:n}):(0,d.jsx)(d.Fragment,{children:n});function yC({id:e,isDraggable:t,pattern:n,onClick:o,onHover:r,showTitlesAsTooltip:i,category:s,isSelected:l}){const[a,c]=(0,h.useState)(!1),{blocks:u,viewportWidth:g}=n,f=`block-editor-block-patterns-list__item-description-${(0,m.useInstanceId)(yC)}`,b=n.type===rt.user,k=(0,h.useMemo)(()=>s&&t?(u??[]).map(e=>{const t=(0,p.cloneBlock)(e);return t.attributes.metadata?.categories?.includes(s)&&(t.attributes.metadata.categories=[s]),t}):u,[u,t,s]);return(0,d.jsx)(nC,{isEnabled:t,blocks:k,pattern:n,children:({draggable:t,onDragStart:s,onDragEnd:p})=>(0,d.jsx)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:e=>{c(!0),s&&(r?.(null),s(e))},onDragEnd:e=>{c(!1),p&&p(e)},children:(0,d.jsx)(_C,{showTooltip:i&&!b,title:n.title,children:(0,d.jsxs)(Ss.Composite.Item,{render:(0,d.jsx)("div",{role:"option","aria-label":n.title,"aria-describedby":n.description?f:void 0,className:gs("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":n.type===rt.user&&!n.syncStatus,"is-selected":l})}),id:e,onClick:()=>{o(n,u),r?.(null)},onMouseEnter:()=>{a||r?.(n)},onMouseLeave:()=>r?.(null),children:[(0,d.jsx)(Yw.Async,{placeholder:(0,d.jsx)(xC,{}),children:(0,d.jsx)(Yw,{blocks:u,viewportWidth:g})}),(!i||b)&&(0,d.jsxs)(Ss.__experimentalHStack,{className:"block-editor-patterns__pattern-details",spacing:2,children:[b&&!n.syncStatus&&(0,d.jsx)("div",{className:"block-editor-patterns__pattern-icon-wrapper",children:(0,d.jsx)(Nl,{className:"block-editor-patterns__pattern-icon",icon:ue})}),(0,d.jsx)("div",{className:"block-editor-block-patterns-list__item-title",children:n.title})]}),!!n.description&&(0,d.jsx)(Ss.VisuallyHidden,{id:f,children:n.description})]})})})})}function xC(){return(0,d.jsx)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var SC=(0,h.forwardRef)(function({isDraggable:e,blockPatterns:t,onHover:n,onClickPattern:o,orientation:r,label:i=(0,T.__)("Block patterns"),category:s,showTitlesAsTooltip:l,pagingProps:a},c){const[u,p]=(0,h.useState)(void 0),[g,m]=(0,h.useState)(null);(0,h.useEffect)(()=>{const e=t[0]?.name;p(e)},[t]);const f=(e,t)=>{m(e.name),o(e,t)};return(0,d.jsxs)(Ss.Composite,{orientation:r,activeId:u,setActiveId:p,role:"listbox",className:"block-editor-block-patterns-list","aria-label":i,ref:c,children:[t.map(t=>(0,d.jsx)(yC,{id:t.name,pattern:t,onClick:f,onHover:n,isDraggable:e,showTitlesAsTooltip:l,category:s,isSelected:!!g&&g===t.name}
2,t.name)),a&&(0,d.jsx)(vC,{...a})]})});function wC({destinationRootClientId:e,destinationIndex:t,rootClientId:n,registry:o}){if(n===e)return t;const r=["",...o.select(Ii).getBlockParents(e),e],i=r.indexOf(n);return-1!==i?o.select(Ii).getBlockIndex(r[i+1])+1:o.select(Ii).getBlockOrder(n).length}var CC=function({rootClientId:e="",insertionIndex:t,clientId:n,isAppender:o,onSelect:r,shouldFocusBlock:i=!0,selectBlockOnInsert:s=!0}){const l=(0,g.useRegistry)(),{getSelectedBlock:a,getClosestAllowedInsertionPoint:c,isBlockInsertionPointVisible:u}=U((0,g.useSelect)(Ii)),{destinationRootClientId:d,destinationIndex:m}=(0,g.useSelect)(r=>{const{getSelectedBlockClientId:i,getBlockRootClientId:s,getBlockIndex:l,getBlockOrder:a,getInsertionPoint:c}=U(r(Ii)),u=i();let d,p=e;const h=c();return void 0!==t?d=t:h&&h.hasOwnProperty("index")?(p=h?.rootClientId?h.rootClientId:e,d=h.index):n?d=l(n):!o&&u?(p=s(u),d=l(u)+1):d=a(p).length,{destinationRootClientId:p,destinationIndex:d}},[e,t,n,o]),{replaceBlocks:f,insertBlocks:b,showInsertionPoint:k,hideInsertionPoint:v,setLastFocus:_}=U((0,g.useDispatch)(Ii)),y=(0,h.useCallback)((e,t,n=!1,c)=>{(n||i||s)&&_(null);const u=a();!o&&u&&(0,p.isUnmodifiedDefaultBlock)(u,"content")?f(u.clientId,e,null,i||n?0:null,t):b(e,o||void 0===c?m:wC({destinationRootClientId:d,destinationIndex:m,rootClientId:c,registry:l}),o||void 0===c?d:c,s,i||n?0:null,t);const h=Array.isArray(e)?e.length:1,g=(0,T.sprintf)((0,T._n)("%d block added.","%d blocks added.",h),h);(0,Ho.speak)(g),r&&r(e)},[o,a,f,b,d,m,r,i,s]),x=(0,h.useCallback)(e=>{if(e&&!u()){const t=c(e.name,d);null!==t&&k(t,wC({destinationRootClientId:d,destinationIndex:m,rootClientId:t,registry:l}))}else v()},[c,u,k,v,d,m]);return[d,y,x]},BC=(e,t,n,o)=>{const r=(0,h.useMemo)(()=>({[dt]:!!o}),[o]),{patternCategories:i,patterns:s,userPatternCategories:l}=(0,g.useSelect)(e=>{const{getSettings:n,__experimentalGetAllowedPatterns:o}=U(e(Ii)),{__experimentalUserPatternCategories:i,__experimentalBlockPatternCategories:s}=n();return{patterns:o(t,r),userPatternCategories:i,patternCategories:s}},[t,r]),{getClosestAllowedInsertionPointForPattern:a}=U((0,g.useSelect)(Ii)),c=(0,h.useMemo)(()=>{const e=[...i];return l?.forEach(t=>{e.find(e=>e.name===t.name)||e.push(t)}),e},[i,l]),{createSuccessNotice:u}=(0,g.useDispatch)(dr.store),d=(0,h.useCallback)((r,i)=>{const s=o?t:a(r,t);if(null===s)return;const l=r.type===rt.user&&"unsynced"!==r.syncStatus?[(0,p.createBlock)("core/block",{ref:r.id})]:i;e((l??[]).map(e=>{const t=(0,p.cloneBlock)(e);return t.attributes.metadata?.categories?.includes(n)&&(t.attributes.metadata.categories=[n]),t}),r.name,!1,s),u((0,T.sprintf)((0,T.__)('Block pattern "%s" inserted.'),r.title),{type:"snackbar",id:"inserter-notice"})},[u,e,n,t,a,o]);return[s,c,d]},IC=n(731),jC=n.n(IC);function EC(e){return e.toLowerCase()}var TC=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],MC=/[^A-Z0-9]+/gi;
2function PC(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce(function(e,t){return e.replace(t,n)},e)}const RC=e=>e.name||"",AC=e=>e.title,NC=e=>e.description||"",LC=e=>e.keywords||[],DC=e=>e.category,OC=()=>null,zC=[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],VC=new RegExp("(\\p{C}|\\p{P}|\\p{S})+","giu"),FC=new Map,HC=new Map;function UC(e=""){if(FC.has(e))return FC.get(e);const t=function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?TC:n,r=t.stripRegexp,i=void 0===r?MC:r,s=t.transform,l=void 0===s?EC:s,a=t.delimiter,c=void 0===a?" ":a,u=PC(PC(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:zC,stripRegexp:VC}).split(" ").filter(Boolean);return FC.set(e,t),t}function GC(e=""){if(HC.has(e))return HC.get(e);let t=jC()(e);return t=t.replace(/^\//,""),t=t.toLowerCase(),HC.set(e,t),t}const $C=(e="")=>UC(GC(e)),WC=(e,t,n,o)=>0===$C(o).length?e:KC(e,o,{getCategory:e=>t.find(({slug:t})=>t===e.category)?.title,getCollection:e=>n[e.name.split("/")[0]]?.title}),KC=(e=[],t="",n={})=>{if(0===$C(t).length)return e;const o=e.map(e=>[e,ZC(e,t,n)]).filter(([,e])=>e>0);return o.sort(([,e],[,t])=>t-e),o.map(([e])=>e)};function ZC(e,t,n={}){const{getName:o=RC,getTitle:r=AC,getDescription:i=NC,getKeywords:s=LC,getCategory:l=DC,getCollection:a=OC}=n,c=o(e),u=r(e),d=i(e),p=s(e),h=l(e),g=a(e),m=GC(t),f=GC(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===(k=UC(m),v=e,k.filter(e=>!$C(v).some(t=>t.includes(e)))).length&&(b+=10)}var k,v;return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function qC(e,t,n,o=""){const[r,i]=(0,h.useState)(1),s=(0,m.usePrevious)(t),l=(0,m.usePrevious)(o);s===t&&l===o||1===r||i(1);const a=e.length,c=r-1,u=(0,h.useMemo)(()=>e.slice(20*c,20*c+20),[c,e]),d=Math.ceil(e.length/20);return(0,h.useEffect)(function(){const e=(0,Fa.getScrollContainer)(n?.current);e?.scrollTo(0,0)},[t,n]),{totalItems:a,categoryPatterns:u,numPages:d,changePage:e=>{const t=(0,Fa.getScrollContainer)(n?.current);t?.scrollTo(0,0),i(e)},currentPage:r}}function YC({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,d.jsx)(Ss.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count",children:(0,T.sprintf)((0,T._n)("%d pattern found","%d patterns found",t),t)}):null}var XC=function({searchValue:e,selectedCategory:t,patternCategories:n,rootClientId:o,onModalClose:r}){const i=(0,h.useRef)(),s=(0,m.useDebounce)(Ho.speak,500),[l,a]=CC({rootClientId:o,shouldFocusBlock:!0}),[c,,u]=BC(a,l,t),p=(0,h.useMemo)(()=>n.map(e=>e.name),[n]),g=(0,h.useMemo)(()=>{const n=c.filter(e=>{if(t===lt.name)return!0;if(t===at.name&&e.type===rt.user)return!0;if(t===ct.name&&e.blockTypes?.includes("core/post-content"))return!0;if("uncategorized"===t){const t=e.categories?.some(e=>p.includes(e))??!1;return!e.categories?.length||!t}return e.categories?.includes(t)});return e?KC(n,e):n},[e,c,t,p]);(0,h.useEffect)(()=>{if(!e)return;const t=g.length,n=(0,T.sprintf)((0,T._n)("%d result found.","%d results found.",t),t);s(n)},[e,s,g.length]);const f=qC(g,t,i),[b,k]=(0,h.useState)(e);e!==b&&(k(e),f.changePage(1));const v=!!g?.length;return(0,d.jsxs)("div",{className:"block-editor-block-patterns-explorer__list",ref:i,children:[(0,d.jsx)(YC,{filterValue:e,filteredBlockPatternsLength:g.length}),(0,d.jsx)(dC,{children:v&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(SC,{blockPatterns:f.categoryPatterns,onClickPattern:(e,t)=>{u(e,t),r()},isDraggable:!1}),(0,d.jsx)(vC,{...f})]})})]})};function QC(e,t="all"){const[n,o]=BC(void 0,e),r=(0,h.useMemo)(()=>"all"===t?n:n.filter(e=>!ut(e,t)),[t,n]),i=(0,h.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,T._x)("Uncategorized")}),r.some(e=>
2e.blockTypes?.includes("core/post-content"))&&e.unshift(ct),r.some(e=>e.type===rt.user)&&e.unshift(at),r.length>0&&e.unshift({name:lt.name,label:lt.label}),(0,Ho.speak)((0,T.sprintf)((0,T._n)("%d category button displayed.","%d category buttons displayed.",e.length),e.length)),e},[o,r]);return i}function JC({initialCategory:e,rootClientId:t,onModalClose:n}){const[o,r]=(0,h.useState)(""),[i,s]=(0,h.useState)(e?.name),l=QC(t);return(0,d.jsxs)("div",{className:"block-editor-block-patterns-explorer",children:[(0,d.jsx)(kC,{selectedCategory:i,patternCategories:l,onClickCategory:s,searchValue:o,setSearchValue:r}),(0,d.jsx)(XC,{searchValue:o,selectedCategory:i,patternCategories:l,rootClientId:t,onModalClose:n})]})}var eB=function({onModalClose:e,...t}){return(0,d.jsx)(Ss.Modal,{title:(0,T.__)("Patterns"),onRequestClose:e,isFullScreen:!0,children:(0,d.jsx)(JC,{onModalClose:e,...t})})};function tB({title:e}){return(0,d.jsx)(Ss.__experimentalVStack,{spacing:0,children:(0,d.jsx)(Ss.__experimentalView,{children:(0,d.jsx)(Ss.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,d.jsxs)(Ss.__experimentalHStack,{spacing:2,children:[(0,d.jsx)(Ss.Navigator.BackButton,{style:{minWidth:24,padding:0},icon:(0,T.isRTL)()?Ab:Nb,size:"small",label:(0,T.__)("Back")}),(0,d.jsx)(Ss.__experimentalSpacer,{children:(0,d.jsx)(Ss.__experimentalHeading,{level:5,children:e})})]})})})})}function nB({categories:e,children:t}){return(0,d.jsxs)(Ss.Navigator,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation",children:[(0,d.jsx)(Ss.Navigator.Screen,{path:"/",children:(0,d.jsx)(Ss.__experimentalItemGroup,{children:e.map(e=>(0,d.jsx)(Ss.Navigator.Button,{path:`/category/${e.name}`,as:Ss.__experimentalItem,isAction:!0,children:(0,d.jsxs)(Ss.__experimentalHStack,{children:[(0,d.jsx)(Ss.FlexBlock,{children:e.label}),(0,d.jsx)(Nl,{icon:(0,T.isRTL)()?Nb:Ab})]})},e.name))})}),e.map(e=>(0,d.jsxs)(Ss.Navigator.Screen,{path:`/category/${e.name}`,children:[(0,d.jsx)(tB,{title:(0,T.__)("Back")}),t(e)]},e.name))]})}const oB=e=>"all"!==e&&"user"!==e,rB=[{value:"all",label:(0,T._x)("All","patterns")},{value:rt.directory,label:(0,T.__)("Pattern Directory")},{value:rt.theme,label:(0,T.__)("Theme & Plugins")},{value:rt.user,label:(0,T.__)("User")}];function iB({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:n,patternSourceFilter:o,scrollContainerRef:r,category:i}){const s=i.name===at.name?rt.user:o,l=oB(s),a=(e=>e.name===at.name)(i),c=(0,h.useMemo)(()=>[{value:"all",label:(0,T._x)("All","patterns")},{value:it,label:(0,T._x)("Synced","patterns"),disabled:l},{value:st,label:(0,T._x)("Not synced","patterns"),disabled:l}],[l]);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(Ss.DropdownMenu,{popoverProps:{placement:"right-end"},label:(0,T.__)("Filter patterns"),toggleProps:{size:"compact"},icon:(0,d.jsx)(Nl,{icon:(0,d.jsx)(Ss.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(Ss.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"currentColor"})})}),children:()=>(0,d.jsxs)(d.Fragment,{children:[!a&&(0,d.jsx)(Ss.MenuGroup,{label:(0,T.__)("Source"),children:(0,d.jsx)(Ss.MenuItemsChoice,{choices:rB,onSelect:n=>{var o;t(o=n),oB(o)&&e("all"),r.current?.scrollTo(0,0)},value:s})}),(0,d.jsx)(Ss.MenuGroup,{label:(0,T.__)("Type"),children:(0,d.jsx)(Ss.MenuItemsChoice,{choices:c,onSelect:t=>{e(t),r.current?.scrollTo(0,0)},value:n})}),(0,d.jsx)("div",{className:"block-editor-inserter__patterns-filter-help",children:(0,h.createInterpolateElement)((0,T.__)("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,d.jsx)(Ss.ExternalLink,{href:(0,T.__)("https://wordpress.org/patterns/")})})})]})})})}const sB=()=>{};function lB({rootClientId:e,onInsert:t,onHover:n=sB,category:o,showTitlesAsTooltip:r}){const[i,,s]=BC(t,e,o?.name),[l,a]=(0,h.useState)("all"),[c,u]=(0,h.useState)("all"),p=QC(e,c),g=(0,h.useRef)(),m=(0,h.useMemo)(()=>i.filter(e=>!ut(e,c,l)&&(o.name===lt.name||o.name===at.name&&e.type===rt.user||!(o.name!==ct.name||!e.blockTypes?.includes("core/p
2ost-content"))||("uncategorized"===o.name?!e.categories||!e.categories.some(e=>p.some(t=>t.name===e)):e.categories?.includes(o.name)))),[i,p,o.name,c,l]),f=qC(m,o,g),{changePage:b}=f;(0,h.useEffect)(()=>()=>n(null),[]);const k=(0,h.useCallback)(e=>{a(e),b(1)},[a,b]),v=(0,h.useCallback)(e=>{u(e),b(1)},[u,b]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(Ss.__experimentalVStack,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header",children:[(0,d.jsxs)(Ss.__experimentalHStack,{children:[(0,d.jsx)(Ss.FlexBlock,{children:(0,d.jsx)(Ss.__experimentalHeading,{className:"block-editor-inserter__patterns-category-panel-title",size:13,level:4,as:"div",children:o.label})}),(0,d.jsx)(iB,{patternSyncFilter:l,patternSourceFilter:c,setPatternSyncFilter:k,setPatternSourceFilter:v,scrollContainerRef:g,category:o})]}),!m.length&&(0,d.jsx)(Ss.__experimentalText,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results",children:(0,T.__)("No results found")})]}),m.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.__experimentalText,{size:"12",as:"p",className:"block-editor-inserter__help-text",children:(0,T.__)("Drag and drop patterns into the canvas.")}),(0,d.jsx)(SC,{ref:g,blockPatterns:f.categoryPatterns,onClickPattern:s,onHover:n,label:o.label,orientation:"vertical",category:o.name,isDraggable:!0,showTitlesAsTooltip:r,patternFilter:c,pagingProps:f})]})]})}const{Tabs:aB}=U(Ss.privateApis);var cB=function({categories:e,selectedCategory:t,onSelectCategory:n,children:o}){const r={type:"tween",duration:(0,m.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]},i=(0,m.usePrevious)(t),s=t?t.name:null,[l,a]=(0,h.useState)(),c=e?.[0]?.name;return null===s&&!l&&c&&a(c),(0,d.jsxs)(aB,{selectOnMove:!1,selectedTabId:s,orientation:"vertical",onSelect:t=>{n(e.find(e=>e.name===t))},activeTabId:l,onActiveTabIdChange:a,children:[(0,d.jsx)(aB.TabList,{className:"block-editor-inserter__category-tablist",children:e.map(e=>(0,d.jsx)(aB.Tab,{tabId:e.name,"aria-current":e===t?"true":void 0,children:e.label},e.name))}),e.map(e=>(0,d.jsx)(aB.TabPanel,{tabId:e.name,focusable:!1,children:(0,d.jsx)(Ss.__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))]})},uB=function({onSelectCategory:e,selectedCategory:t,onInsert:n,rootClientId:o,children:r}){const[i,s]=(0,h.useState)(!1),l=QC(o),a=(0,m.useViewportMatch)("medium","<");return l.length?(0,d.jsxs)(d.Fragment,{children:[!a&&(0,d.jsxs)("div",{className:"block-editor-inserter__block-patterns-tabs-container",children:[(0,d.jsx)(cB,{categories:l,selectedCategory:t,onSelectCategory:e,children:r}),(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__patterns-explore-button",onClick:()=>s(!0),variant:"secondary",children:(0,T.__)("Explore all patterns")})]}),a&&(0,d.jsx)(nB,{categories:l,children:e=>(0,d.jsx)("div",{className:"block-editor-inserter__category-panel",children:(0,d.jsx)(lB,{onInsert:n,rootClientId:o,category:e},e.name)})}),i&&(0,d.jsx)(eB,{initialCategory:t||l[0],patternCategories:l,onModalClose:()=>s(!1),rootClientId:o})]}):(0,d.jsx)(pC,{})},dB=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})});const pB={image:"img",video:"video",audio:"audio"};function hB(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=pB[t],s=(0,d.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,p.createBlock)(`core/${t}`,n),s]}const gB=["image"],mB={placement:"bottom-end",className:"block-editor-inserter__media-list__item-preview-options__popover"};function fB({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return(0,d.jsx)(Ss.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,T.__)("Options"),popoverProps:mB,icon:ev,children:()=>(0,d.jsx)(Ss.MenuGroup,{children:(0,d.jsx)(Ss.MenuItem,{onClick:()=>window.open(n,"_blank").focus(),icon:dB,children:(0,T.sprintf)((0,T.__)("Report %s"),e.mediaType)})})})}function bB({onClose:e,onSubmit:t}){return(0,d.jsxs)(Ss.Modal,{title:(0,T.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",children:[(0,d.jsxs)(Ss.__experimentalVStack,{spacing:3,children:[(0,d.jsx)("p",{children:(0,T.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")}
2),(0,d.jsx)("p",{children:(0,T.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation.")})]}),(0,d.jsxs)(Ss.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,d.jsx)(Ss.FlexItem,{children:(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:(0,T.__)("Cancel")})}),(0,d.jsx)(Ss.FlexItem,{children:(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:t,children:(0,T.__)("Insert")})})]})]})}function kB({media:e,onClick:t,category:n}){const[o,r]=(0,h.useState)(!1),[i,s]=(0,h.useState)(!1),[l,a]=(0,h.useState)(!1),[c,u]=(0,h.useMemo)(()=>hB(e,n.mediaType),[e,n.mediaType]),{createErrorNotice:m,createSuccessNotice:f}=(0,g.useDispatch)(dr.store),{getSettings:b,getBlock:k}=(0,g.useSelect)(Ii),{updateBlockAttributes:v}=(0,g.useDispatch)(Ii),_=(0,h.useCallback)(e=>{if(l)return;const n=b(),o=(0,p.cloneBlock)(e),{id:i,url:s,caption:c}=o.attributes;i||n.mediaUpload?i?t(o):(a(!0),window.fetch(s).then(e=>e.blob()).then(e=>{const r=(0,Va.getFilename)(s)||"image.jpg",i=new File([e],r,{type:e.type});n.mediaUpload({filesList:[i],additionalData:{caption:c},onFileChange([e]){(0,Ha.isBlobURL)(e.url)||(k(o.clientId)?v(o.clientId,{...o.attributes,id:e.id,url:e.url}):(t({...o,attributes:{...o.attributes,id:e.id,url:e.url}}),f((0,T.__)("Image uploaded and inserted."),{type:"snackbar",id:"inserter-notice"})),a(!1))},allowedTypes:gB,onError(e){m(e,{type:"snackbar",id:"inserter-notice"}),a(!1)}})}).catch(()=>{r(!0),a(!1)})):r(!0)},[l,b,t,f,v,m,k]),y="string"==typeof e.title?e.title:e.title?.rendered||(0,T.__)("no title"),x=(0,h.useCallback)(()=>s(!0),[]),S=(0,h.useCallback)(()=>s(!1),[]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(nC,{isEnabled:!0,blocks:[c],children:({draggable:t,onDragStart:o,onDragEnd:r})=>(0,d.jsx)("div",{className:gs("block-editor-inserter__media-list__list-item",{"is-hovered":i}),draggable:t,onDragStart:o,onDragEnd:r,children:(0,d.jsxs)("div",{onMouseEnter:x,onMouseLeave:S,children:[(0,d.jsx)(Ss.Tooltip,{text:y,children:(0,d.jsx)(Ss.Composite.Item,{render:(0,d.jsx)("div",{"aria-label":y,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>_(c),children:(0,d.jsxs)("div",{className:"block-editor-inserter__media-list__item-preview",children:[u,l&&(0,d.jsx)("div",{className:"block-editor-inserter__media-list__item-preview-spinner",children:(0,d.jsx)(Ss.Spinner,{})})]})})}),!l&&(0,d.jsx)(fB,{category:n,media:e})]})})}),o&&(0,d.jsx)(bB,{onClose:()=>r(!1),onSubmit:()=>{t((0,p.cloneBlock)(c)),f((0,T.__)("Image inserted."),{type:"snackbar",id:"inserter-notice"}),r(!1)}})]})}var vB=function({mediaList:e,category:t,onClick:n,label:o=(0,T.__)("Media List")}){return(0,d.jsx)(Ss.Composite,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":o,children:e.map((e,o)=>(0,d.jsx)(kB,{media:e,category:t,onClick:n},e.id||e.sourceId||o))})};function _B({rootClientId:e,onInsert:t,category:n}){const[o,r,i]=(0,m.useDebouncedInput)(),{mediaList:s,isLoading:l}=function(e,t={}){const[n,o]=(0,h.useState)(),[r,i]=(0,h.useState)(!1),s=(0,h.useRef)();return(0,h.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:10,search:i}),a="block-editor-inserter__media-panel",c=n.labels.search_items||(0,T.__)("Search");return(0,d.jsxs)("div",{className:a,children:[(0,d.jsx)(Ss.SearchControl,{__nextHasNoMarginBottom:!0,className:`${a}-search`,onChange:r,value:o,label:c,placeholder:c}),l&&(0,d.jsx)("div",{className:`${a}-spinner`,children:(0,d.jsx)(Ss.Spinner,{})}),!l&&!s?.length&&(0,d.jsx)(pC,{}),!l&&!!s?.length&&(0,d.jsx)(vB,{rootClientId:e,onClick:t,mediaList:s,category:n})]})}const yB=["image","video","audio"];var xB=function({rootClientId:e,selectedCategory:t,onSelectCategory:n,onInsert:o,children:r}){const i=function(e){const[t,n]=(0,h.useState)([]),o=(0,g.useSelect)(e=>U(e(Ii)).getInserterMediaCategories(),[]),{canInsertImage:r,canInsertVideo:i,canInsertAudio:s}=(0,g.useSelect)(t=>{const{canInsertBlockType:n}=t(Ii);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}},[e]);return(0,h.useEffect)(()=>{(async()=>{const e=[];
2if(!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,m.useViewportMatch)("medium","<"),l=(0,h.useCallback)(e=>{if(!e?.url)return;const[t]=hB(e,e.type);o(t)},[o]),a=(0,h.useMemo)(()=>i.map(e=>({...e,label:e.labels.name})),[i]);return a.length?(0,d.jsxs)(d.Fragment,{children:[!s&&(0,d.jsxs)("div",{className:"block-editor-inserter__media-tabs-container",children:[(0,d.jsx)(cB,{categories:a,selectedCategory:t,onSelectCategory:n,children:r}),(0,d.jsx)(Za,{children:(0,d.jsx)(Ka,{multiple:!1,onSelect:l,allowedTypes:yB,render:({open:e})=>(0,d.jsx)(Ss.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,T.__)("Open Media Library")})})})]}),s&&(0,d.jsx)(nB,{categories:a,children:t=>(0,d.jsx)(_B,{onInsert:o,rootClientId:e,category:t})})]}):(0,d.jsx)(pC,{})};const{Fill:SB,Slot:wB}=(0,Ss.createSlotFill)("__unstableInserterMenuExtension");SB.Slot=wB;var CB=SB;const BB=(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,IB=[];var jB=function({filterValue:e,onSelect:t,onHover:n,onHoverPattern:o,rootClientId:r,clientId:i,isAppender:s,__experimentalInsertionIndex:l,maxBlockPatterns:a,maxBlockTypes:c,showBlockDirectory:u=!1,isDraggable:p=!0,shouldFocusBlock:f=!0,prioritizePatterns:b,selectBlockOnInsert:k,isQuick:v}){const _=(0,m.useDebounce)(Ho.speak,500),{prioritizedBlocks:y}=(0,g.useSelect)(e=>{const t=e(Ii).getBlockListSettings(r);return{prioritizedBlocks:t?.prioritizedInserterBlocks||IB}},[r]),[x,S]=CC({onSelect:t,rootClientId:r,clientId:i,isAppender:s,insertionIndex:l,shouldFocusBlock:f,selectBlockOnInsert:k}),[w,C,B,I]=cC(x,S,v),[j,,E]=BC(S,x,void 0,v),M=(0,h.useMemo)(()=>{if(0===a)return[];const t=KC(j,e);return void 0!==a?t.slice(0,a):t},[e,j,a]);let P=c;b&&M.length>2&&(P=0);const R=(0,h.useMemo)(()=>{if(0===P)return[];let t=yt(w.filter(e=>"core/block"!==e.name),"frecency","desc");!e&&y.length&&(t=BB(t,y));const n=WC(t,C,B,e);return void 0!==P?n.slice(0,P):n},[e,w,C,B,P,y]);(0,h.useEffect)(()=>{if(!e)return;const t=R.length+M.length,n=(0,T.sprintf)((0,T._n)("%d result found.","%d results found.",t),t);_(n)},[e,_,R,M]);const A=(0,m.useAsyncList)(R,{step:9}),N=R.length>0||M.length>0,L=!!R.length&&(0,d.jsx)(aC,{title:(0,d.jsx)(Ss.VisuallyHidden,{children:(0,T.__)("Blocks")}),children:(0,d.jsx)(lC,{items:A,onSelect:I,onHover:n,label:(0,T.__)("Blocks"),isDraggable:p})}),D=!!M.length&&(0,d.jsx)(aC,{title:(0,d.jsx)(Ss.VisuallyHidden,{children:(0,T.__)("Block patterns")}),children:(0,d.jsx)("div",{className:"block-editor-inserter__quick-inserter-patterns",children:(0,d.jsx)(SC,{blockPatterns:M,onClickPattern:E,onHover:o,isDraggable:p})})});return(0,d.jsxs)(dC,{children:[!u&&!N&&(0,d.jsx)(pC,{}),b?D:L,!!R.length&&!!M.length&&(0,d.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?L:D,u&&(0,d.jsx)(CB.Slot,{fillProps:{onSelect:I,onHover:n,filterValue:e,hasItems:N,rootClientId:x},children:e=>e.length?e:N?null:(0,d.jsx)(pC,{})})]})},EB=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})});const{Tabs:TB}=U(Ss.privateApis);var MB=(0,h.forwardRef)(function({defaultTabId:e,onClose:t,onSelect:n,selectedTab:o,tabs:r,closeButtonLabel:i},s){return(0,d.jsx)("div",{className:"block-editor-tabbed-sidebar",children:(0,d.jsxs)(TB,{selectOnMove:!1,defaultTabId:e,onSelect:n,selectedTabId:o,children:[(0,d.jsxs)("div",{className:"block-editor-tabbed-sidebar__tablist-and-close-button",children:[(0,d.jsx)(Ss.Button,{className:"block-editor-tabbed-sidebar__close-button",icon:EB,label:i,onClick:()=>t(),size:"compact"}),(0,d.jsx)(TB.TabList,{className:"block-editor-tabbed-sidebar__tablist",ref:s,children:r.map(e=>(0,d.jsx)(TB.Tab,{tabId:e.name,className:"block-editor-tabbed-sidebar__tab",children:e.title},e.name))})]}),r.map(e=>(0,d.jsx)(TB.TabPanel,{tabId:e.name,focusable:!1,className:"block-editor-tabbed-sidebar__tabpanel",ref:e.panelRef,children:e.panel},e.name))]})})});function PB(e=!0){const{setZoomLevel:t,resetZoomLevel:n}
2=U((0,g.useDispatch)(Ii)),{isZoomedOut:o,isZoomOut:r}=(0,g.useSelect)(e=>{const{isZoomOut:t}=U(e(Ii));return{isZoomedOut:t(),isZoomOut:t}},[]),i=(0,h.useRef)(!1),s=(0,h.useRef)(e);(0,h.useEffect)(()=>{o!==s.current&&(i.current=!1)},[o]),(0,h.useEffect)(()=>(s.current=e,e!==r()&&(i.current=!0,e?t("auto-scaled"):n()),()=>{i.current&&r()&&n()}),[e,r,n,t])}const RB=()=>{},AB=(0,h.forwardRef)(function({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,onSelect:r,showInserterHelpPanel:i,showMostUsedBlocks:s,__experimentalFilterValue:l="",shouldFocusBlock:a=!0,onPatternCategorySelection:c,onClose:u,__experimentalInitialTab:p,__experimentalInitialCategory:f},b){const{isZoomOutMode:k,hasSectionRootClientId:v}=(0,g.useSelect)(e=>{const{isZoomOut:t,getSectionRootClientId:n}=U(e(Ii));return{isZoomOutMode:t(),hasSectionRootClientId:!!n()}},[]),[_,y,x]=(0,m.useDebouncedInput)(l),[S,w]=(0,h.useState)(null),[C,B]=(0,h.useState)(f),[I,j]=(0,h.useState)("all"),[E,M]=(0,h.useState)(null),P=(0,m.useViewportMatch)("large"),[R,A]=(0,h.useState)(p||(k?"patterns":"blocks"));PB(v&&("patterns"===R||"media"===R)&&P);const[N,L,D]=CC({rootClientId:e,clientId:t,isAppender:n,insertionIndex:o,shouldFocusBlock:a}),O=(0,h.useRef)(),z=(0,h.useCallback)((e,t,n,o)=>{L(e,t,n,o),r(e),window.requestAnimationFrame(()=>{a||O.current?.contains(b.current.ownerDocument.activeElement)||O.current?.querySelector("button").focus()})},[L,r,a]),V=(0,h.useCallback)((e,t,...n)=>{D(!1),L(e,{patternName:t},...n),r()},[L,r]),F=(0,h.useCallback)(e=>{D(e),w(e)},[D,w]),H=(0,h.useCallback)((e,t)=>{B(e),j(t),c?.()},[B,c]),G="patterns"===R&&!x&&!!C,$="media"===R&&!!E,W=(0,h.useMemo)(()=>"media"===R?null:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{S&&w(null),y(e)},value:_,label:(0,T.__)("Search"),placeholder:(0,T.__)("Search")}),!!x&&(0,d.jsx)(jB,{filterValue:x,onSelect:r,onHover:F,rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,showBlockDirectory:!0,shouldFocusBlock:a,prioritizePatterns:"patterns"===R})]}),[R,S,w,y,_,x,r,F,a,t,e,o,n]),K=(0,h.useMemo)(()=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"block-editor-inserter__block-list",children:(0,d.jsx)(mC,{ref:O,rootClientId:N,onInsert:z,onHover:F,showMostUsedBlocks:s})}),i&&(0,d.jsxs)("div",{className:"block-editor-inserter__tips",children:[(0,d.jsx)(Ss.VisuallyHidden,{as:"h2",children:(0,T.__)("A tip for using the block editor")}),(0,d.jsx)(Rb,{})]})]}),[N,z,F,s,i]),Z=(0,h.useMemo)(()=>(0,d.jsx)(uB,{rootClientId:N,onInsert:V,onSelectCategory:H,selectedCategory:C,children:G&&(0,d.jsx)(lB,{rootClientId:N,onInsert:V,category:C,patternFilter:I,showTitlesAsTooltip:!0})}),[N,V,H,I,C,G]),q=(0,h.useMemo)(()=>(0,d.jsx)(xB,{rootClientId:N,selectedCategory:E,onSelectCategory:M,onInsert:z,children:$&&(0,d.jsx)(_B,{rootClientId:N,onInsert:z,category:E})}),[N,z,E,M,$]),Y=(0,h.useRef)();return(0,h.useLayoutEffect)(()=>{Y.current&&window.requestAnimationFrame(()=>{Y.current.querySelector('[role="tab"][aria-selected="true"]')?.focus()})},[]),(0,d.jsxs)("div",{className:gs("block-editor-inserter__menu",{"show-panel":G||$,"is-zoom-out":k}),ref:b,children:[(0,d.jsx)("div",{className:"block-editor-inserter__main-area",children:(0,d.jsx)(MB,{ref:Y,onSelect:e=>{"patterns"!==e&&B(null),A(e)},onClose:u,selectedTab:R,closeButtonLabel:(0,T.__)("Close Block Inserter"),tabs:[{name:"blocks",title:(0,T.__)("Blocks"),panel:(0,d.jsxs)(d.Fragment,{children:[W,"blocks"===R&&!x&&K]})},{name:"patterns",title:(0,T.__)("Patterns"),panel:(0,d.jsxs)(d.Fragment,{children:[W,"patterns"===R&&!x&&Z]})},{name:"media",title:(0,T.__)("Media"),panel:(0,d.jsxs)(d.Fragment,{children:[W,q]})}]})}),i&&S&&(0,d.jsx)(Ss.Popover,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1,children:(0,d.jsx)(Qw,{item:S})})]})});var NB=(0,h.forwardRef)(function(e,t){return(0,d.jsx)(AB,{...e,onPatternCategorySelection:RB,ref:t})});function LB({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:r,hasSearch:i=!0}){const[s,l]=(0,h.useState)(""),[a,c]=CC({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:r}),[u]=cC(a,c,!0),{setInserterIsOpened:p,insertionIndex:m}=(0,g.useSelect)(e=>{const{getSettings:t,getBlockIndex:o,getBlockCount:r}=e(Ii),i=t(),s=o(n),l=r();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,insertionIndex:-1===s?l:s}},[n]),f=i&&u.length>6;return(0,h.useEffect)(()=>{p&&p(!1)},[p]),(0,d.jsxs)("div",{className:gs("block-editor-inserter__quick-inserter",{"has-search":f,"has-expand":p}),children:[f&&(0,d.jsx)(Ss.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:s,onChange:e=>{l(e)},label:(0,T.__)("Search"),placeholder:(0,T.__)("Search")}),(0,d.jsx)("div",{className:"block-editor-inserter__quick-inserter-results",children:(0,d.jsx)(jB,{filterValue:s,onSelect:e,rootClientId:t,clientId:n,isAppender:o,maxBlockPatterns:s?2:0,maxBlockTypes:6,isDraggable:!1,selectBlockOnInsert:r,isQuick:!0})}),p&&(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{p({filterValue:s,onSelect:e,rootClientId:t,insertionIndex:m})},"aria-label":(0,T.__)("Browse all. This will open the main inserter panel in the editor toolbar."),children:(0,T.__)("Browse all")})]})}const DB=({onToggle:e,disabled:t,isOpen:n,blockTitle:o,hasSingleBlockType:r,toggleProps:i={}})=>{const{as:s=Ss.Button,label:l,onClick:a,...c}=i;let u=l;return!u&&r?u=(0,T.sprintf)((0,T._x)("Add %s","directly add the only allowed block"),o):u||(u=(0,T._x)("Add block","Generic label for block inserter button")),(0,d.jsx)(s,{__next40pxDefaultSize:!i.as||void 0,icon:sc,label:u,tooltipPosition:"bottom",onClick:function(t){e&&e(t),a&&a(t)},className:"block-editor-inserter__toggle","aria-haspopup":!r&&"true","aria-expanded":!r&&n,disabled:t,...c})};class OB extends h.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=DB}=this.props;return a({onToggle:e,isOpen:t,disabled:n||!l,blockTitle:o,hasSingleBlockType:r,directInsertBlock:i,toggleProps:s})}renderContent({onClose:e}){const{rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r,__experimentalIsQuick:i,onSelectOrClose:s,selectBlockOnInsert:l}=this.props;return i?(0,d.jsx)(LB,{onSelect:t=>{const n=Array.isArray(t)&&t?.length?t[0]:t;s&&"function"==typeof s&&s(n),e()},rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:l}):(0,d.jsx)(NB,{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,d.jsx)(Ss.Dropdown,{className:"block-editor-inserter",contentClassName:gs("block-editor-inserter__popover",{"is-quick":r}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,T.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:i})}}var zB=(0,m.compose)([(0,g.withSelect)((e,{clientId:t,rootClientId:n,shouldDirectInsert:o=!0})=>
2{const{getBlockRootClientId:r,hasInserterItems:i,getAllowedBlocks:s,getDirectInsertBlock:l}=e(Ii),{getBlockVariations:a}=e(p.store),c=s(n=n||r(t)||void 0),u=o&&l(n),d=1===c?.length&&0===a(c[0].name,"inserter")?.length;let h=!1;return d&&(h=c[0]),{hasItems:i(n),hasSingleBlockType:d,blockTitle:h?h.title:"",allowedBlockType:h,directInsertBlock:u,rootClientId:n}}),(0,g.withDispatch)((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:o,clientId:r,isAppender:i,hasSingleBlockType:s,allowedBlockType:l,directInsertBlock:a,onSelectOrClose:c,selectBlockOnInsert:u}=t;if(!s&&!a)return;const{insertBlock:d}=e(Ii);let h;if(a){const e=function(e){const{getBlock:t,getPreviousBlockClientId:i}=n(Ii);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];a&&a?.name===t.name&&(l=t.attributes)}}return e.forEach(e=>{l.hasOwnProperty(e)&&(s[e]=l[e])}),s}(a.attributesToCopy);h=(0,p.createBlock)(a.name,{...a.attributes||{},...e})}else h=(0,p.createBlock)(l.name);d(h,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:s,getBlockRootClientId:l}=n(Ii);if(r)return e(r);const a=t();return!i&&a&&l(a)===o?e(a)+1:s(o).length}(),o,u),c&&c(h);const g=(0,T.sprintf)((0,T.__)("%s block added"),l.title);(0,Ho.speak)(g)}})),(0,m.ifCondition)(({hasItems:e,isAppender:t,rootClientId:n,clientId:o})=>e||!t&&!n&&!o)])(OB);function VB({rootClientId:e,className:t,onFocus:n,tabIndex:o,onSelect:r},i){return(0,d.jsx)(zB,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,onSelectOrClose:(...e)=>{r&&"function"==typeof r&&r(...e)},renderToggle:({onToggle:e,disabled:r,isOpen:s,blockTitle:l,hasSingleBlockType:a})=>{const c=!a,u=a?(0,T.sprintf)((0,T._x)("Add %s","directly add the only allowed block"),l):(0,T._x)("Add block","Generic label for block inserter button");return(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,ref:i,onFocus:n,tabIndex:o,className:gs(t,"block-editor-button-block-appender"),onClick:e,"aria-haspopup":c?"true":void 0,"aria-expanded":c?s:void 0,disabled:r,label:u,showTooltip:!0,children:(0,d.jsx)(Nl,{icon:sc})})},isAppender:!0})}const FB=(0,h.forwardRef)((e,t)=>(I()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),VB(e,t)));var HB=(0,h.forwardRef)(VB);function UB({clientId:e,contentRef:t,parentLayout:n}){const o=(0,g.useSelect)(e=>e(Ii).getSettings().isDistractionFree,[]),r=ch(e);if(o||!r)return null;const i=n?.isManualPlacement&&window.__experimentalEnableGridInteractivity;return(0,d.jsx)(GB,{gridClientId:e,gridElement:r,isManualGrid:i,ref:t})}const GB=(0,h.forwardRef)(({gridClientId:e,gridElement:t,isManualGrid:n},o)=>{const[r,i]=(0,h.useState)(()=>Mb(t)),[s,l]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{const e=()=>i(Mb(t)),n=new window.ResizeObserver(e);n.observe(t,{box:"border-box"});const o=new window.ResizeObserver(e);return o.observe(t),()=>{n.disconnect(),o.disconnect()}},[t]),(0,h.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,d.jsx)(Wm,{className:gs("block-editor-grid-visualizer",{"is-dropping-allowed":s}),clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",children:(0,d.jsx)("div",{ref:o,className:"block-editor-grid-visualizer__grid",style:r.style,children:n?(0,d.jsx)($B,{gridClientId:e,gridInfo:r}):Array.from({length:r.numItems},(e,t)=>(0,d.jsx)(WB,{color:r.currentColor},t))})})});function $B({gridClientId:e,gridInfo:t}){const[n,o]=(0,h.useState)(null),r=(0,g.useSelect)(t=>{const{getBlockOrder:n,getBlockStyles:o}=U(t(Ii));return o(n(e))},[e]),i=(0,h.useMemo)(()=>{const e=[];for(const t of Object.values(r)){const{columnStart:n,rowStart:o,columnSpan:r=1,rowSpan:i=1}=t?.layout??{};n&&o&&e.push(new Ib({columnStart:n,rowStart:o,columnSpan:r,rowSpan:i}))}return e},[r]);return Bb(1,t.numRows).map(r=>Bb(1,t.numColumns).map(s=>{const l=i.some(e=>e.contains(s,r)),a=n?.contains(s,r)??!1;return(0,d.jsx)(WB,{color:t.currentColor,className:a&&"is-highlighted",children:l?(0,d.jsx)(ZB,{column:s,row:r,gridClientId:e,gridInfo:t,setHighlightedRect:o}):(0,d.jsx)(qB,{column:s,row:r,gridClientId:e,gridInfo:t,setHighlightedRect:o})},`${r}-${s}`)}))}function WB({color:e,children:t,className:n}){return(0,d.jsx)("div",{className:gs("block-editor-grid-visualizer__cell",n),style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${e} 20%, #0000)`,color:e},children:t})}
2function KB(e,t,n,o,r){const{getBlockAttributes:i,getBlockRootClientId:s,canInsertBlockType:l,getBlockName:a}=(0,g.useSelect)(Ii),{updateBlockAttributes:c,moveBlocksToPosition:u,__unstableMarkNextChangeAsNotPersistent:d}=(0,g.useDispatch)(Ii),p=lm(n,o.numColumns);return function({validateDrag:e,onDragEnter:t,onDragLeave:n,onDrop:o}){const{getDraggedBlockClientIds:r}=(0,g.useSelect)(Ii);return(0,m.__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 Ib({columnStart:e,rowStart:t,columnSpan:c.style?.layout?.columnSpan,rowSpan:c.style?.layout?.rowSpan});return new Ib({columnSpan:o.numColumns,rowSpan:o.numRows}).containsRect(u)},onDragEnter(n){const o=i(n);r(new Ib({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);c(o,{style:{...l.style,layout:{...l.style?.layout,columnStart:e,rowStart:t}}}),d(),u([o],s(o),n,p(e,t))}})}function ZB({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:r}){return(0,d.jsx)("div",{className:"block-editor-grid-visualizer__drop-zone",ref:KB(e,t,n,o,r)})}function qB({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:r}){const{updateBlockAttributes:i,moveBlocksToPosition:s,__unstableMarkNextChangeAsNotPersistent:l}=(0,g.useDispatch)(Ii),a=lm(n,o.numColumns);return(0,d.jsx)(HB,{rootClientId:n,className:"block-editor-grid-visualizer__appender",ref:KB(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 YB({clientId:e,bounds:t,onChange:n,parentLayout:o}){const r=ch(e),i=r?.parentElement,{isManualPlacement:s}=o;return r&&i?(0,d.jsx)(XB,{clientId:e,bounds:t,blockElement:r,rootBlockElement:i,onChange:n,isManualGrid:s&&window.__experimentalEnableGridInteractivity}):null}function XB({clientId:e,bounds:t,blockElement:n,rootBlockElement:o,onChange:r,isManualGrid:i}){const[s,l]=(0,h.useState)(null),[a,c]=(0,h.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,h.useEffect)(()=>{const e=new window.ResizeObserver(()=>{const e=n.getBoundingClientRect(),t=o.getBoundingClientRect();c({top:e.top>t.top,bottom:e.bottom<t.bottom,left:e.left>t.left,right:e.right<t.right})});return e.observe(n),()=>e.disconnect()},[n,o]);const u={right:"left",left:"right"},p={top:"flex-end",bottom:"flex-start"},g={display:"flex",justifyContent:"center",alignItems:"center",...u[s]&&{justifyContent:u[s]},...p[s]&&{alignItems:p[s]}};return(0,d.jsx)(Wm,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",additionalStyles:g,children:(0,d.jsx)(Ss.ResizableBox,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:a.bottom,bottomLeft:!1,bottomRight:!1,left:a.left,right:a.right,top:a.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(jb(o,"column-gap")),a=parseFloat(jb(o,"row-gap")),c=Eb(jb(o,"grid-template-columns"),l),u=Eb(jb(o,"grid-template-rows"),a),d=new window.DOMRect(n.offsetLeft+s.offsetLeft,n.offsetTop+s.offsetTop,s.offsetWidth,s.offsetHeight),p=Tb(c,d.left)+1,h=Tb(u,d.top)+1,g=Tb(c,d.right,"end")+1,m=Tb(u,d.bottom,"end")+1;r({columnSpan:g-p+1,rowSpan:m-h+1,columnStart:i?p:void 0,rowStart:i?h:void 0})}})})}
2var QB=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),JB=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})});function eI({layout:e,parentLayout:t,onChange:n,gridClientId:o,blockClientId:r}){const{moveBlocksToPosition:i,__unstableMarkNextChangeAsNotPersistent:s}=(0,g.useDispatch)(Ii),l=e?.columnStart??1,a=e?.rowStart??1,c=l+(e?.columnSpan??1)-1,u=a+(e?.rowSpan??1)-1,p=t?.columnCount,h=t?.rowCount,m=lm(o,p);return(0,d.jsx)(Ps,{group:"parent",children:(0,d.jsxs)(Ss.ToolbarGroup,{className:"block-editor-grid-item-mover__move-button-container",children:[(0,d.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-left",children:(0,d.jsx)(tI,{icon:(0,T.isRTL)()?Ab:Nb,label:(0,T.__)("Move left"),description:(0,T.__)("Move left"),isDisabled:l<=1,onClick:()=>{n({columnStart:l-1}),s(),i([r],o,o,m(l-1,a))}})}),(0,d.jsxs)("div",{className:"block-editor-grid-item-mover__move-vertical-button-container",children:[(0,d.jsx)(tI,{className:"is-up-button",icon:QB,label:(0,T.__)("Move up"),description:(0,T.__)("Move up"),isDisabled:a<=1,onClick:()=>{n({rowStart:a-1}),s(),i([r],o,o,m(l,a-1))}}),(0,d.jsx)(tI,{className:"is-down-button",icon:JB,label:(0,T.__)("Move down"),description:(0,T.__)("Move down"),isDisabled:h&&u>=h,onClick:()=>{n({rowStart:a+1}),s(),i([r],o,o,m(l,a+1))}})]}),(0,d.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-right",children:(0,d.jsx)(tI,{icon:(0,T.isRTL)()?Nb:Ab,label:(0,T.__)("Move right"),description:(0,T.__)("Move right"),isDisabled:p&&c>=p,onClick:()=>{n({columnStart:l+1}),s(),i([r],o,o,m(l+1,a))}})})]})})}function tI({className:e,icon:t,label:n,isDisabled:o,onClick:r,description:i}){const s=`block-editor-grid-item-mover-button__description-${(0,m.useInstanceId)(tI)}`;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.ToolbarButton,{className:gs("block-editor-grid-item-mover-button",e),icon:t,label:n,"aria-describedby":s,onClick:o?null:r,disabled:o,accessibleWhenDisabled:!0}),(0,d.jsx)(Ss.VisuallyHidden,{id:s,children:i})]})}const nI={};function oI({clientId:e,style:t,setAttributes:n,allowSizingOnChildren:o,isManualPlacement:r,parentLayout:i}){const{rootClientId:s,isVisible:l}=(0,g.useSelect)(t=>{const{getBlockRootClientId:n,getBlockEditingMode:o,getTemplateLock:r}=t(Ii),i=n(e);return r(i)||"default"!==o(i)?{rootClientId:i,isVisible:!1}:{rootClientId:i,isVisible:!0}},[e]),[a,c]=(0,h.useState)();if(!l)return null;function u(e){n({style:{...t,layout:{...t?.layout,...e}}})}return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(UB,{clientId:s,contentRef:c,parentLayout:i}),o&&(0,d.jsx)(YB,{clientId:e,bounds:a,onChange:u,parentLayout:i}),r&&window.__experimentalEnableGridInteractivity&&(0,d.jsx)(eI,{layout:t?.layout,parentLayout:i,onChange:u,gridClientId:s,blockClientId:e})]})}var rI={useBlockProps:function({style:e}){const t=(0,g.useSelect)(e=>!e(Ii).getSettings().disableLayoutStyles),n=e?.layout??{},{selfStretch:o,flexSize:r,columnStart:i,rowStart:s,columnSpan:l,rowSpan:a}=n,c=Ql()||{},{columnCount:u,minimumColumnWidth:d}=c,p=(0,m.useInstanceId)(nI),h=`.wp-container-content-${p}`;let f="";if(t&&("fixed"===o&&r?f=`${h} {\n\t\t\t\tflex-basis: ${r};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===o?f=`${h} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`:i&&l?f=`${h} {\n\t\t\t\tgrid-column: ${i} / span ${l};\n\t\t\t}`:i?f=`${h} {\n\t\t\t\tgrid-column: ${i};\n\t\t\t}`:l&&(f=`${h} {\n\t\t\t\tgrid-column: span ${l};\n\t\t\t}`),s&&a?f+=`${h} {\n\t\t\t\tgrid-row: ${s} / span ${a};\n\t\t\t}`:s?f+=`${h} {\n\t\t\t\tgrid-row: ${s};\n\t\t\t}`:a&&(f+=`${h} {\n\t\t\t\tgrid-row: span ${a};\n\t\t\t}`),(l||i)&&(d||!u))){let e=parseFloat(d);isNaN(e)&&(e=12);let t=d?.replace(e,"");["px","rem","em"].includes(t)||(t="rem");let n=2;n=l&&i?l+i-1:l||i;const o="px"===t?24:1.5,r=n*e+(n-1)*o,s=2*e+o-1,a=l&&l>1?"1/-1":"auto";f+=`@container (max-width: ${Math.max(r,s)}${t}) {\n\t\t\t\t${h} {\n\t\t\t\t\tgrid-column: ${a};\n\t\t\t\t\tgrid-row: auto;\n\t\t\t\t}\n\t\t\t}`}if(vs({css:f}),f)return{className:`wp-container-content-${p}`}},edit:function({clientId:e,style:t,setAttributes:n}
2){const o=Ql()||{},{type:r="default",allowSizingOnChildren:i=!1,isManualPlacement:s}=o;return"grid"!==r?null:(0,d.jsx)(oI,{clientId:e,style:t,setAttributes:n,allowSizingOnChildren:i,isManualPlacement:s,parentLayout:o})},attributeKeys:["style"],hasSupport:()=>!0},iI={edit:function({clientId:e}){const{templateLock:t,isLockedByParent:n,isEditingAsBlocks:o}=(0,g.useSelect)(t=>{const{getContentLockingParent:n,getTemplateLock:o,getTemporarilyEditingAsBlocks:r}=U(t(Ii));return{templateLock:o(e),isLockedByParent:!!n(e),isEditingAsBlocks:r()===e}},[e]),{stopEditingAsBlocks:r}=U((0,g.useDispatch)(Ii)),i=!n&&"contentOnly"===t,s=(0,h.useCallback)(()=>{r(e)},[e,r]);return i||o?o&&!i&&(0,d.jsx)(Ps,{group:"other",children:(0,d.jsx)(Ss.ToolbarButton,{onClick:s,children:(0,T.__)("Done")})}):null},hasSupport:()=>!0};const sI="metadata";(0,f.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",function(e){return e?.attributes?.[sI]?.type||(e.attributes={...e.attributes,[sI]:{type:"object"}}),e}),(0,f.addFilter)("blocks.switchToBlockType.transformedBlock","core/metadata/addTransforms",function(e,t,n,o){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(o.length>1&&t.length>1&&o.length!==t.length)return e;const r=t[n]?.attributes?.metadata;if(!r)return e;const i={};return r.noteId&&!e.attributes?.metadata?.noteId&&(i.noteId=r.noteId),r.name&&!e.attributes?.metadata?.name&&(0,p.hasBlockSupport)(e.name,"renaming",!0)&&(i.name=r.name),void 0!==r.blockVisibility&&!e.attributes?.metadata?.blockVisibility&&(0,p.hasBlockSupport)(e.name,"visibility",!0)&&(i.blockVisibility=r.blockVisibility),Object.keys(i).length>0?{...e,attributes:{...e.attributes,metadata:{...e.attributes.metadata,...i}}}:e});const lI={};var aI={edit:function({name:e,clientId:t,metadata:{ignoredHookedBlocks:n=[]}={}}){const o=(0,g.useSelect)(e=>e(p.store).getBlockTypes(),[]),r=(0,h.useMemo)(()=>o?.filter(({name:t,blockHooks:o})=>o&&e in o||n.includes(t)),[o,e,n]),i=(0,g.useSelect)(n=>{const{getBlocks:o,getBlockRootClientId:i,getGlobalBlockCount:s}=n(Ii),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:lI},[r,e,t]),{getBlockIndex:s,getBlockCount:l,getBlockRootClientId:a}=(0,g.useSelect)(Ii),{insertBlock:c,removeBlock:u}=(0,g.useDispatch)(Ii);if(!r.length)return null;const m=r.reduce((e,t)=>{const[n]=t.name.split("/");return e[n]||(e[n]=[]),e[n].push(t),e},{});return(0,d.jsx)(Oa,{children:(0,d.jsxs)(Ss.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,T.__)("Plugins"),initialOpen:!0,children:[(0,d.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,T.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(m).map(n=>(0,d.jsxs)(h.Fragment,{children:[(0,d.jsx)("h3",{children:n}),m[n].map(n=>{const o=n.name in i;return(0,d.jsx)(Ss.ToggleControl,{__nextHasNoMarginBottom:!0,checked:o,label:n.title,onChange:()=>{if(!o){const o=n.blockHooks[e];return void((e,n)=>{const o=s(t),r=l(t),i=a(t);switch(n){case"before":case"after":c(e,"after"===n?o+1:o,i,!1);break;case"first_child":case"last_child":c(e,"first_child"===n?0:r,t,!1);break;case void 0:c(e,o+1,i,!1)}})((0,p.createBlock)(n.name),o)}u(i[n.name],!1)}},n.title)})]},n))]})})},attributeKeys:["metadata"],hasSupport:()=>!0};const{Menu:cI}=U(Ss.privateApis),uI={},dI=(e,t)=>{const n=(0,p.getBlockType)(e).attributes?.[t]?.type;return"rich-text"===n?"string":n};function pI({attribute:e,binding:t,sources:n}){const{clientId:o}=C(),{updateBlockBindings:r}=qk(),i=(0,m.useViewportMatch)("medium","<"),s=(0,h.useContext)(Gk),{attributeType:l,select:a}=(0,g.useSelect)(t=>{const{name:n}=t(Ii).getBlock(o);return{attributeType:dI(n,e),select:t}},[o,e]);return(0,d.jsx)(cI,{placement:i?"bottom-start":"left-start",children:Object.entries(n).map(([n,o])=>{const c=o.data?.filter(e=>e?.type===l);return c&&0!==c.length?(0,d.jsxs)(cI,{placement:i?"bottom-start":"left-start",children:[(0,d.jsx)(cI.SubmenuTriggerItem,{children:(0,d.jsx)(cI.ItemLabel,{children:o.label})}),(0,d.jsx)(cI.Popover,{gutter:8,children:(0,d.jsx)(cI.Group,{children:c.map(i=>{const l={source:n,args:i?.args||{key:i.key}};let c={};try{c=o.getValues({select:a,context:s,bindings:{[e]:l}})}catch(e){}return(0,d.jsxs)(cI.CheckboxItem,{onChange:()=>{const n=E()(t?.args,i.args)??i.key===t?.args?.key;r(n?{[e]:void 0}:{[e]:l})},name:e+"-binding",value:c[e],checked:E()(t?.args,i.args)??i.key===t?.args?.key,children:[(0,d.jsx)(cI.ItemLabel,{children:i?.label}),(0,d.jsx)(cI.ItemHelpText,{children:c[e]})]},n+JSON.stringify(i.args)||i.key)})})})]},n):null})})}
2function hI({attribute:e,binding:t,sources:n,blockName:o}){const{source:r,args:i}=t||{},s=n?.[r];let l,a=!0;if(void 0===t){const t=dI(o,e);l=Object.values(n).some(e=>e.data?.some(e=>e?.type===t))?(0,T.__)("Not connected"):(0,T.__)("No sources available"),a=!0}else s?l=s.data?.find(e=>E()(e.args,i))?.label||s.label||r:(a=!1,l=(0,T.__)("Source not registered"),0===Object.keys(n).length&&(l=(0,T.__)("No sources available")));return(0,d.jsxs)(Ss.__experimentalVStack,{className:"block-editor-bindings__item",spacing:0,children:[(0,d.jsx)(Ss.__experimentalText,{truncate:!0,children:e}),(0,d.jsx)(Ss.__experimentalText,{truncate:!0,variant:a?"muted":void 0,isDestructive:!a,children:l})]})}function gI({attribute:e,binding:t,sources:n,blockName:o}){const r=(0,m.useViewportMatch)("medium","<");return(0,d.jsx)(Ss.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:e,children:(0,d.jsx)(cI,{placement:r?"bottom-start":"left-start",children:(0,d.jsx)(cI.TriggerButton,{render:(0,d.jsx)(Ss.__experimentalItem,{}),disabled:!0,children:(0,d.jsx)(hI,{attribute:e,binding:t,sources:n,blockName:o})})})})}function mI({attribute:e,binding:t,sources:n,blockName:o}){const{updateBlockBindings:r}=qk(),i=(0,m.useViewportMatch)("medium","<");return(0,d.jsx)(Ss.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:e,onDeselect:()=>{r({[e]:void 0})},children:(0,d.jsxs)(cI,{placement:i?"bottom-start":"left-start",children:[(0,d.jsx)(cI.TriggerButton,{render:(0,d.jsx)(Ss.__experimentalItem,{}),children:(0,d.jsx)(hI,{attribute:e,binding:t,sources:n,blockName:o})}),(0,d.jsx)(cI.Popover,{gutter:i?8:36,children:(0,d.jsx)(pI,{attribute:e,binding:t,sources:n})})]})})}var fI={edit:({name:e,metadata:t})=>{const n=(0,h.useContext)(Gk),{removeAllBlockBindings:o}=qk(),r=(0,m.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}},i={},{sources:s,canUpdateBlockBindings:l,bindableAttributes:a}=(0,g.useSelect)(t=>{const{__experimentalBlockBindingsSupportedAttributes:o}=t(Ii).getSettings(),r=o?.[e];if(!r||0===r.length)return uI;const s=(0,p.getBlockBindingsSources)();return Object.entries(s).forEach(([e,{getFieldsList:o,usesContext:r,label:s,getValues:l}])=>{const a={};if(r?.length)for(const e of r)a[e]=n[e];if(o){const n=o({select:t,context:a});i[e]={data:n||[],label:s,getValues:l}}else i[e]={data:[],label:s,getValues:l}}),{sources:Object.values(i).length>0?i:uI,canUpdateBlockBindings:t(Ii).getSettings().canUpdateBlockBindings,bindableAttributes:r}},[n,e]);if(!a||0===a.length)return null;const{bindings:c}=t||{},u=Object.values(s).some(e=>e.data&&e.data.length>0),f=!l||!u;return void 0!==c||u?(0,d.jsx)(Oa,{group:"bindings",children:(0,d.jsxs)(Ss.__experimentalToolsPanel,{label:(0,T.__)("Attributes"),resetAll:()=>{o()},dropdownMenuProps:r,className:"block-editor-bindings__panel",children:[(0,d.jsx)(Ss.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:a.map(t=>{const n=c?.[t],o=dI(e,t),r=Object.values(s).some(e=>e.data?.some(e=>e?.type===o));return f||!r?(0,d.jsx)(gI,{attribute:t,binding:n,sources:s,blockName:e},t):(0,d.jsx)(mI,{attribute:t,binding:n,sources:s,blockName:e},t)})}),(0,d.jsx)(Ss.__experimentalText,{as:"div",variant:"muted",children:(0,d.jsx)("p",{children:(0,T.__)("Attributes connected to custom fields or other dynamic data.")})})]})}):null},attributeKeys:["metadata"],hasSupport:e=>!["core/post-date","core/navigation-link","core/navigation-submenu"].includes(e)};function bI(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 Ib({columnStart:l,rowStart:s,columnSpan:n,rowSpan:o});if(!e.some(e=>e.intersectsRect(t)))return[l,s]}}function kI(e){!function({clientId:e}){const{gridLayout:t,blockOrder:n,selectedBlockLayout:o}=(0,g.useSelect)(t=>{const{getBlockAttributes:n,getBlockOrder:o}=t(Ii),r=t(Ii).getSelectedBlock();return{gridLayout:n(e).layout??{},blockOrder:o(e),selectedBlockLayout:r?.attributes.style?.layout}},[e]),{getBlockAttributes:r,getBlockRootClientId:i}=(0,g.useSelect)(Ii),{updateBlockAttributes:s,__unstableMarkNextChangeAsNotPersistent:l}=(0,g.useDispatch)(Ii),a=(0,h.useMemo)(()=>o?new Ib(o):null,[o]),c=(0,m.usePrevious)(a),u=(0,m.usePrevious)(t.isManualPlacement),d=(0,m.usePrevious)(n);(0,h.useEffect)(()=>{const o={};if(t.isManualPlacement){const s=[];for(const e of n){const{columnStart:t,rowStart:n,columnSpan:o=1,rowSpan:i=1}=r(e).style?.layout??{};t&&n&&s.push(new Ib({columnStart:t,rowStart:n,columnSpan:o,rowSpan:i}))}for(const e of n){const n=r(e),{columnStart:i,rowStart:l,columnSpan:a=1,rowSpan:u=1}=n.style?.layout??{};if(i&&l)continue;const[d,p]=bI(s,t.columnCount,a,u,c?.columnEnd,c?.rowEnd);s.push(new Ib({columnStart:d,rowStart:p,columnSpan:a,rowSpan:u})),o[e]={style:{...n.style,layout:{...n.style?.layout,columnStart:d,rowStart:p}}}}const l=Math.max(...s.map(e=>e.rowEnd));(!t.rowCount||t.rowCount<l)&&(o[e]={layout:{...t,rowCount:l}});for(const e of d??[])if(!n.includes(e)){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:u,...d}=s.style?.layout??{};if(l||a||c||u){const t=0===Object.keys(d).length;o[e]=ge(s,["style","layout"],t?void 0:d)}}}else{if(!0===u)for(const e of n){const t=r(e),{columnStart:n,rowStart:i,...s}=t.style?.layout??{};if(n||i){const n=0===Object.keys(s).length;o[e]=ge(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,d,n,c,u,l,r,i,s])}(e)}function vI({clientId:e,layout:t}){const n=(0,g.useSelect)(t=>{const{isBlockSelected:n,isDraggingBlocks:o,getTemplateLock:r,getBlockEditingMode:i}=t(Ii);return!(!o()&&!n(e)||r(e)||"default"!==i(e))},[e]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(kI,{clientId:e}),n&&(0,d.jsx)(UB,{clientId:e,parentLayout:t})]})}
2(0,f.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",function(e){return e.__experimentalLabel||(0,p.hasBlockSupport)(e,"renaming",!0)&&(e.__experimentalLabel=(e,{context:t})=>{const{metadata:n}=e;if("list-view"===t&&n?.name)return n.name}),e});const _I=(0,m.createHigherOrderComponent)(e=>t=>"grid"!==t.attributes.layout?.type?(0,d.jsx)(e,{...t},"edit"):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(vI,{clientId:t.clientId,layout:t.attributes.layout}),(0,d.jsx)(e,{...t},"edit")]}),"addGridVisualizerToBlockEdit");function yI(e){const t=e.style?.border||{};return{className:jp(e)||void 0,style:lf({border:t})}}function xI(e){const{colors:t}=jd(),n=yI(e),{borderColor:o}=e;if(o){const e=vp({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function SI(e){return{style:lf({shadow:e.style?.shadow||""})}}function wI(e){const{backgroundColor:t,textColor:n,gradient:o,style:r}=e,i=Id("background-color",t),s=Id("color",n),l=Tp(o),a=l||r?.color?.gradient;return{className:gs(s,l,{[i]:!a&&!!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:lf({color:r?.color||{}})}}function CI(e){const{backgroundColor:t,textColor:n,gradient:o}=e,[r,i,s,l,a,c]=Ei("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),u=(0,h.useMemo)(()=>[...r||[],...i||[],...s||[]],[r,i,s]),d=(0,h.useMemo)(()=>[...l||[],...a||[],...c||[]],[l,a,c]),p=wI(e);if(t){const e=Cd(u,t);p.style.backgroundColor=e.color}if(o&&(p.style.background=Mp(d,o)),n){const e=Cd(u,n);p.style.color=e.color}return p}function BI(e){const{style:t}=e;return{style:lf({spacing:t?.spacing||{}})}}(0,f.addFilter)("editor.BlockEdit","core/editor/grid-visualizer",_I);const{kebabCase:II}=U(Ss.privateApis);function jI(e,t){let n=e?.style?.typography||{};n={...n,fontSize:$i({size:e?.style?.typography?.fontSize},t)};const o=lf({typography:n}),r=e?.fontFamily?`has-${II(e.fontFamily)}-font-family`:"";return{className:gs(r,e?.style?.typography?.textAlign?`has-text-align-${e?.style?.typography?.textAlign}`:"",xg(e?.fontSize)),style:o}}function EI(e){const[t,n]=(0,h.useState)(e);return(0,h.useEffect)(()=>{e&&n(e)},[e]),t}var TI;!function(e){e=e.map(e=>
2({...e,Edit:(0,h.memo)(e.edit)}));const t=(0,m.createHigherOrderComponent)(t=>n=>{const o=C();return[...e.map((e,t)=>{const{Edit:r,hasSupport:i,attributeKeys:s=[],shareWithChildBlocks:l}=e;if(!(o[b]||o[k]&&l)||!i(n.name))return null;const a={};for(const e of s)n.attributes[e]&&(a[e]=n.attributes[e]);return(0,d.jsx)(r,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...a},t)}),(0,d.jsx)(t,{...n},"edit")]},"withBlockEditHooks");(0,f.addFilter)("editor.BlockEdit","core/editor/hooks",t)}([ma,Dg,Uu,$u,gf,Df,Vg,qf,xb,iI,aI,fI,rI,Vu].filter(Boolean)),function(e){const t=(0,m.createHigherOrderComponent)(t=>n=>{const[o,r]=(0,h.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,d.jsx)(xs,{index:t,useBlockProps:s,setAllWrapperProps:r,name:n.name,clientId:n.clientId,...a},t)}),(0,d.jsx)(t,{...n,wrapperProps:o.filter(Boolean).reduce((e,t)=>({...e,...t,className:gs(e.className,t.className),style:{...e.style,...t.style}}),n.wrapperProps||{})},"edit")]},"withBlockListBlockHooks");(0,f.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}([ma,Dg,Pu,gf,wh,nf,Df,kg,Cg,Vg,Ep,qf,bb,rI]),TI=[ma,Dg,Uu,Gu,$u,Ep,Vg,wh,gf,kg,Cg],(0,f.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",function(e,t,n){return TI.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,f.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",e=>(e.hasOwnProperty("className")&&!e.className&&delete e.className,e));const{kebabCase:MI}=U(Ss.privateApis),PI=([e,...t])=>e.toUpperCase()+t.join(""),RI=e=>(0,m.createHigherOrderComponent)(t=>n=>(0,d.jsx)(t,{...n,colors:e}),"withCustomColorPalette"),AI=()=>(0,m.createHigherOrderComponent)(e=>t=>{const[n,o,r]=Ei("color.palette.custom","color.palette.theme","color.palette.default"),i=(0,h.useMemo)(()=>[...n||[],...o||[],...r||[]],[n,o,r]);return(0,d.jsx)(e,{...t,colors:i})},"withEditorColorPalette");function NI(e,t){const n=e.reduce((e,t)=>({...e,..."string"==typeof t?{[t]:MI(t)}:t}),{});return(0,m.compose)([t,e=>class extends h.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=bd(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=PI(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e},{})}createSetColor(e,t){return n=>{const o=Bd(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=Cd(t,e[r],e[`custom${PI(r)}`]),l=o[r],a=l?.color;return a===s.color&&l?n[r]=l:n[r]={...s,class:Id(i,s.slug)},n},{})}render(){return(0,d.jsx)(e,{...{...this.props,colors:void 0,...this.state,...this.setters,colorUtils:this.colorUtils}})}}])}function LI(e){return(...t)=>{const n=RI(e);return(0,m.createHigherOrderComponent)(NI(t,n),"withCustomColors")}}function DI(...e){const t=AI();return(0,m.createHigherOrderComponent)(NI(e,t),"withColors")}var OI=function(e){const[t,n]=Ei("typography.fontSizes","typography.customFontSize");return(0,d.jsx)(Ss.FontSizePicker,{...e,fontSizes:t,disableCustomFontSizes:!n})};const zI=[],VI=([e,...t])=>e.toUpperCase()+t.join("");var FI=(...e)=>{const t=e.reduce((e,t)=>(e[t]=`custom${VI(t)}`,e),{});return(0,m.createHigherOrderComponent)((0,m.compose)([(0,m.createHigherOrderComponent)(e=>t=>{const[n]=Ei("typography.fontSizes");return(0,d.jsx)(e,{...t,fontSizes:n||zI})},"withFontSizes"),e=>class extends h.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object.entries(t).reduce((e,[t,n])=>(e[`set${VI(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=_g(n,i,e[r]);return t[o]={...s,class:xg(i)},t},{});return{...o,...i}}render(){return(0,d.jsx)(e,{...{...this.props,fontSizes:void 0,...this.state,...this.setters}})}}]),"withFontSizes")};const HI=()=>{};var UI={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockId:n,prioritizedBlocks:o}=(0,g.useSelect)(e=>{const{getSelectedBlockClientId:t,getBlock:n,getBlockListSettings:o,getBlockRo
2otClientId:r}=e(Ii),{getActiveBlockVariation:i}=e(p.store),s=t(),{name:l,attributes:a}=n(s),c=i(l,a),u=r(s);return{selectedBlockId:c?`${l}/${c.name}`:l,rootClientId:u,prioritizedBlocks:o(u)?.prioritizedInserterBlocks}},[]),[r,i,s]=cC(t,HI,!0),l=(0,h.useMemo)(()=>(e.trim()?WC(r,i,s,e):BB(yt(r,"frecency","desc"),o)).filter(e=>e.id!==n).slice(0,9),[e,n,r,i,s,o]);return[(0,h.useMemo)(()=>l.map(e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Au,{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,blocks:i}=e;return{action:"replace",value:"unsynced"===r?(i??[]).map(e=>(0,p.cloneBlock)(e)):(0,p.createBlock)(t,n,(0,p.createBlocksFromInnerBlocksTemplate)(o))}}};const GI=window.wp.apiFetch;var $I=n.n(GI),WI=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}),KI={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await $I()({path:(0,Va.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,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Nl,{icon:"page"===e.subtype?cc:WI},"icon"),(0,eS.decodeEntities)(e.title)]}),getOptionCompletion:e=>(0,d.jsx)("a",{href:e.url,children:e.title})};const ZI=[];function qI({completers:e=ZI}){const{name:t}=C();return(0,h.useMemo)(()=>{let n=[...e,KI];return(t===(0,p.getDefaultBlockName)()||(0,p.getBlockSupport)(t,"__experimentalSlashInserter",!1))&&(n=[...n,UI]),(0,f.hasFilter)("editor.Autocomplete.completers")&&(n===e&&(n=n.map(e=>({...e}))),n=(0,f.applyFilters)("editor.Autocomplete.completers",n,t)),n},[e,t])}var YI=function(e){return(0,d.jsx)(Ss.Autocomplete,{...e,completers:qI(e)})},XI=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}),QI=function({isActive:e,label:t=(0,T.__)("Full height"),onToggle:n,isDisabled:o}){return(0,d.jsx)(Ss.ToolbarButton,{isActive:e,icon:XI,label:t,onClick:()=>n(!e),disabled:o})};const JI=()=>{};var ej=function(e){const{label:t=(0,T.__)("Change matrix alignment"),onChange:n=JI,value:o="center",isDisabled:r}=e,i=(0,d.jsx)(Ss.AlignmentMatrixControl.Icon,{value:o});return(0,d.jsx)(Ss.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e,isOpen:n})=>(0,d.jsx)(Ss.ToolbarButton,{onClick:e,"aria-haspopup":"true","aria-expanded":n,onKeyDown:t=>{n||t.keyCode!==Ua.DOWN||(t.preventDefault(),e())},label:t,icon:i,showTooltip:!0,disabled:r}),renderContent:()=>(0,d.jsx)(Ss.AlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};function tj({clientId:e,maximumLength:t,context:n}){const o=(0,g.useSelect)(t=>{if(!e)return null;const{getBlockName:o,getBlockAttributes:r}=t(Ii),{getBlockType:i,getActiveBlockVariation:s}=t(p.store),l=o(e),a=i(l);if(!a)return null;const c=r(e),u=(0,p.__experimentalGetBlockLabel)(a,c,n);if(u!==a.title)return u;const d=s(l,c);return d?.title||a.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 nj({clientId:e,maximumLength:t,context:n}){return tj({clientId:e,maximumLength:t,context:n})}var oj=function({rootLabelText:e}){const{selectBlock:t,clearSelectedBlock:n}=(0,g.useDispatch)(Ii),{clientId:o,parents:r,hasSelection:i}=(0,g.useSelect)(e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getEnabledBlockParents:o}=U(e(Ii)),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}},[]),s=e||(0,T.__)("Document"),l=(0,h.useRef)();return ah(o,l),(0,d.jsxs)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,T.__)("Block breadcrumb"),children:[(0,d.jsxs)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true",children:[i&&(0,d.jsx)(Ss.Button,{size:"small",className:"block-editor-block-breadcrumb__button",onClick:()=>{const e=l.current?.closest(".editor-styles-wrapper");
2n(),function(e){if(!e)return null;const t=Array.from(document.querySelectorAll('iframe[name="editor-canvas"]').values()).find(t=>(t.contentDocument||t.contentWindow.document)===e.ownerDocument)??e;return t?.closest('[role="region"]')??t}(e)?.focus()},children:s}),!i&&(0,d.jsx)("span",{children:s}),!!o&&(0,d.jsx)(Nl,{icon:ec,className:"block-editor-block-breadcrumb__separator"})]}),r.map(e=>(0,d.jsxs)("li",{children:[(0,d.jsx)(Ss.Button,{size:"small",className:"block-editor-block-breadcrumb__button",onClick:()=>t(e),children:(0,d.jsx)(nj,{clientId:e,maximumLength:35})}),(0,d.jsx)(Nl,{icon:ec,className:"block-editor-block-breadcrumb__separator"})]},e)),!!o&&(0,d.jsx)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true",children:(0,d.jsx)(nj,{clientId:o,maximumLength:35})})]})};function rj(e){return(0,g.useSelect)(t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(Ii);return n(e)},[e])}const ij={placement:"top-start"},sj={...ij,flip:!1,shift:!0},lj={...ij,flip:!0,shift:!1};function aj(e,t,n,o,r){if(!e||!t)return sj;const i=n?.scrollTop||0,s=Fm(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?lj:sj}function cj({contentElement:e,clientId:t}){const n=ch(t),[o,r]=(0,h.useState)(0),{blockIndex:i,isSticky:s}=(0,g.useSelect)(e=>{const{getBlockIndex:n,getBlockAttributes:o}=e(Ii);return{blockIndex:n(t),isSticky:Wf(o(t))}},[t]),l=(0,h.useMemo)(()=>{if(e)return(0,Fa.getScrollContainer)(e)},[e]),[a,c]=(0,h.useState)(()=>aj(e,n,l,o,s)),u=(0,m.useRefEffect)(e=>{r(e.offsetHeight)},[]),d=(0,h.useCallback)(()=>c(aj(e,n,l,o,s)),[e,n,l,o]);return(0,h.useLayoutEffect)(d,[i,d]),(0,h.useLayoutEffect)(()=>{if(!e||!n)return;const t=e?.ownerDocument?.defaultView;let o;t?.addEventHandler?.("resize",d);const r=n?.ownerDocument?.defaultView;return r.ResizeObserver&&(o=new r.ResizeObserver(d),o.observe(n)),()=>{t?.removeEventHandler?.("resize",d),o&&o.disconnect()}},[d,e,n]),{...a,ref:u}}function uj(e){const t=(0,g.useSelect)(t=>{const{getBlockRootClientId:n,getBlockParents:o,__experimentalGetBlockListSettingsForBlocks:r,isBlockInsertionPointVisible:i,getBlockInsertionPoint:s,getBlockOrder:l,hasMultiSelection:a,getLastMultiSelectedBlockClientId:c}=t(Ii),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 dj({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:r,rootClientId:i}=uj(e),s=cj({contentElement:t?.current,clientId:e});return(0,d.jsx)(Wm,{clientId:n||e,bottomClientId:r,className:gs("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":o}),__unstableContentRef:t,...s,children:(0,d.jsx)("div",{className:"block-editor-block-list__empty-block-inserter",children:(0,d.jsx)(zB,{position:"bottom right",rootClientId:i,clientId:e,__experimentalIsQuick:!0})})})}var pj=({appendToOwnerDocument:e,children:t,clientIds:n,cloneClassname:o,elementId:r,onDragStart:i,onDragEnd:s,fadeWhenDisabled:l=!1,dragComponent:a})=>{const{srcRootClientId:c,isDraggable:u,icon:f,visibleInserter:b,getBlockType:k}=(0,g.useSelect)(e=>{const{canMoveBlocks:t,getBlockRootClientId:o,getBlockName:r,getBlockAttributes:i,isBlockInsertionPointVisible:s}=e(Ii),{getBlockType:l,getActiveBlockVariation:a}=e(p.store),c=o(n[0]),u=r(n[0]),d=a(u,i(n[0]));return{srcRootClientId:c,isDraggable:t(n),icon:d?.icon||l(u)?.icon,visibleInserter:s(),getBlockType:l}},[n]),v=(0,h.useRef)(!1),[_,y,x]=function(){const e=(0,h.useRef)(null),t=(0,h.useRef)(null),n=(0,h.useRef)(null),o=(0,h.useRef)(null);return(0,h.useEffect)(()=>()=>{o.current&&(clearInterval(o.current),o.current=null)},[]),[(0,h.useCallback)(r=>{e.current=r.clientY,n.current=(0,Fa.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,h.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)}]}
2(),{getAllowedBlocks:S,getBlockNamesByClientId:w,getBlockRootClientId:C}=(0,g.useSelect)(Ii),{startDraggingBlocks:B,stopDraggingBlocks:I}=(0,g.useDispatch)(Ii);(0,h.useEffect)(()=>()=>{v.current&&I()},[]);const j=ch(n[0]),E=j?.closest("body");if((0,h.useEffect)(()=>{if(!E||!l)return;const e=(0,m.throttle)(e=>{if(!e.target.closest("[data-block]"))return;const t=w(n),o=e.target.closest("[data-block]").getAttribute("data-block"),r=S(o),i=w([o])[0];let s;if(0===r?.length){const e=C(o),n=w([e])[0],r=S(e);s=CS(k,r,t,n)}else s=CS(k,r,t,i);s||b?window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.add("block-draggable-invalid-drag-token")},200);return E.addEventListener("dragover",e),()=>{E.removeEventListener("dragover",e)}},[n,E,l,S,w,C,k,b]),!u)return t({draggable:!1});const T={type:"block",srcClientIds:n,srcRootClientId:c};return(0,d.jsx)(Ss.Draggable,{appendToOwnerDocument:e,cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:T,onDragStart:e=>{window.requestAnimationFrame(()=>{B(n),v.current=!0,_(e),i&&i()})},onDragOver:y,onDragEnd:()=>{I(),v.current=!1,x(),s&&s()},__experimentalDragComponent:void 0!==a?a:(0,d.jsx)(tC,{count:n.length,icon:f,fadeWhenDisabled:!0}),elementId:r,children:({onDraggableStart:e,onDraggableEnd:n})=>t({draggable:!0,onDragStart:e,onDragEnd:n})})};const hj=(e,t)=>
2"up"===e?"horizontal"===t?(0,T.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,T.isRTL)()?"left":"right":"down":null;function gj(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,T.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=hj("down",i);if("down"===t)return(0,T.sprintf)((0,T.__)("Move %1$d blocks from position %2$d down by one place"),e,s);if("left"===t)return(0,T.sprintf)((0,T.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if("right"===t)return(0,T.sprintf)((0,T.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(r>0&&o){const e=hj("down",i);if("down"===e)return(0,T.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,T.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,T.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=hj("up",i);if("up"===t)return(0,T.sprintf)((0,T.__)("Move %1$d blocks from position %2$d up by one place"),e,s);if("left"===t)return(0,T.sprintf)((0,T.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if("right"===t)return(0,T.sprintf)((0,T.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(r<0&&n){const e=hj("up",i);if("up"===e)return(0,T.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,T.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,T.__)("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,T.sprintf)((0,T.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!r){const e=hj("down",s);if("down"===e)return(0,T.sprintf)((0,T.__)("Move %1$s block from position %2$d down to position %3$d"),t,l,l+1);if("left"===e)return(0,T.sprintf)((0,T.__)("Move %1$s block from position %2$d left to position %3$d"),t,l,l+1);if("right"===e)return(0,T.sprintf)((0,T.__)("Move %1$s block from position %2$d right to position %3$d"),t,l,l+1)}if(i>0&&r){const e=hj("down",s);if("down"===e)return(0,T.sprintf)((0,T.__)("Block %1$s is at the end of the content and canât be moved down"),t);if("left"===e)return(0,T.sprintf)((0,T.__)("Block %1$s is at the end of the content and canât be moved left"),t);if("right"===e)return(0,T.sprintf)((0,T.__)("Block %1$s is at the end of the content and canât be moved right"),t)}if(i<0&&!o){const e=hj("up",s);if("up"===e)return(0,T.sprintf)((0,T.__)("Move %1$s block from position %2$d up to position %3$d"),t,l,l-1);if("left"===e)return(0,T.sprintf)((0,T.__)("Move %1$s block from position %2$d left to position %3$d"),t,l,l-1);if("right"===e)return(0,T.sprintf)((0,T.__)("Move %1$s block from position %2$d right to position %3$d"),t,l,l-1)}if(i<0&&o){const e=hj("up",s);if("up"===e)return(0,T.sprintf)((0,T.__)("Block %1$s is at the beginning of the content and canât be moved up"),t);if("left"===e)return(0,T.sprintf)((0,T.__)("Block %1$s is at the beginning of the content and canât be moved left"),t);if("right"===e)return(0,T.sprintf)((0,T.__)("Block %1$s is at the beginning of the content and canât be moved right"),t)}}const mj=(e,t)=>
2"up"===e?"horizontal"===t?(0,T.isRTL)()?Ab:Nb:QB:"down"===e?"horizontal"===t?(0,T.isRTL)()?Nb:Ab:JB:null,fj=(e,t)=>"up"===e?"horizontal"===t?(0,T.isRTL)()?(0,T.__)("Move right"):(0,T.__)("Move left"):(0,T.__)("Move up"):"down"===e?"horizontal"===t?(0,T.isRTL)()?(0,T.__)("Move left"):(0,T.__)("Move right"):(0,T.__)("Move down"):null,bj=(0,h.forwardRef)(({clientIds:e,direction:t,orientation:n,...o},r)=>{const i=(0,m.useInstanceId)(bj),s=Array.isArray(e)?e:[e],l=s.length,{disabled:a}=o,{blockType:c,isDisabled:u,rootClientId:h,isFirst:f,isLast:b,firstIndex:k,orientation:v="vertical"}=(0,g.useSelect)(e=>{const{getBlockIndex:o,getBlockRootClientId:r,getBlockOrder:i,getBlock:l,getBlockListSettings:c}=e(Ii),u=s[0],d=r(u),h=o(u),g=o(s[s.length-1]),m=i(d),f=l(u),b=0===h,k=g===m.length-1,{orientation:v}=c(d)||{};return{blockType:f?(0,p.getBlockType)(f.name):null,isDisabled:a||("up"===t?b:k),rootClientId:d,firstIndex:h,isFirst:b,isLast:k,orientation:n||v}},[e,t]),{moveBlocksDown:_,moveBlocksUp:y}=(0,g.useDispatch)(Ii),x="up"===t?y:_,S=`block-editor-block-mover-button__description-${i}`;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,ref:r,className:gs("block-editor-block-mover-button",`is-${t}-button`),icon:mj(t,v),label:fj(t,v),"aria-describedby":S,...o,onClick:u?null:t=>{x(e,h),o.onClick&&o.onClick(t)},disabled:u,accessibleWhenDisabled:!0}),(0,d.jsx)(Ss.VisuallyHidden,{id:S,children:gj(l,c&&c.title,k,f,b,"up"===t?-1:1,v)})]})}),kj=(0,h.forwardRef)((e,t)=>(0,d.jsx)(bj,{direction:"up",ref:t,...e})),vj=(0,h.forwardRef)((e,t)=>(0,d.jsx)(bj,{direction:"down",ref:t,...e}));var _j=function({clientIds:e,hideDragHandle:t,isBlockMoverUpButtonDisabled:n,isBlockMoverDownButtonDisabled:o}){const{canMove:r,rootClientId:i,isFirst:s,isLast:l,orientation:a,isManualGrid:c}=(0,g.useSelect)(t=>{const{getBlockIndex:n,getBlockListSettings:o,canMoveBlocks:r,getBlockOrder:i,getBlockRootClientId:s,getBlockAttributes:l}=t(Ii),a=Array.isArray(e)?e:[e],c=a[0],u=s(c),d=n(c),p=n(a[a.length-1]),h=i(u),{layout:g={}}=l(u)??{};return{canMove:r(e),rootClientId:u,isFirst:0===d,isLast:p===h.length-1,orientation:o(u)?.orientation,isManualGrid:"grid"===g.type&&g.isManualPlacement&&window.__experimentalEnableGridInteractivity}},[e]);return!r||s&&l&&!i||t&&c?null:(0,d.jsxs)(Ss.ToolbarGroup,{className:gs("block-editor-block-mover",{"is-horizontal":"horizontal"===a}),children:[!t&&(0,d.jsx)(pj,{clientIds:e,fadeWhenDisabled:!0,children:e=>(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,icon:eC,className:"block-editor-block-mover__drag-handle",label:(0,T.__)("Drag"),tabIndex:"-1",...e})}),!c&&(0,d.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,d.jsx)(Ss.ToolbarItem,{children:t=>(0,d.jsx)(kj,{disabled:n,clientIds:e,...t})}),(0,d.jsx)(Ss.ToolbarItem,{children:t=>(0,d.jsx)(vj,{disabled:o,clientIds:e,...t})})]})]})};const{clearTimeout:yj,setTimeout:xj}=window,Sj=200;function wj({ref:e,isFocused:t,highlightParent:n,debounceTimeout:o=Sj}){const{getSelectedBlockClientId:r,getBlockRootClientId:i}=(0,g.useSelect)(Ii),{toggleBlockHighlight:s}=(0,g.useDispatch)(Ii),l=(0,h.useRef)(),a=(0,g.useSelect)(e=>e(Ii).getSettings().isDistractionFree,[]),c=e=>{if(e&&a)return;const t=r(),o=n?i(t):t;s(o,e)},u=()=>{const e=l.current;e&&yj&&yj(e)};return(0,h.useEffect)(()=>()=>{c(!1),u()},[]),{debouncedShowGestures:e=>{e&&e.stopPropagation(),u(),c(!0)},debouncedHideGestures:n=>{n&&n.stopPropagation(),u(),l.current=xj(()=>{(()=>{const n=e?.current&&e.current.matches(":hover");return!t&&!n})()&&c(!1)},o)}}}function Cj({ref:e,highlightParent:t=!1,debounceTimeout:n=Sj}){const[o,r]=(0,h.useState)(!1),{debouncedShowGestures:i,debouncedHideGestures:s}=wj({ref:e,debounceTimeout:n,isFocused:o,highlightParent:t}),l=(0,h.useRef)(!1),a=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,h.useEffect)(()=>{const t=e.current,n=()=>{a()&&(r(!0),i())},o=()=>{a()||(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 Bj(){const{selectBlock:e}=(0,g.useDispatch)(Ii),{parentClientId:t}=(0,g.useSelect)(e=>{const{getBlockParents:t,getSelectedBlockClientId:n,getParentSectionBlock:o}
2=U(e(Ii)),r=n(),i=o(r),s=t(r);return{parentClientId:i??s[s.length-1]}},[]),n=zf(t),o=(0,h.useRef)(),r=Cj({ref:o,highlightParent:!0});return(0,d.jsx)("div",{className:"block-editor-block-parent-selector",ref:o,...r,children:(0,d.jsx)(Ss.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,T.sprintf)((0,T.__)("Select parent block: %s"),n?.title),showTooltip:!0,icon:(0,d.jsx)(Au,{icon:n?.icon})})},t)}var Ij=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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 jj({blocks:e}){return(0,m.useViewportMatch)("medium","<")?null:(0,d.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,d.jsx)(Ss.Popover,{className:"block-editor-block-switcher__popover-preview",placement:"right-start",focusOnMount:!1,offset:16,children:(0,d.jsxs)("div",{className:"block-editor-block-switcher__preview",children:[(0,d.jsx)("div",{className:"block-editor-block-switcher__preview-title",children:(0,T.__)("Preview")}),(0,d.jsx)(Yw,{viewportWidth:601,blocks:e})]})})})}const Ej={};function Tj({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:i}=e;return(0,d.jsxs)(Ss.MenuItem,{className:(0,p.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[(0,d.jsx)(Au,{icon:r,showColors:!0}),i]})}var Mj=({transformations:e,onSelect:t,blocks:n})=>{const[o,r]=(0,h.useState)();return(0,d.jsxs)(d.Fragment,{children:[o&&(0,d.jsx)(jj,{blocks:(0,p.cloneBlock)(n[0],e.find(({name:e})=>e===o).attributes)}),e?.map(e=>(0,d.jsx)(Tj,{item:e,onSelect:t,setHoveredTransformItemName:r},e.name))]})};function Pj({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map(e=>(0,d.jsx)(Rj,{item:e,onSelect:t,setHoveredTransformItemName:n},e.name))}function Rj({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:i,isDisabled:s}=e;return(0,d.jsxs)(Ss.MenuItem,{className:(0,p.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},disabled:s,onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[(0,d.jsx)(Au,{icon:r,showColors:!0}),i]})}var Aj=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:n,onSelect:o,onSelectVariation:r,blocks:i})=>{const[s,l]=(0,h.useState)(),{priorityTextTransformations:a,restTransformations:c}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,h.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),u=a.length&&c.length,g=!!c.length&&(0,d.jsx)(Pj,{restTransformations:c,onSelect:o,setHoveredTransformItemName:l});return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(Ss.MenuGroup,{label:(0,T.__)("Transform to"),className:e,children:[s&&(0,d.jsx)(jj,{blocks:(0,p.switchToBlockType)(i,s)}),!!n?.length&&(0,d.jsx)(Mj,{transformations:n,blocks:i,onSelect:r}),a.map(e=>(0,d.jsx)(Rj,{item:e,onSelect:o,setHoveredTransformItemName:l},e.name)),!u&&g]}),!!u&&(0,d.jsx)(Ss.MenuGroup,{className:e,children:g})]})};function Nj(e,t,n){const o=new(gg())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Lj(e){return e?.find(e=>e.isDefault)}function Dj({clientId:e,onSwitch:t}){const{styles:n,block:o,blockType:r,className:i}=(0,g.useSelect)(t=>{const{getBlock:n}=t(Ii),o=n(e);if(!o)return{};const r=(0,p.getBlockType)(o.name),{getBlockStyles:i}=t(p.store);return{block:o,blockType:r,styles:i(o.name),className:o.attributes.className||""}},[e]),{updateBlockAttributes:s}=(0,g.useDispatch)(Ii),l=function(e){return e&&0!==e.length?Lj(e)?e:[{name:"default",label:(0,T._x)("Default","block style"),isDefault:!0},...e]:[]}(n),a=function(e,t){for(const n of new(gg())(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 Lj(e)}(l,i),c=function(e,t){return(0,h.useMemo)(()=>{const n=t?.example,o=t?.name;return n&&o?(0,p.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,p.cloneBlock)(e):void 0},[t?.example?e?.name:e,t])}(o,r);return{onSelect:n=>{const o=Nj(i,a,n);s(e,{className:o}),t()},stylesToRender:l,activeStyle:a,genericPreviewBlock:c,className:i}}
2const Oj=()=>{};function zj({clientId:e,onSwitch:t=Oj}){const{onSelect:n,stylesToRender:o,activeStyle:r}=Dj({clientId:e,onSwitch:t});return o&&0!==o.length?(0,d.jsx)(d.Fragment,{children:o.map(e=>{const t=e.label||e.name;return(0,d.jsx)(Ss.MenuItem,{icon:r.name===e.name?Xd:null,onClick:()=>n(e),children:(0,d.jsx)(Ss.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:t})},e.name)})}):null}function Vj({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return(0,d.jsx)(Ss.MenuGroup,{label:(0,T.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:(0,d.jsx)(zj,{clientId:n,onSwitch:t})})}const Fj=(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=Fj(e,t,n);if(o)return o}}},Hj=(e,t)=>{const n=((e,t)=>{const n=(0,p.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}};function Uj({patterns:e,onSelect:t}){const n=(0,m.useViewportMatch)("medium","<");return(0,d.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,d.jsx)(Ss.Popover,{className:"block-editor-block-switcher__popover-preview",placement:n?"bottom":"right-start",offset:16,children:(0,d.jsx)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:(0,d.jsx)(Gj,{patterns:e,onSelect:t})})})})}function Gj({patterns:e,onSelect:t}){return(0,d.jsx)(Ss.Composite,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,T.__)("Patterns list"),children:e.map(e=>(0,d.jsx)($j,{pattern:e,onSelect:t},e.name))})}function $j({pattern:e,onSelect:t}){const n="block-editor-block-switcher__preview-patterns-container",o=(0,m.useInstanceId)($j,`${n}-list__item-description`);return(0,d.jsxs)("div",{className:`${n}-list__list-item`,children:[(0,d.jsxs)(Ss.Composite.Item,{render:(0,d.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,d.jsx)(Yw,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,d.jsx)("div",{className:`${n}-list__item-title`,children:e.title})]}),!!e.description&&(0,d.jsx)(Ss.VisuallyHidden,{id:o,children:e.description})]})}var Wj=function({blocks:e,patterns:t,onSelect:n}){const[o,r]=(0,h.useState)(!1),i=((e,t)=>(0,h.useMemo)(()=>e.reduce((e,n)=>{const o=((e,t)=>{const n=t.map(e=>(0,p.cloneBlock)(e)),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=Fj(r,t.name,o);if(n){e=!0,o.add(n.clientId),Hj(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e},[]),[e,t]))(t,e);return i.length?(0,d.jsxs)(Ss.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[o&&(0,d.jsx)(Uj,{patterns:i,onSelect:n}),(0,d.jsx)(Ss.MenuItem,{onClick:e=>{e.preventDefault(),r(!o)},icon:Ab,children:(0,T.__)("Patterns")})]}):null};function Kj({onClose:e,clientIds:t,hasBlockStyles:n,canRemove:o}){const{replaceBlocks:r,multiSelect:i,updateBlockAttributes:s}=(0,g.useDispatch)(Ii),{possibleBlockTransformations:l,patterns:a,blocks:c,isUsingBindings:u}=(0,g.useSelect)(e=>{const{getBlockAttributes:n,getBlocksByClientId:o,getBlockRootClientId:r,getBlockTransformItems:i,__experimentalGetPatternTransformItems:s}=e(Ii),l=r(t[0]),a=o(t);return{blocks:a,possibleBlockTransformations:i(a,l),patterns:s(a,l),isUsingBindings:t.every(e=>!!n(e)?.metadata?.bindings)}},[t]),m=function({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:o}=(0,g.useSelect)(n=>{const{getBlockAttributes:o,canRemoveBlocks:r}=n(Ii),{getActiveBlockVariation:i,getBlockVariations:s}=n(p.store),l=r(e);if(1!==t.length||!l)return Ej;const[a]=t;return{blockVariationTransformations:s(a.name,"transform"),activeBlockVariation:i(a.name,o(a.clientId))}},[e,t]);return(0,h.useMemo)(()=>o?.filter(({name:e})=>e!==n?.name),[o,n])}({clientIds:t,blocks:c});function f(e){e.length>1&&i(e[0].clientId,e[e.length-1].clientId)}const b=1===c.length,k=b&&((0,p.isTemplatePart)(c[0])||(0,p.isReusableBlock)(c[0])),v=!!l?.length&&o&&!k,_=!!m?.length,y=!!a?.length&&o,x=v||_;if(!(n||x||y))return(0,d.jsx)("p",{className:"block-editor-block-switcher__no-transforms",children:(0,T.__)("No transforms.")});const S=b?(0,T._x)("This block is connected.","block toolbar button label and description"):(0,T._x)("These blocks are connected.","block toolbar button label and description");return(0,d.jsxs)("div",{className:"block-editor-block-switcher__container",children:[y&&(0,d.jsx)(Wj,{blocks:c,patterns:a,onSelect:n=>{!function(e){r(t,e),f(e)}(n),e()}}),x&&(0,d.jsx)(Aj,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:l,possibleBlockVariationTransformations:m,blocks:c,onSelect:n=>{!function(e){const n=(0,p.switchToBlockType)(c,e);r(t,n),f(n)}(n),e()},onSelectVariation:t=>{!function(e){s(c[0].clientId,{...m.find(({name:t})=>t===e).attributes})}(t),e()}}),n&&(0,d.jsx)(Vj,{hoveredBlock:c[0],onSwitch:e}),u&&(0,d.jsx)(Ss.MenuGroup,{children:(0,d.jsx)(Ss.__experimentalText,{className:"block-editor-block-switcher__binding-indicator",children:S})})]})}var Zj=({clientIds:e})=>{const{hasContentOnlyLocking:t,canRemove:n,hasBlockStyles:o,icon:r,invali
2dBlocks:i,isReusable:s,isTemplate:l,isDisabled:a,isSectionInSelection:c}=(0,g.useSelect)(t=>{const{getTemplateLock:n,getBlocksByClientId:o,getBlockAttributes:r,canRemoveBlocks:i,getBlockEditingMode:s,isSectionBlock:l}=U(t(Ii)),{getBlockStyles:a,getBlockType:c,getActiveBlockVariation:u}=t(p.store),d=o(e);if(!d.length||d.some(e=>!e))return{invalidBlocks:!0};const[{name:h}]=d,g=1===d.length,m=c(h),f=s(e[0]);let b,k;if(g){const t=u(h,r(e[0]));b=t?.icon||m.icon,k="contentOnly"===n(e[0])}else{const t=1===new Set(d.map(({name:e})=>e)).size;k=e.some(e=>"contentOnly"===n(e)),b=t?m.icon:Ij}const v=e.some(e=>l(e));return{canRemove:i(e),hasBlockStyles:g&&!!a(h)?.length,icon:b,isReusable:g&&(0,p.isReusableBlock)(d[0]),isTemplate:g&&(0,p.isTemplatePart)(d[0]),hasContentOnlyLocking:k,isDisabled:"default"!==f,isSectionInSelection:v}},[e]),u=tj({clientId:e?.[0],maximumLength:35}),h=(0,g.useSelect)(e=>e(pr.store).get("core","showIconLabels"),[]);if(i)return null;const m=1===e.length,f=m?u:(0,T.__)("Multiple blocks selected"),b=(s||l)&&!h&&u?u:void 0;if(window?.__experimentalContentOnlyPatternInsertion&&c||a||!o&&!n||t)return(0,d.jsx)(Ss.ToolbarGroup,{children:(0,d.jsx)(Ss.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,d.jsx)(Au,{className:"block-editor-block-switcher__toggle",icon:r,showColors:!0}),text:b})});const k=m?(0,T.__)("Change block type or style"):(0,T.sprintf)((0,T._n)("Change type of %d block","Change type of %d blocks",e.length),e.length);return(0,d.jsx)(Ss.ToolbarGroup,{children:(0,d.jsx)(Ss.ToolbarItem,{children:t=>(0,d.jsx)(Ss.DropdownMenu,{className:"block-editor-block-switcher",label:f,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:(0,d.jsx)(Au,{className:"block-editor-block-switcher__toggle",icon:r,showColors:!0}),text:b,toggleProps:{description:k,...t},menuProps:{orientation:"both"},children:({onClose:t})=>(0,d.jsx)(Kj,{onClose:t,clientIds:e,hasBlockStyles:o,canRemove:n})})})})};const{Fill:qj,Slot:Yj}=(0,Ss.createSlotFill)("__unstableBlockToolbarLastItem");qj.Slot=Yj;var Xj=qj;const Qj="__experimentalBorder",Jj="color",eE="typography.__experimentalFontFamily",tE="typography.fontSize",nE="typography.textAlign",oE=["shadow","typography.lineHeight",tE,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",eE,nE,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalWritingMode","typography.__experimentalLetterSpacing",Qj,Jj,"spacing"],rE={align:e=>(0,p.hasBlockSupport)(e,"align"),borderColor:e=>function(e,t="any"){if("web"!==h.Platform.OS)return!1;const n=(0,p.getBlockSupport)(e,Qj);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}(e,"color"),backgroundColor:e=>{const t=(0,p.getBlockSupport)(e,Jj);return t&&!1!==t.background},textAlign:e=>(0,p.hasBlockSupport)(e,nE),textColor:e=>{const t=(0,p.getBlockSupport)(e,Jj);return t&&!1!==t.text},gradient:e=>{const t=(0,p.getBlockSupport)(e,Jj);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,p.hasBlockSupport)(e,"customClassName",!0),fontFamily:e=>(0,p.hasBlockSupport)(e,eE),fontSize:e=>(0,p.hasBlockSupport)(e,tE),layout:e=>(0,p.hasBlockSupport)(e,"layout"),style:e=>oE.some(t=>(0,p.hasBlockSupport)(e,t))};function iE(e,t){return Object.entries(rE).reduce((n,[o,r])=>(r(e.name)&&r(t.name)&&(n[o]=e.attributes[o]),n),{})}function sE(e,t,n){for(let o=0;o<Math.min(t.length,e.length);o+=1)n(e[o].clientId,iE(t[o],e[o])),sE(e[o].innerBlocks,t[o].innerBlocks,n)}function lE(){const e=(0,g.useRegistry)(),{updateBlockAttributes:t}=(0,g.useDispatch)(Ii),{createSuccessNotice:n,createWarningNotice:o,createErrorNotice:r}=(0,g.useDispatch)(dr.store);return(0,h.useCallback)(async i=>{let s="";try{if(!window.navigator.clipboard)return void r((0,T.__)("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,T.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!s||!function(e){try{const t=(0,p.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(s))return void o((0,T.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const l=(0,p.parse)(s);if(1===l.length?e.batch(()=>{sE(i,i.map(()=>l[0]),t)}):e.batch(()=>{sE(i,l,t)}),1===i.length){const e=(0,p.getBlockType)(i[0].name)?.title;n((0,T.sprintf)((0,T.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,T.sprintf)((0,T.__)("Pasted styles to %d blocks."),i.length),{type:"snackbar"})},[e.batch,t,n,o,r])}function aE({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{getDefaultBlockName:o,getGroupingBlockName:r}=(0,g.useSelect)(p.store),i=(0,g.useSelect)(t=>
2{const{canInsertBlockType:n,getBlockRootClientId:r,getBlocksByClientId:i,getDirectInsertBlock:s,canRemoveBlocks:l}=t(Ii),a=i(e),c=r(e[0]),u=n(o(),c),d=c?s(c):null;return{canRemove:l(e),canInsertBlock:a.every(e=>(u||!!d)&&n(e.name,c)),canCopyStyles:a.every(e=>!!e&&((0,p.hasBlockSupport)(e.name,"color")||(0,p.hasBlockSupport)(e.name,"typography"))),canDuplicate:a.every(e=>!!e&&(0,p.hasBlockSupport)(e.name,"multiple",!0)&&n(e.name,c))}},[e,o]),{getBlocksByClientId:s,getBlocks:l}=(0,g.useSelect)(Ii),{canRemove:a,canInsertBlock:c,canCopyStyles:u,canDuplicate:d}=i,{removeBlocks:h,replaceBlocks:m,duplicateBlocks:f,insertAfterBlock:b,insertBeforeBlock:k,flashBlock:v}=(0,g.useDispatch)(Ii),_=lE();return t({canCopyStyles:u,canDuplicate:d,canInsertBlock:c,canRemove:a,onDuplicate:()=>f(e,n),onRemove:()=>h(e,n),onInsertBefore(){k(e[0])},onInsertAfter(){b(e[e.length-1])},onGroup(){if(!e.length)return;const t=r(),n=(0,p.switchToBlockType)(s(e),t);n&&m(e,n)},onUngroup(){if(!e.length)return;const t=l(e[0]);t.length&&m(e,t)},onCopy(){1===e.length&&v(e[0])},async onPasteStyles(){await _(s(e))}})}var cE=(0,Ss.createSlotFill)(Symbol("CommentIconSlotFill")),uE=function({clientId:e}){const t=(0,g.useSelect)(t=>t(Ii).getBlock(e),[e]),{replaceBlocks:n}=(0,g.useDispatch)(Ii);return t&&"core/html"===t.name?(0,d.jsx)(Ss.MenuItem,{onClick:()=>n(e,(0,p.rawHandler)({HTML:(0,p.getBlockContent)(t)})),children:(0,T.__)("Convert to Blocks")}):null};const{Fill:dE,Slot:pE}=(0,Ss.createSlotFill)("__unstableBlockSettingsMenuFirstItem");dE.Slot=pE;var hE=dE;function gE(e){return(0,g.useSelect)(t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:o,isUngroupable:r,isGroupable:i}=t(Ii),{getGroupingBlockName:s,getBlockType:l}=t(p.store),a=e?.length?e:o(),c=n(a),[u]=c,d=1===a.length&&r(a[0]);return{clientIds:a,isGroupable:i(a),isUngroupable:d,blocksSelection:c,groupingBlockName:s(),onUngroup:d&&l(u.name)?.transforms?.ungroup}},[e])}function mE({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:o,blocksSelection:r,groupingBlockName:i,onClose:s=()=>{}}){const{getSelectedBlockClientIds:l}=(0,g.useSelect)(Ii),{replaceBlocks:a}=(0,g.useDispatch)(Ii);if(!t&&!n)return null;const c=l();return(0,d.jsxs)(d.Fragment,{children:[t&&(0,d.jsx)(Ss.MenuItem,{shortcut:c.length>1?Ua.displayShortcut.primary("g"):void 0,onClick:()=>{(()=>{const t=(0,p.switchToBlockType)(r,i);t&&a(e,t)})(),s()},children:(0,T._x)("Group","verb")}),n&&(0,d.jsx)(Ss.MenuItem,{onClick:()=>{(()=>{let t=r[0].innerBlocks;t.length&&(o&&(t=o(r[0].attributes,r[0].innerBlocks)),a(e,t))})(),s()},children:(0,T._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor")})]})}function fE(e){return(0,g.useSelect)(t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:i,getBlockName:s,getTemplateLock:l}=t(Ii),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])}
2var bE=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.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"})}),kE=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.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"})}),vE=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.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"})});const _E=["core/navigation"];function yE(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function xE({clientId:e,onClose:t}){const[n,o]=(0,h.useState)({move:!1,remove:!1}),{canEdit:r,canMove:i,canRemove:s}=fE(e),{allowsEditLocking:l,templateLock:a,hasTemplateLock:c}=(0,g.useSelect)(t=>{const{getBlockName:n,getBlockAttributes:o}=t(Ii),r=n(e),i=(0,p.getBlockType)(r);return{allowsEditLocking:_E.includes(r),templateLock:o(e)?.templateLock,hasTemplateLock:!!i?.attributes?.templateLock}},[e]),[u,m]=(0,h.useState)(!!a),{updateBlockAttributes:f}=(0,g.useDispatch)(Ii),b=zf(e);(0,h.useEffect)(()=>{o({move:!i,remove:!s,...l?{edit:!r}:{}})},[r,i,s,l]);const k=Object.values(n).every(Boolean),v=Object.values(n).some(Boolean)&&!k;return(0,d.jsx)(Ss.Modal,{title:(0,T.sprintf)((0,T.__)("Lock %s"),b.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,size:"small",children:(0,d.jsxs)("form",{onSubmit:o=>{o.preventDefault(),f([e],{lock:n,templateLock:u?yE(n):void 0}),t()},children:[(0,d.jsxs)("fieldset",{className:"block-editor-block-lock-modal__options",children:[(0,d.jsx)("legend",{children:(0,T.__)("Select the features you want to lock")}),(0,d.jsx)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:(0,d.jsxs)("li",{children:[(0,d.jsx)(Ss.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-all",label:(0,T.__)("Lock all"),checked:k,indeterminate:v,onChange:e=>o({move:e,remove:e,...l?{edit:e}:{}})}),(0,d.jsxs)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:[l&&(0,d.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,d.jsx)(Ss.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Lock editing"),checked:!!n.edit,onChange:e=>o(t=>({...t,edit:e}))}),(0,d.jsx)(Ss.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?vE:bE})]}),(0,d.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,d.jsx)(Ss.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Lock movement"),checked:n.move,onChange:e=>o(t=>({...t,move:e}))}),(0,d.jsx)(Ss.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?vE:bE})]}),(0,d.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,d.jsx)(Ss.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Lock removal"),checked:n.remove,onChange:e=>o(t=>({...t,remove:e}))}),(0,d.jsx)(Ss.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?vE:bE})]})]})]})}),c&&(0,d.jsx)(Ss.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,T.__)("Apply to all blocks inside"),checked:u,disabled:n.move&&!n.remove,onChange:()=>m(!u)})]}),(0,d.jsxs)(Ss.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,d.jsx)(Ss.FlexItem,{children:(0,d.jsx)(Ss.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,T.__)("Cancel")})}),(0,d.jsx)(Ss.FlexItem,{children:(0,d.jsx)(Ss.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,T.__)("Apply")})})]})]})})}function SE({clientId:e}){const{canLock:t,isLocked:n}=fE(e),[o,r]=(0,h.useReducer)(e=>!e,!1);if(!t)return null;const i=n?(0,T.__)("Unlock"):(0,T.__)("Lock");return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.MenuItem,{icon:n?bE:kE,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog",children:i}),o&&(0,d.jsx)(xE,{clientId:e,onClose:r})]})}const wE=()=>{};function CE({clientId:e,onToggle:t=wE}){const{blockType:n,mode:o,enabled:r}=(0,g.useSelect)(t=>{const{getBlock:n,getBlockMode:o,getSettings:r}=t(Ii),i=n(e);return{mode:o(e),blockType:i?(0,p.getBlockType)(i.name):null,enabled:r().codeEditingEnabled&&!!i?.isValid}},[e]),{toggleBlockMode:i}=(0,g.useDispatch)(Ii);if(!n||!(0,p.hasBlockSupport)(n,"html",!0)||!r)return null;const s="visual"===o?(0,T.__)("Edit as HTML"):(0,T.__)("Edit visually");return(0,d.jsx)(Ss.MenuItem,{onClick:()=>{i(e),t()},children:s})}function BE({clientId:e,onClose:t}){const{templateLock:n,isLockedByParent:o,isEditingAsBlocks:r}=(0,g.useSelect)(t=>{const{getContentLockingParent:n,getTemplateLock:o,getTemporarilyEditingAsBlocks:r}=U(t(Ii));return{templateLock:o(e),isLockedByParent:!!n(e),isEditingAsBlocks:r()===e}},[e]),i=(0,g.useDispatch)(Ii),s=!o&&"contentOnly"===n;if(!s&&!r)return null;const{modifyContentLockBlock:l}=U(i);return!r&&s&&(0,d.jsx)(Ss.MenuItem,{onClick:()=>{l(e),t()},children:(0,T._x)("Modify","Unlock content locked blocks")})}function IE({clientId:e,onClose:t}){const[n,o]=(0,h.useState)(),r=zf(e),{metadata:i}=(0,g.useSelect)(t=>{const{getBlockAttributes:n}=t(Ii);return{metadata:n(e)?.metadata}},[e]),{updateBlockAttributes:s}=(0,g.useDispatch)(Ii),l=i?.name||"",a=r?.title,c=!!l&&!!i?.bindings&&Object.values(i.bindings).some(e=>
2"core/pattern-overrides"===e.source),u=void 0!==n&&n!==l,p=n===a,m=(f=n,0===f?.trim()?.length);var f;const b=u||p;return(0,d.jsx)(Ss.Modal,{title:(0,T.__)("Rename"),onRequestClose:t,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",size:"small",children:(0,d.jsx)("form",{onSubmit:o=>{o.preventDefault(),b&&(()=>{const o=p||m?void 0:n,r=p||m?(0,T.sprintf)((0,T.__)('Block name reset to: "%s".'),n):(0,T.sprintf)((0,T.__)('Block name changed to: "%s".'),n);(0,Ho.speak)(r,"assertive"),s([e],{metadata:ms({...i,name:o})}),t()})()},children:(0,d.jsxs)(Ss.__experimentalVStack,{spacing:"3",children:[(0,d.jsx)(Ss.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:n??l,label:(0,T.__)("Name"),help:c?(0,T.__)("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:a,onChange:o,onFocus:e=>e.target.select()}),(0,d.jsxs)(Ss.__experimentalHStack,{justify:"right",children:[(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,T.__)("Cancel")}),(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,disabled:!b,variant:"primary",type:"submit",children:(0,T.__)("Save")})]})]})})})}function jE({clientId:e}){const[t,n]=(0,h.useState)(!1);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.MenuItem,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog",children:(0,T.__)("Rename")}),t&&(0,d.jsx)(IE,{clientId:e,onClose:()=>n(!1)})]})}
2var EE=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"})}
2),TE=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.Path,{d:"M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z"})});function ME({clientIds:e}){const{updateBlockAttributes:t}=(0,g.useDispatch)(Ii),{createSuccessNotice:n}=(0,g.useDispatch)(dr.store),o=(0,g.useSelect)(t=>t(Ii).getBlocksByClientId(e),[e]),r=(0,g.useSelect)(e=>e(Nk.store).getShortcutRepresentation("core/editor/toggle-list-view"),[]),i=o.some(e=>!1===e.attributes.metadata?.blockVisibility);return(0,d.jsx)(Ss.MenuItem,{icon:i?EE:TE,onClick:()=>{const s=!i,l=Object.fromEntries(o?.map(({clientId:e,attributes:t})=>[e,{metadata:ms({...t?.metadata,blockVisibility:!s&&void 0})}]));t(e,l,{uniqueByBlock:!0}),s&&(o.length>1?n((0,T.sprintf)((0,T.__)("Blocks hidden. You can access them via the List View (%s)."),r),{id:"block-visibility-hidden",type:"snackbar"}):n((0,T.sprintf)((0,T.__)("Block hidden. You can access it via the List View (%s)."),r),{id:"block-visibility-hidden",type:"snackbar"}))},children:i?(0,T.__)("Show"):(0,T.__)("Hide")})}const{Fill:PE,Slot:RE}=(0,Ss.createSlotFill)("BlockSettingsMenuControls");function AE({...e}){return(0,d.jsx)(Ss.__experimentalStyleProvider,{document,children:(0,d.jsx)(PE,{...e})})}AE.Slot=({fillProps:e,clientIds:t=null})=>{const{selectedBlocks:n,selectedClientIds:o,isContentOnly:r,canToggleSelectedBlocksVisibility:i}=(0,g.useSelect)(e=>{const{getBlocksByClientId:n,getBlockNamesByClientId:o,getSelectedBlockClientIds:r,getBlockEditingMode:i}=e(Ii),s=null!==t?t:r();return{selectedBlocks:o(s),selectedClientIds:s,isContentOnly:"contentOnly"===i(s[0]),canToggleSelectedBlocksVisibility:n(s).every(e=>(0,p.hasBlockSupport)(e.name,"visibility",!0))}},[t]),{canLock:s}=fE(o[0]),{canRename:l}=(a=n[0],{canRename:(0,p.getBlockSupport)(a,"renaming",!0)});var a;const c=1===o.length&&s&&!r,u=1===o.length&&l&&!r,h=i&&!r,m=gE(o),{isGroupable:f,isUngroupable:b}=m,k=(f||b)&&!r;return(0,d.jsx)(RE,{fillProps:{...e,selectedBlocks:n,selectedClientIds:o},children:t=>!t?.length>0&&!k&&!c?null:(0,d.jsxs)(Ss.MenuGroup,{children:[k&&(0,d.jsx)(mE,{...m,onClose:e?.onClose}),c&&(0,d.jsx)(SE,{clientId:o[0]}),u&&(0,d.jsx)(jE,{clientId:o[0]}),h&&(0,d.jsx)(ME,{clientIds:o}),t,1===o.length&&(0,d.jsx)(BE,{clientId:o[0],onClose:e?.onClose}),1===e?.count&&!r&&(0,d.jsx)(CE,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};var NE=AE;function LE({parentClientId:e,parentBlockType:t}){const n=(0,m.useViewportMatch)("medium","<"),{selectBlock:o}=(0,g.useDispatch)(Ii),r=(0,h.useRef)(),i=Cj({ref:r,highlightParent:!0});return n?(0,d.jsx)(Ss.MenuItem,{...i,ref:r,icon:(0,d.jsx)(Au,{icon:t.icon}),onClick:()=>o(e),children:(0,T.sprintf)((0,T.__)("Select parent block (%s)"),t.title)}):null}const DE={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function OE({clientIds:e,onCopy:t,label:n,shortcut:o,eventType:r="copy",__experimentalUpdateSelection:i=!1}){const{getBlocksByClientId:s}=(0,g.useSelect)(Ii),{removeBlocks:l}=(0,g.useDispatch)(Ii),a=aw(),c=(0,m.useCopyToClipboard)(()=>(0,p.serialize)(s(e)),()=>{switch(r){case"copy":case"copyStyles":t(),a(r,e);break;case"cut":a(r,e),l(e,i)}}),u=n||(0,T.__)("Copy");return(0,d.jsx)(Ss.MenuItem,{ref:c,shortcut:o,children:u})}function zE({block:e,clientIds:t,children:n,__experimentalSelectBlock:o,...r}){const i=e?.clientId,s=t.length,l=t[0],{firstParentClientId:a,parentBlockType:c,previousBlockClientId:u,selectedBlockClientIds:f,openedBlockSettingsMenu:b,isContentOnly:k,isZoomOut:v}=(0,g.useSelect)(e=>{const{getBlockName:t,getBlockRootClientId:n,getPreviousBlockClientId:o,getSelectedBlockClientIds:r,getBlockAttributes:i,getOpenedBlockSettingsMenu:s,getBlockEditingMode:a,isZ
2oomOut:c}=U(e(Ii)),{getActiveBlockVariation:u}=e(p.store),d=n(l),h=d&&t(d);return{firstParentClientId:d,parentBlockType:d&&(u(h,i(d))||(0,p.getBlockType)(h)),previousBlockClientId:o(l),selectedBlockClientIds:r(),openedBlockSettingsMenu:s(),isContentOnly:"contentOnly"===a(l),isZoomOut:c()}},[l]),{getBlockOrder:_,getSelectedBlockClientIds:y}=(0,g.useSelect)(Ii),{setOpenedBlockSettingsMenu:x}=U((0,g.useDispatch)(Ii)),S=(0,g.useSelect)(e=>{const{getShortcutRepresentation:t}=e(Nk.store);return{copy:t("core/block-editor/copy"),cut:t("core/block-editor/cut"),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")}},[]),w=f.length>0;async function C(e){if(!o)return;const t=await e;t&&t[0]&&o(t[0],!1)}function B(){if(!o)return;let e=u||a;e||(e=_()[0]);const t=w&&0===y().length;o(e,t)}const I=f?.includes(a),j=i?b===i||!1:void 0;function E(e){e&&b!==i?x(i):!e&&b&&b===i&&x(void 0)}const M=!I&&!!a;return(0,d.jsx)(aE,{clientIds:t,__experimentalUpdateSelection:!o,children:({canCopyStyles:e,canDuplicate:i,canInsertBlock:u,canRemove:p,onDuplicate:g,onInsertAfter:f,onInsertBefore:b,onRemove:_,onCopy:y,onPasteStyles:x})=>p||i||u||!k?(0,d.jsx)(Ss.DropdownMenu,{icon:ev,label:(0,T.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:DE,open:j,onToggle:E,noIcons:!0,...r,children:({onClose:r})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(Ss.MenuGroup,{children:[(0,d.jsx)(hE.Slot,{fillProps:{onClose:r}}),M&&(0,d.jsx)(LE,{parentClientId:a,parentBlockType:c}),1===s&&(0,d.jsx)(uE,{clientId:l}),!k&&(0,d.jsx)(OE,{clientIds:t,onCopy:y,shortcut:S.copy}),!k&&(0,d.jsx)(OE,{clientIds:t,label:(0,T.__)("Cut"),eventType:"cut",shortcut:S.cut,__experimentalUpdateSelection:!o}),i&&(0,d.jsx)(Ss.MenuItem,{onClick:(0,m.pipe)(r,g,C),shortcut:S.duplicate,children:(0,T.__)("Duplicate")}),u&&!v&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.MenuItem,{onClick:(0,m.pipe)(r,b),shortcut:S.insertBefore,children:(0,T.__)("Add before")}),(0,d.jsx)(Ss.MenuItem,{onClick:(0,m.pipe)(r,f),shortcut:S.insertAfter,children:(0,T.__)("Add after")})]}),1===s&&(0,d.jsx)(cE.Slot,{fillProps:{clientId:l,onClose:r}})]}),e&&!k&&(0,d.jsxs)(Ss.MenuGroup,{children:[(0,d.jsx)(OE,{clientIds:t,onCopy:y,label:(0,T.__)("Copy styles"),eventType:"copyStyles"}),(0,d.jsx)(Ss.MenuItem,{onClick:x,children:(0,T.__)("Paste styles")})]}),!k&&(0,d.jsx)(NE.Slot,{fillProps:{onClose:r,count:s,firstBlockClientId:l},clientIds:t}),"function"==typeof n?n({onClose:r}):h.Children.map(e=>(0,h.cloneElement)(e,{onClose:r})),p&&(0,d.jsx)(Ss.MenuGroup,{children:(0,d.jsx)(Ss.MenuItem,{onClick:(0,m.pipe)(r,_,B),shortcut:S.remove,children:(0,T.__)("Delete")})})]})}):null})}var VE=zE,FE=(0,Ss.createSlotFill)(Symbol("CommentIconToolbarSlotFill")),HE=function({clientIds:e,...t}){return(0,d.jsxs)(Ss.ToolbarGroup,{children:[(0,d.jsx)(FE.Slot,{}),(0,d.jsx)(Ss.ToolbarItem,{children:n=>(0,d.jsx)(VE,{clientIds:e,toggleProps:n,...t})})]})};function UE({clientId:e}){const{canLock:t,isLocked:n}=fE(e),[o,r]=(0,h.useReducer)(e=>!e,!1),i=(0,h.useRef)(!1);if((0,h.useEffect)(()=>{n&&(i.current=!0)},[n]),!n&&!i.current)return null;let s=n?(0,T.__)("Unlock"):(0,T.__)("Lock");return!t&&n&&(s=(0,T.__)("Locked")),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.ToolbarGroup,{className:"block-editor-block-lock-toolbar",children:(0,d.jsx)(Ss.ToolbarButton,{disabled:!t,icon:n?vE:bE,label:s,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog"})}),o&&(0,d.jsx)(xE,{clientId:e,onClose:r})]})}function GE({clientIds:e}){const{blocks:t,canToggleBlockVisibility:n}=(0,g.useSelect)(t=>{const{getBlockName:n,getBlocksByClientId:o}=t(Ii),r=o(e);return{blocks:r,canToggleBlockVisibility:r.every(({clientId:e})=>(0,p.hasBlockSupport)(n(e),"visibility",!0))}},[e]),o=t.some(e=>!1===e.attributes.metadata?.blockVisibility),r=(0,h.useRef)(!1),{updateBlockAttributes:i}=(0,g.useDispatch)(Ii);return(0,h.useEffect)(()=>{o&&(r.current=!0)},[o]),o||r.current?(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(Ss.ToolbarGroup,{className:"block-editor-block-lock-toolbar",children:(0,d.jsx)(Ss.ToolbarButton,{disabled:!n,icon:o?TE:EE,label:o?(0,T.__)("Hidden"):(0,T.__)("Visible"),onClick:()=>{const n=Object.fromEntries(t?.map(({clientId:e,attributes:t})=>[e,{metadata:ms({...t?.metadata,blockVisibility:!!o&&void 0})}]));i(e,n,{uniqueByBlock:!0})}})})}):null}
2var $E=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.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"})}),WE=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}),KE=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}),ZE=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})});const qE={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}};var YE=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=gE(),{replaceBlocks:r}=(0,g.useDispatch)(Ii),{canRemove:i,variations:s}=(0,g.useSelect)(e=>{const{canRemoveBlocks:o}=e(Ii),{getBlockVariations:r}=e(p.store);return{canRemove:o(t),variations:r(n,"transform")}},[t,n]),l=o=>{const i=(0,p.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),i&&i.length>0&&(i[0].attributes.layout=qE[o],r(t,i))};if(!o||!i)return null;const a=!!s.find(({name:e})=>"group-row"===e),c=!!s.find(({name:e})=>"group-stack"===e),u=!!s.find(({name:e})=>"group-grid"===e);return(0,d.jsxs)(Ss.ToolbarGroup,{children:[(0,d.jsx)(Ss.ToolbarButton,{icon:$E,label:(0,T._x)("Group","action: convert blocks to group"),onClick:l}),a&&(0,d.jsx)(Ss.ToolbarButton,{icon:WE,label:(0,T._x)("Row","action: convert blocks to row"),onClick:()=>l("row")}),c&&(0,d.jsx)(Ss.ToolbarButton,{icon:KE,label:(0,T._x)("Stack","action: convert blocks to stack"),onClick:()=>l("stack")}),u&&(0,d.jsx)(Ss.ToolbarButton,{icon:ZE,label:(0,T._x)("Grid","action: convert blocks to grid"),onClick:()=>l("grid")})]})};function XE({clientIds:e}){const t=1===e.length?e[0]:void 0,n=(0,g.useSelect)(e=>!!t&&"html"===e(Ii).getBlockMode(t),[t]),{toggleBlockMode:o}=(0,g.useDispatch)(Ii);return n?(0,d.jsx)(Ss.ToolbarGroup,{children:(0,d.jsx)(Ss.ToolbarButton,{onClick:()=>{o(t)},children:(0,T.__)("Edit visually")})}):null}const QE=(0,h.createContext)("");QE.displayName="__unstableBlockNameContext";var JE=QE;function eT(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function tT(e){return e.contains(e.ownerDocument.activeElement)}function nT({children:e,focusOnMount:t,focusEditorOnEscape:n=!1,shouldUseKeyboardFocusShortcut:o=!0,__experimentalInitialIndex:r,__experimentalOnIndexChange:i,orientation:s="horizontal",...l}){const a=(0,h.useRef)(),c=function(e){const[t,n]=(0,h.useState)(!0),o=(0,h.useCallback)(()=>{const t=!Fa.focus.tabbable.find(e.current).some(e=>!("toolbarItem"in e.dataset));t||I()("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,h.useLayoutEffect)(()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()},[o,t,e]),t}(a);return function({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:n,defaultIndex:o,onIndexChange:r,shouldUseKeyboardFocusShortcut:i,focusEditorOnEscape:s}){const[l]=(0,h.useState)(t),[a]=(0,h.useState)(o),c=(0,h.useCallback)(()=>{!function(e){const[t]=Fa.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)},[e]);(0,Nk.useShortcut)("core/block-editor/focus-toolbar",()=>{i&&c()}),(0,h.useEffect)(()=>{l&&c()},[n,l,c]),(0,h.useEffect)(()=>{const t=e.current;let n=0;return l||tT(t)||(n=window.requestAnimationFrame(()=>{const e=eT(t),n=a||0;e[n]&&tT(t)&&e[n].focus({preventScroll:!0})}
2)),()=>{if(window.cancelAnimationFrame(n),!r||!t)return;const e=eT(t).findIndex(e=>0===e.tabIndex);r(e)}},[a,l,r,e]);const{getLastFocus:u}=U((0,g.useSelect)(Ii));(0,h.useEffect)(()=>{const t=e.current;if(s){const e=e=>{const t=u();e.keyCode===Ua.ESCAPE&&t?.current&&(e.preventDefault(),t.current.focus())};return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}},[s,u,e])}({toolbarRef:a,focusOnMount:t,defaultIndex:r,onIndexChange:i,isAccessibleToolbar:c,shouldUseKeyboardFocusShortcut:o,focusEditorOnEscape:n}),c?(0,d.jsx)(Ss.Toolbar,{label:l["aria-label"],ref:a,orientation:s,...l,children:e}):(0,d.jsx)(Ss.NavigableMenu,{orientation:s,role:"toolbar",ref:a,...l,children:e})}function oT(){const e=(0,g.useSelect)(e=>{const{getBlockEditingMode:t,getBlockName:n,getBlockSelectionStart:o}=e(Ii),r=o(),i=r&&(0,p.getBlockType)(n(r));return i&&(0,p.hasBlockSupport)(i,"__experimentalToolbar",!0)&&"disabled"!==t(r)},[]);return e}const rT=[],iT=6,sT={placement:"bottom-start"};function lT({clientId:e}){const{categories:t,currentPatternName:n,patterns:o}=(0,g.useSelect)(t=>{const{getBlockAttributes:n,getBlockRootClientId:o,__experimentalGetAllowedPatterns:r}=t(Ii),i=n(e),s=i?.metadata?.categories||rT,l=o(e),a=s.length>0?r(l):rT;return{categories:s,currentPatternName:i?.metadata?.patternName,patterns:a}},[e]),{replaceBlocks:r}=(0,g.useDispatch)(Ii),i=(0,h.useMemo)(()=>0!==t.length&&o&&0!==o.length?o.filter(e=>{const o="core"===e.source||e.source?.startsWith("pattern-directory")&&"pattern-directory/theme"!==e.source;return 1===e.blocks.length&&!o&&n!==e.name&&e.categories?.some(e=>t.includes(e))&&("unsynced"===e.syncStatus||!e.id)}).slice(0,iT):rT,[t,n,o]);if(i.length<2)return null;const s=n=>{const o=(n.blocks??[]).map(e=>(0,p.cloneBlock)(e));o[0].attributes.metadata={...o[0].attributes.metadata,categories:t},r(e,o)};return(0,d.jsx)(Ss.Dropdown,{popoverProps:sT,renderToggle:({onToggle:e,isOpen:t})=>(0,d.jsx)(Ss.ToolbarGroup,{children:(0,d.jsx)(Ss.ToolbarButton,{onClick:()=>e(!t),"aria-expanded":t,children:(0,T.__)("Change design")})}),renderContent:()=>(0,d.jsx)(Ss.__experimentalDropdownContentWrapper,{className:"block-editor-block-toolbar-change-design-content-wrapper",paddingSize:"none",children:(0,d.jsx)(SC,{blockPatterns:i,onClickPattern:s,showTitlesAsTooltip:!0})})})}const aT=(0,d.jsxs)(Ss.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)(Ss.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"}),(0,d.jsx)(Ss.Path,{stroke:"currentColor",strokeWidth:"1.5",d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"})]});var cT=function({clientId:e}){const{stylesToRender:t,activeStyle:n,className:o}=Dj({clientId:e}),{updateBlockAttributes:r}=(0,g.useDispatch)(Ii),{merged:i}=(0,h.useContext)(rs),{globalSettings:s,globalStyles:l,blockName:a}=(0,g.useSelect)(t=>{const n=t(Ii).getSettings();return{globalSettings:n.__experimentalFeatures,globalStyles:n[N],blockName:t(Ii).getBlockName(e)}},[e]),c=n?.name?fb({settings:i?.settings??s,styles:i?.styles??l},a,n.name)?.color?.background:void 0;return t&&0!==t.length?(0,d.jsx)(Ss.ToolbarGroup,{children:(0,d.jsx)(Ss.ToolbarButton,{onClick:()=>{const i=(t.findIndex(e=>e.name===n.name)+1)%t.length,s=t[i],l=Nj(o,n,s);r(e,{className:l})},label:(0,T.__)("Shuffle styles"),children:(0,d.jsx)(Ss.Icon,{icon:aT,style:{fill:c||"transparent"}})})}):null};function uT({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,variant:r="unstyled"}){const{blockClientId:i,blockClientIds:s,isDefaultEditingMode:l,blockType:a,toolbarKey:c,shouldShowVisualToolbar:u,showParentSelector:f,isUsingBindings:b,hasParentPattern:k,hasContentOnlyLocking:v,showShuffleButton:_,showSlots:y,showGroupButtons:x,showLockButtons:S,showBlockVisibilityButton:w,showSwitchSectionStyleButton:C}=(0,g.useSelect)(e=>{const{getBlockName:t,getBlockMode:n,getBlockParents:o,getSelectedBlockClientIds:r,isBlockValid:i,getBlockEditingMode:s,getBlockAttributes:l,getBlockParentsByBlockName:a,getTemplateLock:c,getParentSectionBlock:u,isZoomOut:d,isSectionBlock:h}
2=U(e(Ii)),g=r(),m=g[0],f=o(m),b=u(m)??f[f.length-1],k=t(b),v=(0,p.getBlockType)(k),_=s(m),y="default"===_,x=t(m),S=g.every(e=>i(e)),w=g.every(e=>"visual"===n(e)),C=g.every(e=>!!l(e)?.metadata?.bindings),B=g.every(e=>a(e,"core/block",!0).length>0),I=g.some(e=>"contentOnly"===c(e)),j=d(),E=window?.__experimentalContentOnlyPatternInsertion&&(j||h(m));return{blockClientId:m,blockClientIds:g,isDefaultEditingMode:y,blockType:m&&(0,p.getBlockType)(x),shouldShowVisualToolbar:S&&w,toolbarKey:`${m}${b}`,showParentSelector:!j&&v&&"contentOnly"!==_&&"disabled"!==s(b)&&(0,p.hasBlockSupport)(v,"__experimentalParentSelector",!0)&&1===g.length,isUsingBindings:C,hasParentPattern:B,hasContentOnlyLocking:I,showShuffleButton:j,showSlots:!j,showGroupButtons:!j,showLockButtons:!j,showBlockVisibilityButton:!j,showSwitchSectionStyleButton:E}},[]),B=(0,h.useRef)(null),I=(0,h.useRef)(),j=Cj({ref:I}),E=!(0,m.useViewportMatch)("medium","<");if(!oT())return null;const M=s.length>1,P=(0,p.isReusableBlock)(a)||(0,p.isTemplatePart)(a),R=gs("block-editor-block-contextual-toolbar",{"has-parent":f}),A=gs("block-editor-block-toolbar",{"is-synced":P,"is-connected":b});return(0,d.jsx)(nT,{focusEditorOnEscape:!0,className:R,"aria-label":(0,T.__)("Block tools"),variant:"toolbar"===r?void 0:r,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,children:(0,d.jsxs)("div",{ref:B,className:A,children:[f&&!M&&E&&(0,d.jsx)(Bj,{}),(u||M)&&!k&&(0,d.jsx)("div",{ref:I,...j,children:(0,d.jsxs)(Ss.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls",children:[(0,d.jsx)(Zj,{clientIds:s}),l&&w&&(0,d.jsx)(GE,{clientIds:s}),!M&&l&&S&&(0,d.jsx)(UE,{clientId:i}),(0,d.jsx)(_j,{clientIds:s,hideDragHandle:e})]})}),!v&&u&&M&&x&&(0,d.jsx)(YE,{}),_&&(0,d.jsx)(lT,{clientId:s[0]}),C&&(0,d.jsx)(cT,{clientId:s[0]}),u&&y&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ps.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,d.jsx)(Ps.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,d.jsx)(Ps.Slot,{className:"block-editor-block-toolbar__slot"}),(0,d.jsx)(Ps.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,d.jsx)(Ps.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,d.jsx)(JE.Provider,{value:a?.name,children:(0,d.jsx)(Xj.Slot,{})})]}),(0,d.jsx)(XE,{clientIds:s}),(0,d.jsx)(HE,{clientIds:s})]})},c)}function dT({hideDragHandle:e,variant:t}){return(0,d.jsx)(uT,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0})}function pT({clientId:e,isTyping:t,__unstableContentRef:n}){const{capturingClientId:o,isInsertionPointVisible:r,lastClientId:i}=uj(e),s=(0,h.useRef)();(0,h.useEffect)(()=>{s.current=void 0},[e]);const{stopTyping:l}=(0,g.useDispatch)(Ii),a=(0,h.useRef)(!1);(0,Nk.useShortcut)("core/block-editor/focus-toolbar",()=>{a.current=!0,l(!0)}),(0,h.useEffect)(()=>{a.current=!1});const c=o||e,u=cj({contentElement:n?.current,clientId:c});return!t&&(0,d.jsx)(Um,{clientId:c,bottomClientId:i,className:gs("block-editor-block-list__block-popover",{"is-insertion-point-visible":r}),resize:!1,...u,__unstableContentRef:n,children:(0,d.jsx)(uT,{focusOnMount:a.current,__experimentalInitialIndex:s.current,__experimentalOnIndexChange:e=>{s.current=e},variant:"toolbar"})})}var hT=function({onClick:e}){return(0,d.jsx)(Ss.Button,{variant:"primary",icon:sc,size:"compact",className:gs("block-editor-button-pattern-inserter__button","block-editor-block-tools__zoom-out-mode-inserter-button"),onClick:e,label:(0,T._x)("Add pattern","Generic label for pattern inserter button")})},gT=function(){const[e,t]=(0,h.useState)(!1),{hasSelection:n,blockOrder:o,setInserterIsOpened:r,sectionRootClientId:i,selectedBlockClientId:s,blockInsertionPoint:l,insertionPointVisible:a}=(0,g.useSelect)(e=>{const{getSettings:t,getBlockOrder:n,getSelectionStart:o,getSelectedBlockClientId:r,getSectionRootClientId:i,getBlockInsertionPoint:s,isBlockInsertionPointVisible:l}=U(e(Ii)),a=i();return{hasSelection:!!o().clientId,blockOrder:n(a),sectionRootClientId:a,setInserterIsOpened:t().__experimentalSetIsInserterOpened,selectedBlockClientId:r(),blockInsertionPoint:s(),insertionPointVisible:l()}},[]),{showInsertionPoint:c}=U((0,g.useDispatch)(Ii));if((0,h.useEffect)(()=>{const e=setTimeout(()=>{t(!0)},500);return()=>{clearTimeout(e)}},[]),!e||!n)return null;const u=s,p=o.findIndex(e=>s===e)+1,m=o[p];return a&&l?.index===p?null:(0,d.jsx)(sS,{previousClientId:u,nextClientId:m,children:(0,d.jsx)(hT,{onClick:()=>{r({rootClientId:i,insertionIndex:p,tab:"patterns",category:"all"}),c(i,p,{operation:"insert"})}})})};function mT(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getSettings:o,isTyping:r,isDragging:i,isZoomOut:s}=U(e(Ii));return{clientId:t()||n(),hasFixedToolbar:o().hasFixedToolbar,isTyping:r(),isZ
2oomOutMode:s(),isDragging:i()}}function fT({children:e,__unstableContentRef:t,...n}){const{clientId:o,hasFixedToolbar:r,isTyping:i,isZoomOutMode:s,isDragging:l}=(0,g.useSelect)(mT,[]),a=(0,Nk.__unstableUseShortcutEventMatch)(),{getBlocksByClientId:c,getSelectedBlockClientIds:u,getBlockRootClientId:m,isGroupable:f,getBlockName:b}=(0,g.useSelect)(Ii),{getGroupingBlockName:k}=(0,g.useSelect)(p.store),{showEmptyBlockSideInserter:v,showBlockToolbarPopover:_}=(0,g.useSelect)(e=>{const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlock:o,getBlockMode:r,getSettings:i,isTyping:s,isBlockInterfaceHidden:l}=U(e(Ii)),a=t()||n(),c=o(a),u=!!a&&!!c,d=u&&(0,p.isUnmodifiedDefaultBlock)(c,"content")&&"html"!==r(a),h=a&&!s()&&d;return{showEmptyBlockSideInserter:h,showBlockToolbarPopover:!l()&&!i().hasFixedToolbar&&!h&&u&&!d}},[]),y=lE(),{duplicateBlocks:x,removeBlocks:S,replaceBlocks:w,insertAfterBlock:C,insertBeforeBlock:B,selectBlock:I,moveBlocksUp:j,moveBlocksDown:E,expandBlock:M,updateBlockAttributes:P}=U((0,g.useDispatch)(Ii)),R=Tm(t),A=Tm(t);return(0,d.jsx)("div",{...n,onKeyDown:function(e){if(!e.defaultPrevented)if(a("core/block-editor/move-up",e)||a("core/block-editor/move-down",e)){const t=u();if(t.length){e.preventDefault();const n=m(t[0]);"up"==(a("core/block-editor/move-up",e)?"up":"down")?j(t,n):E(t,n);const o=Array.isArray(t)?t.length:1,r=(0,T.sprintf)((0,T._n)("%d block moved.","%d blocks moved.",t.length),o);(0,Ho.speak)(r)}}else if(a("core/block-editor/duplicate",e)){const t=u();t.length&&(e.preventDefault(),x(t))}else if(a("core/block-editor/remove",e)){const t=u();t.length&&(e.preventDefault(),S(t))}else if(a("core/block-editor/paste-styles",e)){const t=u();if(t.length){e.preventDefault();const n=c(t);y(n)}}else if(a("core/block-editor/insert-after",e)){const t=u();t.length&&(e.preventDefault(),C(t[t.length-1]))}else if(a("core/block-editor/insert-before",e)){const t=u();t.length&&(e.preventDefault(),B(t[0]))}else if(a("core/block-editor/unselect",e)){if(e.target.closest("[role=toolbar]"))return;const t=u();t.length>1&&(e.preventDefault(),I(t[0]))}else if(a("core/block-editor/collapse-list-view",e)){if((0,Fa.isTextField)(e.target)||(0,Fa.isTextField)(e.target?.contentWindow?.document?.activeElement))return;e.preventDefault(),M(o)}else if(a("core/block-editor/group",e)){const t=u();if(t.length>1&&f(t)){e.preventDefault();const n=c(t),o=k(),r=(0,p.switchToBlockType)(n,o);w(t,r),(0,Ho.speak)((0,T.__)("Selected blocks are grouped."))}}else if(a("core/block-editor/toggle-block-visibility",e)){const t=u();if(t.length){e.preventDefault();const n=c(t);if(!n.every(e=>(0,p.hasBlockSupport)(b(e.clientId),"visibility",!0)))return;const o=n.some(e=>!1===e.attributes.metadata?.blockVisibility),r=Object.fromEntries(n.map(({clientId:e,attributes:t})=>[e,{metadata:ms({...t?.metadata,blockVisibility:!!o&&void 0})}]));P(t,r,{uniqueByBlock:!0})}}},className:gs(n.className,{"block-editor-block-tools--is-dragging":l}),children:(0,d.jsxs)(cS.Provider,{value:(0,h.useRef)(!1),children:[!i&&!s&&(0,d.jsx)(dS,{__unstableContentRef:t}),v&&(0,d.jsx)(dj,{__unstableContentRef:t,clientId:o}),_&&(0,d.jsx)(pT,{__unstableContentRef:t,clientId:o,isTyping:i}),!s&&!r&&(0,d.jsx)(Ss.Popover.Slot,{name:"block-toolbar",ref:R}),e,(0,d.jsx)(Ss.Popover.Slot,{name:"__unstable-block-tools-after",ref:A}),s&&!l&&(0,d.jsx)(gT,{__unstableContentRef:t})]})})}const bT=window.wp.commands;var kT=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}),vT=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})});const _T=()=>function(){const{replaceBlocks:e,multiSelect:t}=(0,g.useDispatch)(Ii),{blocks:n,clientIds:o,canRemove:r,possibleBlockTransformations:i,invalidSelection:s}=(0,g.useSelect)(e=>
2{const{getBlockRootClientId:t,getBlockTransformItems:n,getSelectedBlockClientIds:o,getBlocksByClientId:r,canRemoveBlocks:i}=e(Ii),s=o(),l=r(s);return l.filter(e=>!e).length>0?{invalidSelection:!0}:{blocks:l,clientIds:s,possibleBlockTransformations:n(l,t(s[0])),canRemove:i(s),invalidSelection:!1}},[]);if(s)return{isLoading:!1,commands:[]};const l=1===n.length&&(0,p.isTemplatePart)(n[0]);const a=!!i.length&&r&&!l;return!o||o.length<1||!a?{isLoading:!1,commands:[]}:{isLoading:!1,commands:i.map(r=>{const{name:i,title:s,icon:l}=r;return{name:"core/block-editor/transform-to-"+i.replace("/","-"),label:(0,T.sprintf)((0,T.__)("Transform to %s"),s),icon:(0,d.jsx)(Au,{icon:l}),callback:({close:r})=>{(function(r){const i=(0,p.switchToBlockType)(n,r);var s;e(o,i),(s=i).length>1&&t(s[0].clientId,s[s.length-1].clientId)})(i),r()}}})}},yT=()=>{(0,bT.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:_T()}),(0,bT.useCommandLoader)({name:"core/block-editor/blockQuickActions",hook:function(){const{clientIds:e,isUngroupable:t,isGroupable:n}=(0,g.useSelect)(e=>{const{getSelectedBlockClientIds:t,isUngroupable:n,isGroupable:o}=e(Ii);return{clientIds:t(),isUngroupable:n(),isGroupable:o()}},[]),{canInsertBlockType:o,getBlockRootClientId:r,getBlocksByClientId:i,canRemoveBlocks:s,getBlockName:l}=(0,g.useSelect)(Ii),{getDefaultBlockName:a,getGroupingBlockName:c}=(0,g.useSelect)(p.store),u=i(e),{removeBlocks:d,replaceBlocks:h,duplicateBlocks:m,insertAfterBlock:f,insertBeforeBlock:b,updateBlockAttributes:k}=(0,g.useDispatch)(Ii);if(!e||e.length<1)return{isLoading:!1,commands:[]};const v=r(e[0]),_=o(a(),v),y=u.every(e=>!!e&&(0,p.hasBlockSupport)(e.name,"multiple",!0)&&o(e.name,v)),x=s(e),S=u.every(({clientId:e})=>(0,p.hasBlockSupport)(l(e),"visibility",!0)),w=[];if(y&&w.push({name:"duplicate",label:(0,T.__)("Duplicate"),callback:()=>m(e,!0),icon:Ij}),_&&w.push({name:"add-before",label:(0,T.__)("Add before"),callback:()=>{const t=Array.isArray(e)?e[0]:t;b(t)},icon:sc},{name:"add-after",label:(0,T.__)("Add after"),callback:()=>{const t=Array.isArray(e)?e[e.length-1]:t;f(t)},icon:sc}),n&&w.push({name:"Group",label:(0,T.__)("Group"),callback:()=>{if(!u.length)return;const t=c(),n=(0,p.switchToBlockType)(u,t);n&&h(e,n)},icon:$E}),t&&w.push({name:"ungroup",label:(0,T.__)("Ungroup"),callback:()=>{if(!u.length)return;const t=u[0].innerBlocks;t.length&&h(e,t)},icon:kT}),x&&w.push({name:"remove",label:(0,T.__)("Delete"),callback:()=>d(e,!0),icon:vT}),S){const t=u.some(e=>!1===e.attributes.metadata?.blockVisibility);w.push({name:"core/toggle-block-visibility",label:t?(0,T.__)("Show"):(0,T.__)("Hide"),callback:()=>{const n=Object.fromEntries(u?.map(({clientId:e,attributes:n})=>[e,{metadata:ms({...n?.metadata,blockVisibility:!!t&&void 0})}]));k(e,n,{uniqueByBlock:!0})},icon:t?EE:TE})}return{isLoading:!1,commands:w.map(e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}}))}},context:"block-selection-edit"})},xT={ignoredSelectors:[/\.editor-styles-wrapper/gi]};function ST({shouldIframe:e=!0,height:t="300px",children:n=(0,d.jsx)($S,{}),styles:o,contentRef:r,iframeProps:i}){yT();const s=(0,m.useViewportMatch)("medium","<"),l=LS(),a=hS(),c=(0,h.useRef)(),u=(0,m.useMergeRefs)([r,a,c]),p=(0,g.useSelect)(e=>U(e(Ii)).getZoomLevel(),[]),f=100===p||s?{}:{scale:p,frameSize:"40px"};return e?(0,d.jsx)(fT,{__unstableContentRef:c,style:{height:t,display:"flex"},children:(0,d.jsxs)(_w,{...i,...f,ref:l,contentRef:u,style:{...i?.style},name:"editor-canvas",children:[(0,d.jsx)(Fw,{styles:o}),n]})}):(0,d.jsxs)(fT,{__unstableContentRef:c,style:{height:t,display:"flex"},children:[(0,d.jsx)(Fw,{styles:o,scope:":where(.editor-styles-wrapper)",transformOptions:xT}),(0,d.jsx)(gw,{ref:u,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%"},children:n})]})}var wT=function({children:e,height:t,styles:n}){return(0,d.jsx)(ST,{height:t,styles:n,children:e})};const CT=()=>(0,d.jsx)(Ss.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:(0,d.jsx)(Ss.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"})}),BT=({style:e,className:t})=>(0,d.jsx)("div",{className:"block-library-colors-selector__icon-container",children:(0,d.jsx)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e,children:(0,d.jsx)(CT,{})})}
2),IT=({TextColor:e,BackgroundColor:t})=>({onToggle:n,isOpen:o})=>(0,d.jsx)(Ss.ToolbarGroup,{children:(0,d.jsx)(Ss.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,T.__)("Open Colors Selector"),onClick:n,onKeyDown:e=>{o||e.keyCode!==Ua.DOWN||(e.preventDefault(),n())},icon:(0,d.jsx)(t,{children:(0,d.jsx)(e,{children:(0,d.jsx)(BT,{})})})})});var jT=({children:e,...t})=>(I()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,d.jsx)(Ss.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:IT(t),renderContent:()=>e})),ET=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})});const TT=(0,h.createContext)({});TT.displayName="ListViewContext";const MT=()=>(0,h.useContext)(TT);function PT({children:e,...t}){const n=(0,h.useRef)();return(0,h.useEffect)(()=>{n.current&&(n.current.textContent=n.current.textContent)},[e]),(0,d.jsx)("div",{hidden:!0,...t,ref:n,children:e})}const RT=(0,h.forwardRef)(({nestingLevel:e,blockCount:t,clientId:n,...o},r)=>{const{insertedBlock:i,setInsertedBlock:s}=MT(),l=(0,m.useInstanceId)(RT),{directInsert:a,hideInserter:c}=(0,g.useSelect)(e=>{const{getBlockListSettings:t,getTemplateLock:o,isZoomOut:r}=U(e(Ii)),i=t(n);return{directInsert:i?.directInsert||!1,hideInserter:!!o(n)||r()}},[n]),u=tj({clientId:n,context:"list-view"}),p=tj({clientId:i?.clientId,context:"list-view"});if((0,h.useEffect)(()=>{p?.length&&(0,Ho.speak)((0,T.sprintf)((0,T.__)("%s block inserted"),p),"assertive")},[p]),c)return null;const f=`list-view-appender__${l}`,b=(0,T.sprintf)((0,T.__)("Append to %1$s block at position %2$d, Level %3$d"),u,t+1,e);return(0,d.jsxs)("div",{className:"list-view-appender",children:[(0,d.jsx)(zB,{ref:r,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:a,__experimentalIsQuick:!0,...o,toggleProps:{"aria-describedby":f},onSelectOrClose:e=>{e?.clientId&&s(e)}}),(0,d.jsx)(PT,{id:f,children:b})]})}),AT=Nx(Ss.__experimentalTreeGridRow),NT=(0,h.forwardRef)(({isDragged:e,isSelected:t,position:n,level:o,rowCount:r,children:i,className:s,path:l,...a},c)=>{const u=Dx({clientId:a["data-block"],enableAnimation:!0,triggerAnimationOnChange:l}),p=(0,m.useMergeRefs)([c,u]);return(0,d.jsx)(AT,{ref:p,className:gs("block-editor-list-view-leaf",s),level:o,positionInSet:n,setSize:r,isExpanded:void 0,...a,children:i})});
2var LT=NT,DT=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.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"})}),OT=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.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 zT({onClick:e}){return(0,d.jsx)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander",children:(0,d.jsx)(Nl,{icon:(0,T.isRTL)()?Ja:ec})})}const VT={"core/image":({clientId:e,attributes:t})=>{if(t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/cover":({clientId:e,attributes:t})=>{if("image"===t.backgroundType&&t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/media-text":({clientId:e,attributes:t})=>{if("image"===t.mediaType&&t.mediaUrl)return{url:t.mediaUrl,alt:t.mediaAlt||"",clientId:e}},"core/gallery":({innerBlocks:e})=>{const t=[],n=e?.length?VT[e[0].name]:void 0;if(!n)return t;for(const o of e){const e=n(o);if(e&&t.push(e),t.length>=3)return t}return t}};const{Badge:FT}=U(Ss.privateApis);var HT=(0,h.forwardRef)(function({className:e,block:{clientId:t},onClick:n,onContextMenu:o,onMouseDown:r,onToggleExpanded:i,tabIndex:s,onFocus:l,onDragStart:a,onDragEnd:c,draggable:u,isExpanded:m,ariaDescribedBy:f},b){const k=zf(t),v=tj({clientId:t,context:"list-view"}),{isLocked:_}=fE(t),{canToggleBlockVisibility:y,isBlockHidden:x,isContentOnly:S}=(0,g.useSelect)(e=>{const{getBlockName:n}=e(Ii),{isBlockHidden:o}=U(e(Ii));return{canToggleBlockVisibility:(0,p.hasBlockSupport)(n(t),"visibility",!0),isBlockHidden:o(t),isContentOnly:"contentOnly"===e(Ii).getBlockEditingMode(t)}},[t]),w=_&&!S,C=y&&x,B="sticky"===k?.positionType,I=function({clientId:e,isExpanded:t}){const{block:n}=(0,g.useSelect)(t=>({block:t(Ii).getBlock(e)}),[e]);return(0,h.useMemo)(()=>function(e,t){const n=VT[e.name],o=n?n(e):void 0;return o?Array.isArray(o)?t?[]:o:[o]:[]}(n,t),[n,t])}({clientId:t,isExpanded:m});return(0,d.jsxs)("a",{className:gs("block-editor-list-view-block-select-button",e),onClick:n,onContextMenu:o,onKeyDown:function(e){e.keyCode!==Ua.ENTER&&e.keyCode!==Ua.SPACE||n(e)},onMouseDown:r,ref:b,tabIndex:s,onFocus:l,onDragStart:e=>{e.dataTransfer.clearData(),a?.(e)},onDragEnd:c,draggable:u,href:`#block-${t}`,"aria-describedby":f,"aria-expanded":m,children:[(0,d.jsx)(zT,{onClick:i}),(0,d.jsx)(Au,{icon:k?.icon,showColors:!0,context:"list-view"}),(0,d.jsxs)(Ss.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,d.jsx)(Ss.__experimentalTruncate,{ellipsizeMode:"auto",children:v})}),k?.anchor&&(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:(0,d.jsx)(FT,{className:"block-editor-list-view-block-select-button__anchor",children:k.anchor})}),B&&(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__sticky",children:(0,d.jsx)(Nl,{icon:DT})}),I.length?(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:I.map((e,t)=>(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${e.url})`,zIndex:I.length-t}},e.clientId))}):null,C&&(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__block-visibility",children:(0,d.jsx)(Nl,{icon:TE})}),w&&(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__lock",children:(0,d.jsx)(Nl,{icon:OT})})]})]})});const UT=(0,h.forwardRef)(({onClick:e,onToggleExpanded:t,block:n,isSelected:o,position:r,siblingBlockCount:i,level:s,isExpanded:l,selectedClientIds:a,...c},u)=>{const{clientId:p}=n,{AdditionalBlockContent:h,insertedBlock:g,setInsertedBlock:m}=MT(),f=a.includes(p)?a:[p];return(0,d.jsxs)(d.Fragment,{children:[h&&(0,d.jsx)(h,{block:n,insertedBlock:g,setInsertedBlock:m}),(0,d.jsx)(pj,{appendToOwnerDocument:!0,clientIds:f,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:a,onDragStart:p,onDragEnd:h})=>(0,d.jsx)(HT,{ref:u,className:"block-editor-list-view-block-contents",block:n,onClick:e,onToggleExpanded:t,isSelected:o,position:r,siblingBlockCount:i,level:s,draggable:a,onDragStart:p,onDragEnd:h,isExpanded:l,...c})})]})});var GT=UT;function $T(e,t){const n=()=>{const n=t?.querySelector(`[role=row][data-block="${e}"]`);return n?Fa.focus.focusable.find(n)[0]:null};let o=n();o?o.focus():window.requestAnimationFrame(()=>{o=n(),o&&o.focus()})}var WT=(0,h.memo)(function e({block:{clientId:t},displacement:n,isAfterDraggedBlocks:o,isDragged:r,isNesting:i,isSelected:s,isBranchSelected:l,selectBlock:a,position:c,level:u,rowCount:f,siblingBlockCount:b,showBlockMovers:k,path:v,isExpanded:_,selectedClientIds:y,isSyncedBranch:x}){const S=(0,h.useRef)(null),w=(0,h.useRef)(null),C=(0,h.useRef)(null),[B,I]=(0,h.useState)(!1),[j,E]=(0,h.useState)(),{isLocked:M,c
2anEdit:P,canMove:R}=fE(t),A=s&&y[0]===t,N=s&&y[y.length-1]===t,{toggleBlockHighlight:L,duplicateBlocks:D,multiSelect:O,replaceBlocks:z,removeBlocks:V,insertAfterBlock:F,insertBeforeBlock:H,setOpenedBlockSettingsMenu:G,updateBlockAttributes:$}=U((0,g.useDispatch)(Ii)),W=(0,m.useDebounce)(L,50),{canInsertBlockType:K,getSelectedBlockClientIds:Z,getPreviousBlockClientId:q,getBlockRootClientId:Y,getBlockOrder:X,getBlockParents:Q,getBlocksByClientId:J,canRemoveBlocks:ee,isGroupable:te}=(0,g.useSelect)(Ii),{getGroupingBlockName:ne}=(0,g.useSelect)(p.store),oe=zf(t),re=lE(),{block:ie,blockName:se,allowRightClickOverrides:le,isBlockHidden:ae}=(0,g.useSelect)(e=>{const{getBlock:n,getBlockName:o,getSettings:r}=e(Ii),{isBlockHidden:i}=U(e(Ii));return{block:n(t),blockName:o(t),allowRightClickOverrides:r().allowRightClickOverrides,isBlockHidden:i(t)}},[t]),ce=(0,p.hasBlockSupport)(se,"__experimentalToolbar",!0),ue=`list-view-block-select-button__description-${(0,m.useInstanceId)(e)}`,{expand:de,collapse:pe,collapseAll:he,BlockSettingsMenu:ge,listViewInstanceId:me,expandedState:fe,setInsertedBlock:be,treeGridElementRef:ke,rootClientId:ve}=MT(),_e=(0,Nk.__unstableUseShortcutEventMatch)();function ye(){const e=Z(),n=e.includes(t),o=n?e[0]:t,r=Y(o);return{blocksToUpdate:n?e:[t],firstBlockClientId:o,firstBlockRootClientId:r,selectedBlockClientIds:e}}const xe=(0,h.useCallback)(()=>{I(!0),W(t,!0)},[t,I,W]),Se=(0,h.useCallback)(()=>{I(!1),W(t,!1)},[t,I,W]),we=(0,h.useCallback)(e=>{a(e,t),e.preventDefault()},[t,a]),Ce=(0,h.useCallback)((e,t)=>{t&&a(void 0,e,null,null),$T(e,ke?.current)},[a,ke]),Be=(0,h.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),!0===_?pe(t):!1===_&&de(t)},[t,de,pe,_]),Ie=(0,h.useCallback)(e=>{ce&&le&&(C.current?.click(),E(new window.DOMRect(e.clientX,e.clientY,0,0)),e.preventDefault())},[le,C,ce]),je=(0,h.useCallback)(e=>{le&&2===e.button&&e.preventDefault()},[le]),Ee=(0,h.useMemo)(()=>{const{ownerDocument:e}=w?.current||{};if(j&&e)return{ownerDocument:e,getBoundingClientRect:()=>j}},[j]),Te=(0,h.useCallback)(()=>{E(void 0)},[E]);if(function({isSelected:e,selectedClientIds:t,rowItemRef:n}){const o=1===t.length;(0,h.useLayoutEffect)(()=>{if(!e||!o||!n.current)return;const t=(0,Fa.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:w,selectedClientIds:y}),!ie)return null;const Me=((e,t,n)=>(0,T.sprintf)((0,T.__)("Block %1$d of %2$d, Level %3$d."),e,t,n))(c,b,u),Pe=((e,t)=>[e?.positionLabel?`${(0,T.sprintf)((0,T.__)("Position: %s"),e.positionLabel)}.`:void 0,t?(0,T.__)("This block is locked."):void 0].filter(Boolean).join(" "))(oe,M),Re=ae?(0,T.__)("Block is hidden."):null,Ae=k&&b>0,Ne=gs("block-editor-list-view-block__mover-cell",{"is-visible":B||s}),Le=gs("block-editor-list-view-block__menu-cell",{"is-visible":B||A});let De;Ae?De=2:ce||(De=3);const Oe=gs({"is-selected":s,"is-first-selected":A,"is-last-selected":N,"is-branch-selected":l,"is-synced-branch":x,"is-dragging":r,"has-single-cell":!ce,"is-synced":oe?.isSynced,"is-draggable":R,"is-displacement-normal":"normal"===n,"is-displacement-up":"up"===n,"is-displacement-down":"down"===n,"is-after-dragged-blocks":o,"is-nesting":i}),ze=y.includes(t)?y:[t],Ve=s&&1===y.length;return(0,d.jsxs)(LT,{className:Oe,isDragged:r,onKeyDown:async function(e){if(e.defaultPrevented)return;if(e.target.closest("[role=dialog]"))return;const t=[Ua.BACKSPACE,Ua.DELETE].includes(e.keyCode);if(_e("core/block-editor/unselect",e)&&y.length>0)e.stopPropagation(),e.preventDefault(),a(e,void 0);else if(t||_e("core/block-editor/remove",e)){const{blocksToUpdate:e,firstBlockClientId:t,firstBlockRootClientId:n,selectedBlockClientIds:o}=ye();if(!ee(e))return;let r=q(t)??n;V(e,!1);const i=o.length>0&&0===Z().length;r||(r=X()[0]),Ce(r,i)}else if(_e("core/block-editor/paste-styles",e)){e.preventDefault();const{blocksToUpdate:t}=ye(),n=J(t);re(n)}else if(_e("core/block-editor/duplicate",e)){e.preventDefault();const{blocksToUpdate:t,firstBlockRootClientId:n}=ye();if(J(t).every(e=>!!e&&(0,p.hasBlockSupport)(e.name,"multiple",!0)&&K(e.name,n))){const e=await D(t,!1);e?.length&&Ce(e[0],!1)}}else if(_e("core/block-editor/insert-before",e)){e.preventDefault();const{blocksToUpdate:t}=ye();await H(t[0]);const n=Z();G(void 0),Ce(n[0],!1)}else if(_e("core/block-editor/insert-after",e)){e.preventDefault();const{blocksToUpdate:t}=ye();await F(t.at(-1));const n=Z();G(void 0),Ce(n[0],!1)}else if(_e("core/block-editor/select-all",e)){e.preventDefault();const{firstBlockRootClientId:t,selectedBlockClientIds:n}=ye(),o=X(t);if(!o.length)return;if(Ya()(n,o)&&t&&t!==ve)return void Ce(t,!0);O(o[0],o[o.length-1],null)}else if(_e("core/block-editor/collapse-list-view",e)){e.preventDefault();const{firstBlockClientId:t}=ye(),n=Q(t,!1);he(),de(n)}else if(_e("core/block-editor/group",e)){const{blocksToUpdate:t}=ye();if(t.length>1&&te(t)){e.preventDefault();const n=J(t),o=ne(),r=(0,p.switchToBlockType)(n,o);z(t,r),(0,Ho.speak)((0,T.__)("Selected blocks are grouped."));const i=Z();G(void 0),Ce(i[0],!1)}}else if(_e("core/block-editor/toggle-block-visibility",e)){e.preventDefault();const{blocksToUpdate:t}=ye(),n=J(t);if(!n.every(e=>(0,p.hasBlockSupport)(e.name,"visibility",!0)))return;const o=n.some(e=>!1===e.attributes.metadata?.blockVisibility),r=Object.fromEntries(n.map(({clientId:e,attributes:t})=>[e,{metadata:ms({...t?.metadata,blockVisibility:!!o&&void 0})}]));$(t,r,{uniqueByBlock:!0})}},onMouseEnter:xe,onMouseLeave:Se,onFocus:xe,onBlur:Se,level:u,position:c,rowCount:f,path:v,id:`list-view-${me}-block-${t}`,"data-block":t,"data-expanded":P?_:void 0,ref:w,children:[(0,d.jsx)(Ss.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:De,ref:S,"aria-selected":!!s,children:({ref:e,tabIndex:t,onFocus:n})=>(0,d.jsxs)("div",{className:"block-editor-list-view-block__contents-container",children:[(0,d.jsx)(GT,{block:ie,onClick:we,onContextMenu:Ie,onMouseDown:je,onToggleExpanded:Be,isSelected:s,position:c,siblingBlockCount:b,level:u,ref:e,tabIndex:Ve?0:t,onFocus:n,isExpanded:P?_:void 0,selectedClientIds:y,ariaDescribedBy:ue}
2),(0,d.jsx)(PT,{id:ue,children:[Me,Pe,Re].filter(Boolean).join(" ")})]})}),Ae&&(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(Ss.__experimentalTreeGridCell,{className:Ne,withoutGridItem:!0,children:[(0,d.jsx)(Ss.__experimentalTreeGridItem,{children:({ref:e,tabIndex:n,onFocus:o})=>(0,d.jsx)(kj,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o})}),(0,d.jsx)(Ss.__experimentalTreeGridItem,{children:({ref:e,tabIndex:n,onFocus:o})=>(0,d.jsx)(vj,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o})})]})}),ce&&ge&&(0,d.jsx)(Ss.__experimentalTreeGridCell,{className:Le,"aria-selected":!!s,ref:C,children:({ref:e,tabIndex:t,onFocus:n})=>(0,d.jsx)(ge,{clientIds:ze,block:ie,icon:ev,label:(0,T.__)("Options"),popoverProps:{anchor:Ee},toggleProps:{ref:e,className:"block-editor-list-view-block__menu",tabIndex:t,onClick:Te,onFocus:n,size:"small"},disableOpenOnArrowDown:!0,expand:de,expandedState:fe,setInsertedBlock:be,__experimentalSelectBlock:Ce})})]})});function KT(e,t,n,o){const r=n?.includes(e.clientId);return r?0:t[e.clientId]??o?1+e.innerBlocks.reduce(ZT(t,n,o),0):1}const ZT=(e,t,n)=>(o,r)=>{const i=t?.includes(r.clientId);return i?o:(e[r.clientId]??n)&&r.innerBlocks.length>0?o+KT(r,e,t,n):o+1},qT=()=>{};var YT=(0,h.memo)(function e(t){const{blocks:n,selectBlock:o=qT,showBlockMovers:r,selectedClientIds:i,level:s=1,path:l="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:u,isExpanded:p,parentId:m,shouldShowInnerBlocks:f=!0,isSyncedBranch:b=!1,showAppender:k=!0}=t,v=zf(m),_=b||!!v?.isSynced,y=(0,g.useSelect)(e=>!m||e(Ii).canEditBlock(m),[m]),{blockDropPosition:x,blockDropTargetIndex:S,firstDraggedBlockIndex:w,blockIndexes:C,expandedState:B,draggedClientIds:I}=MT(),j=(0,h.useRef)();if(!y)return null;const E=k&&1===s,T=n.filter(Boolean),M=T.length,P=E?M+1:M;return j.current=c,(0,d.jsxs)(d.Fragment,{children:[T.map((t,n)=>{const{clientId:c,innerBlocks:h}=t;n>0&&(j.current+=KT(T[n-1],B,I,p));const m=!!I?.includes(c),{displacement:b,isAfterDraggedBlocks:k,isNesting:v}=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:C,blockDropTargetIndex:S,blockDropPosition:x,clientId:c,firstDraggedBlockIndex:w,isDragged:m}),{itemInView:y}=u,E=y(j.current),R=n+1,A=l.length>0?`${l}_${R}`:`${R}`,N=!!h?.length,L=N&&f?B[c]??p:void 0,D=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(c,i),O=a||D&&N,z=m||E||D&&c===i[0]||0===n||n===M-1;return(0,d.jsxs)(g.AsyncModeProvider,{value:!D,children:[z&&(0,d.jsx)(WT,{block:t,selectBlock:o,isSelected:D,isBranchSelected:O,isDragged:m,level:s,position:R,rowCount:P,siblingBlockCount:M,showBlockMovers:r,path:A,isExpanded:!m&&L,listPosition:j.current,selectedClientIds:i,isSyncedBranch:_,displacement:b,isAfterDraggedBlocks:k,isNesting:v}),!z&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{className:"block-editor-list-view-placeholder"})}),N&&L&&!m&&(0,d.jsx)(e,{parentId:c,blocks:h,selectBlock:o,showBlockMovers:r,level:s+1,path:A,listPosition:j.current+1,fixedListWindow:u,isBranchSelected:O,selectedClientIds:i,isExpanded:p,isSyncedBranch:_})]},c)}),E&&(0,d.jsx)(Ss.__experimentalTreeGridRow,{level:s,setSize:P,positionInSet:P,isExpanded:!0,children:(0,d.jsx)(Ss.__experimentalTreeGridCell,{children:e=>(0,d.jsx)(RT,{clientId:m,nestingLevel:s,blockCount:M,...e})})})]})});function XT({draggedBlockClientId:e,listViewRef:t,blockDropTarget:n}){const o=zf(e),r=tj({clientId:e,context:"list-view"}),{rootClientId:i,clientId:s,dropPosition:l}=n||{},[a,c]=(0,h.useMemo)(()=>t.current?[i?t.current.querySelector(`[data-block="${i}"]`):void 0,s?t.current.querySelector(`[data-block="${s}"]`):void 0]:[],[t,i,s]),u=c||a,p=(0,T.isRTL)(),g=(0,h.useCallback)((e,t)=>{if(!u)return 0;let n=u.offsetWidth;
2const o=(0,Fa.getScrollContainer)(u,"horizontal"),r=u.ownerDocument,i=o===r.body||o===r.documentElement;if(o&&!i){const r=o.getBoundingClientRect(),i=(0,T.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,u]),m=(0,h.useMemo)(()=>{if(!u)return{};const e=u.getBoundingClientRect();return{width:g(e,0)}},[g,u]),f=(0,h.useMemo)(()=>{if(!u)return{};const e=(0,Fa.getScrollContainer)(u),t=u.ownerDocument,n=e===t.body||e===t.documentElement;if(e&&!n){const t=e.getBoundingClientRect(),n=u.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,u]),b=(0,h.useMemo)(()=>{if(!a)return 1;const e=parseInt(a.getAttribute("aria-level"),10);return e?e+1:1},[a]),k=(0,h.useMemo)(()=>!!u&&u.classList.contains("is-branch-selected"),[u]),v=(0,h.useMemo)(()=>{if(u&&("top"===l||"bottom"===l||"inside"===l))return{contextElement:u,getBoundingClientRect(){const e=u.getBoundingClientRect();let t=e.left,n=0;const o=(0,Fa.getScrollContainer)(u,"horizontal"),r=u.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=g(e,0),a=e.height;return new window.DOMRect(t,n,s,a)}}},[u,l,g,p]);return u?(0,d.jsx)(Ss.Popover,{animate:!1,anchor:v,focusOnMount:!1,className:"block-editor-list-view-drop-indicator--preview",variant:"unstyled",flip:!1,resize:!0,children:(0,d.jsx)("div",{style:m,className:gs("block-editor-list-view-drop-indicator__line",{"block-editor-list-view-drop-indicator__line--darker":k}),children:(0,d.jsxs)("div",{className:"block-editor-list-view-leaf","aria-level":b,children:[(0,d.jsxs)("div",{className:gs("block-editor-list-view-block-select-button","block-editor-list-view-block-contents"),style:f,children:[(0,d.jsx)(zT,{onClick:()=>{}}),(0,d.jsx)(Au,{icon:o?.icon,showColors:!0,context:"list-view"}),(0,d.jsx)(Ss.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,d.jsx)(Ss.__experimentalTruncate,{ellipsizeMode:"auto",children:r})})})]}),(0,d.jsx)("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}const QT=24;function JT(e,t){const n=e[t+1];return n&&n.isDraggedBlock?JT(e,t+1):n}const eM=["top","bottom"];function tM(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]=_S(t,c,eM),p=yS(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*QT:t.left+n*QT;return(o?e.x<r-QT:e.x>r+QT)&&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*QT:t.left+n*QT;return o?e.x>r:e.x<r}(t,s,a.length,n)){const i=JT(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*QT:t.left+n*QT,i=o?r-e.x:e.x-r,s=Math.round(i/QT);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 nM={leading:!1,trailing:!0};const oM=(e,t)=>"clear"===t.type?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce((e,n)=>({...e,[n]:"expand"===t.type}),{})}:e,rM=(0,h.forwardRef)(function e({id:t,blocks:n,dropZoneElement:o,showBlockMovers:r=!1,isExpanded:i=!1,showAppender:s=!1,blockSettingsMenu:l=zE,rootClientId:a,description:c,onSelect:u,additionalBlockContent:f},b){n&&I()("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const k=(0,m.useInstanceId)(e),{clientIdsTree:v,draggedClientIds:_,selectedClientIds:y}=function({blocks:e,rootClientId:t}){return(0,g.useSelect)(n=>{const{getDraggedBlockClientIds:o,getSelectedBlockClientIds:r,getEnabledClientIdsTree:i}=U(n(Ii));return{selectedClientIds:r(),draggedClientIds:o(),clientIdsTree:e??i(t)}},[e,t])}({blocks:n,rootClientId:a}),x=function(e){return(0,h.useMemo)(()=>{const t={};let n=0;const o=e=>
2{e.forEach(e=>{t[e.clientId]=n,n++,e.innerBlocks.length>0&&o(e.innerBlocks)})};return o(e),t},[e])}(v),{getBlock:S}=(0,g.useSelect)(Ii),{visibleBlockCount:w}=(0,g.useSelect)(e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(Ii),o=_?.length>0?n(_).length+1:0;return{visibleBlockCount:t()-o}},[_]),{updateBlockSelection:C}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,g.useDispatch)(Ii),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:i,getSelectedBlockClientIds:s,hasMultiSelection:l,hasSelectedBlock:a}=(0,g.useSelect)(Ii),{getBlockType:c}=(0,g.useSelect)(p.store),u=(0,h.useCallback)(async(u,d,p,h)=>{if(!u?.shiftKey&&u?.keyCode!==Ua.ESCAPE)return void n(d,h);u.preventDefault();const g="keydown"===u.type&&u.keyCode===Ua.ESCAPE,m="keydown"===u.type&&(u.keyCode===Ua.UP||u.keyCode===Ua.DOWN||u.keyCode===Ua.HOME||u.keyCode===Ua.END);if(!m&&!a()&&!l())return void n(d,null);const f=s(),b=[...r(d),d];if((g||m&&!f.some(e=>b.includes(e)))&&await e(),!g){let e=i(),n=d;m&&(a()||l()||(e=d),p&&(n=p));const o=r(e),s=r(n),{start:c,end:u}=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(c,u,null)}const k=s();if((u.keyCode===Ua.HOME||u.keyCode===Ua.END)&&k.length>1)return;const v=f.filter(e=>!k.includes(e));let _;if(1===v.length){const e=c(o(v[0]))?.title;e&&(_=(0,T.sprintf)((0,T.__)("%s deselected."),e))}else v.length>1&&(_=(0,T.sprintf)((0,T.__)("%s blocks deselected."),v.length));_&&(0,Ho.speak)(_,"assertive")},[e,o,c,r,i,s,l,a,t,n]);return{updateBlockSelection:u}}(),[B,j]=(0,h.useReducer)(oM,{}),[E,M]=(0,h.useState)(null),{setSelectedTreeId:P}=function({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,o]=(0,h.useState)(null),{selectedBlockParentClientIds:r}=(0,g.useSelect)(t=>{const{getBlockParents:n}=t(Ii);return{selectedBlockParentClientIds:n(e,!1)}},[e]);return(0,h.useEffect)(()=>{n!==e&&r?.length&&t({type:"expand",clientIds:r})},[e,r,n,t]),{setSelectedTreeId:o}}({firstSelectedBlockClientId:y[0],setExpandedState:j}),R=(0,h.useCallback)((e,t,n)=>{C(e,t,null,n),P(t),u&&u(S(t))},[P,C,u,S]),{ref:A,target:N}=function({dropZoneElement:e,expandedState:t,setExpandedState:n}){const{getBlockRootClientId:o,getBlockIndex:r,getBlockCount:i,getDraggedBlockClientIds:s,canInsertBlocks:l}=(0,g.useSelect)(Ii),[a,c]=(0,h.useState)(),{rootClientId:u,blockIndex:d}=a||{},p=vS(u,d),f=(0,T.isRTL)(),b=(0,m.usePrevious)(u),k=(0,h.useCallback)((e,t)=>{const{rootClientId:o}=t||{};o&&("inside"!==t?.dropPosition||e[o]||n({type:"expand",clientIds:[o]}))},[n]),v=(0,m.useThrottle)(k,500,nM);(0,h.useEffect)(()=>{"inside"===a?.dropPosition&&b===a?.rootClientId?v(t,a):v.cancel()},[t,b,a,v]);const _=s(),y=(0,m.useThrottle)((0,h.useCallback)((e,t)=>{const n={x:e.clientX,y:e.clientY},s=!!_?.length,a=tM(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&&c(a)},[l,_,i,r,o,f]),50);return{ref:(0,m.__experimentalUseDropZone)({dropZoneElement:e,onDrop(e){y.cancel(),a&&p(e),c(void 0)},onDragLeave(){y.cancel(),c(null)},onDragOver(e){y(e,e.currentTarget)},onDragEnd(){y.cancel(),c(void 0)}}),target:a}}({dropZoneElement:o,expandedState:B,setExpandedState:j}),L=(0,h.useRef)(),D=function({selectBlock:e}){const t=(0,g.useRegistry)(),{getBlockOrder:n,getBlockRootClientId:o,getBlocksByClientId:r,getPreviousBlockClientId:i,getSelectedBlockClientIds:s,getSettings:l,canInsertBlockType:a,canRemoveBlocks:c}=(0,g.useSelect)(Ii),{flashBlock:u,removeBlocks:d,replaceBlocks:h,insertBlocks:f}=(0,g.useDispatch)(Ii),b=aw();return(0,m.useRefEffect)(g=>{function m(t,n){n&&e(void 0,t,null,null),$T(t,g)}function k(e){if(e.defaultPrevented)return;if(!g.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:y,firstBlockRootClientId:x,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&&u(_[0]),b(e.type,_),dw(e,r(_),t)),"cut"===e.type){if(!c(_))return;let e=i(y)??x;d(_,!1);const t=S.length>0&&0===s().length;e||(e=n()[0]),m(e,t)}else if("paste"===e.type){const{__experimentalCanUserUseUnfilteredHTML:t}=l(),n=function(e,t){const{plainText:n,html:o,files:r}=cw(e);let i=[];if(r.length){const e=(0,p.getBlockTransforms)("from");i=r.reduce((t,n)=>{const o=(0,p.findTransform)(e,e=>"files"===e.type&&e.isMatch([n]));return o&&t.push(o.transform([n])),t},[]).flat()}else i=(0,p.pasteHandler)({HTML:o,plainText:n,mode:"BLOCKS",canUserUseUnfilteredHTML:t});return i}(e,t);if(1===_.length){const[e]=_;if(n.every(t=>a(t.name,e)))return f(n,void 0,e),void m(n[0]?.clientId,!1)}h(_,n,n.length-1,-1),m(n[0]?.clientId,!1)}}return g.ownerDocument.addEventListener("copy",k),g.ownerDocument.addEventListener("cut",k),g.ownerDocument.addEventListener("paste",k),()=>{g.ownerDocument.removeEventListener("copy",k),g.ownerDocument.removeEventListener("cut",k),g.ownerDocument.removeEventListener("paste",k)}},[])}({selectBlock:R}),O=(0,m.useMergeRefs)([D,L,A,b]);(0,h.useEffect)(()=>{y?.length&&$T(y[0],L?.current)},[]);const z=(0,h.useCallback)(e=>{if(!e)return;const t=Array.isArray(e)?e:[e];
2j({type:"expand",clientIds:t})},[j]),V=(0,h.useCallback)(e=>{e&&j({type:"collapse",clientIds:[e]})},[j]),F=(0,h.useCallback)(()=>{j({type:"clear"})},[j]),H=(0,h.useCallback)(e=>{z(e?.dataset?.block)},[z]),G=(0,h.useCallback)(e=>{V(e?.dataset?.block)},[V]),$=(0,h.useCallback)((e,t,n)=>{e.shiftKey&&C(e,t?.dataset?.block,n?.dataset?.block)},[C]);!function({collapseAll:e,expand:t}){const{expandedBlock:n,getBlockParents:o}=(0,g.useSelect)(e=>{const{getBlockParents:t,getExpandedBlock:n}=U(e(Ii));return{expandedBlock:n(),getBlockParents:t}},[]);(0,h.useEffect)(()=>{if(n){const r=o(n,!1);e(),t(r)}},[e,t,n,o])}({collapseAll:F,expand:z});const W=_?.[0],{blockDropTargetIndex:K,blockDropPosition:Z,firstDraggedBlockIndex:q}=(0,h.useMemo)(()=>{let e,t;if(N?.clientId){const t=x[N.clientId];e=void 0===t||"top"===N?.dropPosition?t:t+1}else null===N&&(e=null);if(W){const e=x[W];t=void 0===e||"top"===N?.dropPosition?e:e+1}return{blockDropTargetIndex:e,blockDropPosition:N?.dropPosition,firstDraggedBlockIndex:t}},[N,x,W]),Y=(0,h.useMemo)(()=>({blockDropPosition:Z,blockDropTargetIndex:K,blockIndexes:x,draggedClientIds:_,expandedState:B,expand:z,firstDraggedBlockIndex:q,collapse:V,collapseAll:F,BlockSettingsMenu:l,listViewInstanceId:k,AdditionalBlockContent:f,insertedBlock:E,setInsertedBlock:M,treeGridElementRef:L,rootClientId:a}),[Z,K,x,_,B,z,q,V,F,l,k,f,E,M,a]),[X]=(0,m.__experimentalUseFixedWindowList)(L,32,w,{expandedState:B,useWindowing:!0,windowOverscan:40});if(!v.length&&!s)return null;const Q=c&&`block-editor-list-view-description-${k}`;return(0,d.jsxs)(g.AsyncModeProvider,{value:!0,children:[(0,d.jsx)(XT,{draggedBlockClientId:W,listViewRef:L,blockDropTarget:N}),c&&(0,d.jsx)(Ss.VisuallyHidden,{id:Q,children:c}),(0,d.jsx)(Ss.__experimentalTreeGrid,{id:t,className:gs("block-editor-list-view-tree",{"is-dragging":_?.length>0&&void 0!==K}),"aria-label":(0,T.__)("Block navigation structure"),ref:O,onCollapseRow:G,onExpandRow:H,onFocusRow:$,applicationAriaLabel:(0,T.__)("Block navigation structure"),"aria-describedby":Q,style:{"--wp-admin--list-view-dragged-items-height":_?.length?32*(_.length-1)+"px":null},children:(0,d.jsx)(TT.Provider,{value:Y,children:(0,d.jsx)(YT,{blocks:v,parentId:a,selectBlock:R,showBlockMovers:r,fixedListWindow:X,selectedClientIds:y,isExpanded:i,showAppender:s})})})]})});var iM=(0,h.forwardRef)((e,t)=>(0,d.jsx)(rM,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0}));function sM({isEnabled:e,onToggle:t,isOpen:n,innerRef:o,...r}){return(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,...r,ref:o,icon:ET,"aria-expanded":n,"aria-haspopup":"true",onClick:e?t:void 0,label:(0,T.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}var lM=(0,h.forwardRef)(function({isDisabled:e,...t},n){I()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const o=(0,g.useSelect)(e=>!!e(Ii).getBlockCount(),[])&&!e;return(0,d.jsx)(Ss.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:e,onToggle:r})=>(0,d.jsx)(sM,{...t,innerRef:n,isOpen:e,onToggle:r,isEnabled:o}),renderContent:()=>(0,d.jsxs)("div",{className:"block-editor-block-navigation__container",children:[(0,d.jsx)("p",{className:"block-editor-block-navigation__label",children:(0,T.__)("List view")}),(0,d.jsx)(iM,{})]})})});function aM({genericPreviewBlock:e,style:t,className:n,activeStyle:o}){const r=(0,p.getBlockType)(e.name)?.example,i=Nj(n,o,t),s=(0,h.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,d.jsx)(Qw,{item:s})}const cM=()=>{};var uM=function({clientId:e,onSwitch:t=cM,onHoverClassName:n=cM}){const{onSelect:o,stylesToRender:r,activeStyle:i,genericPreviewBlock:s,className:l}=Dj({clientId:e,onSwitch:t}),[a,c]=(0,h.useState)(null),u=(0,m.useViewportMatch)("medium","<");if(!r||0===r.length)return null;const p=(0,m.debounce)(c,250),g=e=>{a!==e?(p(e),n(e?.name??null)):p.cancel()};return(0,d.jsxs)("div",{className:"block-editor-block-styles",children:[(0,d.jsx)("div",{className:"block-editor-block-styles__variants",children:r.map(e=>{const t=e.label||e.name;return(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,className:gs("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),c(null),p.cancel()})(e),"aria-current":i.name===e.name,children:(0,d.jsx)(Ss.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:t})},e.name)})}),a&&!u&&(0,d.jsx)(Ss.Popover,{placement:"left-start",offset:34,focusOnMount:!1,children:(0,d.jsx)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>g(null),children:(0,d.jsx)(aM,{activeStyle:i,className:l,genericPreviewBlock:s,style:a})})})]})};const dM={0:(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})}),2:(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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
2-.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,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})}),5:(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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 pM({level:e}){return dM[e]?(0,d.jsx)(Ss.Icon,{icon:dM[e]}):null}const hM=[1,2,3,4,5,6],gM={className:"block-library-heading-level-dropdown"};function mM({options:e=hM,value:t,onChange:n}){const o=e.filter(e=>0===e||hM.includes(e)).sort((e,t)=>e-t);return(0,d.jsx)(Ss.ToolbarDropdownMenu,{popoverProps:gM,icon:(0,d.jsx)(pM,{level:t}),label:(0,T.__)("Change level"),controls:o.map(e=>{const o=e===t;return{icon:(0,d.jsx)(pM,{level:e}),title:0===e?(0,T.__)("Paragraph"):(0,T.sprintf)((0,T.__)("Heading %d"),e),isActive:o,onClick(){n(e)},role:"menuitemradio"}})})}var fM=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}),bM=function({icon:e=fM,label:t=(0,T.__)("Choose variation"),instructions:n=(0,T.__)("Select a variation to start with:"),variations:o,onSelect:r,allowSkip:i}){const s=gs("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,d.jsxs)(Ss.Placeholder,{icon:e,label:t,instructions:n,className:s,children:[(0,d.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,T.__)("Block variations"),children:o.map(e=>(0,d.jsxs)("li",{children:[(0,d.jsx)(Ss.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,d.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:e.title})]},e.name))}),i&&(0,d.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>r(),children:(0,T.__)("Skip")})})]})};const kM="carousel",vM="grid",_M=({onBlockPatternSelect:e})=>(0,d.jsx)("div",{className:"block-editor-block-pattern-setup__actions",children:(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:e,children:(0,T.__)("Choose")})}),yM=({handlePrevious:e,handleNext:t,activeSlide:n,totalSlides:o})=>(0,d.jsxs)("div",{className:"block-editor-block-pattern-setup__navigation",children:[(0,d.jsx)(Ss.Button,{size:"compact",icon:(0,T.isRTL
2)()?Ab:Nb,label:(0,T.__)("Previous pattern"),onClick:e,disabled:0===n,accessibleWhenDisabled:!0}),(0,d.jsx)(Ss.Button,{size:"compact",icon:(0,T.isRTL)()?Nb:Ab,label:(0,T.__)("Next pattern"),onClick:t,disabled:n===o-1,accessibleWhenDisabled:!0})]});var xM=({viewMode:e,setViewMode:t,handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:i,onBlockPatternSelect:s})=>{const l=e===kM,a=(0,d.jsxs)("div",{className:"block-editor-block-pattern-setup__display-controls",children:[(0,d.jsx)(Ss.Button,{size:"compact",icon:sa,label:(0,T.__)("Carousel view"),onClick:()=>t(kM),isPressed:l}),(0,d.jsx)(Ss.Button,{size:"compact",icon:ZE,label:(0,T.__)("Grid view"),onClick:()=>t(vM),isPressed:e===vM})]});return(0,d.jsxs)("div",{className:"block-editor-block-pattern-setup__toolbar",children:[l&&(0,d.jsx)(yM,{handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:i}),a,l&&(0,d.jsx)(_M,{onBlockPatternSelect:s})]})};const SM=({viewMode:e,activeSlide:t,patterns:n,onBlockPatternSelect:o,showTitles:r})=>{const i="block-editor-block-pattern-setup__container";if(e===kM){const e=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,d.jsx)("div",{className:"block-editor-block-pattern-setup__carousel",children:(0,d.jsx)("div",{className:i,children:(0,d.jsx)("div",{className:"carousel-container",children:n.map((n,o)=>(0,d.jsx)(CM,{active:o===t,className:e.get(o)||"",pattern:n},n.name))})})})}return(0,d.jsx)("div",{className:"block-editor-block-pattern-setup__grid",children:(0,d.jsx)(Ss.Composite,{role:"listbox",className:i,"aria-label":(0,T.__)("Patterns list"),children:n.map(e=>(0,d.jsx)(wM,{pattern:e,onSelect:o,showTitles:r},e.name))})})};function wM({pattern:e,onSelect:t,showTitles:n}){const o="block-editor-block-pattern-setup-list",{blocks:r,description:i,viewportWidth:s=700}=e,l=(0,m.useInstanceId)(wM,`${o}__item-description`);return(0,d.jsx)("div",{className:`${o}__list-item`,children:(0,d.jsxs)(Ss.Composite.Item,{render:(0,d.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,d.jsx)(Yw,{blocks:r,viewportWidth:s}),n&&(0,d.jsx)("div",{className:`${o}__item-title`,children:e.title}),!!i&&(0,d.jsx)(Ss.VisuallyHidden,{id:l,children:i})]})})}function CM({active:e,className:t,pattern:n,minHeight:o}){const{blocks:r,title:i,description:s}=n,l=(0,m.useInstanceId)(CM,"block-editor-block-pattern-setup-list__item-description");return(0,d.jsxs)("div",{"aria-hidden":!e,role:"img",className:`pattern-slide ${t}`,"aria-label":i,"aria-describedby":s?l:void 0,children:[(0,d.jsx)(Yw,{blocks:r,minHeight:o}),!!s&&(0,d.jsx)(Ss.VisuallyHidden,{id:l,children:s})]})}var BM=({clientId:e,blockName:t,filterPatternsFn:n,onBlockPatternSelect:o,initialViewMode:r=kM,showTitles:i=!1})=>{const[s,l]=(0,h.useState)(r),[a,c]=(0,h.useState)(0),{replaceBlock:u}=(0,g.useDispatch)(Ii),m=function(e,t,n){return(0,g.useSelect)(o=>{const{getBlockRootClientId:r,getPatternsByBlockTypes:i,__experimentalGetAllowedPatterns:s}=o(Ii),l=r(e);return n?s(l).filter(n):i(t,l)},[e,t,n])}(e,t,n);if(!m?.length)return null;const f=o||(t=>{const n=t.map(e=>(0,p.cloneBlock)(e));u(e,n)});return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`,children:[(0,d.jsx)(SM,{viewMode:s,activeSlide:a,patterns:m,onBlockPatternSelect:f,showTitles:i}),(0,d.jsx)(xM,{viewMode:s,setViewMode:l,activeSlide:a,totalSlides:m.length,handleNext:()=>{c(e=>Math.min(e+1,m.length-1))},handlePrevious:()=>{c(e=>Math.max(e-1,0))},onBlockPatternSelect:()=>{f(m[a].blocks)}})]})})};function IM({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,d.jsxs)("fieldset",{className:e,children:[(0,d.jsx)(Ss.VisuallyHidden,{as:"legend",children:(0,T.__)("Transform to variation")}),o.map(e=>(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,size:"compact",icon:(0,d.jsx)(Au,{icon:e.icon,showColors:!0}),isPressed:n===e.name,label:n===e.name?e.title:(0,T.sprintf)((0,T.__)("Transform to %s"),e.title),onClick:()=>t(e.name),"aria-label":e.title,showTooltip:!0},e.name))]})}function jM({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,d.jsx)(Ss.DropdownMenu,{className:e,label:(0,T.__)("Transform to variation"),text:(0,T.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:JB,toggleProps:{iconPosition:"right"},children:()=>(0,d.jsx)(Ss.MenuGroup,{children:(0,d.jsx)(Ss.MenuItemsChoice,{choices:r,value:n,onSelect:t})})})}function EM({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,d.jsx)("div",{className:e,children:(0,d.jsx)(Ss.__experimentalToggleGroupControl,{label:(0,T.__)("Transform to variation"),value:n,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:o.map(e=>(0,d.jsx)(Ss.__experimentalToggleGroupControlOptionIcon,{icon:(0,d.jsx)(Au,{icon:e.icon,showColors:!0}),value:e.name,label:n===e.name?e.title:(0,T.sprintf)((0,T.__)("Transform to %s"),e.title)},e.name))})})}var TM=function({blockClientId:e}){const{updateBlockAttributes:t}=(0,g.useDispatch)(Ii),{activeBlockVariation:n,unfilteredVariations:o,blockName:r,isContentOnly:i,isSection:s}=(0,g.useSelect)(t=>{const{getActiveBlockVariation:n,getBlockVariations:o}=t(p.store),{getBlockName:r,getBlockAttributes:i,getBlockEditingMode:s,isSectionBlock:l}=U(t(Ii)),a=e&&r(e),{hasContentRoleAttribute:c}=U(t(p.store)),u=c(a);return{activeBlockVariation:n(a,i(e),"transform"),unfilteredVariations:a&&o(a,"transform"),blockName:a,isContentOnly:"c
2ontentOnly"===s(e)&&!u,isSection:l(e)}},[e]),l=(0,h.useMemo)(()=>"core/paragraph"===r?"stretchy-paragraph"===n?.name||o.every(e=>["paragraph","stretchy-paragraph"].includes(e.name))?[]:o.filter(e=>"stretchy-paragraph"!==e.name):"core/heading"===r?"stretchy-heading"===n?.name||o.every(e=>["heading","stretchy-heading"].includes(e.name))?[]:o.filter(e=>"stretchy-heading"!==e.name):o,[n?.name,r,o]),a=n?.name,c=(0,h.useMemo)(()=>{const e=new Set;return!!l&&(l.forEach(t=>{t.icon&&e.add(t.icon?.src||t.icon)}),e.size===l.length)},[l]),u=window?.__experimentalContentOnlyPatternInsertion&&s;if(!l?.length||i||u)return null;const m=l.length>5,f=c?m?IM:EM:jM;return(0,d.jsx)(f,{className:"block-editor-block-variation-transforms",onSelectVariation:n=>{t(e,{...l.find(({name:e})=>e===n).attributes})},selectedValue:a,variations:l})},MM=(0,m.createHigherOrderComponent)(e=>t=>{const[n,o,r,i,s]=Ei("color.palette.default","color.palette.theme","color.palette.custom","color.custom","color.defaultPalette"),l=s?[...o||[],...n||[],...r||[]]:[...o||[],...r||[]],{colors:a=l,disableCustomColors:c=!i}=t,u=a&&a.length>0||!c;return(0,d.jsx)(e,{...{...t,colors:a,disableCustomColors:c,hasColorsToChoose:u}})},"withColorContext"),PM=MM(Ss.ColorPalette);function RM({onChange:e,value:t,...n}){return(0,d.jsx)(Fp,{...n,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}const AM=window.wp.date,NM=new Date;function LM({format:e,defaultFormat:t,onChange:n}){return(0,d.jsxs)(Ss.__experimentalVStack,{as:"fieldset",spacing:4,className:"block-editor-date-format-picker",children:[(0,d.jsx)(Ss.VisuallyHidden,{as:"legend",children:(0,T.__)("Date format")}),(0,d.jsx)(Ss.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Default format"),help:`${(0,T.__)("Example:")} ${(0,AM.dateI18n)(t,NM)}`,checked:!e,onChange:e=>n(e?null:t)}),e&&(0,d.jsx)(DM,{format:e,onChange:n})]})}function DM({format:e,onChange:t}){const n=[...[...new Set(["Y-m-d",(0,T._x)("n/j/Y","short date format"),(0,T._x)("n/j/Y g:i A","short date format with time"),(0,T._x)("M j, Y","medium date format"),(0,T._x)("M j, Y g:i A","medium date format with time"),(0,T._x)("F j, Y","long date format"),(0,T._x)("M j","short date format without the year")])].map((e,t)=>({key:`suggested-${t}`,name:(0,AM.dateI18n)(e,NM),format:e})),{key:"human-diff",name:(0,AM.humanTimeDiff)(NM),format:"human-diff"}],o={key:"custom",name:(0,T.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",hint:(0,T.__)("Enter your own date format")},[r,i]=(0,h.useState)(()=>!!e&&!n.some(t=>t.format===e));return(0,d.jsxs)(Ss.__experimentalVStack,{children:[(0,d.jsx)(Ss.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Choose a format"),options:[...n,o],value:r?o:n.find(t=>t.format===e)??o,onChange:({selectedItem:e})=>{e===o?i(!0):(i(!1),t(e.format))}}),r&&(0,d.jsx)(Ss.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Custom format"),hideLabelFromVision:!0,help:(0,h.createInterpolateElement)((0,T.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,d.jsx)(Ss.ExternalLink,{href:(0,T.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:e=>t(e)})]})}NM.setDate(20),NM.setMonth(NM.getMonth()-3),4===NM.getMonth()&&NM.setMonth(3);const OM=({setting:e,children:t,panelId:n,...o})=>(0,d.jsx)(Ss.__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}),zM=({colorValue:e,label:t})=>(0,d.jsxs)(Ss.__experimentalHStack,{justify:"flex-start",children:[(0,d.jsx)(Ss.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,d.jsx)(Ss.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),VM=e=>({onToggle:t,isOpen:n})=>{const{clearable:o,colorValue:r,gradientValue:i,onColorChange:s,onGradientChange:l,label:a}=e,c=(0,h.useRef)(void 0),u={onClick:t,className:gs("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,ref:c},p=r??i;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,...u,children:(0,d.jsx)(zM,{colorValue:p,label:a})}),o&&p&&(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,label:(0,T.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:za,onClick:()=>{r?s():i&&l(),n&&t(),c.current?.focus()}})]})};function FM({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlp
2ha:o,gradients:r,settings:i,__experimentalIsRenderedInSidebar:s,...l}){let a;return s&&(a={placement:"left-start",offset:36,shift:!0}),(0,d.jsx)(d.Fragment,{children:i.map((i,c)=>{const u={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={clearable:i.clearable,label:i.label,colorValue:i.colorValue,gradientValue:i.gradientValue,onColorChange:i.onColorChange,onGradientChange:i.onGradientChange};return i&&(0,d.jsx)(OM,{setting:i,...l,children:(0,d.jsx)(Ss.Dropdown,{popoverProps:a,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:VM(p),renderContent:()=>(0,d.jsx)(Ss.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,d.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,d.jsx)(Fp,{...u})})})})},c)})})}const HM=["colors","disableCustomColors","gradients","disableCustomGradients"],UM=({className:e,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,children:i,settings:s,title:l,showTitle:a=!0,__experimentalIsRenderedInSidebar:c,enableAlp
2ha:u})=>{const p=(0,m.useInstanceId)(UM),{batch:h}=(0,g.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,d.jsxs)(Ss.__experimentalToolsPanel,{className:gs("block-editor-panel-color-gradient-settings",e),label:a?l:void 0,resetAll:()=>{h(()=>{s.forEach(({colorValue:e,gradientValue:t,onColorChange:n,onGradientChange:o})=>{e?n():t&&o()})})},panelId:p,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,d.jsx)(FM,{settings:s,panelId:p,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:c,enableAlpha:u}),!!i&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.__experimentalSpacer,{marginY:4})," ",i]})]}):null},GM=e=>{const t=jd();return(0,d.jsx)(UM,{...{...t,...e}})};var $M=e=>HM.every(t=>e.hasOwnProperty(t))?(0,d.jsx)(UM,{...e}):(0,d.jsx)(GM,{...e}),WM=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})});const KM=100,ZM=300,qM={placement:"bottom-start"},YM={crop:(0,T.__)("Image cropped."),rotate:(0,T.__)("Image rotated."),cropAndRotate:(0,T.__)("Image cropped and rotated.")},XM=(0,h.createContext)({});XM.displayName="ImageEditingContext";const QM=()=>(0,h.useContext)(XM);function JM({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,h.useState)(),[i,s]=(0,h.useState)(),[l,a]=(0,h.useState)({x:0,y:0}),[c,u]=(0,h.useState)(100),[d,p]=(0,h.useState)(0),g=t/n,[m,b]=(0,h.useState)(g),k=(0,h.useCallback)(()=>{const t=(d+90)%360;let n=g;if(d%180==90&&(n=1/g),0===t)return r(),p(t),b(g),void a(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)),p(t),b(o.width/o.height),a(e=>({x:-e.y*n,y:e.x*n}))})};const i=(0,f.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof i&&(o.crossOrigin=i)},[d,g,e]);return(0,h.useMemo)(()=>({editedUrl:o,setEditedUrl:r,crop:i,setCrop:s,position:l,setPosition:a,zoom:c,setZoom:u,rotation:d,setRotation:p,rotateClockwise:k,aspect:m,setAspect:b,defaultAspect:g}),[o,i,l,c,d,k,m,g])}({url:t,naturalWidth:n,naturalHeight:o}),a=function({crop:e,rotation:t,url:n,id:o,onSaveImage:r,onFinishEditing:i}){const{createErrorNotice:s,createSuccessNotice:l}=(0,g.useDispatch)(dr.store),[a,c]=(0,h.useState)(!1),{editMediaEntity:u}=(0,g.useSelect)(e=>{const t=e(Ii).getSettings();return{editMediaEntity:t?.[V]}},[]),d=(0,h.useCallback)(()=>{c(!1),i()},[i]),p=(0,h.useCallback)(async()=>{if(!u)return i(),void s((0,T.__)("Sorry, you are not allowed to edit images on this site."),{id:"image-editing-error",type:"snackbar"});c(!0);const a=[];if(t>0&&a.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&a.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),0===a.length)return c(!1),void i();const d=1===a.length?a[0].type:"cropAndRotate";try{const e=await u(o,{src:n,modifiers:a},{throwOnError:!0});e&&(r({id:e.id,url:e.source_url}),l(YM[d],{type:"snackbar",actions:[{label:(0,T.__)("Undo"),onClick:()=>{r({id:o,url:n})}}]}))}catch(e){s((0,T.sprintf)((0,T.__)("Could not edit image. %s"),(0,Fa.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})}finally{c(!1),i()}},[e,t,o,n,r,s,l,i,u]);return(0,h.useMemo)(()=>({isInProgress:a,apply:p,cancel:d}),[a,p,d])}({id:e,url:t,onSaveImage:i,onFinishEditing:r,...l}),c=(0,h.useMemo)(()=>({...l,...a}),[l,a]);return(0,d.jsx)(XM.Provider,{value:c,children:s})}function eP({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:r}){return(0,d.jsx)(Ss.MenuGroup,{label:n,children:e.map(({name:e,slug:n,ratio:i})=>(0,d.jsx)(Ss.MenuItem,{disabled:t,onClick:()=>{o(i)},role:"menuitemradio",isSelected:i===r,icon:i===r?Xd:void 0,children:e},n))})}function tP(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 nP({ratio:e,...t}){return{ratio:tP(e),...t}}function oP({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:r}=QM(),[i,s,l]=Ei("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return(0,d.jsx)(Ss.DropdownMenu,{icon:WM,label:(0,T.__)("Aspect Ratio"),popoverProps:qM,toggleProps:e,children:({onClose:e})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(eP,{isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{slug:"original",name:(0,T.__)("Original"),ratio:r},...l?i.map(nP).filter(({ratio:e})=>1===e):[]]}),s?.length>0&&(0,d.jsx)(eP,{label:(0,T.__)("Theme"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:s}),l&&(0,d.jsx)(eP,{label:(0,T.__)("Landscape"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:i.map(nP).filter(({ratio:e})=>e>1)}),l&&(0,d.jsx)(eP,{label:(0,T.__)("Portrait"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:i.map(nP).filter(({ratio:e})=>e<1)})]})})}var rP=function(e,t){return rP=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])},rP(e,t)};var iP=function(){return iP=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},iP.apply(this,arguments)};Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var sP=n(4030);function lP(e,t,n,o,r){void 0===r&&(r=0);var i=gP(t.width,t.height,r),s=i.width,l=i.height;return{x:aP(e.x,s,n.width,o),y:aP(e.y,l,n.height,o)}}function aP(e,t,n,o){var r=t*o/2-n/2;return mP(e,-r,r)}function cP(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function uP(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function dP(e,t){return Math.min(e,Math.max(0,t))}function pP(e,t){return t}function hP(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function gP(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 mP(e,t,n){return Math.min(Math.max(e,t),n)}function fP(){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 bP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.cropperRef=nc.createRef(),n.imageRef=nc.createRef(),n.videoRef=nc.createRef(),n.containerPosition={x:0,y:0}
2,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.previousCropSize=null,n.isInitialized=!1,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("gesturechange",n.onGestureChange),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.previousCropSize=e,n.emitCropData(),n.setInitialCrop(e),n.isInitialized=!0),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=gP(t.width,t.height,n),l=mP(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=gP(t.naturalWidth,t.naturalHeight,n),l=mP(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=iP(iP({},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=gP(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.onGestureChange),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureChange=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=iP({},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?lP(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=sP(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=mP(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?lP(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);
2var l=s?dP:pP,a=gP(t.width,t.height,i),c=gP(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:iP(iP({},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?lP(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(){var e,t;if(n.state.cropSize){var o=n.props.crop;if(n.isInitialized&&(null===(e=n.previousCropSize)||void 0===e?void 0:e.width)&&(null===(t=n.previousCropSize)||void 0===t?void 0:t.height)&&(Math.abs(n.previousCropSize.width-n.state.cropSize.width)>1e-6||Math.abs(n.previousCropSize.height-n.state.cropSize.height)>1e-6)){var r=n.state.cropSize.width/n.previousCropSize.width,i=n.state.cropSize.height/n.previousCropSize.height;o={x:n.props.crop.x*r,y:n.props.crop.y*i}}var s=n.props.restrictPosition?lP(o,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):o;n.previousCropSize=n.state.cropSize,n.props.onCropChange(s),n.emitCropData()}},n.onKeyDown=function(e){var t,o,r=n.props,i=r.crop,s=r.onCropChange,l=r.keyboardStep,a=r.zoom,c=r.rotation,u=l;if(n.state.cropSize){e.shiftKey&&(u*=.2);var d=iP({},i);switch(e.key){case"ArrowUp":d.y-=u,e.preventDefault();break;case"ArrowDown":d.y+=u,e.preventDefault();break;case"ArrowLeft":d.x-=u,e.preventDefault();break;case"ArrowRight":d.x+=u,e.preventDefault();break;default:return}n.props.restrictPosition&&(d=lP(d,n.mediaSize,n.state.cropSize,a,c)),e.repeat||null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t),s(d)}},n.onKeyUp=function(e){var t,o;switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":e.preventDefault();break;default:return}n.emitCropData(),null===(o=(t=n.props).onInteractionEnd)||void 0===o||o.call(t)},n}return function(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}rP(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(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}
2\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),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},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=cP(n,o),this.lastPinchRotation=uP(n,o),this.onDragStart(hP(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=hP(o,r);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var e=cP(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,i,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var s=uP(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,t=this,n=this.props,o=n.image,r=n.video,i=n.mediaProps,s=n.cropperProps,l=n.transform,a=n.crop,c=a.x,u=a.y,d=n.rotation,p=n.zoom,h=n.cropShape,g=n.showGrid,m=n.roundCropAreaPixels,f=n.style,b=f.containerStyle,k=f.cropAreaStyle,v=f.mediaStyle,_=n.classes,y=_.containerClassName,x=_.cropAreaClassName,S=_.mediaClassName,w=null!==(e=this.state.mediaObjectFit)&&void 0!==e?e:this.getObjectFit();return nc.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(e){return t.containerRef
2=e},"data-testid":"container",style:b,className:fP("reactEasyCrop_Container",y)},o?nc.createElement("img",iP({alt:"",className:fP("reactEasyCrop_Image","contain"===w&&"reactEasyCrop_Contain","horizontal-cover"===w&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===w&&"reactEasyCrop_Cover_Vertical",S)},i,{src:o,ref:this.imageRef,style:iP(iP({},v),{transform:l||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(p,")")}),onLoad:this.onMediaLoad})):r&&nc.createElement("video",iP({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:fP("reactEasyCrop_Video","contain"===w&&"reactEasyCrop_Contain","horizontal-cover"===w&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===w&&"reactEasyCrop_Cover_Vertical",S)},i,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:iP(iP({},v),{transform:l||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(p,")")}),controls:!1}),(Array.isArray(r)?r:[{src:r}]).map(function(e){return nc.createElement("source",iP({key:e.src},e))})),this.state.cropSize&&nc.createElement("div",iP({ref:this.cropperRef,style:iP(iP({},k),{width:m?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:m?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:fP("reactEasyCrop_CropArea","round"===h&&"reactEasyCrop_CropAreaRound",g&&"reactEasyCrop_CropAreaGrid",x)},s)))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:1},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}(nc.Component);function kP({url:e,width:t,height:n,naturalHeight:o,naturalWidth:r,borderProps:i}){const{isInProgress:s,editedUrl:l,position:a,zoom:c,aspect:u,setPosition:p,setCrop:h,setZoom:g,rotation:f}=QM(),[b,{width:k}]=(0,m.useResizeObserver)();let v=n||k*o/r;f%180==90&&(v=k*r/o);const _=(0,d.jsxs)("div",{className:gs("wp-block-image__crop-area",i?.className,{"is-applying":s}),style:{...i?.style,width:t||k,height:v},children:[(0,d.jsx)(bP,{image:l||e,disabled:s,minZoom:KM/100,maxZoom:ZM/100,crop:a,zoom:c/100,aspect:u,onCropChange:e=>{p(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{g(100*e)}}),s&&(0,d.jsx)(Ss.Spinner,{})]});return(0,d.jsxs)(d.Fragment,{children:[b,_]})}var vP=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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 _P(){const{isInProgress:e,zoom:t,setZoom:n}=QM();return(0,d.jsx)(Ss.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:qM,renderToggle:({isOpen:t,onToggle:n})=>(0,d.jsx)(Ss.ToolbarButton,{icon:vP,label:(0,T.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,d.jsx)(Ss.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,d.jsx)(Ss.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Zoom"),min:KM,max:ZM,value:Math.round(t),onChange:n})})})}var yP=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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 xP(){const{isInProgress:e,rotateClockwise:t}=QM();return(0,d.jsx)(Ss.ToolbarButton,{icon:yP,label:(0,T.__)("Rotate"),onClick:t,disabled:e})}function SP(){const{isInProgress:e,apply:t,cancel:n}=QM();return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.ToolbarButton,{onClick:t,disabled:e,children:(0,T.__)("Apply")}),(0,d.jsx)(Ss.ToolbarButton,{onClick:n,children:(0,T.__)("Cancel")})]})}
2function wP({id:e,url:t,width:n,height:o,naturalHeight:r,naturalWidth:i,onSaveImage:s,onFinishEditing:l,borderProps:a}){return(0,d.jsxs)(JM,{id:e,url:t,naturalWidth:i,naturalHeight:r,onSaveImage:s,onFinishEditing:l,children:[(0,d.jsx)(kP,{borderProps:a,url:t,width:n,height:o,naturalHeight:r,naturalWidth:i}),(0,d.jsxs)(Ps,{children:[(0,d.jsxs)(Ss.ToolbarGroup,{children:[(0,d.jsx)(_P,{}),(0,d.jsx)(Ss.ToolbarItem,{children:e=>(0,d.jsx)(oP,{toggleProps:e})}),(0,d.jsx)(xP,{})]}),(0,d.jsx)(Ss.ToolbarGroup,{children:(0,d.jsx)(SP,{})})]})]})}const CP=[25,50,75,100],BP=()=>{};function IP(e,t,n){return{scaledWidth:Math.round(t*(e/100)),scaledHeight:Math.round(n*(e/100))}}function jP({imageSizeHelp:e,imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:i,width:s,height:l,onChange:a,onChangeImage:c=BP}){const{currentHeight:u,currentWidth:p,updateDimension:g,updateDimensions:m}=function(e,t,n,o,r){const[i,s]=(0,h.useState)(t??o??""),[l,a]=(0,h.useState)(e??n??"");return(0,h.useEffect)(()=>{void 0===t&&void 0!==o&&s(o),void 0===e&&void 0!==n&&a(n)},[o,n]),(0,h.useEffect)(()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(i)&&s(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(l)&&a(e)},[t,e]),{currentHeight:l,currentWidth:i,updateDimension:(e,t)=>{const n=""===t?void 0:parseInt(t,10);"width"===e?s(n):a(n),r({[e]:n})},updateDimensions:(e,t)=>{a(e??n),s(t??o),r({height:e,width:t})}}}(l,s,n,t,a),f=CP.find(e=>{const{scaledWidth:o,scaledHeight:r}=IP(e,t,n);return p===o&&u===r});return(0,d.jsxs)(Ss.__experimentalVStack,{className:"block-editor-image-size-control",spacing:"4",children:[o&&o.length>0&&(0,d.jsx)(Ss.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Resolution"),value:i,options:o,onChange:c,help:e,size:"__unstable-large"}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(Ss.__experimentalHStack,{align:"baseline",spacing:"4",children:[(0,d.jsx)(Ss.__experimentalNumberControl,{label:(0,T.__)("Width"),value:p,min:1,onChange:e=>g("width",e),size:"__unstable-large"}),(0,d.jsx)(Ss.__experimentalNumberControl,{label:(0,T.__)("Height"),value:u,min:1,onChange:e=>g("height",e),size:"__unstable-large"})]}),(0,d.jsx)(Ss.__experimentalToggleGroupControl,{label:(0,T.__)("Image size presets"),hideLabelFromVision:!0,onChange:e=>{if(void 0===e)return void m();const{scaledWidth:o,scaledHeight:r}=IP(e,t,n);m(r,o)},value:f,isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:CP.map(e=>(0,d.jsx)(Ss.__experimentalToggleGroupControlOption,{value:e,label:(0,T.sprintf)((0,T.__)("%d%%"),e)},e))})]})]})}function EP({url:e,urlLabel:t,className:n}){const o=gs(n,"block-editor-url-popover__link-viewer-url");return e?(0,d.jsx)(Ss.ExternalLink,{className:o,href:e,children:t||(0,Va.filterURLForDisplay)((0,Va.safeDecodeURI)(e))}):(0,d.jsx)("span",{className:o})}const{__experimentalPopoverLegacyPositionToPlacement:TP}=U(Ss.privateApis),MP=(0,h.forwardRef)(({additionalControls:e,children:t,renderSettings:n,placement:o,focusOnMount:r="firstElement",position:i,...s},l)=>{let a;void 0!==i&&I()("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==o?a=o:void 0!==i&&(a=TP(i)),a=a||"bottom";const[c,u]=(0,h.useState)(!1),p=!!n&&c;return(0,d.jsxs)(Ss.Popover,{ref:l,role:"dialog","aria-modal":"true","aria-label":(0,T.__)("Edit URL"),className:"block-editor-url-popover",focusOnMount:r,placement:a,shift:!0,variant:"toolbar",...s,children:[(0,d.jsx)("div",{className:"block-editor-url-popover__input-container",children:(0,d.jsxs)("div",{className:"block-editor-url-popover__row",children:[t,!!n&&(0,d.jsx)(Ss.Button,{className:"block-editor-url-popover__settings-toggle",icon:JB,label:(0,T.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c,size:"compact"})]})}),p&&(0,d.jsx)("div",{className:"block-editor-url-popover__settings",children:n()}),e&&!p&&(0,d.jsx)("div",{className:"block-editor-url-popover__additional-controls",children:e})]})});MP.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...r}){return(0,d.jsxs)("form",{className:gs("block-editor-url-popover__link-editor",t),...r,children:[(0,d.jsx)(ic,{value:o,onChange:n,autocompleteRef:e}),(0,d.jsx)(Ss.Button,{icon:Qa,label:(0,T.__)("Apply"),type:"submit",size:"compact"})]})},MP.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:r,...i}){return(0,d.jsxs)("div",{className:gs("block-editor-url-popover__link-viewer",e),...i,children:[(0,d.jsx)(EP,{url:o,urlLabel:r,className:t}),n&&(0,d.jsx)(Ss.Button,{icon:Hc,label:(0,T.__)("Edit"),onClick:n,size:"compact"})]})};var PP=MP;const RP=()=>{},AP=({src:e,onChange:t,onSubmit:n,onClose:o,popoverAnchor:r})=>(0,d.jsx)(PP,{anchor:r,onClose:o,children:(0,d.jsx)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n,children:(0,d.jsx)(Ss.__experimentalInputControl,{__next40pxDefaultSize:!0,label:(0,T.__)("URL"),type:"text",hideLabelFromVision:!0,placeholder:(0,T.__)("Paste or type URL"),onChange:t,value:e,suffix:(0,d.jsx)(Ss.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,d.jsx)(Ss.Button,{size:"small",icon:Qa,label:(0,T.__)("Apply"),type:"submit"})})})})}),NP=({src:e,onChangeSrc:t,onSelectURL:n})=>{const[o,r]=(0,h.useState)(null),[i,s]=(0,h.useState)(!1),l=()=>{s(!1),o?.focus()};return(0,d.jsxs)("div",{className:"block-editor-media-placeholder__url-input-container",children:[(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:()=>{s(!0)},isPressed:i,variant:"secondary","aria-haspopup":"dialog",ref:r,children:(0,T.__)("Insert from URL")}),i&&(0,d.jsx)(AP,{src:e,onChange:t,onSubmit:t=>{t.preventDefault(),e&&n&&(n(e),l())},onClose:l,popoverAnchor:o})]})};var LP=(0,Ss.withFilters)("editor.MediaPlaceholder")(function({value:e={},allowedTypes:t,className:n,icon:o,labels:r={},mediaPreview:i,notices:s,isAppender:l,accept:a,addToGallery:c,multiple:u=!1,handleUpload:p=!0,disableDropZone:m,disableMediaButtons:f,onError:b,onSelect:k,onCancel:v,onSelectURL:_,onToggleFeaturedImage:y,onDoubleClick:x,onFilesPreUpload:S=RP,onHTMLDrop:w,children:C,mediaLibraryButton:B,placeholder:j,style:E}){w&&I()("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const M=(0,g.useSelect)(e=>{const{getSettings:t}=e(Ii);return t().mediaUpload},[]),[P,R]=(0,h.useState)("");(0,h.useEffect)(()=>{R(e?.src??"")},[e?.src]);const A=n=>{if(!p||"function"==typeof p&&!p(n))return k(n);let o;if(S(n),u)if(c){let t=[];o=n=>{const o=(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,multiple:u})};async function N(e){const{blocks:n}=kS(e);if(!n?.length)return;const o=await Promise.all(n.map(e=>{const n=e.name.split("/")[1];return e.attributes.id?(e.attributes.type=n,e.attributes):new Promise((o,r)=>{window.fetch(e.attributes.url).then(e=>e.blob()).then(i=>M({filesList:[i],additionalData:{title:e.attributes.title,alt_text:e.attributes.alt,caption:e.attributes.caption,type:n},onFileChange:([e])=>{e.id&&o(e)},allowedTypes:t,onError:r})).catch(()=>o(e.attributes.url))})})).catch(e=>b(e));o?.length&&k(u?o:o[0])}const L=e=>{A(e.target.files)},D=j??(e=>{let{instructions:a,title:c}=r;if(M||_||(a=(0,T.__)("To edit this block, you need permission to upload media.")),void 0===a||void 0===c){const e=t??[],[n]=e,o=1===e.length,r=o&&"audio"===n,i=o&&"image"===n,s=o&&"video"===n;void 0===a&&M&&(a=(0,T.__)("Drag and drop an image or video, upload, or choose from your library."),r?a=(0,T.__)("Drag and drop an audio file, upload, or choose from your library."):i?a=(0,T.__)("Drag and drop an image, upload, or choose from your library."):s&&(a=(0,T.__)("Drag and drop a video, upload, or choose from your library."))),void 0===c&&(c=(0,T.__)("Media"),r?c=(0,T.__)("Audio"):i?c=(0,T.__)("Image"):s&&(c=(0,T.__)("Video")))}const u=gs("block-editor-media-placeholder",n,{"is-appender":l});return(0,d.jsxs)(Ss.Placeholder,{icon:o,label:c,instructions:a,className:u,notices:s,onDoubleClick:x,preview:i,style:E,children:[e,C]})}),O=()=>m?null:(0,d.jsx)(Ss.DropZone,{onFilesDrop:A,onDrop:N,isEligible:e=>{const n=[];for(const t of e.types)t.startsWith("wp-block:core/")&&n.push(t.slice(14));return n.every(e=>t.includes(e))&&(!!u||1===n.length)}}),z=()=>v&&(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__cancel-button",title:(0,T.__)("Cancel"),variant:"link",onClick:v,children:(0,T.__)("Cancel")}),V=()=>_&&(0,d.jsx)(NP,{src:P,onChangeSrc:R,onSelectURL:_}),F=()=>y&&(0,d.jsx)("div",{className:"block-editor-media-placeholder__url-input-container",children:(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:y,variant:"secondary",children:(0,T.__)("Use featured image")})});return f?(0,d.jsx)(Za,{children:O()}):(0,d.jsx)(Za,{fallback:D(V()),children:(()=>{const n=B??(({open:e})=>(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{e()},children:(0,T.__)("Media Library")})),o=(0,d.jsx)(Ka,{addToGallery:c,gallery:u&&!(!t||0===t.length)&&t.every(e=>"image"===e||e.startsWith("image/")),multiple:u,onSelect:k,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map(({id:e})=>e):e.id,render:n});if(M&&l)return(0,d.jsxs)(d.Fragment,{children:[O(),(0,d.jsx)(Ss.FormFileUpload,{onChange:L,accept:a,multiple:!!u,render:({openFileDialog:e})=>{const t=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"primary",className:gs("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e,children:(0,T._x)("Upload","verb")}),o,V(),F(),z()]});return D(t)}})]});if(M){const e=(0,d.jsxs)(d.Fragment,{children:[O(),(0,d.jsx)(Ss.FormFileUpload,{render:({openFileDialog:e})=>(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,onClick:e,variant:"primary",className:gs("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),children:(0,T._x)("Upload","verb")}),onChange:L,accept:a,multiple:!!u}),o,V(),F(),z()]});return D(e)}return D(o)})()})}),DP=({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,d.jsx)($M,{settings:n,gradients:[],disableCustomGradients:!0,...t})};const OP={placement:"bottom-start"};var zP=()=>(0,d.jsxs)(d.Fragment,{children:[["bold","italic","link","unknown"].map(e=>(0,d.jsx)(Ss.Slot,{name:`RichText.ToolbarControls.${e}`},e)),(0,d.jsx)(Ss.Slot,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;const t=e.map(([{props:e}])=>e).some(({isActive:e})=>e);return(0,d.jsx)(Ss.ToolbarItem,{children:n=>(0,d.jsx)(Ss.DropdownMenu,{icon:JB,label:(0,T.__)("More"),toggleProps:{...n,className:gs(n.className,{"is-pressed":t}),description:(0,T.__)("Displays more block tools")},controls:yt(e.map(([{props:e}])=>e),"title"),popoverProps:OP})})}})]});function VP({popoverAnchor:e}){return(0,d.jsx)(Ss.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,d.jsx)(nT,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,T.__)("Format tools"),children:(0,d.jsx)(Ss.ToolbarGroup,{children:(0,d.jsx)(zP,{})})})})}var FP=({inline:e,editableContentElement:t})=>e?(0,d.jsx)(VP,{popoverAnchor:t}):(0,d.jsx)(Ps,{group:"inline",children:(0,d.jsx)(zP,{})});function HP(e){return e(de.store).getFormatTypes()}const UP=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function GP(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map(([e,n])=>[`${t}.${e}`,n]))}function $P(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 WP=["`",'"',"'","ââ","ââ"];function KP(e){let t=e.length;for(;t--;){const n=gr(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].toString().replace(hr,""),[e[t].clientId,n,0,0];const o=KP(e[t].innerBlocks);if(o)return o}return[]}function ZP(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}
2function qP({allowedFormats:e,disableFormats:t}){return t?qP.EMPTY_ARRAY:e}qP.EMPTY_ARRAY=[];const YP=[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,de.isCollapsed)(i))return;const a=(0,f.applyFilters)("blockEditor.wrapSelectionSettings",WP).find(([e,t])=>e===r||t===r);if(!a)return;const[c,u=c]=a,d=i.start,p=i.end+c.length;let h=(0,de.insert)(i,c,d,d);h=(0,de.insert)(h,u,p,p);const{__unstableMarkLastChangeAsPersistent:g,__unstableMarkAutomaticChange:m}=l.dispatch(Ii);g(),s(h),m();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:l}=i;if(" "!==l.slice(s-1,s))return;const a=l.slice(0,s).trim(),c=(0,p.getBlockTransforms)("from").filter(({type:e})=>"prefix"===e),u=(0,p.findTransform)(c,({prefix:e})=>a===e);if(!u)return;const d=(0,de.toHTMLString)({value:(0,de.insert)(i,hr,0,s)}),h=u.transform(d);return o(...KP([h])),n([h]),r.dispatch(Ii).__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{start:t,text:n}=e;return t<18||"tales of gutenberg"!==n.slice(t-18,t).toLowerCase()?e:(0,de.insert)(e," ð¡ð¢ð¦ð¤ð¦ðð§ð¹ð¦ð¦ð¦ð¼ð¿ðð´ððð¦ð¦ð±ðÏððð§ð¥¨ððð ð¥¦ð¥ð¥ðð¥¥ð¥ðµð¥ðð¯ð¾ð²ðºðð®âï¸")}(u)),{__unstableMarkLastChangeAsPersistent:p,__unstableMarkAutomaticChange:h}=c.dispatch(Ii);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(Ii).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},()=>e=>{function t(e){(Ua.isKeyboardEvent.primary(e,"z")||Ua.isKeyboardEvent.primary(e,"y")||Ua.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!==Ua.BACKSPACE&&n!==Ua.ESCAPE)return;const{registry:o}=e.current,{didAutomaticChange:r,getSettings:i}=o.select(Ii),{__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:l,onReplace:a,__unstableEmbedURLOnPaste:c,preserveWhiteSpace:u,pastePlainText:d}=e.current;if(!t.contains(n.target))return;if(n.defaultPrevented)return;const{plainText:h,html:g}=cw(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,de.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,de.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,de.insert)(i,t))}}if("true"===n.clipboardData.getData("rich-text"))return void m(g);if(d)return void r((0,de.insert)(i,(0,de.create)({text:h})));let f="INLINE";const b=h.trim();c&&(0,de.isEmpty)(i)&&(0,Va.isURL)(b)&&/^https?:/.test(b)&&(f="BLOCKS");const k=(0,p.pasteHandler)({HTML:g,plainText:h,mode:f,tagName:l,preserveWhiteSpace:u});"string"==typeof k?m(k):k.length>0&&a&&(0,de.isEmpty)(i)&&a(k,k.length-1,-1)}const{defaultView:o}=t.ownerDocument;
2return 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===Ua.DELETE||n===Ua.BACKSPACE){const{start:e,end:s,text:l}=o,a=n===Ua.BACKSPACE,c=o.activeFormats&&!!o.activeFormats.length;if(!(0,de.isCollapsed)(o)||c||a&&0!==e||!a&&s!==l.length)return;r?r(!a):i&&(0,de.isEmpty)(o)&&a&&i(!a),t.preventDefault()}}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){if(t.keyCode!==Ua.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!==Ua.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,de.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,de.remove)(e)),l()}):i||r((0,de.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(Ii).isMultiSelecting())return;const o=t.parentElement.closest('[contenteditable="true"]');o&&o.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}];function XP(e){const t=(0,h.useRef)(e);(0,h.useInsertionEffect)(()=>{t.current=e});const n=(0,h.useMemo)(()=>YP.map(e=>e(t)),[t]);return(0,m.useRefEffect)(t=>{if(!e.isSelected)return;const o=n.map(e=>e(t));return()=>{o.forEach(e=>e())}},[n,e.isSelected])}const QP={},JP=Symbol("usesContext");function eR({onChange:e,onFocus:t,value:n,forwardedRef:o,settings:r}){const{name:i,edit:s,[JP]:l}=r,a=(0,h.useContext)(Gk),c=(0,h.useMemo)(()=>l?Object.fromEntries(Object.entries(a).filter(([e])=>l.includes(e))):QP,[l,a]);if(!s)return null;const u=(0,de.getActiveFormat)(n,i),p=void 0!==u,g=(0,de.getActiveObject)(n),m=void 0!==g&&g.type===i;return(0,d.jsx)(s,{isActive:p,activeAttributes:p&&u.attributes||{},isObjectActive:m,activeObjectAttributes:m&&g.attributes||{},value:n,onChange:e,onFocus:t,contentRef:o,context:c},i)}function tR({formatTypes:e,...t}){return e.map(e=>(0,nc.createElement)(eR,{settings:e,...t,key:e.name}))}function nR(e,t){if(hR.isEmpty(e)){const e=ZP(t);return e?`<${e}></${e}>`:""}return Array.isArray(e)?(I()("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/"}),p.children.toHTML(e)):"string"==typeof e?e:e.toHTMLString()}function oR({value:e,tagName:t,multiline:n,format:o,...r}){return e=(0,d.jsx)(h.RawHTML,{children:nR(e,n)}),t?(0,d.jsx)(t,{...r,children:e}):e}var rR=(0,h.forwardRef)(function({children:e,identifier:t,tagName:n="div",value:o="",onChange:r,multiline:i,...s},l){I()("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}=C(),{getSelectionStart:c,getSelectionEnd:u}=(0,g.useSelect)(Ii),{selectionChange:p}=(0,g.useDispatch)(Ii),h=ZP(i),m=`</${h}>${o=o||`<${h}></${h}>`}<${h}>`.split(`</${h}><${h}>`);function f(e){r(`<${h}>${e.join(`</${h}><${h}>`)}</${h}>`)}return m.shift(),m.pop(),(0,d.jsx)(n,{ref:l,children:m.map((e,n)=>(0,d.jsx)(cR,{identifier:`${t}-${n}`,tagName:h,value:e,onChange:e=>{const t=m.slice();t[n]=e,f(t)},isSelected:void 0,onKeyDown:o=>{if(o.keyCode!==Ua.ENTER)return;o.preventDefault();const{offset:r}=c(),{offset:i}=u();if("number"!=typeof r||"number"!=typeof i)return;const s=(0,de.create)({html:e});s.start=r,s.end=i;const l=(0,de.split)(s).map(e=>(0,de.toHTMLString)({value:e})),d=m.slice();d.splice(n,1,...l),f(d),p(a,`${t}-${n+1}`,0,0)},onMerge:e=>{const o=m.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}f(o),p(a,`${t}-${n-(e?0:1)}`,r,r)},...s},n))})});const iR=(0,h.createContext)();iR.displayName="keyboardShortcutContext";const sR=(0,h.createContext)();sR.displayName="inputEventContext";const lR=Symbol("instanceId");function aR(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}
2function cR({children:e,tagName:t="div",value:n="",onChange:o,isSelected:r,multiline:i,inlineToolbar:s,wrapperClassName:l,autocompleters:a,onReplace:c,placeholder:u,allowedFormats:f,withoutInteractiveFormatting:b,onRemove:k,onMerge:v,onSplit:y,__unstableOnSplitAtEnd:x,__unstableOnSplitAtDoubleLineEnd:S,identifier:w,preserveWhiteSpace:B,__unstablePastePlainText:j,__unstableEmbedURLOnPaste:M,__unstableDisableFormats:P,disableLineBreaks:R,__unstableAllowPrefixTransformations:A,readOnly:N,...L},D){L=aR(L),y&&I()("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});const O=(0,m.useInstanceId)(cR),z=(0,h.useRef)(),V=C(),{clientId:F,isSelected:H}=V,U=V[_],G=(0,h.useContext)(Gk),{bindableAttributes:$}=(0,h.useContext)(Yk),W=(0,g.useRegistry)(),{selectionStart:K,selectionEnd:Z,isSelected:q}=(0,g.useSelect)(e=>{if(!H)return{isSelected:!1};const{getSelectionStart:t,getSelectionEnd:n}=e(Ii),o=t(),i=n();let s;return void 0===r?s=o.clientId===F&&i.clientId===F&&(w?o.attributeKey===w:o[lR]===O):r&&(s=o.clientId===F),{selectionStart:s?o.offset:void 0,selectionEnd:s?i.offset:void 0,isSelected:s}},[F,w,O,r,H]),{disableBoundBlock:Y,bindingsPlaceholder:X,bindingsLabel:Q}=(0,g.useSelect)(e=>{if(!U?.[w]||!$)return{};const t=U[w],o=(0,p.getBlockBindingsSource)(t.source),r={};if(o?.usesContext?.length)for(const e of o.usesContext)r[e]=G[e];const i=!o?.canUserEditValue?.({select:e,context:r,args:t.args});if(n.length>0)return{disableBoundBlock:i,bindingsPlaceholder:null,bindingsLabel:null};const{getBlockAttributes:s}=e(Ii),l=s(F);let a=null;if(o?.getFieldsList){const n=o.getFieldsList({select:e,context:r});a=n?.find(e=>E()(e.args,t?.args))?.label}const c=a??o?.label,u=i?c:(0,T.sprintf)((0,T.__)("Add %s"),c),d=i?t?.args?.key||o?.label:(0,T.sprintf)((0,T.__)("Empty %s; start writing to edit its value"),t?.args?.key||o?.label);return{disableBoundBlock:i,bindingsPlaceholder:l?.placeholder||u,bindingsLabel:d}},[U,w,$,n,F,G]),J=N||Y||!!G?.["pattern/overrides"]&&!("core/pattern-overrides"===U?.__default?.source),{getSelectionStart:ee,getSelectionEnd:te,getBlockRootClientId:ne}=(0,g.useSelect)(Ii),{selectionChange:oe}=(0,g.useDispatch)(Ii),re=qP({allowedFormats:f,disableFormats:P}),ie=!re||re.length>0,se=(0,h.useCallback)((e,t)=>{const n={},o=void 0===e&&void 0===t,r={clientId:F,[w?"attributeKey":lR]:w||O};if("number"==typeof e||o){if(void 0===t&&ne(F)!==ne(te().clientId))return;n.start={...r,offset:e}}if("number"==typeof t||o){if(void 0===e&&ne(F)!==ne(ee().clientId))return;n.end={...r,offset:t}}oe(n)},[F,ne,te,ee,w,O,oe]),{formatTypes:le,prepareHandlers:ae,valueHandlers:ce,changeHandlers:ue,dependencies:pe}=function({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:o}){const r=(0,g.useSelect)(HP,[]),i=(0,h.useMemo)(()=>r.filter(({name:e,interactive:t,tagName:r})=>!(o&&!o.includes(e)||n&&(t||UP.has(r)))),[r,o,n]),s=(0,g.useSelect)(n=>i.reduce((o,r)=>r.__experimentalGetPropsForEditableTreePreparation?{...o,...GP(r.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e}),r.name)}:o,{}),[i,e,t]),l=(0,g.useDispatch)(),a=[],c=[],u=[],d=[];for(const e in s)d.push(s[e]);return i.forEach(n=>{if(n.__experimentalCreatePrepareEditableTree){const o=n.__experimentalCreatePrepareEditableTree($P(s,n.name),{richTextIdentifier:t,blockClientId:e});n.__experimentalCreateOnChangeEditableValue?c.push(o):a.push(o)}if(n.__experimentalCreateOnChangeEditableValue){let o={};n.__experimentalGetPropsForEditableTreeChangeHandler&&(o=n.__experimentalGetPropsForEditableTreeChangeHandler(l,{richTextIdentifier:t,blockClientId:e}));const r=$P(s,n.name);u.push(n.__experimentalCreateOnChangeEditableValue({..."object"==typeof r?r:{},...o},{richTextIdentifier:t,blockClientId:e}))}}),{formatTypes:i,prepareHandlers:a,valueHandlers:c,changeHandlers:u,dependencies:d}}({clientId:F,identifier:w,withoutInteractiveFormatting:b,allowedFormats:re});function he(e){return le.forEach(t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,de.removeFormat)(e,t.name,0,e.text.length))}),e.formats}const{value:ge,getValue:me,onChange:fe,ref:be}=(0,de.__unstableUseRichText)({value:n,onChange(e,{__unstableFormats:t,__unstableText:n}
2){o(e),Object.values(ue).forEach(e=>{e(t,n)})},selectionStart:K,selectionEnd:Z,onSelectionChange:se,placeholder:X||u,__unstableIsSelected:q,__unstableDisableFormats:P,preserveWhiteSpace:B,__unstableDependencies:[...pe,t],__unstableAfterParse:function(e){return ce.reduce((t,n)=>n(t,e.text),e.formats)},__unstableBeforeSerialize:he,__unstableAddInvisibleFormats:function(e){return ae.reduce((t,n)=>n(t,e.text),e.formats)}}),ke=function(e){return(0,Ss.__unstableUseAutocompleteProps)({...e,completers:qI(e)})}({onReplace:c,completers:a,record:ge,onChange:fe});!function({html:e,value:t}){const n=(0,h.useRef)(),o=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:r}=(0,g.useDispatch)(Ii);(0,h.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:ge});const ve=(0,h.useRef)(new Set),_e=(0,h.useRef)(new Set);function ye(){z.current?.focus()}const xe=t;return(0,d.jsxs)(d.Fragment,{children:[q&&(0,d.jsx)(iR.Provider,{value:ve,children:(0,d.jsx)(sR.Provider,{value:_e,children:(0,d.jsxs)(Ss.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:ge,onChange:fe,onFocus:ye}),(0,d.jsx)(tR,{value:ge,onChange:fe,onFocus:ye,formatTypes:le,forwardedRef:z})]})})}),q&&ie&&(0,d.jsx)(FP,{inline:s,editableContentElement:z.current}),(0,d.jsx)(xe,{role:"textbox","aria-multiline":!R,"aria-readonly":J,...L,draggable:void 0,"aria-label":Q||L["aria-label"]||u,...ke,ref:(0,m.useMergeRefs)([be,D,ke.ref,L.ref,XP({registry:W,getValue:me,onChange:fe,__unstableAllowPrefixTransformations:A,formatTypes:le,onReplace:c,selectionChange:oe,isSelected:q,disableFormats:P,value:ge,tagName:t,onSplit:y,__unstableEmbedURLOnPaste:M,pastePlainText:j,onMerge:v,onRemove:k,removeEditorOnlyFormats:he,disableLineBreaks:R,onSplitAtEnd:x,onSplitAtDoubleLineEnd:S,keyboardShortcuts:ve,inputEvents:_e}),z]),contentEditable:!J,suppressContentEditableWarning:!0,className:gs("block-editor-rich-text__editable",L.className,"rich-text"),tabIndex:0!==L.tabIndex||J?L.tabIndex:null,"data-wp-block-attribute-key":w})]})}const uR=(dR=(0,h.forwardRef)(cR),(0,h.forwardRef)((e,t)=>{let n=e.value,o=e.onChange;Array.isArray(n)&&(I()("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=p.children.toHTML(e.value),o=t=>e.onChange(p.children.fromDOM((0,de.__unstableCreateElement)(document,t).childNodes)));const r=e.multiline?rR:dR;return(0,d.jsx)(r,{...e,value:n,onChange:o,ref:t})}));var dR;uR.Content=oR,uR.isEmpty=e=>!e||0===e.length;const pR=(0,h.forwardRef)((e,t)=>{if(C()[y]){const{children:n,tagName:o="div",value:r,onChange:i,isSelected:s,multiline:l,inlineToolbar:a,wrapperClassName:c,autocompleters:u,onReplace:p,placeholder:h,allowedFormats:g,withoutInteractiveFormatting:m,onRemove:f,onMerge:b,onSplit:k,__unstableOnSplitAtEnd:v,__unstableOnSplitAtDoubleLineEnd:_,identifier:y,preserveWhiteSpace:x,__unstablePastePlainText:S,__unstableEmbedURLOnPaste:w,__unstableDisableFormats:C,disableLineBreaks:B,__unstableAllowPrefixTransformations:I,readOnly:j,...E}=aR(e);return(0,d.jsx)(o,{ref:t,...E,dangerouslySetInnerHTML:{__html:nR(r,l)}})}return(0,d.jsx)(uR,{ref:t,...e,readOnly:!1})});pR.Content=oR,pR.isEmpty=e=>!e||0===e.length;var hR=pR;const gR=(0,h.forwardRef)((e,t)=>(0,d.jsx)(hR,{ref:t,...e,__unstableDisableFormats:!0}));gR.Content=({value:e="",tagName:t="div",...n})=>(0,d.jsx)(t,{...n,children:e});var mR=gR,fR=(0,h.forwardRef)(({__experimentalVersion:e,...t},n)=>{if(2===e)return(0,d.jsx)(mR,{ref:n,...t});const{className:o,onChange:r,...i}=t;return(0,d.jsx)(hv.A,{ref:n,className:gs("block-editor-plain-text",o),onChange:e=>r(e.target.value),...i})});function bR({property:e,viewport:t,desc:n}){const o=(0,m.useInstanceId)(bR),r=n||(0,T.sprintf)((0,T._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,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{"aria-describedby":`rbc-desc-${o}`,children:t.label}),(0,d.jsx)(Ss.VisuallyHidden,{as:"span",id:`rbc-desc-${o}`,children:r})]})}var kR=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:i,renderResponsiveControls:s,isResponsive:l=!1,defaultLabel:a={id:"all",label:(0,T._x)("All","screen sizes")}
2,viewports:c=[{id:"small",label:(0,T.__)("Small screens")},{id:"medium",label:(0,T.__)("Medium screens")},{id:"large",label:(0,T.__)("Large screens")}]}=e;if(!t||!n||!i)return null;const u=o||(0,T.sprintf)((0,T.__)("Use the same %s on all screen sizes."),n),p=(0,T.__)("Choose whether to use the same value for all screen sizes or a unique value for each screen size."),g=i((0,d.jsx)(bR,{property:n,viewport:a}),a);return(0,d.jsxs)("fieldset",{className:"block-editor-responsive-block-control",children:[(0,d.jsx)("legend",{className:"block-editor-responsive-block-control__title",children:t}),(0,d.jsxs)("div",{className:"block-editor-responsive-block-control__inner",children:[(0,d.jsx)(Ss.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-responsive-block-control__toggle",label:u,checked:!l,onChange:r,help:p}),(0,d.jsxs)("div",{className:gs("block-editor-responsive-block-control__group",{"is-responsive":l}),children:[!l&&g,l&&(s?s(c):c.map(e=>(0,d.jsx)(h.Fragment,{children:i((0,d.jsx)(bR,{property:n,viewport:e}),e)},e.id)))]})]})]})};function vR({character:e,type:t,onUse:n}){const o=(0,h.useContext)(iR),r=(0,h.useRef)();return r.current=n,(0,h.useEffect)(()=>{function n(n){Ua.isKeyboardEvent[t](n,e)&&(r.current(),n.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}},[e,t]),null}function _R({name:e,shortcutType:t,shortcutCharacter:n,...o}){let r,i="RichText.ToolbarControls";return e&&(i+=`.${e}`),t&&n&&(r=Ua.displayShortcut[t](n)),(0,d.jsx)(Ss.Fill,{name:i,children:(0,d.jsx)(Ss.ToolbarButton,{...o,shortcut:r})})}function yR({inputType:e,onInput:t}){const n=(0,h.useContext)(sR),o=(0,h.useRef)();return o.current=t,(0,h.useEffect)(()=>{function t(t){t.inputType===e&&(o.current(),t.preventDefault())}return n.current.add(t),()=>{n.current.delete(t)}},[e]),null}function xR({units:e,...t}){const[n]=Ei("spacing.units"),o=(0,Ss.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vw"],units:e});return(0,d.jsx)(Ss.__experimentalUnitControl,{units:o,...t})}var SR=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})}),wR=function({url:e,onChange:t}){const[n,o]=(0,h.useReducer)(e=>!e,!1);return(0,d.jsxs)("div",{className:"block-editor-url-input__button",children:[(0,d.jsx)(Ss.Button,{size:"compact",icon:Ed,label:e?(0,T.__)("Edit link"):(0,T.__)("Insert link"),onClick:o,className:"components-toolbar__control",isPressed:!!e}),n&&(0,d.jsx)("form",{className:"block-editor-url-input__button-modal",onSubmit:e=>{e.preventDefault(),o()},children:(0,d.jsxs)("div",{className:"block-editor-url-input__button-modal-line",children:[(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,className:"block-editor-url-input__back",icon:SR,label:(0,T.__)("Close"),onClick:o}),(0,d.jsx)(ic,{value:e||"",onChange:t,suffix:(0,d.jsx)(Ss.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,d.jsx)(Ss.Button,{size:"small",icon:Qa,label:(0,T.__)("Submit"),type:"submit"})})})]})})]})}
2,CR=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.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"})});const BR="none",IR="custom",jR="media",ER="attachment",TR=["noreferrer","noopener"],MR=({linkDestination:e,onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:r,mediaLink:i,linkTarget:s,linkClass:l,rel:a,showLightboxSetting:c,lightboxEnabled:u,onSetLightbox:p,resetLightbox:g})=>{const[m,f]=(0,h.useState)(!1),[b,k]=(0,h.useState)(null),[v,_]=(0,h.useState)(!1),[y,x]=(0,h.useState)(null),S=(0,h.useRef)(null),w=(0,h.useRef)();(0,h.useEffect)(()=>{w.current&&(Fa.focus.focusable.find(w.current)[0]||w.current).focus()},[v,n,u]);const C=()=>{_(!1)},B=()=>{const e=[{linkDestination:jR,title:(0,T.__)("Link to image file"),url:"image"===o?r:void 0,icon:CR}];return"image"===o&&i&&e.push({linkDestination:ER,title:(0,T.__)("Link to attachment page"),url:"image"===o?i:void 0,icon:cc}),e},I=(0,d.jsxs)(Ss.__experimentalVStack,{spacing:"3",children:[(0,d.jsx)(Ss.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Open in new tab"),onChange:e=>{const n=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(a??"").split(" ");TR.forEach(t=>{e.includes(t)||e.push(t)}),n=e.join(" ")}else{const e=(a??"").split(" ").filter(e=>!1===TR.includes(e));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===s}),(0,d.jsx)(Ss.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Link relation"),value:a??"",onChange:e=>{t({rel:e})},help:(0,h.createInterpolateElement)((0,T.__)("The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document."),{a:(0,d.jsx)(Ss.ExternalLink,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})})}),(0,d.jsx)(Ss.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Link CSS class"),value:l||"",onChange:e=>{t({linkClass:e})}})]}),j=null!==y?y:n,E=!u||u&&!c,M=!j&&E,P=(B().find(t=>t.linkDestination===e)||{}).title;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ss.ToolbarButton,{icon:Ed,className:"components-toolbar__control",label:(0,T.__)("Link"),"aria-expanded":m,onClick:()=>{f(!0)},ref:k,isActive:!!n||u&&c}),m&&(0,d.jsx)(PP,{ref:w,anchor:b,onFocusOutside:e=>{const t=S.current;t&&t.contains(e.target)||(f(!1),x(null),C())},onClose:()=>{x(null),C(),f(!1)},renderSettings:E?()=>I:null,additionalControls:M&&(0,d.jsxs)(Ss.NavigableMenu,{children:[B().map(e=>(0,d.jsx)(Ss.MenuItem,{icon:e.icon,iconPosition:"left",onClick:()=>{x(null),(e=>{const n=B();let o;o=e?(n.find(t=>t.url===e)||{linkDestination:IR}).linkDestination:BR,t({linkDestination:o,href:e})})(e.url),C()},children:e.title},e.linkDestination)),c&&(0,d.jsx)(Ss.MenuItem,{className:"block-editor-url-popover__expand-on-click",icon:XI,info:(0,T.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{x(null),t({linkDestination:BR,href:""}),p?.(!0),C()},children:(0,T.__)("Enlarge on click")},"expand-on-click")]}),offset:13,children:u&&c&&!n&&!v?(0,d.jsxs)("div",{className:"block-editor-url-popover__expand-on-click",children:[(0,d.jsx)(Nl,{icon:XI}),(0,d.jsxs)("div",{className:"text",children:[(0,d.jsx)("p",{children:(0,T.__)("Enlarge on click")}),(0,d.jsx)("p",{className:"description",children:(0,T.__)("Scales the image with a lightbox effect")})]}),(0,d.jsx)(Ss.Button,{icon:Xa,label:(0,T.__)("Disable enlarge on click"),onClick:()=>{p?.(!1)},size:"compact"})]}):!n||v?(0,d.jsx)(PP.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:j,onChangeInputValue:x,onSubmit:e=>{if(y){const e=B().find(e=>e.url===y)?.linkDestination||IR;t({href:(0,Va.prependHTTP)(y),linkDestination:e,lightbox:{enabled:!1}})}C(),x(null),e.preventDefault()},autocompleteRef:S}):n&&!v?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(PP.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:()=>{e!==jR&&e!==ER||x(""),_(!0)},urlLabel:P}),(0,d.jsx)(Ss.Button,{icon:Xa,label:(0,T.__)("Remove link"),onClick:()=>{t({linkDestination:BR,href:""}),g?.()},size:"compact"})]}):void 0})]})};function PR(){return I()("wp.blockEditor.PreviewOptions",{version:"6.5"}),null}function RR(e){const[t,n]=(0,h.useState)(window.innerWidth);(0,h.useEffect)(()=>
2{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="40px",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 AR({clientId:e}){const{updateBlockAttributes:t}=(0,g.useDispatch)(Ii),{attributes:n}=(0,g.useSelect)(t=>({attributes:t(Ii).getBlockAttributes(e)}),[e]);return n?.metadata?.patternName?(0,d.jsx)(Ss.Button,{className:"block-editor-block-inspector-edit-contents-button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{const{patternName:o,...r}=n?.metadata??{};t(e,{...n,metadata:r})},children:(0,T.__)("Edit contents")}):null}function NR(){const e=(0,g.useSelect)(e=>e(Ii).getBlockSelectionStart(),[]),t=(0,h.useRef)();return ah(e,t),e?(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current?.focus()},children:(0,T.__)("Skip to the selected block")}):null}function LR(){const e=(0,g.useSelect)(e=>e(Ii).getSelectedBlockCount(),[]);return(0,d.jsxs)(Ss.__experimentalHStack,{justify:"flex-start",spacing:2,className:"block-editor-multi-selection-inspector__card",children:[(0,d.jsx)(Au,{icon:Ij,showColors:!0}),(0,d.jsx)("div",{className:"block-editor-multi-selection-inspector__card-title",children:(0,T.sprintf)((0,T._n)("%d Block","%d Blocks",e),e)})]})}var DR=(0,d.jsx)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ce.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"})}
2),OR=(0,d.jsx)(ce.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ce.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"})});const zR={name:"settings",title:(0,T.__)("Settings"),value:"settings",icon:DR},VR={name:"styles",title:(0,T.__)("Styles"),value:"styles",icon:OR},FR={name:"content",title:(0,T.__)("Content"),value:"content",icon:cc},HR={name:"list",title:(0,T.__)("List View"),value:"list-view",icon:ET};var UR=()=>{const e=(0,Ss.__experimentalUseSlotFills)(Da.slotName),t=(0,Ss.__experimentalUseSlotFills)(Ea.name),n=Boolean(e&&e.length),o=Boolean(t&&t.length);return n||o?(0,d.jsxs)(Ss.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,T.__)("Advanced"),initialOpen:!1,children:[(0,d.jsx)(Oa.Slot,{group:"advanced"}),(0,d.jsx)(Ea.Slot,{})]}):null};const GR=()=>{const{selectedClientIds:e,selectedBlocks:t,hasPositionAttribute:n}=(0,g.useSelect)(e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:n}=e(Ii),o=n(),r=t(o);return{selectedClientIds:o,selectedBlocks:r,hasPositionAttribute:r?.some(({attributes:e})=>!!e?.style?.position?.type)}},[]),{updateBlockAttributes:o}=(0,g.useDispatch)(Ii),r=Qi();function i(){if(!e?.length||!t?.length)return;const n=Object.fromEntries(t?.map(({clientId:e,attributes:t})=>[e,{style:ms({...t?.style,position:{...t?.style?.position,type:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0}})}]));o(e,n,!0)}return(0,d.jsx)(Ss.__experimentalToolsPanel,{className:"block-editor-block-inspector__position",label:(0,T.__)("Position"),resetAll:i,dropdownMenuProps:r,children:(0,d.jsx)(Ss.__experimentalToolsPanelItem,{isShownByDefault:n,label:(0,T.__)("Position"),hasValue:()=>n,onDeselect:i,children:(0,d.jsx)(Oa.Slot,{group:"position"})})})};var $R=()=>{const e=(0,Ss.__experimentalUseSlotFills)(ja.position.name);return Boolean(e&&e.length)?(0,d.jsx)(GR,{}):null},WR=({showAdvancedControls:e=!1})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Oa.Slot,{}),(0,d.jsx)($R,{}),(0,d.jsx)(Oa.Slot,{group:"bindings"}),e&&(0,d.jsx)("div",{children:(0,d.jsx)(UR,{})})]}),KR=({blockName:e,clientId:t,hasBlockStyles:n,isSectionBlock:o})=>{const r=Bp({blockName:e});return(0,d.jsxs)(d.Fragment,{children:[n&&(0,d.jsx)("div",{children:(0,d.jsx)(Ss.PanelBody,{title:(0,T.__)("Styles"),children:(0,d.jsx)(uM,{clientId:t})})}),!o&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Oa.Slot,{group:"color",label:(0,T.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,d.jsx)(Oa.Slot,{group:"background",label:(0,T.__)("Backgroun
2d image")}),(0,d.jsx)(Oa.Slot,{group:"filter"}),(0,d.jsx)(Oa.Slot,{group:"typography",label:(0,T.__)("Typography")}),(0,d.jsx)(Oa.Slot,{group:"dimensions",label:(0,T.__)("Dimensions")}),(0,d.jsx)(Oa.Slot,{group:"border",label:r}),(0,d.jsx)(Oa.Slot,{group:"styles"})]})]})};function ZR({clientIds:e,onSelect:t}){return e.length?(0,d.jsx)(Ss.__experimentalVStack,{spacing:1,children:e.map(e=>(0,d.jsx)(qR,{onSelect:t,clientId:e},e))}):null}function qR({clientId:e,onSelect:t}){const n=zf(e),o=tj({clientId:e,context:"list-view"}),{isSelected:r}=(0,g.useSelect)(t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t(Ii);return{isSelected:n(e)||o(e,!0)}},[e]),{selectBlock:i}=(0,g.useDispatch)(Ii);return(0,d.jsx)(Ss.Button,{__next40pxDefaultSize:!0,isPressed:r,onClick:async()=>{await i(e),t&&t(e)},children:(0,d.jsxs)(Ss.Flex,{children:[(0,d.jsx)(Ss.FlexItem,{children:(0,d.jsx)(Au,{icon:n?.icon})}),(0,d.jsx)(Ss.FlexBlock,{style:{textAlign:"left"},children:(0,d.jsx)(Ss.__experimentalTruncate,{children:o})})]})})}var YR=({contentClientIds:e})=>e&&0!==e.length?(0,d.jsx)(Ss.PanelBody,{title:(0,T.__)("Content"),children:(0,d.jsx)(ZR,{clientIds:e})}):null;const XR=["core/navigation"];var QR=e=>!XR.includes(e);const{Tabs:JR}=U(Ss.privateApis);function eA({blockName:e,clientId:t,hasBlockStyles:n,tabs:o,isSectionBlock:r,contentClientIds:i}){const s=(0,g.useSelect)(e=>e(pr.store).get("core","showIconLabels"),[]),l=QR(e)?void 0:HR.name,[a,c]=(0,h.useState)(l??o[0]?.name);return(0,h.useEffect)(()=>{!l&&o?.length&&a&&(o.find(e=>e.name===a)||c(o[0].name))},[o,a,l]),(0,d.jsx)("div",{className:"block-editor-block-inspector__tabs",children:(0,d.jsxs)(JR,{defaultTabId:l,selectedTabId:a,onSelect:c,children:[(0,d.jsx)(JR.TabList,{children:o.map(e=>s?(0,d.jsx)(JR.Tab,{tabId:e.name,children:e.title},e.name):(0,d.jsx)(Ss.Tooltip,{text:e.title,children:(0,d.jsx)(JR.Tab,{tabId:e.name,"aria-label":e.title,children:(0,d.jsx)(Ss.Icon,{icon:e.icon})})},e.name))}),(0,d.jsx)(JR.TabPanel,{tabId:zR.name,focusable:!1,children:(0,d.jsx)(WR,{showAdvancedControls:!!e})}),(0,d.jsx)(JR.TabPanel,{tabId:VR.name,focusable:!1,children:(0,d.jsx)(KR,{blockName:e,clientId:t,hasBlockStyles:n,isSectionBlock:r})}),(0,d.jsx)(JR.TabPanel,{tabId:FR.name,focusable:!1,children:(0,d.jsx)(YR,{contentClientIds:i})}),(0,d.jsx)(JR.TabPanel,{tabId:HR.name,focusable:!1,children:(0,d.jsx)(Oa.Slot,{group:"list"})})]},t)})}const tA=[];function nA({clientId:e}){return(0,d.jsx)(Ss.PanelBody,{title:(0,T.__)("Styles"),children:(0,d.jsx)(uM,{clientId:e})})}function oA({blockName:e,showAdvancedControls:t=!0,showPositionControls:n=!0,showListControls:o=!1,showBindingsControls:r=!0}){const i=Bp({blockName:e});return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Oa.Slot,{}),o&&(0,d.jsx)(Oa.Slot,{group:"list"}),(0,d.jsx)(Oa.Slot,{group:"color",label:(0,T.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,d.jsx)(Oa.Slot,{group:"background",label:(0,T.__)("Backgroun
2d image")}),(0,d.jsx)(Oa.Slot,{group:"typography",label:(0,T.__)("Typography")}),(0,d.jsx)(Oa.Slot,{group:"dimensions",label:(0,T.__)("Dimensions")}),(0,d.jsx)(Oa.Slot,{group:"border",label:i}),(0,d.jsx)(Oa.Slot,{group:"styles"}),n&&(0,d.jsx)($R,{}),r&&(0,d.jsx)(Oa.Slot,{group:"bindings"}),t&&(0,d.jsx)("div",{children:(0,d.jsx)(UR,{})})]})}const rA=({animate:e,wrapper:t,children:n})=>e?t(n):n,iA=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const o=e&&"leftToRight"===e.enterDirection?-50:50;return(0,d.jsx)(Ss.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},children:n},t)},sA=({clientId:e,blockName:t,isSectionBlock:n,availableTabs:o,contentClientIds:r,hasBlockStyles:i})=>{const s=o?.length>1,l=zf(e),a=l.isSynced,c=!a&&s;return(0,d.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,d.jsx)(Db,{...l,className:a&&"is-synced",allowParentNavigation:!0,children:window?.__experimentalContentOnlyPatternInsertion&&(0,d.jsx)(AR,{clientId:e})}),(0,d.jsx)(TM,{blockClientId:e}),c&&(0,d.jsx)(eA,{hasBlockStyles:i,clientId:e,blockName:t,tabs:o,isSectionBlock:n,contentClientIds:r}),!c&&(0,d.jsxs)(d.Fragment,{children:[i&&(0,d.jsx)(nA,{clientId:e}),(0,d.jsx)(YR,{contentClientIds:r}),!n&&(0,d.jsx)(oA,{blockName:t,showListControls:!0})]}),(0,d.jsx)(NR,{},"back")]})};var lA=function(){const{selectedBlockCount:e,selectedBlockName:t,selectedBlockClientId:n,blockType:o,isSectionBlock:r,isSectionBlockInSelection:i,hasBlockStyles:s}=(0,g.useSelect)(e=>{const{getSelectedBlockClientId:t,getSelectedBlockClientIds:n,getSelectedBlockCount:o,getBlockName:r,getParentSectionBlock:i,isSectionBlock:s}=U(e(Ii)),{getBlockStyles:l}=e(p.store),a=t(),c=i(a)||a,u=c&&r(c),d=u&&(0,p.getBlockType)(u),h=n().some(e=>s(e)),g=u&&l(u),m=g&&g.length>0;return{selectedBlockCount:o(),selectedBlockClientId:c,selectedBlockName:u,blockType:d,isSectionBlockInSelection:h,isSectionBlock:s(c),hasBlockStyles:m}},[]),l=(0,g.useSelect)(e=>{if(!r||!n)return[];const{getClientIdsOfDescendants:t,getBlockName:o,getBlockEditingMode:i}=U(e(Ii)),s=t(n),l=new Set;return s.forEach(e=>{"core/navigation"===o(e)&&t(e).forEach(e=>l.add(e))}),s.filter(e=>!l.has(e)&&"core/list-item"!==o(e)&&"contentOnly"===i(e))},[r,n]),a=function(e,t,n,o){const r=[],{bindings:i,border:s,color:l,default:a,dimensions:c,list:u,position:d,styles:p,typography:h,effects:m}=ja,f=QR(e),b=(0,Ss.__experimentalUseSlotFills)(u.name),k=!f&&!!b&&b.length,v=[...(0,Ss.__experimentalUseSlotFills)(s.name)||[],...(0,Ss.__experimentalUseSlotFills)(l.name)||[],...(0,Ss.__experimentalUseSlotFills)(c.name)||[],...(0,Ss.__experimentalUseSlotFills)(p.name)||[],...(0,Ss.__experimentalUseSlotFills)(h.name)||[],...(0,Ss.__experimentalUseSlotFills)(m.name)||[]].length,_=[...(0,Ss.__experimentalUseSlotFills)(Da.slotName)||[],...(0,Ss.__experimentalUseSlotFills)(i.name)||[]],y=[...(0,Ss.__experimentalUseSlotFills)(a.name)||[],...(0,Ss.__experimentalUseSlotFills)(d.name)||[],...k&&v>1?_:[]],x=!!(t&&t.length>0);return k&&!n&&r.push(HR),x&&r.push(FR),y.length&&!n&&r.push(zR),(n?o:v)&&r.push(VR),function(e,t={}){return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,g.useSelect)(e=>e(Ii).getSettings().blockInspectorTabs,[]))?r:tA}(o?.name,l,r,s),c=a?.length>1,u=function(e){return(0,g.useSelect)(t=>{if(e){const n=t(Ii).getSettings().blockInspectorAnimation,o=n?.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:i}=t(Ii);return i(r(),o,!0)[0]||e.name===o?n?.[e.name]:null}return null},[e])}(o),h=e>1;if(h&&!i)return(0,d.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,d.jsx)(LR,{}),c?(0,d.jsx)(eA,{tabs:a}):(0,d.jsx)(oA,{blockName:t,showAdvancedControls:!1,showPositionControls:!1,showBindingsControls:!1})]});if(h&&i)return(0,d.jsx)("div",{className:"block-editor-block-inspector",children:(0,d.jsx)(LR,{})});const m=t===(0,p.getUnregisteredTypeHandlerName)();return o&&n&&!m?(0,d.jsx)(rA,{animate:u,wrapper:e=>(0,d.jsx)(iA,{blockInspectorAnimationSettings:u,selectedBlockClientId:n,children:e}),children:(0,d.jsx)(sA,{clientId:n,blockName:o.name,isSectionBlock:r,availableTabs:a,contentClientIds:l,hasBlockStyles:s})}):(0,d.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,T.__)("No block selected.")})};const aA=()=>(I()("__unstableUseClipboardHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),pw());function cA(e){return I()("CopyHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),(0,d.jsx)("div",{...e,ref:pw()})}const uA=()=>{},dA=(0,h.forwardRef)(function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r=!1,__experimentalInsertionIndex:i,__experimentalInitialTab:s,__experimentalInitialCategory:l,__experimentalFilterValue:a,onPatternCategorySelection:c,onSelect:u=uA,shouldFocusBlock:p=!1,onClose:h},m){const{destinationRootClientId:f}=(0,g.useSelect)(n=>
2{const{getBlockRootClientId:o}=n(Ii);return{destinationRootClientId:e||o(t)||void 0}},[t,e]);return(0,d.jsx)(AB,{onSelect:u,rootClientId:f,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r,__experimentalInsertionIndex:i,__experimentalFilterValue:a,onPatternCategorySelection:c,__experimentalInitialTab:s,__experimentalInitialCategory:l,shouldFocusBlock:p,ref:m,onClose:h})});var pA=(0,h.forwardRef)(function(e,t){return(0,d.jsx)(dA,{...e,onPatternCategorySelection:void 0,ref:t})});function hA(){return I()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const gA=-1!==window.navigator.userAgent.indexOf("Trident"),mA=new Set([Ua.UP,Ua.DOWN,Ua.LEFT,Ua.RIGHT]),fA=.75;function bA(){const e=(0,g.useSelect)(e=>e(Ii).hasSelectedBlock(),[]);return(0,m.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,Fa.computeCaretRect)(o);if(!r)return;if(!s)return void(s=r);if(mA.has(e))return void(s=r);const i=r.top-s.top;if(0===i)return;const l=(0,Fa.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<fA&&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,Fa.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])}var kA=gA?e=>e.children:function({children:e}){return(0,d.jsx)("div",{ref:bA(),className:"block-editor__typewriter",children:e})};const vA=(0,h.createContext)({});function _A({children:e,uniqueId:t,blockName:n=""}){const o=(0,h.useContext)(vA),{name:r}=C();n=n||r;const i=(0,h.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,d.jsx)(vA.Provider,{value:i,children:e})}function yA(e,t=""){const n=(0,h.useContext)(vA),{name:o}=C();return t=t||o,Boolean(n[t]?.has(e))}vA.displayName="RenderedRefsContext";const xA=e=>(I()("wp.blockEditor.__experimentalRecursionProvider",{since:"6.5",alternative:"wp.blockEditor.RecursionProvider"}),(0,d.jsx)(_A,{...e})),SA=(...e)=>(I()("wp.blockEditor.__experimentalUseHasRecursion",{since:"6.5",alternative:"wp.blockEditor.useHasRecursion"}),yA(...e));function wA({title:e,help:t,actions:n=[],onClose:o}){return(0,d.jsxs)(Ss.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4,children:[(0,d.jsxs)(Ss.__experimentalHStack,{alignment:"center",children:[(0,d.jsx)(Ss.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),(0,d.jsx)(Ss.__experimentalSpacer,{}),n.map(({label:e,icon:t,onClick:n})=>(0,d.jsx)(Ss.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:e,icon:t,variant:!t&&"tertiary",onClick:n,children:!t&&e},e)),o&&(0,d.jsx)(Ss.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:(0,T.__)("Close"),icon:EB,onClick:o})]}),t&&(0,d.jsx)(Ss.__experimentalText,{children:t})]})}const CA=(0,h.forwardRef)(function({onClose:e,onChange:t,showPopoverHeaderActions:n,isCompact:o,currentDate:r,title:i,...s},l){const a={startOfWeek:(0,AM.getSettings)().l10n.startOfWeek,onChange:t,currentDate:o?void 0:r,currentTime:o?r:void 0,...s},c=o?Ss.TimePicker:Ss.DateTimePicker;return(0,d.jsxs)("div",{ref:l,className:"block-editor-publish-date-time-picker",children:[(0,d.jsx)(wA,{title:i||(0,T.__)("Publish"),actions:n?[{label:(0,T.__)("Now"),onClick:()=>t?.(null)}]:void 0,onClose:e}),(0,d.jsx)(c,{...a})]})});var BA=(0,h.forwardRef)(function(e,t){return(0,d.jsx)(CA,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})}),IA=(0,h.forwardRef)(function(){return I()("wp.blockEditor.ToolSelector",{since:"6.9",hint:"The ToolSelector component no longer renders anything."}),null});const jA={button:"wp-element-button",caption:"wp-element-caption"},EA=e=>jA[e]?jA[e]:"";var TA=()=>"";function MA(e,t,n){return"core/image"===e&&n?.lightbox?.allowEditing||!!t?.lightbox}function PA({onChange:e,value:t,inheritedValue:n,panelId:o}){const r=Qi(),i=()=>{e(void 0)};let s=!1;return n?.lightbox?.enabled&&(s=n.lightbox.enabled),(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(Ss.__experimentalToolsPanel,{label:(0,T._x)("Settings","Image settings"),resetAll:i,panelId:o,dropdownMenuProps:r,children:(0,d.jsx)(Ss.__experimentalToolsPanelItem,{hasValue:()=>!!t?.lightbox,label:(0,T.__)("Enlarge on click"),onDeselect:i,isS
2hownByDefault:!0,panelId:o,children:(0,d.jsx)(Ss.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Enlarge on click"),checked:s,onChange:t=>{e({enabled:t})}})})})})}function RA({value:e,onChange:t,inheritedValue:n=e}){const[o,r]=(0,h.useState)(null),i=n?.css;return(0,d.jsxs)(Ss.__experimentalVStack,{spacing:3,children:[o&&(0,d.jsx)(Ss.Notice,{status:"error",onRemove:()=>r(null),children:o}),(0,d.jsx)(Ss.TextareaControl,{label:(0,T.__)("Additional CSS"),__nextHasNoMarginBottom:!0,value:i,onChange:n=>function(n){if(t({...e,css:n}),o){const[e]=zw([{css:n}],".for-validation-only");e&&r(null)}}(n),onBlur:function(e){if(!e?.target?.value)return void r(null);const[t]=zw([{css:e.target.value}],".for-validation-only");r(null===t?(0,T.__)("There is an error with your CSS structure."):null)},className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1})]})}const AA=new Map,NA=[],LA={caption:(0,T.__)("Caption"),link:(0,T.__)("Link"),button:(0,T.__)("Button"),heading:(0,T.__)("Heading"),h1:(0,T.__)("H1"),h2:(0,T.__)("H2"),h3:(0,T.__)("H3"),h4:(0,T.__)("H4"),h5:(0,T.__)("H5"),h6:(0,T.__)("H6"),"settings.color":(0,T.__)("Color"),"settings.typography":(0,T.__)("Typography"),"settings.shadow":(0,T.__)("Shadow"),"settings.layout":(0,T.__)("Layout"),"styles.color":(0,T.__)("Colors"),"styles.spacing":(0,T.__)("Spacing"),"styles.background":(0,T.__)("Backgroun
2d"),"styles.typography":(0,T.__)("Typography")},DA=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,p.getBlockTypes)().reduce((e,{name:t,title:n})=>(e[t]=n,e),{})),OA=e=>null!==e&&"object"==typeof e;function zA(e,t,n=""){if(!OA(e)&&!OA(t))return e!==t?n.split(".").slice(0,2).join("."):void 0;e=OA(e)?e:{},t=OA(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=zA(e[i],t[i],o);s&&(r=r.concat(s))}return r}function VA(e,t){const n=JSON.stringify({next:e,previous:t});if(AA.has(n))return AA.get(n);const o=zA({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 AA.set(n,NA),NA;const r=[...new Set(o)].reduce((e,t)=>{const n=function(e){if(LA[e])return LA[e];const t=e.split(".");if("blocks"===t?.[0]){const e=DA()?.[t[1]];return e||t[1]}return"elements"===t?.[0]?LA[t[1]]||t[1]:void 0}(t);return n&&e.push([t.split(".")[0],n]),e},[]);return AA.set(n,r),r}function FA(e,t,n={}){let o=VA(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,T.__)(", "));switch(e){case"blocks":return(0,T.sprintf)((0,T._n)("%s block.","%s blocks.",n),o);case"elements":return(0,T.sprintf)((0,T._n)("%s element.","%s elements.",n),o);case"settings":return(0,T.sprintf)((0,T.__)("%s settings."),o);case"styles":return(0,T.sprintf)((0,T.__)("%s styles."),o);default:return(0,T.sprintf)((0,T.__)("%s."),o)}})):NA}function HA(e,t,n){if(null==e||!1===e)return;if(Array.isArray(e))return UA(e,t,n);switch(typeof e){case"string":case"number":return}const{type:o,props:r}=e;switch(o){case h.StrictMode:case h.Fragment:return UA(r.children,t,n);case h.RawHTML:return;case AS.Content:return GA(t,n);case oR:return void t.push(r.value)}switch(typeof o){case"string":return void 0!==r.children?UA(r.children,t,n):void 0;case"function":return HA(o.prototype&&"function"==typeof o.prototype.render?new o(r).render():o(r),t,n)}}function UA(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;n<e.length;n++)HA(e[n],...t)}function GA(e,t){for(let n=0;n<t.length;n++){const{name:o,attributes:r,innerBlocks:i}=t[n];HA((0,p.getSaveElement)(o,r,(0,d.jsx)(AS.Content,{})),e,i)}}const $A=[{value:"fill",label:(0,T._x)("Fill","Scale option for dimensions control"),help:(0,T.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,T._x)("Contain","Scale option for dimensions control"),help:(0,T.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,T._x)("Cover","Scale option for dimensions control"),help:(0,T.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,T._x)("None","Scale option for dimensions control"),help:(0,T.__)("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,T._x)("Scale down","Scale option for dimensions control"),help:(0,T.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function WA({panelId:e,value:t,onChange:n,options:o=$A,defaultValue:r=$A[0].value,isShownByDefault:i=!0}){const s=t??"fill",l=(0,h.useMemo)(()=>o.reduce((e,t)=>
2(e[t.value]=t.help,e),{}),[o]);return(0,d.jsx)(Ss.__experimentalToolsPanelItem,{label:(0,T.__)("Scale"),isShownByDefault:i,hasValue:()=>s!==r,onDeselect:()=>n(r),panelId:e,children:(0,d.jsx)(Ss.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Scale"),isBlock:!0,help:l[s],value:s,onChange:n,size:"__unstable-large",children:o.map(e=>(0,d.jsx)(Ss.__experimentalToggleGroupControlOption,{...e},e.value))})})}function KA(){return KA=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},KA.apply(this,arguments)}var ZA=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){}}else t.appendChild(document.createTextNode(e));this.ctr++}
vendor: 5,300 bytes, line 2
2,t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),qA=Math.abs,YA=String.fromCharCode,XA=Object.assign;function QA(e){return e.trim()}function JA(e,t,n){return e.replace(t,n)}function eN(e,t){return e.indexOf(t)}function tN(e,t){return 0|e.charCodeAt(t)}function nN(e,t,n){return e.slice(t,n)}function oN(e){return e.length}function rN(e){return e.length}function iN(e,t){return t.push(e),e}var sN=1,lN=1,aN=0,cN=0,uN=0,dN="";function pN(e,t,n,o,r,i,s){return{value:e,root:t,parent:n,type:o,props:r,children:i,line:sN,column:lN,length:s,return:""}}function hN(e,t){return XA(pN("",null,null,"",null,null,0),e,{length:-e.length},t)}function gN(){return uN=cN>0?tN(dN,--cN):0,lN--,10===uN&&(lN=1,sN--),uN}function mN(){return uN=cN<aN?tN(dN,cN++):0,lN++,10===uN&&(lN=1,sN++),uN}function fN(){return tN(dN,cN)}function bN(){return cN}function kN(e,t){return nN(dN,e,t)}function vN(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 _N(e){return sN=lN=1,aN=oN(dN=e),cN=0,[]}function yN(e){return dN="",e}function xN(e){return QA(kN(cN-1,CN(91===e?e+2:40===e?e+1:e)))}function SN(e){for(;(uN=fN())&&uN<33;)mN();return vN(e)>2||vN(uN)>3?"":" "}function wN(e,t){for(;--t&&mN()&&!(uN<48||uN>102||uN>57&&uN<65||uN>70&&uN<97););return kN(e,bN()+(t<6&&32==fN()&&32==mN()))}function CN(e){for(;mN();)switch(uN){case e:return cN;case 34:case 39:34!==e&&39!==e&&CN(uN);break;case 40:41===e&&CN(e);break;case 92:mN()}return cN}function BN(e,t){for(;mN()&&e+uN!==57&&(e+uN!==84||47!==fN()););return"/*"+kN(t,cN-1)+"*"+YA(47===e?e:mN())}function IN(e){for(;!vN(fN());)mN();return kN(e,cN)}var jN="-ms-",EN="-moz-",TN="-webkit-",MN="comm",PN="rule",RN="decl",AN="@keyframes";function NN(e,t){for(var n="",o=rN(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function LN(e,t,n,o){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case RN:return e.return=e.return||e.value;case MN:return"";case AN:return e.return=e.value+"{"+NN(e.children,o)+"}";case PN:e.value=e.props.join(",")}return oN(n=NN(e.children,o))?e.return=e.value+"{"+n+"}":""}function DN(e){return yN(ON("",null,null,null,[""],e=_N(e),0,[0],e))}function ON(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,y=i,x=o,S=v;f;)switch(g=k,k=mN()){case 40:if(108!=g&&58==tN(S,d-1)){-1!=eN(S+=JA(xN(k),"&","&\f"),"&\f")&&(b=-1);break}case 34:case 39:case 91:S+=xN(k);break;case 9:case 10:case 13:case 32:S+=SN(g);break;case 92:S+=wN(bN()-1,7);continue;case 47:switch(fN()){case 42:case 47:iN(VN(BN(mN(),bN()),t,n),a);break;default:S+="/"}break;case 123*m:l[c++]=oN(S)*b;case 125*m:case 59:case 0:switch(k){case 0:case 125:f=0;case 59+u:-1==b&&(S=JA(S,/\f/g,"")),h>0&&oN(S)-d&&iN(h>32?FN(S+";",o,n,d-1):FN(JA(S," ","")+";",o,n,d-2),a);break;case 59:S+=";";default:if(iN(x=zN(S,t,n,c,u,r,l,v,_=[],y=[],d),i),123===k)if(0===u)ON(S,t,x,x,_,i,d,l,y);else switch(99===p&&110===tN(S,3)?100:p){case 100:case 108:case 109:case 115:ON(e,x,x,o&&iN(zN(e,x,x,0,0,r,l,v,r,_=[],d),y),r,y,d,l,o?_:y);break;default:ON(S,x,x,x,[""],y,0,l,y)}}c=u=h=0,m=b=1,v=S="",d=s;break;case 58:d=1+oN(S),h=g;default:if(m<1)if(123==k)--m;else if(125==k&&0==m++&&125==gN())continue;switch(S+=YA(k),k*m){case 38:b=u>0?1:(S+="\f",-1);break;case 44:l[c++]=(oN(S)-1)*b,b=1;break;case 64:45===fN()&&(S+=xN(mN())),p=fN(),u=d=oN(v=S+=IN(bN())),k++;break;case 45:45===g&&2==oN(S)&&(m=0)}}return i}function zN(e,t,n,o,r,i,s,l,a,c,u){for(var d=r-1,p=0===r?i:[""],h=rN(p),g=0,m=0,f=0;g<o;++g)for(var b=0,k=nN(e,d+1,d=qA(m=s[g])),v=e;b<h;++b)(v=QA(m>0?p[b]+" "+k:JA(k,/&\f/g,p[b])))&&(a[f++]=v);return pN(e,t,n,0===r?PN:l,a,c,u)}function VN(e,t,n){return pN(e,t,n,MN,YA(uN),nN(e,2,-2),0)}function FN(e,t,n,o){return pN(e,t,n,RN,nN(e,0,o),nN(e,o+1,-1),o)}var HN=function(e,t,n){for(var o=0,r=0;o=r,r=fN(),38===o&&12===r&&(t[n]=1),!vN(r);)mN();return kN(e,cN)},UN=new WeakMap,GN=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)||UN.get(n))&&!o){UN.set(e,!0);for(var r=[],i=function(e,t){return yN(function(e,t){var n=-1,o=44;do{switch(vN(o)){case 0:38===o&&12===fN()&&(t[n]=1),e[n]+=HN(cN-1,t,n);break;case 2:e[n]+=xN(o);break;case 4:if(44===o){e[++n]=58===fN()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=YA(o)}}while(o=mN());return e}(_N(e),t))}(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]}}},$N=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function WN(e,t){switch(function(e,t){return 45^tN(e,0)?(((t<<2^tN(e,0))<<2^tN(e,1))<<2^tN(e,2))<<2^tN(e,3):0}(e,t)){case 5103:return TN+"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 TN+e+e;
vendor: 4,887 bytes, line 2
2case 5349:case 4246:case 4810:case 6968:case 2756:return TN+e+EN+e+jN+e+e;case 6828:case 4268:return TN+e+jN+e+e;case 6165:return TN+e+jN+"flex-"+e+e;case 5187:return TN+e+JA(e,/(\w+).+(:[^]+)/,TN+"box-$1$2"+jN+"flex-$1$2")+e;case 5443:return TN+e+jN+"flex-item-"+JA(e,/flex-|-self/,"")+e;case 4675:return TN+e+jN+"flex-line-pack"+JA(e,/align-content|flex-|-self/,"")+e;case 5548:return TN+e+jN+JA(e,"shrink","negative")+e;case 5292:return TN+e+jN+JA(e,"basis","preferred-size")+e;case 6060:return TN+"box-"+JA(e,"-grow","")+TN+e+jN+JA(e,"grow","positive")+e;case 4554:return TN+JA(e,/([^-])(transform)/g,"$1"+TN+"$2")+e;case 6187:return JA(JA(JA(e,/(zoom-|grab)/,TN+"$1"),/(image-set)/,TN+"$1"),e,"")+e;case 5495:case 3959:return JA(e,/(image-set\([^]*)/,TN+"$1$`$1");case 4968:return JA(JA(e,/(.+:)(flex-)?(.*)/,TN+"box-pack:$3"+jN+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+TN+e+e;case 4095:case 3583:case 4068:case 2532:return JA(e,/(.+)-inline(.+)/,TN+"$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(oN(e)-1-t>6)switch(tN(e,t+1)){case 109:if(45!==tN(e,t+4))break;case 102:return JA(e,/(.+:)(.+)-([^]+)/,"$1"+TN+"$2-$3$1"+EN+(108==tN(e,t+3)?"$3":"$2-$3"))+e;case 115:return~eN(e,"stretch")?WN(JA(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==tN(e,t+1))break;case 6444:switch(tN(e,oN(e)-3-(~eN(e,"!important")&&10))){case 107:return JA(e,":",":"+TN)+e;case 101:return JA(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+TN+(45===tN(e,14)?"inline-":"")+"box$3$1"+TN+"$2$3$1"+jN+"$2box$3")+e}break;case 5936:switch(tN(e,t+11)){case 114:return TN+e+jN+JA(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return TN+e+jN+JA(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return TN+e+jN+JA(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return TN+e+jN+e+e}return e}var KN=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case RN:e.return=WN(e.value,e.length);break;case AN:return NN([hN(e,{value:JA(e.value,"@","@"+TN)})],o);case PN:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return NN([hN(e,{props:[JA(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return NN([hN(e,{props:[JA(t,/:(plac\w+)/,":"+TN+"input-$1")]}),hN(e,{props:[JA(t,/:(plac\w+)/,":-moz-$1")]}),hN(e,{props:[JA(t,/:(plac\w+)/,jN+"input-$1")]})],o)}return""})}}],ZN=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,r,i=e.stylisPlugins||KN,s={},l=[];o=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=[LN,(d=function(e){a.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],h=(c=[GN,$N].concat(i,p),u=rN(c),function(e,t,n,o){for(var r="",i=0;i<u;i++)r+=c[i](e,t,n,o)||"";return r});r=function(e,t,n,o){a=n,NN(DN(e?e+"{"+t.styles+"}":t.styles),h),o&&(g.inserted[t.name]=!0)};var g={key:t,sheet:new ZA({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:r};return g.sheet.hydrate(l),g},qN={animationIterationCount:1,aspectRatio: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,scale: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 YN(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var XN=/[A-Z]|^ms/g,QN=/_EMO_([^_]+?)_([^]*?)_EMO_/g,JN=function(e){return 45===e.charCodeAt(1)},eL=function(e){return null!=e&&"boolean"!=typeof e},tL=YN(function(e){return JN(e)?e:e.replace(XN,"-$&").toLowerCase()}),nL=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(QN,function(e,t,n){return rL={name:t,styles:n,next:rL},t})}return 1===qN[e]||JN(e)||"number"!=typeof t||0===t?t:t+"px"};function oL(e,t,n){if(null==n)return"";var o=n;if(void 0!==o.__emotion_styles)return o;switch(typeof n){case"boolean":return"";case"object":var r=n;if(1===r.anim)return rL={name:r.name,styles:r.styles,next:rL},r.name;var i=n;
vendor: 6,035 bytes, line 2
2if(void 0!==i.styles){var s=i.next;if(void 0!==s)for(;void 0!==s;)rL={name:s.name,styles:s.styles,next:rL},s=s.next;return i.styles+";"}return function(e,t,n){var o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=oL(e,t,n[r])+";";else for(var i in n){var s=n[i];if("object"!=typeof s){var l=s;null!=t&&void 0!==t[l]?o+=i+"{"+t[l]+"}":eL(l)&&(o+=tL(i)+":"+nL(i,l)+";")}else if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var a=oL(e,t,s);switch(i){case"animation":case"animationName":o+=tL(i)+":"+a+";";break;default:o+=i+"{"+a+"}"}}else for(var c=0;c<s.length;c++)eL(s[c])&&(o+=tL(i)+":"+nL(i,s[c])+";")}return o}(e,t,n);case"function":if(void 0!==e){var l=rL,a=n(e);return rL=l,oL(e,t,a)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var rL,iL=/label:\s*([^\s;{]+)\s*(;|$)/g,sL=!!nc.useInsertionEffect&&nc.useInsertionEffect,lL=sL||function(e){return e()},aL=(sL||nc.useLayoutEffect,nc.createContext("undefined"!=typeof HTMLElement?ZN({key:"css"}):null)),cL=(aL.Provider,function(e){return(0,nc.forwardRef)(function(t,n){var o=(0,nc.useContext)(aL);return e(t,o,n)})}),uL=nc.createContext({}),dL=function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)},pL=/^((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|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|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|popover|popoverTarget|popoverTargetAction|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)-.*))$/,hL=YN(function(e){return pL.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),gL=function(e){return"theme"!==e},mL=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?hL:gL},fL=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},bL=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;return dL(t,n,o),lL(function(){return function(e,t,n){dL(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}
2while(void 0!==r)}}(t,n,o)}),null},kL=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=fL(t,n,i),a=l||mL(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{var p=u[0];d.push(p[0]);for(var h=u.length,g=1;g<h;g++)d.push(u[g],p[g])}var m=cL(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=nc.useContext(uL)}"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]+";"):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="";rL=void 0;var i=e[0];null==i||void 0===i.raw?(o=!1,r+=oL(n,t,i)):r+=i[0];for(var s=1;s<e.length;s++)r+=oL(n,t,e[s]),o&&(r+=i[s]);iL.lastIndex=0;for(var l,a="";null!==(l=iL.exec(r));)a+="-"+l[1];var c=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)}(r)+a;return{name:c,styles:r,next:rL}}(d.concat(u),t.registered,p);i+=t.key+"-"+g.name,void 0!==r&&(i+=" "+r);var m=c&&void 0===l?mL(o):a,f={};for(var b in e)c&&"as"===b||m(b)&&(f[b]=e[b]);return f.className=i,n&&(f.ref=n),nc.createElement(nc.Fragment,null,nc.createElement(bL,{cache:t,serialized:g,isStringTag:"string"==typeof o}),nc.createElement(o,f))});return m.displayName=void 0!==o?o:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=s,m.__emotion_styles=d,m.__emotion_forwardProp=l,Object.defineProperty(m,"toString",{value:function(){return"."+r}}),m.withComponent=function(t,o){return e(t,KA({},n,o,{shouldForwardProp:fL(m,o,!0)})).apply(void 0,d)},m}}.bind(null);["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","marquee","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"].forEach(function(e){kL[e]=kL(e)});const vL=kL(Ss.__experimentalToolsPanelItem)` 3 grid-column: span 1; 4`;function _L({panelId:e,value:t={},onChange:n=()=>{},units:o,isShownByDefault:r=!0}){const i="auto"===t.width?"":t.width??"",s="auto"===t.height?"":t.height??"",l=e=>o=>{const r={...t};o?r[e]=o:delete r[e],n(r)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(vL,{label:(0,T.__)("Width"),isShownByDefault:r,hasValue:()=>""!==i,onDeselect:l("width"),panelId:e,children:(0,d.jsx)(Ss.__experimentalUnitControl,{label:(0,T.__)("Width"),placeholder:(0,T.__)("Auto"),labelPosition:"top",units:o,min:0,value:i,onChange:l("width"),size:"__unstable-large"})}),(0,d.jsx)(vL,{label:(0,T.__)("Height"),isShownByDefault:r,hasValue:()=>""!==s,onDeselect:l("height"),panelId:e,children:(0,d.jsx)(Ss.__experimentalUnitControl,{label:(0,T.__)("Height"),placeholder:(0,T.__)("Auto"),labelPosition:"top",units:o,min:0,value:s,onChange:l("height"),size:"__unstable-large"})})]})}const yL=[{label:(0,T._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,T._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,T._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,T._x)("Full Size","Image size option for resolution control"),value:"full"}],xL={a:(0,T.__)("The <a> element should be used for links that navigate to a different page or to a different section within the same page."),article:(0,T.__)("The <article> element should represent a self-contained, syndicatable portion of the document."),aside:(0,T.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),button:(0,T.__)("The <button> element should be used for interactive controls that perform an action on the current page, such as opening a modal or toggling content visibility."),div:(0,T.__)("The <div> element should only be used if the block is a design element with no semantic meaning."),footer:(0,T.__)("The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.)."),header:(0,T.__)("The <header> element should represent introductory content, typically a group of introductory or navigational aids."),main:(0,T.__)("The <main> element should be used for the primary content of your document only."),nav:(0,T.__)("The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation."),section:(0,T.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element.")},SL={};H(SL,{...u,ExperimentalBlockCanvas:ST,ExperimentalBlockEditorProvider:Vk,getDuotoneFilter:yf,getRichTextValues:function(e=[]){p.__unstableGetBlockProps.skipFilters=!0;const t=[];return GA(t,e),p.__unstableGetBlockProps.skipFilters=!1,t.map(e=>e instanceof de.RichTextData?e:de.RichTextData.fromHTMLString(e))},PrivateQuickInserter:LB,extractWords:UC,getNormalizedSearchTerms:$C,normalizeString:GC,PrivateListView:rM,ResizableBoxPopover:function({clientId:e,resizableBoxProps:t,...n}){return(0,d.jsx)(Wm,{clientId:e,__unstablePopoverSlot:"block-toolbar",...n,children:(0,d.jsx)(Ss.ResizableBox,{...t})})},useHasBlockToolbar:oT,cleanEmptyObject:ms,BlockQuickNavigation:ZR,LayoutStyle:function({layout:e={}
4,css:t,...n}){const o=Zl(e.type),[r]=Ei("spacing.blockGap"),i=null!==r;if(o){if(t)return(0,d.jsx)("style",{children:t});const r=o.getLayoutStyle?.({hasBlockGapSupport:i,layout:e,...n});if(r)return(0,d.jsx)("style",{children:r})}return null},BlockManager:Du,BlockRemovalWarningModal:function({rules:e}){const{clientIds:t,selectPrevious:n,message:o}=(0,g.useSelect)(e=>U(e(Ii)).getRemovalPromptData()),{clearBlockRemovalPrompt:r,setBlockRemovalRules:i,privateRemoveBlocks:s}=U((0,g.useDispatch)(Ii));if((0,h.useEffect)(()=>(i(e),()=>{i()}),[e,i]),o)return(0,d.jsxs)(Ss.Modal,{title:(0,T.__)("Be careful!"),onRequestClose:r,size:"medium",children:[(0,d.jsx)("p",{children:o}),(0,d.jsxs)(Ss.__experimentalHStack,{justify:"right",children:[(0,d.jsx)(Ss.Button,{variant:"tertiary",onClick:r,__next40pxDefaultSize:!0,children:(0,T.__)("Cancel")}),(0,d.jsx)(Ss.Button,{variant:"primary",onClick:()=>{s(t,n,!0),r()},__next40pxDefaultSize:!0,children:(0,T.__)("Delete")})]})]})},useLayoutClasses:yb,useLayoutStyles:function(e={},t,n){const{layout:o={},style:r={}}=e,i=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||{},s=Zl(i?.type||"default"),[l]=Ei("spacing.blockGap"),a=null!==l;return s?.getLayoutStyle?.({blockName:t,selector:n,layout:o,style:r,hasBlockGapSupport:a})},DimensionsTool:function({panelId:e,value:t={},onChange:n=()=>{},aspectRatioOptions:o,defaultAspectRatio:r="auto",scaleOptions:i,defaultScale:s="fill",unitsOptions:l,tools:a=["aspectRatio","widthHeight","scale"]}){const c=void 0===t.width||"auto"===t.width?null:t.width,u=void 0===t.height||"auto"===t.height?null:t.height,p=void 0===t.aspectRatio||"auto"===t.aspectRatio?null:t.aspectRatio,g=void 0===t.scale||"fill"===t.scale?null:t.scale,[m,f]=(0,h.useState)(g),[b,k]=(0,h.useState)(p),v=c&&u?"custom":b,_=p||c&&u;return(0,d.jsxs)(d.Fragment,{children:[a.includes("aspectRatio")&&(0,d.jsx)(hm,{panelId:e,options:o,defaultValue:r,value:v,onChange:e=>{const o={...t};k(e="auto"===e?null:e),e?o.aspectRatio=e:delete o.aspectRatio,e?m?o.scale=m:(o.scale=s,f(s)):delete o.scale,"custom"!==e&&c&&u&&delete o.height,n(o)}}),a.includes("widthHeight")&&(0,d.jsx)(_L,{panelId:e,units:l,value:{width:c,height:u},onChange:({width:e,height:o})=>{const r={...t};o="auto"===o?null:o,(e="auto"===e?null:e)?r.width=e:delete r.width,o?r.height=o:delete r.height,e&&o?delete r.aspectRatio:b&&(r.aspectRatio=b),b||!!e==!!o?m?r.scale=m:(r.scale=s,f(s)):delete r.scale,n(r)}}),a.includes("scale")&&_&&(0,d.jsx)(WA,{panelId:e,options:i,defaultValue:s,value:m,onChange:e=>{const o={...t};f(e="fill"===e?null:e),e?o.scale=e:delete o.scale,n(o)}})]})},ResolutionTool:function({panelId:e,value:t,onChange:n,options:o=yL,defaultValue:r=yL[0].value,isShownByDefault:i=!0,resetAllFilter:s}){const l=t??r;return(0,d.jsx)(Ss.__experimentalToolsPanelItem,{hasValue:()=>l!==r,label:(0,T.__)("Resolution"),onDeselect:()=>n(r),isShownByDefault:i,panelId:e,resetAllFilter:s,children:(0,d.jsx)(Ss.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Resolution"),value:l,options:o,onChange:n,help:(0,T.__)("Select the size of the source image."),size:"__unstable-large"})})},TabbedSidebar:MB,TextAlignmentControl:Dh,usesContextKey:JP,useFlashEditableBlocks:$x,HTMLElementControl:function({tagName:e,onChange:t,clientId:n,options:o=[{label:(0,T.__)("Default (<div>)"),value:"div"},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"}]}){const r=!!n&&o.some(e=>"main"===e.value),i=(0,g.useSelect)(e=>{if(!r)return!1;const{getClientIdsWithDescendants:t,getBlockAttributes:o}=e(Ii);return t().some(e=>e!==n&&"main"===o(e)?.tagName)},[n,r]),s=o.map(t=>"main"===t.value&&i&&"main"!==e?{...t,disabled:!0,label:(0,T.sprintf)((0,T.__)("%s (Already in use)"),t.label)}:t);return(0,d.jsxs)(Ss.__experimentalVStack,{spacing:2,className:"block-editor-html-element-control",children:[(0,d.jsx)(Ss.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,T.__)("HTML element"),options:s,value:e,onCh
4ange:t,help:xL[e]}),"main"===e&&i&&(0,d.jsx)(Ss.Notice,{status:"warning",isDismissible:!1,children:(0,T.__)("Multiple <main> elements detected. The duplicate may be in your content or template. This is not valid HTML and may cause accessibility issues. Please change this HTML element.")})]})},useZoomOut:PB,globalStylesDataKey:N,globalStylesLinksDataKey:L,selectBlockPatternsKey:D,requiresWrapperOnCopy:uw,PrivateRichText:uR,PrivateInserterLibrary:dA,reusableBlocksSelectKey:O,PrivateBlockPopover:Um,PrivatePublishDateTimePicker:CA,useSpacingSizes:Yg,useBlockDisplayTitle:tj,__unstableBlockStyleVariationOverridesWithConfig:function({config:e}){const{getBlockStyles:t,overrides:n}=(0,g.useSelect)(e=>({getBlockStyles:e(p.store).getBlockStyles,overrides:U(e(Ii)).getStyleOverrides()}),[]),{getBlockName:o}=(0,g.useSelect)(Ii),r=(0,h.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),l=e?.styles?.blocks?.[n]?.variations?.[s.variation];if(l){const o={settings:e?.settings,styles:{blocks:{[n]:{variations:{[`${s.variation}-${s.clientId}`]:l}}}}},a=cb((0,p.getBlockTypes)(),t,s.clientId),c=ab(o,a,!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:c,__unstableType:"variation",variation:s.variation,clientId:s.clientId}),i.push(s.clientId)}}return r},[e,n,t,o]);if(r&&r.length)return(0,d.jsx)(d.Fragment,{children:r.map(e=>(0,d.jsx)(mb,{override:e},e.id))})},setBackgroundStyleDefaults:ju,sectionRootClientIdKey:z,CommentIconSlotFill:cE,CommentIconToolbarSlotFill:FE,mediaEditKey:V,useBlockElement:ch,useBlockElementRef:ah})})(),(window.wp=window.wp||{}).blockEditor=o})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.